summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2023-02-26 14:26:29 -0500
committerMike Gilbert <floppym@gentoo.org>2023-02-26 14:27:02 -0500
commitbfebeda18b81d781f9dcf8d12c1adddefff6b9a4 (patch)
tree6ad69e352954f0c5d14046068402e88823675c99 /sys-apps
parentapp-misc/openrgb-plugin-effects: Stabilize 0.8 amd64, #897886 (diff)
downloadgentoo-bfebeda18b81d781f9dcf8d12c1adddefff6b9a4.tar.gz
gentoo-bfebeda18b81d781f9dcf8d12c1adddefff6b9a4.tar.bz2
gentoo-bfebeda18b81d781f9dcf8d12c1adddefff6b9a4.zip
sys-apps/systemd: work around dracut bug with LVM
Bug: https://bugs.gentoo.org/896364 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/systemd/files/systemd-253-initrd-generators.patch34
-rw-r--r--sys-apps/systemd/systemd-253-r1.ebuild (renamed from sys-apps/systemd/systemd-253.ebuild)1
2 files changed, 35 insertions, 0 deletions
diff --git a/sys-apps/systemd/files/systemd-253-initrd-generators.patch b/sys-apps/systemd/files/systemd-253-initrd-generators.patch
new file mode 100644
index 000000000000..60e7b29d7a1f
--- /dev/null
+++ b/sys-apps/systemd/files/systemd-253-initrd-generators.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/896364
+
+Workaround for bug in sys-kernel/dracut.
+
+From 6b25470ee28843a49c50442e9d8a98edc842ceca Mon Sep 17 00:00:00 2001
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Mon, 20 Feb 2023 12:00:30 +0900
+Subject: [PATCH] core/manager: run generators directly when we are in initrd
+
+Some initrd system write files at ourside of /run, /etc, or other
+allowed places. This is a kind of workaround, but in most cases, such
+sandboxing is not necessary as the filesystem is on ramfs when we are in
+initrd.
+
+Fixes #26488.
+---
+ src/core/manager.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 7b394794b0d4..306477c6e6c2 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -3822,8 +3822,8 @@ static int manager_run_generators(Manager *m) {
+ /* If we are the system manager, we fork and invoke the generators in a sanitized mount namespace. If
+ * we are the user manager, let's just execute the generators directly. We might not have the
+ * necessary privileges, and the system manager has already mounted /tmp/ and everything else for us.
+- */
+- if (MANAGER_IS_USER(m)) {
++ * If we are in initrd, let's also execute the generators directly, as we are in ramfs. */
++ if (MANAGER_IS_USER(m) || in_initrd()) {
+ r = manager_execute_generators(m, paths, /* remount_ro= */ false);
+ goto finish;
+ }
diff --git a/sys-apps/systemd/systemd-253.ebuild b/sys-apps/systemd/systemd-253-r1.ebuild
index 77c9145b2914..cb638034f21f 100644
--- a/sys-apps/systemd/systemd-253.ebuild
+++ b/sys-apps/systemd/systemd-253-r1.ebuild
@@ -231,6 +231,7 @@ src_unpack() {
src_prepare() {
local PATCHES=(
+ "${FILESDIR}/systemd-253-initrd-generators.patch"
)
if ! use vanilla; then