summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2024-07-01 11:12:43 -0400
committerMike Gilbert <floppym@gentoo.org>2024-07-01 15:14:31 -0400
commit2e0a4dbc6b7753f19a8a6243603bd2792082359e (patch)
tree54eb9b32b7ef29f8f0724a12145b8c8c110cc381 /sys-apps/systemd
parentnet-libs/grpc: add 1.62.1, wire up tests (diff)
downloadgentoo-2e0a4dbc6b7753f19a8a6243603bd2792082359e.tar.gz
gentoo-2e0a4dbc6b7753f19a8a6243603bd2792082359e.tar.bz2
gentoo-2e0a4dbc6b7753f19a8a6243603bd2792082359e.zip
sys-apps/systemd: add pkg_pretend check for cgroup-hybrid
Bug: https://bugs.gentoo.org/935261 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-apps/systemd')
-rw-r--r--sys-apps/systemd/systemd-256.1-r2.ebuild (renamed from sys-apps/systemd/systemd-256.1-r1.ebuild)28
-rw-r--r--sys-apps/systemd/systemd-9999.ebuild28
2 files changed, 54 insertions, 2 deletions
diff --git a/sys-apps/systemd/systemd-256.1-r1.ebuild b/sys-apps/systemd/systemd-256.1-r2.ebuild
index d2c7ad24ef7b..178565ec7d40 100644
--- a/sys-apps/systemd/systemd-256.1-r1.ebuild
+++ b/sys-apps/systemd/systemd-256.1-r2.ebuild
@@ -33,7 +33,7 @@ HOMEPAGE="https://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
- acl apparmor audit boot cryptsetup curl +dns-over-tls elfutils
+ acl apparmor audit boot cgroup-hybrid cryptsetup curl +dns-over-tls elfutils
fido2 +gcrypt gnutls homed http idn importd iptables +kernel-install +kmod
+lz4 lzma +openssl pam pcre pkcs11 policykit pwquality qrcode
+resolvconf +seccomp selinux split-usr +sysv-utils test tpm ukify vanilla xkb +zstd
@@ -180,12 +180,38 @@ BDEPEND="
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
+check_cgroup_layout() {
+ # https://bugs.gentoo.org/935261
+ [[ ${MERGE_TYPE} != buildonly ]] || return
+ [[ -z ${ROOT} ]] || return
+ [[ -e /sys/fs/cgroup/unified ]] || return
+ grep -q 'SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1' /proc/cmdline && return
+
+ eerror "This system appears to be booted with the 'hybrid' cgroup layout."
+ eerror "This layout obsolete and is disabled in systemd."
+
+ if grep -qF 'systemd.legacy_systemd_cgroup_controller' /proc/cmdline; then
+ eerror "Remove the systemd.legacy_systemd_cgroup_controller option"
+ eerror "from the kernel command line and reboot."
+ die "hybrid cgroup layout detected"
+ fi
+}
+
pkg_pretend() {
if use split-usr; then
eerror "Please complete the migration to merged-usr."
eerror "https://wiki.gentoo.org/wiki/Merge-usr"
die "systemd no longer supports split-usr"
fi
+
+ check_cgroup_layout
+
+ if use cgroup-hybrid; then
+ eerror "Disable the 'cgroup-hybrid' USE flag."
+ eerror "Rebuild any initramfs images after rebuilding systemd."
+ die "cgroup-hybrid is no longer supported"
+ fi
+
if [[ ${MERGE_TYPE} != buildonly ]]; then
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild
index d2c7ad24ef7b..178565ec7d40 100644
--- a/sys-apps/systemd/systemd-9999.ebuild
+++ b/sys-apps/systemd/systemd-9999.ebuild
@@ -33,7 +33,7 @@ HOMEPAGE="https://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
- acl apparmor audit boot cryptsetup curl +dns-over-tls elfutils
+ acl apparmor audit boot cgroup-hybrid cryptsetup curl +dns-over-tls elfutils
fido2 +gcrypt gnutls homed http idn importd iptables +kernel-install +kmod
+lz4 lzma +openssl pam pcre pkcs11 policykit pwquality qrcode
+resolvconf +seccomp selinux split-usr +sysv-utils test tpm ukify vanilla xkb +zstd
@@ -180,12 +180,38 @@ BDEPEND="
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
+check_cgroup_layout() {
+ # https://bugs.gentoo.org/935261
+ [[ ${MERGE_TYPE} != buildonly ]] || return
+ [[ -z ${ROOT} ]] || return
+ [[ -e /sys/fs/cgroup/unified ]] || return
+ grep -q 'SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1' /proc/cmdline && return
+
+ eerror "This system appears to be booted with the 'hybrid' cgroup layout."
+ eerror "This layout obsolete and is disabled in systemd."
+
+ if grep -qF 'systemd.legacy_systemd_cgroup_controller' /proc/cmdline; then
+ eerror "Remove the systemd.legacy_systemd_cgroup_controller option"
+ eerror "from the kernel command line and reboot."
+ die "hybrid cgroup layout detected"
+ fi
+}
+
pkg_pretend() {
if use split-usr; then
eerror "Please complete the migration to merged-usr."
eerror "https://wiki.gentoo.org/wiki/Merge-usr"
die "systemd no longer supports split-usr"
fi
+
+ check_cgroup_layout
+
+ if use cgroup-hybrid; then
+ eerror "Disable the 'cgroup-hybrid' USE flag."
+ eerror "Rebuild any initramfs images after rebuilding systemd."
+ die "cgroup-hybrid is no longer supported"
+ fi
+
if [[ ${MERGE_TYPE} != buildonly ]]; then
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE