kdumpctl: fix error handling in fadump case

In fadump, in case of failure while rebuilding initrd, the error status
is not handled properly. See code snippet below:

    $MKDUMPRD $target_initrd_tmp --rebuild $TARGET_INITRD --kver $kdump_kver \
            -i /tmp/fadump.initramfs /etc/fadump.initramfs
    rm -f /tmp/fadump.initramfs
    if [ $? != 0 ]; then
        echo "mkdumprd: failed to rebuild initrd with fadump support" >&2
        return 1
    fi

This patch fixes this issue

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
Hari Bathini 2014-08-04 16:16:36 +05:30 committed by WANG Chao
parent 2276b8561c
commit adb585a336

View File

@ -156,11 +156,12 @@ rebuild_fadump_initrd()
target_initrd_tmp="$TARGET_INITRD.tmp"
$MKDUMPRD $target_initrd_tmp --rebuild $TARGET_INITRD --kver $kdump_kver \
-i /tmp/fadump.initramfs /etc/fadump.initramfs
rm -f /tmp/fadump.initramfs
if [ $? != 0 ]; then
echo "mkdumprd: failed to rebuild initrd with fadump support" >&2
rm -f /tmp/fadump.initramfs
return 1
fi
rm -f /tmp/fadump.initramfs
# updating fadump initrd
mv $target_initrd_tmp $TARGET_INITRD