The idea behind adding support for dracut '--rebuild' option was to ensure the initrd built for fadump takes into consideration all the build parameters passed to original initrd. Pass original initrd instead of current default initrd for rebuild as current initrd might already have build parameters from original initrd along with parameters from previous fadump intird build making the build parameters look like this after a few iterations:
# lsinitrd -f /usr/lib/dracut/build-parameter.txt -H --persistent-policy 'by-uuid' -f --quiet --hostonly --hostonly- cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot //home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot//home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot//home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --
Since it is not desirable to build initrd with stale and/or duplicate build parameters, use original initrd (backed up) to rebuild fadump initrd, instead of current default initrd.
Signed-off-by: Hari Bathini hbathini@linux.ibm.com --- kdumpctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index de6da39..5ecae06 100755 --- a/kdumpctl +++ b/kdumpctl @@ -94,7 +94,7 @@ rebuild_fadump_initrd() # this file tells the initrd is fadump enabled touch /tmp/fadump.initramfs target_initrd_tmp="$TARGET_INITRD.tmp" - $MKDUMPRD $target_initrd_tmp --rebuild $TARGET_INITRD --kver $kdump_kver \ + $MKDUMPRD $target_initrd_tmp --rebuild $DEFAULT_INITRD_BAK --kver $kdump_kver \ -i /tmp/fadump.initramfs /etc/fadump.initramfs if [ $? != 0 ]; then echo "mkdumprd: failed to rebuild initrd with fadump support" >&2
Hi Hari,
On 02/06/19 at 01:47am, Hari Bathini wrote:
The idea behind adding support for dracut '--rebuild' option was to ensure the initrd built for fadump takes into consideration all the build parameters passed to original initrd. Pass original initrd instead of current default initrd for rebuild as current initrd might already have build parameters from original initrd along with parameters from previous fadump intird build making the build parameters look like this after a few iterations:
# lsinitrd -f /usr/lib/dracut/build-parameter.txt -H --persistent-policy 'by-uuid' -f --quiet --hostonly --hostonly- cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot //home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot//home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/rhel_zzfp219--lp3-home /kdumproot//home xfs defaults' -f --kver '4.18.0-60.el8.ppc64le' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --include '/tmp/fadump.initramfs' '/etc/fadump.initramfs' --
Since it is not desirable to build initrd with stale and/or duplicate build parameters, use original initrd (backed up) to rebuild fadump initrd, instead of current default initrd.
Signed-off-by: Hari Bathini hbathini@linux.ibm.com
kdumpctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index de6da39..5ecae06 100755 --- a/kdumpctl +++ b/kdumpctl @@ -94,7 +94,7 @@ rebuild_fadump_initrd() # this file tells the initrd is fadump enabled touch /tmp/fadump.initramfs target_initrd_tmp="$TARGET_INITRD.tmp"
- $MKDUMPRD $target_initrd_tmp --rebuild $TARGET_INITRD --kver $kdump_kver \
- $MKDUMPRD $target_initrd_tmp --rebuild $DEFAULT_INITRD_BAK --kver $kdump_kver \ -i /tmp/fadump.initramfs /etc/fadump.initramfs if [ $? != 0 ]; then echo "mkdumprd: failed to rebuild initrd with fadump support" >&2
Seems can not find --rebuild in dracut manpage, and dracut --help has it only --rebuild without arguments for rebuilding. It would be good to improve the dracut code to make it clear.
But for this fix, it looks good:
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave