[sys-kernel/dracut] sync, now back to EAPI 8 since CRATES can be empty

This commit is contained in:
Robert Förster 2023-12-24 16:02:21 +01:00
parent a14591e59e
commit 5259c2f9d1
6 changed files with 125 additions and 19 deletions

View File

@ -1,11 +1,12 @@
# Copyright 1999-2023 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
CARGO_OPTIONAL=1 CARGO_OPTIONAL=1
inherit bash-completion-r1 cargo edo optfeature systemd toolchain-funcs inherit bash-completion-r1 cargo edo optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then if [[ ${PV} == 9999 ]] ; then
inherit git-r3 inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut" EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
@ -25,13 +26,12 @@ HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="0" SLOT="0"
if [[ "${PV}" != *_rc* ]]; then if [[ "${PV}" != *_rc* ]]; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi fi
IUSE="dracut-cpio selinux test" IUSE="dracut-cpio selinux test"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
RDEPEND=" RDEPEND="
app-arch/cpio
>=app-shells/bash-4.0:0 >=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)] sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools] >=sys-apps/kmod-23[tools]
@ -51,6 +51,7 @@ RDEPEND="
sys-libs/libselinux sys-libs/libselinux
sys-libs/libsepol sys-libs/libsepol
) )
!dracut-cpio? ( app-arch/cpio )
" "
DEPEND=" DEPEND="
>=sys-apps/kmod-23 >=sys-apps/kmod-23
@ -70,6 +71,9 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
PATCHES=( PATCHES=(
"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch "${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
"${FILESDIR}"/dracut-060-fix-resume-hostonly.patch
"${FILESDIR}"/dracut-060-systemd-255.patch
"${FILESDIR}"/dracut-059-install-new-systemd-hibernate-resume.service.patch
) )
src_configure() { src_configure() {
@ -84,11 +88,6 @@ src_configure() {
tc-export CC PKG_CONFIG tc-export CC PKG_CONFIG
edo ./configure "${myconf[@]}" edo ./configure "${myconf[@]}"
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
fi
} }
src_test() { src_test() {

View File

@ -1,11 +1,12 @@
# Copyright 1999-2023 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
CARGO_OPTIONAL=1 CARGO_OPTIONAL=1
inherit bash-completion-r1 cargo edo optfeature systemd toolchain-funcs inherit bash-completion-r1 cargo edo optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then if [[ ${PV} == 9999 ]] ; then
inherit git-r3 inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut" EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
@ -31,7 +32,6 @@ IUSE="dracut-cpio selinux test"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
RDEPEND=" RDEPEND="
app-arch/cpio
>=app-shells/bash-4.0:0 >=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)] sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools] >=sys-apps/kmod-23[tools]
@ -51,6 +51,7 @@ RDEPEND="
sys-libs/libselinux sys-libs/libselinux
sys-libs/libsepol sys-libs/libsepol
) )
!dracut-cpio? ( app-arch/cpio )
" "
DEPEND=" DEPEND="
>=sys-apps/kmod-23 >=sys-apps/kmod-23
@ -84,11 +85,6 @@ src_configure() {
tc-export CC PKG_CONFIG tc-export CC PKG_CONFIG
edo ./configure "${myconf[@]}" edo ./configure "${myconf[@]}"
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
fi
} }
src_test() { src_test() {

View File

@ -0,0 +1,21 @@
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

@ -0,0 +1,65 @@
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

@ -0,0 +1,26 @@
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

View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="person">
<email>chutzpah@gentoo.org</email>
<name>Patrick McLean</name>
</maintainer>
<maintainer type="person" proxied="yes"> <maintainer type="person" proxied="yes">
<email>alexander@tsoy.me</email> <email>alexander@tsoy.me</email>
<name>Alexander Tsoy</name> <name>Alexander Tsoy</name>
@ -13,4 +9,7 @@
<email>floppym@gentoo.org</email> <email>floppym@gentoo.org</email>
<name>Mike Gilbert</name> <name>Mike Gilbert</name>
</maintainer> </maintainer>
<upstream>
<remote-id type="github">dracutdevs/dracut</remote-id>
</upstream>
</pkgmetadata> </pkgmetadata>