From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 442681382C5 for ; Wed, 17 Mar 2021 14:19:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 789A9E086A; Wed, 17 Mar 2021 14:19:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FEF7E086A for ; Wed, 17 Mar 2021 14:19:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1AD34340F5D for ; Wed, 17 Mar 2021 14:19:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8F8FB4F1 for ; Wed, 17 Mar 2021 14:19:11 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1615990703.e473f70fbcfc239779f91c1649af4f369e0f2b6e.floppym@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/files/, sys-apps/systemd/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/systemd/files/247-cgroup-test.patch sys-apps/systemd/systemd-247.2-r4.ebuild X-VCS-Directories: sys-apps/systemd/files/ sys-apps/systemd/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: e473f70fbcfc239779f91c1649af4f369e0f2b6e X-VCS-Branch: master Date: Wed, 17 Mar 2021 14:19:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b1c6009b-cb02-4cd0-99b1-9edf1bda7913 X-Archives-Hash: 2c537bdf7c15824c4af0d18827451a8e commit: e473f70fbcfc239779f91c1649af4f369e0f2b6e Author: Mike Gilbert gentoo org> AuthorDate: Wed Mar 17 14:18:23 2021 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Wed Mar 17 14:18:23 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e473f70f sys-apps/systemd: fix cgroup-related test failures Closes: https://bugs.gentoo.org/771819 Signed-off-by: Mike Gilbert gentoo.org> sys-apps/systemd/files/247-cgroup-test.patch | 35 ++++++++++++++++++++++++++++ sys-apps/systemd/systemd-247.2-r4.ebuild | 1 + 2 files changed, 36 insertions(+) diff --git a/sys-apps/systemd/files/247-cgroup-test.patch b/sys-apps/systemd/files/247-cgroup-test.patch new file mode 100644 index 00000000000..bfa4422a621 --- /dev/null +++ b/sys-apps/systemd/files/247-cgroup-test.patch @@ -0,0 +1,35 @@ +From ddfc6ad061ad47caeeff901d27cbc59af85e0db3 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Tue, 9 Mar 2021 17:57:37 -0500 +Subject: [PATCH] cg_unified_cached: return ENOMEDIUM if we cannot find a known + hierarchy + +When the test suite is being run in a foreign environment, +/sys/fs/cgroup might not be set up in a way that we recognize. +Returning ENOMEDIUM causes the tests to be skipped in this case. + +Bug: https://bugs.gentoo.org/771819 +--- + src/basic/cgroup-util.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c +index 527043a2b39..0b252eb28fb 100644 +--- a/src/basic/cgroup-util.c ++++ b/src/basic/cgroup-util.c +@@ -2052,8 +2052,14 @@ int cg_unified_cached(bool flush) { + unified_cache = CGROUP_UNIFIED_SYSTEMD; + unified_systemd_v232 = false; + } else { +- if (statfs("/sys/fs/cgroup/systemd/", &fs) < 0) ++ if (statfs("/sys/fs/cgroup/systemd/", &fs) < 0) { ++ if (errno == ENOENT) { ++ /* Some other software may have set up /sys/fs/cgroup in a configuration we do not recognize. */ ++ log_debug_errno(errno, "Unsupported cgroupsv1 setup detected: name=systemd hierarchy not found."); ++ return -ENOMEDIUM; ++ } + return log_debug_errno(errno, "statfs(\"/sys/fs/cgroup/systemd\" failed: %m"); ++ } + + if (F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) { + log_debug("Found cgroup2 on /sys/fs/cgroup/systemd, unified hierarchy for systemd controller (v232 variant)"); diff --git a/sys-apps/systemd/systemd-247.2-r4.ebuild b/sys-apps/systemd/systemd-247.2-r4.ebuild index 4c9425020e3..4853d82c9c9 100644 --- a/sys-apps/systemd/systemd-247.2-r4.ebuild +++ b/sys-apps/systemd/systemd-247.2-r4.ebuild @@ -212,6 +212,7 @@ src_prepare() { # Add local patches here PATCHES+=( + "${FILESDIR}"/247-cgroup-test.patch ) if ! use vanilla; then