There could be some dynamic system modification, which may affect kdump
kernel boot process. In such situation initramfs must be rebulit on the
basis of changes.
Since most of these checking methods will use information from
TARGET_INITRD, therefore check for its existence in common code.
Signed-off-by: Pratyush Anand <panand(a)redhat.com>
---
kdumpctl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index ef18a2d4f6ce..614a816e344c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -327,6 +327,13 @@ setup_target_initrd()
fi
}
+is_system_modified()
+{
+ [[ -f $TARGET_INITRD ]] || return 1
+
+ return 0
+}
+
check_rebuild()
{
local extra_modules modified_files=""
@@ -388,6 +395,11 @@ check_rebuild()
fi
done
+ is_system_modified
+ if [ $? -ne 0 ]; then
+ force_rebuild="1"
+ fi
+
#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`
--
2.5.0