If the directory where the kdump.img saved has not enough space for the
kdump.img, after restart kdump, it will get an incomplete file named
initramfs-xxxkdump.img, the restart of kdump failed, but did not remove the
incomplete file. So when reboot the system, kdump will load the incomplete
file, and then when kernel crash, the kdump will fail because the file
initramfs-xxxkdump.img is incomplete.
So, when the dracut failed build the initramfs-xxxkdump.img, kdump should
remove the file initramfs-xxxkdump.img so that kdump will not load a wrong
initramfs-xxxkdump.img when reboot the system.
Signed-off-by: Chao Fan <cfan(a)redhat.com>
---
kdumpctl | 1 +
1 file changed, 1 insertion(+)
diff --git a/kdumpctl b/kdumpctl
index eaf7f67..b82e3f0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -175,6 +175,7 @@ rebuild_kdump_initrd()
$MKDUMPRD $TARGET_INITRD $kdump_kver
if [ $? != 0 ]; then
echo "mkdumprd: failed to make kdump initrd" >&2
+ rm -f $TARGET_INITRD
return 1
fi
--
2.1.0
Show replies by date