This reverts commit 6b479b657266f130e6dc343817986e88883cabaf.
Check initramfs rebuild by looking at if there is any change of load
kernel modules list is not very stable after all. Previously we are
counting on udev to settle before kdump is started to ensure all modules
is ready, but actually any service may cause a kernel module load, even
after udev is settled.
The previous commit is trying to workaround an issue that VM created
with disk snapshot may fail in the kdump initramfs. The better fix is to
not include the kdump initramfs in the disk snapshot at all, as the
kdump initramfs is not generated for a generic use. And With new added
"kdumpctl reload" command, admins could rebuild the image easily, and
should rebuild the initramfs on hardware change manually.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
kdumpctl | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index ac7b86f..3f80ba4 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -486,31 +486,6 @@ check_wdt_modified()
return 1
}
-check_kmodules_modified()
-{
- # always sort again to avoid LANG/LC inconsistent problem
- local _old_modules="$(lsinitrd $TARGET_INITRD -f /usr/lib/dracut/loaded-kernel-modules.txt | sort)"
- local _new_modules="$(get_loaded_kernel_modules | sort)"
-
- [[ -z $_old_modules ]] && echo "Warning: Previous loaded kernel module list is absent or empty"
-
- local _added_modules=$(comm -13 <(echo "$_old_modules") <(echo "$_new_modules"))
- local _dropped_modules=$(comm -23 <(echo "$_old_modules") <(echo "$_new_modules"))
-
- if [ "$_old_modules" != "$_new_modules" ]; then
- echo "Detected change(s) of loaded kernel modules list:"
- [[ -n $_added_modules ]] && for _module in $_added_modules; do
- echo " +$_module"
- done
- [[ -n $_dropped_modules ]] && for _module in $_dropped_modules; do
- echo " -$_module"
- done
- return 1
- fi
-
- return 0
-}
-
# returns 0 if system is not modified
# returns 1 if system is modified
# returns 2 if system modification is invalid
@@ -538,11 +513,6 @@ check_system_modified()
return 1
fi
- check_kmodules_modified
- if [ $? -ne 0 ]; then
- return 1
- fi
-
return 0
}
--
2.20.1