Switch root is never used for kdump image, and this will be helpful to reduce the initramfs size.
Also increase dracut dependency version and the function is dracut_no_switch_root is new introduced.
This commit is applied to RHEL some time ago, but missing in Fedora as Fedora's Dracut didn't backport this feature at that time. Now apply this missing commit.
Signed-off-by: Kairui Song kasong@redhat.com --- dracut-module-setup.sh | 3 +++ kexec-tools.spec | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 5397eb5..2cf7518 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -843,5 +843,8 @@ install() { echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf + + # Save more memory by dropping switch root capability + dracut_no_switch_root fi } diff --git a/kexec-tools.spec b/kexec-tools.spec index 6bada4a..cbea367 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -55,13 +55,13 @@ Source110: dracut-kdump-wait-for-target.sh Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units -Requires(pre): coreutils sed zlib -Requires: dracut >= 047-34.git20180604 -Requires: dracut-network >= 044-117 -Requires: dracut-squash >= 049-4 +Requires(pre): coreutils sed zlib +Requires: dracut >= 050 +Requires: dracut-network >= 050 +Requires: dracut-squash >= 050 Requires: ethtool BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel -BuildRequires: pkgconfig intltool gettext +BuildRequires: pkgconfig intltool gettext BuildRequires: systemd-units BuildRequires: automake autoconf libtool %ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le
On 05/17/2020 10:47 PM, Kairui Song wrote:
Switch root is never used for kdump image, and this will be helpful to reduce the initramfs size.
Also increase dracut dependency version and the function is dracut_no_switch_root is new introduced.
This commit is applied to RHEL some time ago, but missing in Fedora as Fedora's Dracut didn't backport this feature at that time. Now apply this missing commit.
Signed-off-by: Kairui Song kasong@redhat.com
dracut-module-setup.sh | 3 +++ kexec-tools.spec | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 5397eb5..2cf7518 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -843,5 +843,8 @@ install() { echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "Storage=none" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
# Save more memory by dropping switch root capability
fidracut_no_switch_root
} diff --git a/kexec-tools.spec b/kexec-tools.spec index 6bada4a..cbea367 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -55,13 +55,13 @@ Source110: dracut-kdump-wait-for-target.sh Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units -Requires(pre): coreutils sed zlib -Requires: dracut >= 047-34.git20180604 -Requires: dracut-network >= 044-117 -Requires: dracut-squash >= 049-4 +Requires(pre): coreutils sed zlib +Requires: dracut >= 050 +Requires: dracut-network >= 050 +Requires: dracut-squash >= 050 Requires: ethtool BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel -BuildRequires: pkgconfig intltool gettext +BuildRequires: pkgconfig intltool gettext BuildRequires: systemd-units BuildRequires: automake autoconf libtool %ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le
Acked-by: Pingfan Liu piliu@redhat.com