There could be some dynamic system modification, which may affect kdump kernel boot process. For example, if status of a watchdog device is changed by an user then initramfs must be rebuilt on the basis of new watchdog status.
This patch adds a path to check such dynamic system modifications. While doing that, it also adds a checker for watchdog status modification.
Testing: ------------------------------------------------------- Initramfs wdt state Prev Current Result ------------------------------------------------------- Not Exist NA X Rebuild Exist Inact Inact No Rebuild Exist Inact Act Force Rebuild Exist Act Inact Force Rebuild Exist Act Act(Same wdt) No Rebuild Exist Act Act(Diff wdt) Force Rebuild
Signed-off-by: Pratyush Anand panand@redhat.com --- kdumpctl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 9f7e56b1a524..58d6ccf4b90d 100755 --- a/kdumpctl +++ b/kdumpctl @@ -322,6 +322,27 @@ setup_target_initrd() fi }
+is_wdt_modified() +{ + [ -f $TARGET_INITRD ] || return 0 + + wdtcmdline=$(get_wdt_cmdline) + if [ "$?" = "0" ];then + lsinitrd -f etc/cmdline.d/00-wdt.conf $TARGET_INITRD | grep $wdtcmdline &> /dev/null + else + [ "$(lsinitrd -f etc/cmdline.d/00-wdt.conf $TARGET_INITRD)" = "" ] + fi + + return $? +} + +is_system_modified() +{ + is_wdt_modified || return 1 + + return 0 +} + check_rebuild() { local extra_modules modified_files="" @@ -383,6 +404,8 @@ check_rebuild() fi done
+ is_system_modified || force_rebuild="1" + #check if target initrd has fadump support if [ "$DEFAULT_DUMP_MODE" = "fadump" ] && [ -f "$TARGET_INITRD" ]; then initramfs_has_fadump=`lsinitrd -m $TARGET_INITRD | grep ^kdumpbase$ | wc -l`