From 1da9e36a1af7477a13c33b16647beeacf65eb605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20F=C3=B6rster?= Date: Sun, 10 Nov 2024 04:09:32 +0100 Subject: [PATCH] [sys-kernel/dracut] sync --- ...dracut-105.ebuild => dracut-105-r3.ebuild} | 4 +++ .../dracut-105-fix-check_kernel_module.patch | 28 ++++++++++++++++++ .../files/dracut-105-systemd-cryptsetup.patch | 29 +++++++++++++++++++ 3 files changed, 61 insertions(+) rename sys-kernel/dracut/{dracut-105.ebuild => dracut-105-r3.ebuild} (96%) create mode 100644 sys-kernel/dracut/files/dracut-105-fix-check_kernel_module.patch create mode 100644 sys-kernel/dracut/files/dracut-105-systemd-cryptsetup.patch diff --git a/sys-kernel/dracut/dracut-105.ebuild b/sys-kernel/dracut/dracut-105-r3.ebuild similarity index 96% rename from sys-kernel/dracut/dracut-105.ebuild rename to sys-kernel/dracut/dracut-105-r3.ebuild index e46c080..5e22f44 100644 --- a/sys-kernel/dracut/dracut-105.ebuild +++ b/sys-kernel/dracut/dracut-105-r3.ebuild @@ -103,6 +103,10 @@ PATCHES=( "${FILESDIR}"/${PN}-103-acct-user-group-gentoo.patch # https://github.com/dracut-ng/dracut-ng/pull/834 "${FILESDIR}"/${PN}-105-ensure-abs-args-for-objcopy.patch + # https://github.com/dracut-ng/dracut-ng/pull/904 + "${FILESDIR}"/${PN}-105-fix-check_kernel_module.patch + # https://github.com/dracut-ng/dracut-ng/pull/921 + "${FILESDIR}"/dracut-105-systemd-cryptsetup.patch ) src_configure() { diff --git a/sys-kernel/dracut/files/dracut-105-fix-check_kernel_module.patch b/sys-kernel/dracut/files/dracut-105-fix-check_kernel_module.patch new file mode 100644 index 0000000..e1fc792 --- /dev/null +++ b/sys-kernel/dracut/files/dracut-105-fix-check_kernel_module.patch @@ -0,0 +1,28 @@ +From b90eda4b431af23d1101f1ea68b656929c6a82b2 Mon Sep 17 00:00:00 2001 +From: Nowa Ammerlaan +Date: Fri, 8 Nov 2024 20:01:54 +0100 +Subject: [PATCH] fix(dracut-functions.sh): check for modules in --kmoddir, not + in --sysroot + +Modules are installed from the directory specified by --kmoddir, but currently +the check_kernel_module() function is checking for the module in +--sysroot/lib/modules. This is notably not the same when kernels packages are +being built inside some docker container. We should check for the modules +existence in the directory we are actually going to install it from. +--- + dracut-functions.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 865c31290..245c69cb6 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -761,7 +761,7 @@ check_kernel_config() { + # 0 if the kernel module is either built-in or available + # 1 if the kernel module is not enabled + check_kernel_module() { +- modprobe -d "$dracutsysrootdir" -S "$kernel" --dry-run "$1" &> /dev/null || return 1 ++ modprobe -d "$drivers_dir/../../" -S "$kernel" --dry-run "$1" &> /dev/null || return 1 + } + + # get_cpu_vendor diff --git a/sys-kernel/dracut/files/dracut-105-systemd-cryptsetup.patch b/sys-kernel/dracut/files/dracut-105-systemd-cryptsetup.patch new file mode 100644 index 0000000..154bd21 --- /dev/null +++ b/sys-kernel/dracut/files/dracut-105-systemd-cryptsetup.patch @@ -0,0 +1,29 @@ +https://github.com/dracut-ng/dracut-ng/pull/921 +https://bugs.gentoo.org/943035 + +From 2d4b550c71cc79ac7a3f18afc09d8263963d5de2 Mon Sep 17 00:00:00 2001 +From: Jo Zzsi +Date: Sat, 9 Nov 2024 14:06:57 -0500 +Subject: [PATCH] fix(dracut-systemd): check systemd-cryptsetup before + including + +--- + modules.d/98dracut-systemd/module-setup.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh +index 0438e40f0..f2502cd78 100755 +--- a/modules.d/98dracut-systemd/module-setup.sh ++++ b/modules.d/98dracut-systemd/module-setup.sh +@@ -19,7 +19,10 @@ depends() { + # systemd-cryptsetup is mandatory dependency + # see https://github.com/dracut-ng/dracut-ng/issues/563 + if dracut_module_included "crypt"; then +- deps+=" systemd-cryptsetup" ++ module_check systemd-cryptsetup > /dev/null 2>&1 ++ if [[ $? == 255 ]]; then ++ deps+=" systemd-cryptsetup" ++ fi + fi + + echo "$deps"