These code actually prepares the kernel/initrd/cmdline arguments,
move them to a new function named prepare_dump(), it will also be
used by the new reload_dump() in the following patch.
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 8d0ab81..69b2f3b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -333,6 +333,25 @@ setup_target_initrd()
fi
}
+prepare_dump()
+{
+ check_boot_dir
+
+ if [ -z "$KDUMP_KERNELVER" ]; then
+ kdump_kver=`uname -r`
+ else
+ kdump_kver=$KDUMP_KERNELVER
+ fi
+
+ kdump_kernel="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}"
+
+ KDUMP_COMMANDLINE=$(prepare_cmdline)
+
+ setup_target_initrd
+
+ return $?
+}
+
check_files_modified()
{
local modified_files=""
@@ -509,16 +528,7 @@ check_rebuild()
local ret system_modified="0"
local initramfs_has_fadump
- check_boot_dir
-
- if [ -z "$KDUMP_KERNELVER" ]; then
- kdump_kver=`uname -r`
- else
- kdump_kver=$KDUMP_KERNELVER
- fi
-
- kdump_kernel="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}"
- setup_target_initrd
+ prepare_dump
if [ $? -ne 0 ]; then
return 1
fi
@@ -634,8 +644,6 @@ load_kdump()
fi
fi
- KDUMP_COMMANDLINE=`prepare_cmdline`
-
# For secureboot enabled machines, use new kexec file based syscall.
# Old syscall will always fail as it does not have capability to
# to kernel signature verification.
--
1.8.3.1