From c6ac204513ebfb60165602e9e132802a5a772498 Mon Sep 17 00:00:00 2001 From: cr6git Date: Sat, 20 Jan 2018 22:32:16 +0100 Subject: [PATCH] elogind: add Gentoo patch (#11002) Close #10997 --- .../elogind-235.2-legacy-cgroupmode.patch | 56 +++++++++++++++++++ srcpkgs/elogind/template | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/elogind/patches/elogind-235.2-legacy-cgroupmode.patch diff --git a/srcpkgs/elogind/patches/elogind-235.2-legacy-cgroupmode.patch b/srcpkgs/elogind/patches/elogind-235.2-legacy-cgroupmode.patch new file mode 100644 index 00000000000..259dc85c967 --- /dev/null +++ b/srcpkgs/elogind/patches/elogind-235.2-legacy-cgroupmode.patch @@ -0,0 +1,56 @@ +From 003ece760231aba0c661e2390dfd11075d72a8da Mon Sep 17 00:00:00 2001 +From: Sven Eden +Date: Thu, 18 Jan 2018 23:01:12 +0100 +Subject: [PATCH] Prep v235.3 : Fix cgroup hierarchy detection code + +There is no sub-grouping with elogind, so /sys/fs/cgroup/elogind is +not needed to be mounted as cgroup fs in legacy mode. + +Fixes Bug https://bugs.gentoo.org/644834 +--- + src/basic/cgroup-util.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c +index 7f86c532c..cb60108ef 100644 +--- src/basic/cgroup-util.c ++++ src/basic/cgroup-util.c +@@ -2550,28 +2550,31 @@ static int cg_unified_update(void) { + + if (F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) + unified_cache = CGROUP_UNIFIED_ALL; ++#if 0 /// The handling of cgroups is a bit different with elogind + else if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC)) { ++#else ++ else if (F_TYPE_EQUAL(fs.f_type, CGROUP_SUPER_MAGIC) ++ || F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC)) { ++#endif // 0 + if (statfs("/sys/fs/cgroup/unified/", &fs) == 0 && + F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) { + unified_cache = CGROUP_UNIFIED_SYSTEMD; + unified_systemd_v232 = false; + #if 0 /// elogind uses its own name + } else if (statfs("/sys/fs/cgroup/systemd/", &fs) == 0 && +- F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) { +- unified_cache = CGROUP_UNIFIED_SYSTEMD; +- unified_systemd_v232 = true; +- } else { +- if (statfs("/sys/fs/cgroup/systemd/", &fs) < 0) +- return -errno; + #else + } else if (statfs("/sys/fs/cgroup/elogind/", &fs) == 0 && ++#endif // 0 + F_TYPE_EQUAL(fs.f_type, CGROUP2_SUPER_MAGIC)) { + unified_cache = CGROUP_UNIFIED_SYSTEMD; + unified_systemd_v232 = true; + } else { +-#endif // 0 ++#if 0 /// There is no sub-grouping within elogind ++ if (statfs("/sys/fs/cgroup/systemd/", &fs) < 0) ++ return -errno; + if (!F_TYPE_EQUAL(fs.f_type, CGROUP_SUPER_MAGIC)) + return -ENOMEDIUM; ++#endif // 0 + unified_cache = CGROUP_UNIFIED_NONE; + } + } else diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template index cc79a3a945d..72b58352baf 100644 --- a/srcpkgs/elogind/template +++ b/srcpkgs/elogind/template @@ -1,7 +1,7 @@ # Template file for 'elogind' pkgname=elogind version=235.2 -revision=1 +revision=2 build_style=meson hostmakedepends="intltool pkg-config gperf docbook-xsl gettext-devel shadow m4 libxslt git" makedepends="libcap-devel libmount-devel libseccomp-devel libblkid-devel pam-devel gettext-devel eudev-libudev-devel acl-devel glib-devel"