[sys-kernel/dracut] change to the use of new fork, from gentoo PR

This commit is contained in:
2024-04-06 15:39:18 +02:00
parent bfd294583c
commit 8fd0f197f5
6 changed files with 13 additions and 138 deletions

View File

@@ -1,21 +0,0 @@
From https://github.com/dracutdevs/dracut/pull/2527
From a2fe89116db4b286fbf515f26bd1773b5e6ee8ad Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Tue, 26 Sep 2023 09:43:37 +0200
Subject: [PATCH] fix(resume): add new systemd-hibernate-resume.service
Since https://github.com/systemd/systemd/commit/a628d933, the generator only
does the initial validation of the system info and then enables the new
`systemd-hibernate-resume.service`.
Fixes #2513
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -44,6 +44,7 @@ install() {
if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
inst_multiple -o \
"$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
+ "$systemdsystemunitdir"/systemd-hibernate-resume.service \
"$systemdsystemunitdir"/systemd-hibernate-resume@.service \
"$systemdutildir"/systemd-hibernate-resume
return 0

View File

@@ -1,65 +0,0 @@
https://bugs.gentoo.org/917000
https://github.com/dracutdevs/dracut/pull/2494
From b88d0bab791bdc4ca75d13802f0391caf537650d Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Sun, 20 Aug 2023 11:47:22 +0200
Subject: [PATCH] fix(resume): include in hostonly mode if resume= on cmdline
The grep introduced in commit e3a7112bef794e2f2dd741ec2c74fa9cb9117651
does not work as intended. The resume module is always excluded in hostonly
mode.
Made this a bit more explicit with if/else so it is more clear what is going
on. The in-line ||/&& makes the line really long and makes it more difficult
to understand what is going on.
Bug: https://github.com/dracutdevs/dracut/issues/924
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
---
modules.d/95resume/module-setup.sh | 32 +++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index d255103366..2d48043827 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -10,13 +10,31 @@ check() {
return 1
}
- # Only support resume if hibernation is currently on
- # and no swap is mounted on a net device
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ -f /sys/power/resume && "$(< /sys/power/resume)" == "0:0" ]] || grep -rq '^\|[[:space:]]resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null && return 255
- }
-
- return 0
+ # If hostonly check if we want to include the resume module
+ if [[ $hostonly ]] || [[ $mount_needs ]]; then
+ # Resuming won't work if swap is on a netdevice
+ swap_on_netdevice && return 255
+ if grep -rq 'resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null; then
+ # hibernation support requested on kernel command line
+ return 0
+ else
+ # resume= not set on kernel command line
+ if [[ -f /sys/power/resume ]]; then
+ if [[ "$(< /sys/power/resume)" == "0:0" ]]; then
+ # hibernation supported by the kernel, but not enabled
+ return 255
+ else
+ # hibernation supported by the kernel and enabled
+ return 0
+ fi
+ else
+ # resume file doesn't exist, hibernation not supported by kernel
+ return 255
+ fi
+ fi
+ else
+ return 0
+ fi
}
# called by dracut

View File

@@ -1,26 +0,0 @@
https://github.com/dracutdevs/dracut/pull/2586/files
diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
index fa960a42c1..87efd0c1a6 100755
--- a/modules.d/01systemd-pcrphase/module-setup.sh
+++ b/modules.d/01systemd-pcrphase/module-setup.sh
@@ -6,7 +6,11 @@
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
- require_binaries "$systemdutildir"/systemd-pcrphase || return 1
+ # systemd-255 renamed the binary, check for old and new location.
+ if ! require_binaries "$systemdutildir"/systemd-pcrphase && \
+ ! require_binaries "$systemdutildir"/systemd-pcrextend; then
+ return 1
+ fi
# Return 255 to only include the module, if another module requires it.
return 255
@@ -28,6 +32,7 @@ install() {
inst_multiple -o \
"$systemdutildir"/systemd-pcrphase \
+ "$systemdutildir"/systemd-pcrextend \
"$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
"$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service