From b828bee6b45ab552aff4e28b8e712472c9004e2d Mon Sep 17 00:00:00 2001 From: Chris Co Date: Fri, 2 Oct 2020 00:30:33 +0000 Subject: [PATCH 1/2] initramfs: Always use host-only mode kdump currently uses the host system's initrd when enrolling a crash kernel and initrd. There is a limitation where the kdump initrd must be generated with dracut in "host-only" mode. The -k option forces a host-only initrd build. The -q option suppresses verbose output If mkinitrd is called without and parameters, it will default to calling dracut in "host-mode" mode on every kernel version it can find in /boot. If mkinitrd is called with and parameters, it will default to calling dracut in "generic host" mode for rebuilding the specific initrd. Therefore we need to make sure to add the -k option when invoking mkinitrd with an explicit and --- SPECS/initramfs/initramfs.spec | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/SPECS/initramfs/initramfs.spec b/SPECS/initramfs/initramfs.spec index 3a57a816eb8..28294cf437e 100644 --- a/SPECS/initramfs/initramfs.spec +++ b/SPECS/initramfs/initramfs.spec @@ -1,7 +1,7 @@ Summary: initramfs Name: initramfs Version: 2.0 -Release: 5%{?dist} +Release: 6%{?dist} Source0: fscks.conf License: Apache License Group: System Environment/Base @@ -66,6 +66,21 @@ mkdir -p %{_localstatedir}/lib/rpm-state/initramfs \ touch %{_localstatedir}/lib/rpm-state/initramfs/regenerate \ echo "initramfs (re)generation" %* >&2 +# kdump currently uses the host system's initrd when enrolling a crash kernel +# and initrd. There is a limitation where the kdump initrd must be generated +# with dracut in "host-only" mode. +# +# The -k option forces a host-only initrd build. +# The -q option suppresses verbose output +# +# If mkinitrd is called without and parameters, it will +# default to calling dracut in "host-mode" mode on every kernel version it can +# find in /boot. +# +# If mkinitrd is called with and parameters, it will +# default to calling dracut in "generic host" mode for rebuilding the specific +# initrd. Therefore we need to make sure to add the -k option when invoking +# mkinitrd with an explicit and %define file_trigger_action() \ cat > /dev/null \ if [ -f %{_localstatedir}/lib/rpm-state/initramfs/regenerate ]; then \ @@ -74,7 +89,7 @@ if [ -f %{_localstatedir}/lib/rpm-state/initramfs/regenerate ]; then \ elif [ -d %{_localstatedir}/lib/rpm-state/initramfs/pending ]; then \ for k in `ls %{_localstatedir}/lib/rpm-state/initramfs/pending/`; do \ echo "(re)generate initramfs for $k," %* >&2 \ - mkinitrd -q /boot/initrd.img-$k $k \ + mkinitrd -q /boot/initrd.img-$k $k -k \ done; \ fi \ %removal_action @@ -111,6 +126,8 @@ echo "initramfs" %{version}-%{release} "postun" >&2 %dir %{_localstatedir}/lib/initramfs/kernel %changelog +* Thu Oct 01 2020 Chris Co 2.0-6 +- Update file-triggered initrd generation to workaround kdump initrd limitations * Tue Sep 03 2019 Mateusz Malisz 2.0-5 - Initial CBL-Mariner import from Photon (license: Apache2). * Mon Aug 27 2018 Dheeraj Shetty 2.0-4 From bfcb8f6417434c412663fb71ae8b3fc64e6285b1 Mon Sep 17 00:00:00 2001 From: Chris Co Date: Fri, 2 Oct 2020 01:29:07 +0000 Subject: [PATCH 2/2] Reword comment block --- SPECS/initramfs/initramfs.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SPECS/initramfs/initramfs.spec b/SPECS/initramfs/initramfs.spec index 28294cf437e..ef2bad36be6 100644 --- a/SPECS/initramfs/initramfs.spec +++ b/SPECS/initramfs/initramfs.spec @@ -70,17 +70,18 @@ echo "initramfs (re)generation" %* >&2 # and initrd. There is a limitation where the kdump initrd must be generated # with dracut in "host-only" mode. # -# The -k option forces a host-only initrd build. +# The -k option forces "host-only" initrd build for the specified kernel version. # The -q option suppresses verbose output # # If mkinitrd is called without and parameters, it will -# default to calling dracut in "host-mode" mode on every kernel version it can +# default to invoking dracut in "host-mode" mode on every kernel version it can # find in /boot. # # If mkinitrd is called with and parameters, it will -# default to calling dracut in "generic host" mode for rebuilding the specific -# initrd. Therefore we need to make sure to add the -k option when invoking -# mkinitrd with an explicit and +# default to invoking dracut in "generic host" mode to create an initrd. +# +# So in order to be compatible with kdump, we need to make sure to add the -k +# option when invoking mkinitrd with an explicit and %define file_trigger_action() \ cat > /dev/null \ if [ -f %{_localstatedir}/lib/rpm-state/initramfs/regenerate ]; then \