The script dracut-kdump.sh is responsible for capturing vmcore during
second kernel boot. Currently this script gets installed into kdump
initrd as part of kdumpbase dracut module. Since it's always installed
into kdump initrd, this script assumes that '/proc/vmcore' will always
be present when it is invoked.
With fadump support, 'dracut-kdump.sh' script also gets installed into
default initrd to capture vmcore generated by firmware assisted dump.
Thus in fadump case, the same initrd is going to be used for normal
boot as well as boot after system crash. Hence a check is required to
see if '/proc/vmcore' file exists before executing steps to capture
vmcore. This check will help to bypass the vmcore capture steps during
normal boot process.
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
dracut-kdump.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index cb13d92..55ac8bc 100755
@@ -1,5 +1,8 @@
+# continue only if /proc/vmcore is present.
+[ ! -f /proc/vmcore ] && return
exec &> /dev/console