Revert "kdumpctl: Rebuild initramfs if loaded kernel modules changed"

This reverts commit 6b479b6572.

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@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Kairui Song 2019-04-29 15:12:29 +08:00
parent a585f981bd
commit 09f50350d9

View File

@ -486,31 +486,6 @@ check_wdt_modified()
return 1 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 0 if system is not modified
# returns 1 if system is modified # returns 1 if system is modified
# returns 2 if system modification is invalid # returns 2 if system modification is invalid
@ -538,11 +513,6 @@ check_system_modified()
return 1 return 1
fi fi
check_kmodules_modified
if [ $? -ne 0 ]; then
return 1
fi
return 0 return 0
} }