From 54940adbaf0ae72c59d8e86fb5b7c227deea5a03 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sun, 13 Nov 2022 21:57:33 -0500 Subject: [PATCH] Backport fix to add sysctl to initramfs to handle modprobe files --- ...o-initramfs-to-handle-modprobe-files.patch | 29 +++++++++++++++++++ dracut.spec | 9 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch diff --git a/2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch b/2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch new file mode 100644 index 0000000..fb8f368 --- /dev/null +++ b/2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch @@ -0,0 +1,29 @@ +From 16f1daa9015b4cac6f390c0832f37479bc1377ba Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Sat, 5 Nov 2022 18:28:34 -0400 +Subject: [PATCH] fix(kernel-modules): add sysctl to initramfs to handle + modprobe files + +Users were seeing errors like this: + +[ 2.917246] dracut-pre-udev[717]: sh: line 1: /sbin/sysctl: No such file or directory + +This was the result of modprobe.d files that needed to call sysctl +and failing because sysctl wasn't included in the initramfs. + +This change makes it so that we have the binary included so those +modprobe configuration files work properly. +--- + modules.d/90kernel-modules/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index b1fb74020..eb478c7ee 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -147,4 +147,5 @@ install() { + inst_hook cmdline 01 "$moddir/parse-kernel.sh" + fi + inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh ++ inst_multiple -o sysctl + } diff --git a/dracut.spec b/dracut.spec index 06bd387..c4a5192 100644 --- a/dracut.spec +++ b/dracut.spec @@ -7,7 +7,7 @@ %global __requires_exclude pkg-config # rpmdev-bumpspec and releng automation compatible variable -%global baserelease 4 +%global baserelease 5 Name: dracut Version: 057 @@ -41,6 +41,10 @@ Patch1: 1521-Never-enable-the-bluetooth-module-by-default.patch # https://github.com/dracutdevs/dracut/pull/1991 Patch2: 1991-feat-dmsquash-live-add-new-dmsquash-live-autooverlay.patch +# Add sysctl to initramfs to handle modprobe files +# https://github.com/dracutdevs/dracut/pull/2037 +Patch3: 2037-Add-sysctl-to-initramfs-to-handle-modprobe-files.patch + BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -440,6 +444,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Sun Nov 13 2022 Davide Cavalca - 057-5 +- Backport fix to add sysctl to initramfs to handle modprobe files + * Sat Oct 15 2022 Neal Gompa - 057-4 - Backport dmsquash-live-autooverlay module