Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/, sys-apps/systemd/files/
Date: Thu, 21 May 2020 00:13:08
Message-Id: 1590019978.25690985f6ec821756db3ee0af7484976005b79d.floppym@gentoo
1 commit: 25690985f6ec821756db3ee0af7484976005b79d
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 21 00:11:48 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu May 21 00:12:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25690985
7
8 sys-apps/systemd: remove old
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-apps/systemd/Manifest | 1 -
13 sys-apps/systemd/files/243-seccomp.patch | 145 ---------
14 sys-apps/systemd/systemd-243-r2.ebuild | 504 -------------------------------
15 3 files changed, 650 deletions(-)
16
17 diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
18 index fe384c4ffdc..2b7c2f78b20 100644
19 --- a/sys-apps/systemd/Manifest
20 +++ b/sys-apps/systemd/Manifest
21 @@ -1,4 +1,3 @@
22 -DIST systemd-243.tar.gz 8242522 BLAKE2B 89e3ebbea5a99061329f7c78220a66c1e075d5ba90dfdf5ee8d0d9b762ef4600dc82d8ca2054632e5e343b6272cd8046c92f7f99dcfa8287c5ef2b42fb96d4cb SHA512 56b52a297aa5ac04d9667eb3afb1598725b197de73ff72baa1aabbc2844e36fba7b7fccdf6d214ae8b5b926616b2b7e15772763aaa80ec938d74333ff9c8673e
23 DIST systemd-244.tar.gz 8445963 BLAKE2B 19751fb9c058a079694ee1b991259fd3f1fa30ae98ca38bbe8caadfc5628db7848c7f742a1b11781fbd67f911adda917d7a4da1dddb63064907f86f47e5a3256 SHA512 08f260fb15b5eb273faafda826dd9154e9a02841b4c5911cc1c7e1445072ad51389f8cced7b9acf112737c20fd56b2fbf48b3f914733c934c774d38a23b616fb
24 DIST systemd-245.tar.gz 8993479 BLAKE2B be0b1fca5ba8585978f570868bc9135c1fee78ea64dcdf8b1a3419e856a83da90104ed2f86e5f3e5b0b6f29d4b34f603bfe1e4cbc61ccf71bedce547db62ff35 SHA512 1b80d0e02472dfc4197f11dab4f56cf90e8a6e105ce19f837cb11335b6d8577ed49031dad94cdb41aa9bdc06ec8eec62c8e9246272b83935e7bb9dcd3cd8c012
25 DIST systemd-stable-244.3.tar.gz 8484735 BLAKE2B 25125ecdae59c852e8ceb45b7ed0b76631b301ab4026c4e389c4bc12090fe41f5918411a75bd20f38b6b3993445df93c850ba98f8d9b30fd24fc4e25f8355a3d SHA512 f8e83fa3e57ac8fdbed61b66bb45fd0eafa6fb36eda26f10690d93f34b03daab6ce4e7eff45b79dcaf59f11f41c1b022d1d9314f576c50ad28f6bb5901f1b18d
26
27 diff --git a/sys-apps/systemd/files/243-seccomp.patch b/sys-apps/systemd/files/243-seccomp.patch
28 deleted file mode 100644
29 index 88b129f7722..00000000000
30 --- a/sys-apps/systemd/files/243-seccomp.patch
31 +++ /dev/null
32 @@ -1,145 +0,0 @@
33 -From 4df8fe8415eaf4abd5b93c3447452547c6ea9e5f Mon Sep 17 00:00:00 2001
34 -From: Lennart Poettering <lennart@××××××××××.net>
35 -Date: Thu, 14 Nov 2019 17:51:30 +0100
36 -Subject: [PATCH] seccomp: more comprehensive protection against libseccomp's
37 - __NR_xyz namespace invasion
38 -
39 -A follow-up for 59b657296a2fe104f112b91bbf9301724067cc81, adding the
40 -same conditioning for all cases of our __NR_xyz use.
41 -
42 -Fixes: #14031
43 ----
44 - src/basic/missing_syscall.h | 10 +++++-----
45 - src/test/test-seccomp.c | 19 ++++++++++---------
46 - 2 files changed, 15 insertions(+), 14 deletions(-)
47 -
48 -diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
49 -index 6d9b12544d..1255d8b197 100644
50 ---- a/src/basic/missing_syscall.h
51 -+++ b/src/basic/missing_syscall.h
52 -@@ -274,7 +274,7 @@ static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, c
53 -
54 - #if !HAVE_KCMP
55 - static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
56 --# ifdef __NR_kcmp
57 -+# if defined __NR_kcmp && __NR_kcmp > 0
58 - return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
59 - # else
60 - errno = ENOSYS;
61 -@@ -289,7 +289,7 @@ static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long i
62 -
63 - #if !HAVE_KEYCTL
64 - static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) {
65 --# ifdef __NR_keyctl
66 -+# if defined __NR_keyctl && __NR_keyctl > 0
67 - return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
68 - # else
69 - errno = ENOSYS;
70 -@@ -300,7 +300,7 @@ static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg
71 - }
72 -
73 - static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
74 --# ifdef __NR_add_key
75 -+# if defined __NR_add_key && __NR_add_key > 0
76 - return syscall(__NR_add_key, type, description, payload, plen, ringid);
77 - # else
78 - errno = ENOSYS;
79 -@@ -311,7 +311,7 @@ static inline key_serial_t missing_add_key(const char *type, const char *descrip
80 - }
81 -
82 - static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
83 --# ifdef __NR_request_key
84 -+# if defined __NR_request_key && __NR_request_key > 0
85 - return syscall(__NR_request_key, type, description, callout_info, destringid);
86 - # else
87 - errno = ENOSYS;
88 -@@ -496,7 +496,7 @@ enum {
89 - static inline long missing_set_mempolicy(int mode, const unsigned long *nodemask,
90 - unsigned long maxnode) {
91 - long i;
92 --# ifdef __NR_set_mempolicy
93 -+# if defined __NR_set_mempolicy && __NR_set_mempolicy > 0
94 - i = syscall(__NR_set_mempolicy, mode, nodemask, maxnode);
95 - # else
96 - errno = ENOSYS;
97 -diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
98 -index 018c20f8be..c6692043fe 100644
99 ---- a/src/test/test-seccomp.c
100 -+++ b/src/test/test-seccomp.c
101 -@@ -28,7 +28,8 @@
102 - #include "tmpfile-util.h"
103 - #include "virt.h"
104 -
105 --#if SCMP_SYS(socket) < 0 || defined(__i386__) || defined(__s390x__) || defined(__s390__)
106 -+/* __NR_socket may be invalid due to libseccomp */
107 -+#if !defined(__NR_socket) || __NR_socket <= 0 || defined(__i386__) || defined(__s390x__) || defined(__s390__)
108 - /* On these archs, socket() is implemented via the socketcall() syscall multiplexer,
109 - * and we can't restrict it hence via seccomp. */
110 - # define SECCOMP_RESTRICT_ADDRESS_FAMILIES_BROKEN 1
111 -@@ -304,14 +305,14 @@ static void test_protect_sysctl(void) {
112 - assert_se(pid >= 0);
113 -
114 - if (pid == 0) {
115 --#if __NR__sysctl > 0
116 -+#if defined __NR__sysctl && __NR__sysctl > 0
117 - assert_se(syscall(__NR__sysctl, NULL) < 0);
118 - assert_se(errno == EFAULT);
119 - #endif
120 -
121 - assert_se(seccomp_protect_sysctl() >= 0);
122 -
123 --#if __NR__sysctl > 0
124 -+#if defined __NR__sysctl && __NR__sysctl > 0
125 - assert_se(syscall(__NR__sysctl, 0, 0, 0) < 0);
126 - assert_se(errno == EPERM);
127 - #endif
128 -@@ -640,7 +641,7 @@ static void test_load_syscall_filter_set_raw(void) {
129 - assert_se(poll(NULL, 0, 0) == 0);
130 -
131 - assert_se(s = hashmap_new(NULL));
132 --#if SCMP_SYS(access) >= 0
133 -+#if defined __NR_access && __NR_access > 0
134 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_access + 1), INT_TO_PTR(-1)) >= 0);
135 - #else
136 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_faccessat + 1), INT_TO_PTR(-1)) >= 0);
137 -@@ -656,7 +657,7 @@ static void test_load_syscall_filter_set_raw(void) {
138 - s = hashmap_free(s);
139 -
140 - assert_se(s = hashmap_new(NULL));
141 --#if SCMP_SYS(access) >= 0
142 -+#if defined __NR_access && __NR_access > 0
143 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_access + 1), INT_TO_PTR(EILSEQ)) >= 0);
144 - #else
145 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_faccessat + 1), INT_TO_PTR(EILSEQ)) >= 0);
146 -@@ -672,7 +673,7 @@ static void test_load_syscall_filter_set_raw(void) {
147 - s = hashmap_free(s);
148 -
149 - assert_se(s = hashmap_new(NULL));
150 --#if SCMP_SYS(poll) >= 0
151 -+#if defined __NR_poll && __NR_poll > 0
152 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_poll + 1), INT_TO_PTR(-1)) >= 0);
153 - #else
154 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_ppoll + 1), INT_TO_PTR(-1)) >= 0);
155 -@@ -689,7 +690,7 @@ static void test_load_syscall_filter_set_raw(void) {
156 - s = hashmap_free(s);
157 -
158 - assert_se(s = hashmap_new(NULL));
159 --#if SCMP_SYS(poll) >= 0
160 -+#if defined __NR_poll && __NR_poll > 0
161 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_poll + 1), INT_TO_PTR(EILSEQ)) >= 0);
162 - #else
163 - assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_ppoll + 1), INT_TO_PTR(EILSEQ)) >= 0);
164 -@@ -767,8 +768,8 @@ static int real_open(const char *path, int flags, mode_t mode) {
165 - * testing purposes that calls the real syscall, on architectures where SYS_open is defined. On
166 - * other architectures, let's just fall back to the glibc call. */
167 -
168 --#ifdef SYS_open
169 -- return (int) syscall(SYS_open, path, flags, mode);
170 -+#if defined __NR_open && __NR_open > 0
171 -+ return (int) syscall(__NR_open, path, flags, mode);
172 - #else
173 - return open(path, flags, mode);
174 - #endif
175 ---
176 -2.24.0
177 -
178
179 diff --git a/sys-apps/systemd/systemd-243-r2.ebuild b/sys-apps/systemd/systemd-243-r2.ebuild
180 deleted file mode 100644
181 index 62ea76aad71..00000000000
182 --- a/sys-apps/systemd/systemd-243-r2.ebuild
183 +++ /dev/null
184 @@ -1,504 +0,0 @@
185 -# Copyright 2011-2020 Gentoo Authors
186 -# Distributed under the terms of the GNU General Public License v2
187 -
188 -EAPI=7
189 -
190 -if [[ ${PV} == 9999 ]]; then
191 - EGIT_REPO_URI="https://github.com/systemd/systemd.git"
192 - inherit git-r3
193 -else
194 - MY_PV=${PV/_/-}
195 - MY_P=${PN}-${MY_PV}
196 - S=${WORKDIR}/${MY_P}
197 - SRC_URI="https://github.com/systemd/systemd/archive/v${MY_PV}/${MY_P}.tar.gz"
198 - KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86"
199 -fi
200 -
201 -PYTHON_COMPAT=( python{3_6,3_7} )
202 -
203 -inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
204 -
205 -DESCRIPTION="System and service manager for Linux"
206 -HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
207 -
208 -LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
209 -SLOT="0/2"
210 -IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr static-libs +sysv-utils test vanilla xkb"
211 -
212 -REQUIRED_USE="importd? ( curl gcrypt lzma )"
213 -RESTRICT="!test? ( test )"
214 -
215 -MINKV="3.11"
216 -
217 -COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
218 - sys-libs/libcap:0=[${MULTILIB_USEDEP}]
219 - acl? ( sys-apps/acl:0= )
220 - apparmor? ( sys-libs/libapparmor:0= )
221 - audit? ( >=sys-process/audit-2:0= )
222 - cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
223 - curl? ( net-misc/curl:0= )
224 - dns-over-tls? ( >=net-libs/gnutls-3.5.3:0= )
225 - elfutils? ( >=dev-libs/elfutils-0.158:0= )
226 - gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
227 - http? (
228 - >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)]
229 - >=net-libs/gnutls-3.1.4:0=
230 - )
231 - idn? ( net-dns/libidn2:= )
232 - importd? (
233 - app-arch/bzip2:0=
234 - sys-libs/zlib:0=
235 - )
236 - kmod? ( >=sys-apps/kmod-15:0= )
237 - lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
238 - lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
239 - nat? ( net-firewall/iptables:0= )
240 - pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
241 - pcre? ( dev-libs/libpcre2 )
242 - qrcode? ( media-gfx/qrencode:0= )
243 - seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
244 - selinux? ( sys-libs/libselinux:0= )
245 - xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
246 -
247 -# Newer linux-headers needed by ia64, bug #480218
248 -DEPEND="${COMMON_DEPEND}
249 - >=sys-kernel/linux-headers-${MINKV}
250 - gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
251 -"
252 -
253 -# baselayout-2.2 has /run
254 -RDEPEND="${COMMON_DEPEND}
255 - acct-group/adm
256 - acct-group/wheel
257 - acct-group/kmem
258 - acct-group/tty
259 - acct-group/utmp
260 - acct-group/audio
261 - acct-group/cdrom
262 - acct-group/dialout
263 - acct-group/disk
264 - acct-group/input
265 - acct-group/kvm
266 - acct-group/render
267 - acct-group/tape
268 - acct-group/video
269 - acct-group/systemd-journal
270 - acct-user/systemd-journal-remote
271 - acct-user/systemd-coredump
272 - acct-user/systemd-network
273 - acct-user/systemd-resolve
274 - acct-user/systemd-timesync
275 - >=sys-apps/baselayout-2.2
276 - selinux? ( sec-policy/selinux-base-policy[systemd] )
277 - sysv-utils? ( !sys-apps/sysvinit )
278 - !sysv-utils? ( sys-apps/sysvinit )
279 - resolvconf? ( !net-dns/openresolv )
280 - !build? ( || (
281 - sys-apps/util-linux[kill(-)]
282 - sys-process/procps[kill(+)]
283 - sys-apps/coreutils[kill(-)]
284 - ) )
285 - !sys-auth/nss-myhostname
286 - !sys-fs/eudev
287 - !sys-fs/udev
288 -"
289 -
290 -# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
291 -PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
292 - >=sys-apps/hwids-20150417[udev]
293 - >=sys-fs/udev-init-scripts-25
294 - policykit? ( sys-auth/polkit )
295 - !vanilla? ( sys-apps/gentoo-systemd-integration )"
296 -
297 -BDEPEND="
298 - app-arch/xz-utils:0
299 - dev-util/gperf
300 - >=dev-util/meson-0.46
301 - >=dev-util/intltool-0.50
302 - >=sys-apps/coreutils-8.16
303 - sys-devel/m4
304 - virtual/pkgconfig[${MULTILIB_USEDEP}]
305 - test? ( sys-apps/dbus )
306 - app-text/docbook-xml-dtd:4.2
307 - app-text/docbook-xml-dtd:4.5
308 - app-text/docbook-xsl-stylesheets
309 - dev-libs/libxslt:0
310 - $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
311 -"
312 -
313 -python_check_deps() {
314 - has_version -b "dev-python/lxml[${PYTHON_USEDEP}]"
315 -}
316 -
317 -pkg_pretend() {
318 - if [[ ${MERGE_TYPE} != buildonly ]]; then
319 - if use test && has pid-sandbox ${FEATURES}; then
320 - ewarn "Tests are known to fail with PID sandboxing enabled."
321 - ewarn "See https://bugs.gentoo.org/674458."
322 - fi
323 -
324 - local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
325 - ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
326 - ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
327 - ~TIMERFD ~TMPFS_XATTR ~UNIX
328 - ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
329 - ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
330 - ~!SYSFS_DEPRECATED_V2"
331 -
332 - use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
333 - use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
334 - kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
335 - kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
336 - kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
337 -
338 - if linux_config_exists; then
339 - local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
340 - if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
341 - ewarn "It's recommended to set an empty value to the following kernel config option:"
342 - ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
343 - fi
344 - if linux_chkconfig_present X86; then
345 - CONFIG_CHECK+=" ~DMIID"
346 - fi
347 - fi
348 -
349 - if kernel_is -lt ${MINKV//./ }; then
350 - ewarn "Kernel version at least ${MINKV} required"
351 - fi
352 -
353 - check_extra_config
354 - fi
355 -}
356 -
357 -pkg_setup() {
358 - :
359 -}
360 -
361 -src_unpack() {
362 - default
363 - [[ ${PV} != 9999 ]] || git-r3_src_unpack
364 -}
365 -
366 -src_prepare() {
367 - # Do NOT add patches here
368 - local PATCHES=()
369 -
370 - [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
371 -
372 - # Add local patches here
373 - PATCHES+=(
374 - "${FILESDIR}/243-seccomp.patch"
375 - "${FILESDIR}/245-clang-gnu11.patch"
376 - )
377 -
378 - if ! use vanilla; then
379 - PATCHES+=(
380 - "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch"
381 - "${FILESDIR}/gentoo-systemd-user-pam.patch"
382 - "${FILESDIR}/gentoo-generator-path-r1.patch"
383 - )
384 - fi
385 -
386 - default
387 -}
388 -
389 -src_configure() {
390 - # Prevent conflicts with i686 cross toolchain, bug 559726
391 - tc-export AR CC NM OBJCOPY RANLIB
392 -
393 - python_setup
394 -
395 - multilib-minimal_src_configure
396 -}
397 -
398 -meson_use() {
399 - usex "$1" true false
400 -}
401 -
402 -meson_multilib() {
403 - if multilib_is_native_abi; then
404 - echo true
405 - else
406 - echo false
407 - fi
408 -}
409 -
410 -meson_multilib_native_use() {
411 - if multilib_is_native_abi && use "$1"; then
412 - echo true
413 - else
414 - echo false
415 - fi
416 -}
417 -
418 -multilib_src_configure() {
419 - local myconf=(
420 - --localstatedir="${EPREFIX}/var"
421 - -Dsupport-url="https://gentoo.org/support/"
422 - -Dpamlibdir="$(getpam_mod_dir)"
423 - # avoid bash-completion dep
424 - -Dbashcompletiondir="$(get_bashcompdir)"
425 - # make sure we get /bin:/sbin in PATH
426 - -Dsplit-usr=$(usex split-usr true false)
427 - -Dsplit-bin=true
428 - -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
429 - -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
430 - -Dsysvinit-path=
431 - -Dsysvrcnd-path=
432 - # Avoid infinite exec recursion, bug 642724
433 - -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
434 - # no deps
435 - -Defi=$(meson_multilib)
436 - -Dima=true
437 - -Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
438 - # Optional components/dependencies
439 - -Dacl=$(meson_multilib_native_use acl)
440 - -Dapparmor=$(meson_multilib_native_use apparmor)
441 - -Daudit=$(meson_multilib_native_use audit)
442 - -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
443 - -Dlibcurl=$(meson_multilib_native_use curl)
444 - -Ddns-over-tls=$(meson_multilib_native_use dns-over-tls)
445 - -Delfutils=$(meson_multilib_native_use elfutils)
446 - -Dgcrypt=$(meson_use gcrypt)
447 - -Dgnu-efi=$(meson_multilib_native_use gnuefi)
448 - -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
449 - -Dmicrohttpd=$(meson_multilib_native_use http)
450 - -Didn=$(meson_multilib_native_use idn)
451 - -Dimportd=$(meson_multilib_native_use importd)
452 - -Dbzip2=$(meson_multilib_native_use importd)
453 - -Dzlib=$(meson_multilib_native_use importd)
454 - -Dkmod=$(meson_multilib_native_use kmod)
455 - -Dlz4=$(meson_use lz4)
456 - -Dxz=$(meson_use lzma)
457 - -Dlibiptc=$(meson_multilib_native_use nat)
458 - -Dpam=$(meson_use pam)
459 - -Dpcre2=$(meson_multilib_native_use pcre)
460 - -Dpolkit=$(meson_multilib_native_use policykit)
461 - -Dqrencode=$(meson_multilib_native_use qrcode)
462 - -Dseccomp=$(meson_multilib_native_use seccomp)
463 - -Dselinux=$(meson_multilib_native_use selinux)
464 - -Ddbus=$(meson_multilib_native_use test)
465 - -Dxkbcommon=$(meson_multilib_native_use xkb)
466 - -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
467 - # Breaks screen, tmux, etc.
468 - -Ddefault-kill-user-processes=false
469 - -Dcreate-log-dirs=false
470 -
471 - # multilib options
472 - -Dbacklight=$(meson_multilib)
473 - -Dbinfmt=$(meson_multilib)
474 - -Dcoredump=$(meson_multilib)
475 - -Denvironment-d=$(meson_multilib)
476 - -Dfirstboot=$(meson_multilib)
477 - -Dhibernate=$(meson_multilib)
478 - -Dhostnamed=$(meson_multilib)
479 - -Dhwdb=$(meson_multilib)
480 - -Dldconfig=$(meson_multilib)
481 - -Dlocaled=$(meson_multilib)
482 - -Dman=$(meson_multilib)
483 - -Dnetworkd=$(meson_multilib)
484 - -Dquotacheck=$(meson_multilib)
485 - -Drandomseed=$(meson_multilib)
486 - -Drfkill=$(meson_multilib)
487 - -Dsysusers=$(meson_multilib)
488 - -Dtimedated=$(meson_multilib)
489 - -Dtimesyncd=$(meson_multilib)
490 - -Dtmpfiles=$(meson_multilib)
491 - -Dvconsole=$(meson_multilib)
492 -
493 - # static-libs
494 - -Dstatic-libsystemd=$(usex static-libs true false)
495 - -Dstatic-libudev=$(usex static-libs true false)
496 - )
497 -
498 - meson_src_configure "${myconf[@]}"
499 -}
500 -
501 -multilib_src_compile() {
502 - eninja
503 -}
504 -
505 -multilib_src_test() {
506 - unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
507 - meson_src_test
508 -}
509 -
510 -multilib_src_install() {
511 - DESTDIR="${D}" eninja install
512 -}
513 -
514 -multilib_src_install_all() {
515 - local rootprefix=$(usex split-usr '' /usr)
516 -
517 - # meson doesn't know about docdir
518 - mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
519 -
520 - einstalldocs
521 - dodoc "${FILESDIR}"/nsswitch.conf
522 -
523 - if ! use resolvconf; then
524 - rm -f "${ED}${rootprefix}"/sbin/resolvconf || die
525 - fi
526 -
527 - if ! use sysv-utils; then
528 - rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
529 - rm "${ED}"/usr/share/man/man1/init.1 || die
530 - rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
531 - fi
532 -
533 - if ! use resolvconf && ! use sysv-utils; then
534 - rmdir "${ED}${rootprefix}"/sbin || die
535 - fi
536 -
537 - # Preserve empty dirs in /etc & /var, bug #437008
538 - keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
539 - keepdir /etc/kernel/install.d
540 - keepdir /etc/systemd/{network,system,user}
541 - keepdir /etc/udev/{hwdb.d,rules.d}
542 - keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
543 - keepdir /usr/lib/{binfmt.d,modules-load.d}
544 - keepdir /usr/lib/systemd/user-generators
545 - keepdir /var/lib/systemd
546 - keepdir /var/log/journal
547 -
548 - # Symlink /etc/sysctl.conf for easy migration.
549 - dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
550 -
551 - rm -r "${ED}${rootprefix}"/lib/udev/hwdb.d || die
552 -
553 - if use split-usr; then
554 - # Avoid breaking boot/reboot
555 - dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
556 - dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
557 - fi
558 -
559 - gen_usr_ldscript -a systemd udev
560 -}
561 -
562 -migrate_locale() {
563 - local envd_locale_def="${EROOT}/etc/env.d/02locale"
564 - local envd_locale=( "${EROOT}"/etc/env.d/??locale )
565 - local locale_conf="${EROOT}/etc/locale.conf"
566 -
567 - if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
568 - # If locale.conf does not exist...
569 - if [[ -e ${envd_locale} ]]; then
570 - # ...either copy env.d/??locale if there's one
571 - ebegin "Moving ${envd_locale} to ${locale_conf}"
572 - mv "${envd_locale}" "${locale_conf}"
573 - eend ${?} || FAIL=1
574 - else
575 - # ...or create a dummy default
576 - ebegin "Creating ${locale_conf}"
577 - cat > "${locale_conf}" <<-EOF
578 - # This file has been created by the sys-apps/systemd ebuild.
579 - # See locale.conf(5) and localectl(1).
580 -
581 - # LANG=${LANG}
582 - EOF
583 - eend ${?} || FAIL=1
584 - fi
585 - fi
586 -
587 - if [[ ! -L ${envd_locale} ]]; then
588 - # now, if env.d/??locale is not a symlink (to locale.conf)...
589 - if [[ -e ${envd_locale} ]]; then
590 - # ...warn the user that he has duplicate locale settings
591 - ewarn
592 - ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
593 - ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
594 - ewarn "and create the symlink with the following command:"
595 - ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
596 - ewarn
597 - else
598 - # ...or just create the symlink if there's nothing here
599 - ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
600 - ln -n -s ../locale.conf "${envd_locale_def}"
601 - eend ${?} || FAIL=1
602 - fi
603 - fi
604 -}
605 -
606 -save_enabled_units() {
607 - ENABLED_UNITS=()
608 - type systemctl &>/dev/null || return
609 - for x; do
610 - if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then
611 - ENABLED_UNITS+=( "${x}" )
612 - fi
613 - done
614 -}
615 -
616 -pkg_preinst() {
617 - save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@××××.service
618 -
619 - if ! use split-usr; then
620 - local dir
621 - for dir in bin sbin lib; do
622 - if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
623 - eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged."
624 - eerror "One of them should be a symbolic link to the other one."
625 - FAIL=1
626 - fi
627 - done
628 - if [[ ${FAIL} ]]; then
629 - eerror "Migration to system layout with merged directories must be performed before"
630 - eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
631 - die "System layout with split directories still used"
632 - fi
633 - fi
634 -}
635 -
636 -pkg_postinst() {
637 - systemd_update_catalog
638 -
639 - # Keep this here in case the database format changes so it gets updated
640 - # when required. Despite that this file is owned by sys-apps/hwids.
641 - if has_version "sys-apps/hwids[udev]"; then
642 - udevadm hwdb --update --root="${EROOT}"
643 - fi
644 -
645 - udev_reload || FAIL=1
646 -
647 - # Bug 465468, make sure locales are respect, and ensure consistency
648 - # between OpenRC & systemd
649 - migrate_locale
650 -
651 - systemd_reenable systemd-networkd.service systemd-resolved.service
652 -
653 - if [[ ${ENABLED_UNITS[@]} ]]; then
654 - systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}"
655 - fi
656 -
657 - if [[ -z ${REPLACING_VERSIONS} ]]; then
658 - if type systemctl &>/dev/null; then
659 - systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
660 - fi
661 - elog "To enable a useful set of services, run the following:"
662 - elog " systemctl preset-all --preset-mode=enable-only"
663 - fi
664 -
665 - if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
666 - rm "${EROOT}/var/lib/systemd/timesync"
667 - fi
668 -
669 - if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
670 - ebegin "Reexecuting system manager"
671 - systemctl daemon-reexec
672 - eend $?
673 - fi
674 -
675 - if [[ ${FAIL} ]]; then
676 - eerror "One of the postinst commands failed. Please check the postinst output"
677 - eerror "for errors. You may need to clean up your system and/or try installing"
678 - eerror "systemd again."
679 - eerror
680 - fi
681 -}
682 -
683 -pkg_prerm() {
684 - # If removing systemd completely, remove the catalog database.
685 - if [[ ! ${REPLACED_BY_VERSION} ]]; then
686 - rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
687 - fi
688 -}