Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generate_dump] Ignoring file/directory not found error #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ save_nat_info() {
save_proc() {
local procfiles="$@"
$MKDIR $V -p $TARDIR/proc \
&& $CP $V -r $procfiles $TARDIR/proc \
&& (for f in $procfiles; do ( [ -e $f ] && $CP $V -r $f $TARDIR/proc ) || echo "$f not found" > $TARDIR/$f; done) \
&& $TAR $V -rhf $TARFILE -C $DUMPDIR --mode=+rw $BASE/proc \
&& $RM $V -rf $TARDIR/proc
}
Expand Down Expand Up @@ -461,7 +461,7 @@ main() {
$MKDIR $V -p $LOGDIR
$LN $V -s /etc $TARDIR/etc

($TAR $V -rhf $TARFILE -C $DUMPDIR --mode=+rw \
($TAR $V -rf $TARFILE -C $DUMPDIR --mode=+rw \
--exclude="etc/alternatives" \
--exclude="*/etc/passwd*" \
--exclude="*/etc/shadow*" \
Expand Down Expand Up @@ -506,7 +506,7 @@ main() {
done

# archive kernel dump files
for file in $(find_files "/var/crash/"); do
[ -e /var/crash/ ] && for file in $(find_files "/var/crash/"); do
# don't gzip already-gzipped dmesg files :)
if [ ! ${file} = "/var/crash/kexec_cmd" -a ! ${file} = "/var/crash/export" ]; then
if [[ ${file} == *"kdump."* ]]; then
Expand All @@ -517,10 +517,12 @@ main() {
fi
done

if [[ "$asic" = "mellanox" ]]; then
# run 'hw-management-generate-dump.sh' script and save the result file
/usr/bin/hw-management-generate-dump.sh
save_file "/tmp/hw-mgmt-dump*" "hw-mgmt" false
rm -f /tmp/hw-mgmt-dump*
fi

# clean up working tar dir before compressing
$RM $V -rf $TARDIR
Expand Down