sys-apps/systemd: Sync with Gentoo

It's from Gentoo commit c923eb13e743b615782a2000cdeafc84db07e533.
This commit is contained in:
Sayan Chowdhury 2024-02-05 16:47:28 +05:30 committed by Adrian Vladu
parent 2ea7f40401
commit e107522864
32 changed files with 4751 additions and 1209 deletions

View File

@ -1,2 +0,0 @@
- Check that the `systemd-sysext.service`'s `ConditionDirectoryNotEmpty` entries are correctly reflected in `flatcar/init:systemd/system/ensure-sysext.service`
- Check if our preset setup in `multilib_src_install_all` is in sync with `systemd/systemd:presets/90-systemd.preset`.

View File

@ -1 +1,6 @@
DIST systemd-stable-252.11.tar.gz 11845530 BLAKE2B 5c4492040640d09248d4ec775e8bfca5dbe81d42f4fbda6ecb120271624c19d84eeacd0e93dd018fbab714a29954d50898a93238179948927e466b345446bc9a SHA512 f64c452b028eb8c6342a7e3b943fc22adb04bcfe00790dd91827604bf8746b5cf87fbffd666f408b1a89ed999dec2629533b92d02bec560406ea03313fc41206
DIST systemd-stable-254.5.tar.gz 14334696 BLAKE2B 2f63d79ae93add69ac0b56dda9f67019340f84692de4da200557b9f5f1f16bebbad42a9a7e2d6ef7420aa37746d2ede0481fd8e39f03a31576c7e4e48e259ce3 SHA512 cac713670216add9e5473e2c86f04da441015e7cc0ac1500b9e1489a435f9b80c4c6ee24e9b22e4c4213a495bc1a0a908925df2045e344a2170d5aea6aafa16c
DIST systemd-stable-254.7.tar.gz 14411955 BLAKE2B 1213237a001fb0aef8912637f31d7d77888bc2505e1e8d8d295642a547bdebbc3a786eed095694e6a6fe2665d6e8e45e98cd883186eedeb1b4fd73daf2520dcf SHA512 2e859813f1f52fa693631ce43466875ac2ac42e09872011ee52fe4e44727663c3de9f128a47776899423188c1e99ce73a69059426a9356c930e275037d001685
DIST systemd-stable-254.8.tar.gz 14418468 BLAKE2B e5a151ece86e57c7224fc95bda1b4ede1277fce4a2ba28d3605ab0431a2aafe1088f90c49a20e3b53a5b56aeef7c0f1f5da0601db740150f5efdf6eae7bbde80 SHA512 a3f35d9fcafcccd8d9c33ab1047241f226146017be95562a67c7dcc9eeb4b77bded92ad80e92f4767f2bf2009df0172a621d4c54a805e07ed5a5ed03940ec28e
DIST systemd-stable-254.9.tar.gz 14423806 BLAKE2B ab39c0a00b8451b24b40e39f4bf7ecb912ff23d9cd6f8d30fd0545e895936baa635b1ff63c02a83761682b72f44244aac8338bf6506885c9b07cd0c5247b6693 SHA512 a0300693a044cfe4c76deb0e3e48a927125eb97c3952c07ba68936f1e093c93506d8044b249b534b8e778ade6143b43194f8d6b721a8cd520bc7bb4cb3d3e5c1
DIST systemd-stable-255.2.tar.gz 14864388 BLAKE2B 101da82a5d63eaa48c2dc4bad5ab713b4e8b544134de8216f315a97736eb699eaf756aef2d9a4e2126f0d248b3a7e28bc986ccc2154d5d110db733d114072eec SHA512 0a9a43adc6d23f52349d298cdff3f3ae6accd7e43a33253608f7a9d241699c7cba3c9f6a0fa6da3ae3cba0e246e272076bfa2cdf5bade7bc019406f407be0bb9
DIST systemd-stable-255.3.tar.gz 14873273 BLAKE2B e22ef391c691fcf1e765c5112e1a55096d3bba61a9dae3ea1a3958add4e355892a97d5214e63c516ba3b70e2a83bb5d21254812d870f06c16c74a58d4f957d75 SHA512 c2868a53df2176649b0d0c94e5d451c46ba783bcdbc89ce12434ed2d11dba44b4854ffe4c2430f3f64eef2e214cbb51d5f740170afbd9edd66761a8851157453

View File

@ -1,32 +0,0 @@
From 02ebe43df912c7090a155484fbd1b422c4f438f4 Mon Sep 17 00:00:00 2001
From: David Michael <dm0@redhat.com>
Date: Tue, 16 Apr 2019 02:44:51 +0000
Subject: [PATCH 1/7] wait-online: set --any by default
The systemd-networkd-wait-online command would normally continue
waiting after a network interface is usable if other interfaces are
still configuring. There is a new flag --any to change this.
Preserve previous Container Linux behavior for compatibility by
setting the --any flag by default. See patches from v241 (or
earlier) for the original implementation.
---
src/network/wait-online/wait-online.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/wait-online/wait-online.c b/src/network/wait-online/wait-online.c
index a679b858fa..3b6dad8d1d 100644
--- a/src/network/wait-online/wait-online.c
+++ b/src/network/wait-online/wait-online.c
@@ -20,7 +20,7 @@ static Hashmap *arg_interfaces = NULL;
static char **arg_ignore = NULL;
static LinkOperationalStateRange arg_required_operstate = { _LINK_OPERSTATE_INVALID, _LINK_OPERSTATE_INVALID };
static AddressFamily arg_required_family = ADDRESS_FAMILY_NO;
-static bool arg_any = false;
+static bool arg_any = true;
STATIC_DESTRUCTOR_REGISTER(arg_interfaces, hashmap_free_free_freep);
STATIC_DESTRUCTOR_REGISTER(arg_ignore, strv_freep);
--
2.25.1

View File

@ -1,24 +0,0 @@
From e124d3716ada4fc7c34278435a61d51b07b61024 Mon Sep 17 00:00:00 2001
From: Nick Owens <nick.owens@coreos.com>
Date: Tue, 2 Jun 2015 18:22:32 -0700
Subject: [PATCH 2/7] networkd: default to "kernel" IPForwarding setting
---
src/network/networkd-network.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index a6c5b44238..54f9d12fec 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -465,6 +465,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
.link_local = _ADDRESS_FAMILY_INVALID,
.ipv6ll_address_gen_mode = _IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID,
+ .ip_forward = _ADDRESS_FAMILY_INVALID,
.ipv4_accept_local = -1,
.ipv4_route_localnet = -1,
.ipv6_privacy_extensions = IPV6_PRIVACY_EXTENSIONS_NO,
--
2.25.1

View File

@ -1,58 +0,0 @@
From a8366f0ddffabef08c010064ea62e64d7276a0f3 Mon Sep 17 00:00:00 2001
From: Alex Crawford <alex.crawford@coreos.com>
Date: Wed, 2 Mar 2016 10:46:33 -0800
Subject: [PATCH 3/7] needs-update: don't require strictly newer usr
Updates should be triggered whenever usr changes, not only when it is newer.
---
man/systemd-update-done.service.xml | 2 +-
src/shared/condition.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/systemd-update-done.service.xml b/man/systemd-update-done.service.xml
index 3393010ff6..5478baca25 100644
--- a/man/systemd-update-done.service.xml
+++ b/man/systemd-update-done.service.xml
@@ -50,7 +50,7 @@
<varname>ConditionNeedsUpdate=</varname> (see
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
condition to make sure to run when <filename>/etc/</filename> or
- <filename>/var/</filename> are older than <filename>/usr/</filename>
+ <filename>/var/</filename> aren't the same age as <filename>/usr/</filename>
according to the modification times of the files described above.
This requires that updates to <filename>/usr/</filename> are always
followed by an update of the modification time of
diff --git a/src/shared/condition.c b/src/shared/condition.c
index a23d6a3e45..8ca1f4606f 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -792,7 +792,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
* First, compare seconds as they are always accurate...
*/
if (usr.st_mtim.tv_sec != other.st_mtim.tv_sec)
- return usr.st_mtim.tv_sec > other.st_mtim.tv_sec;
+ return true;
/*
* ...then compare nanoseconds.
@@ -803,7 +803,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
* (otherwise the filesystem supports nsec timestamps, see stat(2)).
*/
if (usr.st_mtim.tv_nsec == 0 || other.st_mtim.tv_nsec > 0)
- return usr.st_mtim.tv_nsec > other.st_mtim.tv_nsec;
+ return usr.st_mtim.tv_nsec != other.st_mtim.tv_nsec;
_cleanup_free_ char *timestamp_str = NULL;
r = parse_env_file(NULL, p, "TIMESTAMP_NSEC", &timestamp_str);
@@ -823,7 +823,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
return true;
}
- return timespec_load_nsec(&usr.st_mtim) > timestamp;
+ return timespec_load_nsec(&usr.st_mtim) != timestamp;
}
static int condition_test_first_boot(Condition *c, char **env) {
--
2.25.1

View File

@ -1,64 +0,0 @@
From 7f71d79cc1cac4dc509cecb2f5c00b6dcfd7732b Mon Sep 17 00:00:00 2001
From: Sayan Chowdhury <sayan@kinvolk.io>
Date: Thu, 22 Apr 2021 20:08:33 +0530
Subject: [PATCH 4/7] core: use max for DefaultTasksMax
Since systemd v228, systemd has a DefaultTasksMax which defaulted
to 512, later 15% of the system's maximum number of PIDs. This
limit is low and a change in behavior that people running services
in containers will hit frequently, so revert to previous behavior.
Though later the TasksMax was changed in the a dynamic property to
accommodate stale values.
This change is built on previous patch by David Michael(dm0-).
Signed-off-by: Sayan Chowdhury <sayan@kinvolk.io>
---
man/systemd-system.conf.xml | 2 +-
src/core/main.c | 2 +-
src/core/system.conf.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
index ac21c31d9a..39323f6a55 100644
--- a/man/systemd-system.conf.xml
+++ b/man/systemd-system.conf.xml
@@ -461,7 +461,7 @@
<listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details. This setting applies to all unit types that support resource control settings, with the exception
- of slice units. Defaults to 15% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
+ of slice units. Defaults to 100% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
and root cgroup <varname>pids.max</varname>.
Kernel has a default value for <varname>kernel.pid_max=</varname> and an algorithm of counting in case of more than 32 cores.
For example with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 4915,
diff --git a/src/core/main.c b/src/core/main.c
index a3fdd1dfe1..9b79308397 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -100,7 +100,7 @@
#include <sanitizer/lsan_interface.h>
#endif
-#define DEFAULT_TASKS_MAX ((TasksMax) { 15U, 100U }) /* 15% */
+#define DEFAULT_TASKS_MAX ((TasksMax) { 100U, 100U }) /* 100% */
static enum {
ACTION_RUN,
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
index 71a5869ec0..92fe35b2d6 100644
--- a/src/core/system.conf.in
+++ b/src/core/system.conf.in
@@ -56,7 +56,7 @@
#DefaultIPAccounting=no
#DefaultMemoryAccounting={{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }}
#DefaultTasksAccounting=yes
-#DefaultTasksMax=15%
+#DefaultTasksMax=100%
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
--
2.25.1

View File

@ -1,29 +0,0 @@
From 0a5e52f5511cd7a5312d06abff12bc432bdedc96 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg59@coreos.com>
Date: Tue, 20 Dec 2016 16:43:22 +0000
Subject: [PATCH 5/7] systemd: Disable SELinux permissions checks
We don't care about the interaction between systemd and SELinux policy, so
let's just disable these checks rather than having to incorporate policy
support. This has no impact on our SELinux use-case, which is purely intended
to limit containers and not anything running directly on the host.
---
src/core/selinux-access.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 11dbf4640e..c839a4f39e 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -2,7 +2,7 @@
#include "selinux-access.h"
-#if HAVE_SELINUX
+#if 0
#include <errno.h>
#include <selinux/avc.h>
--
2.25.1

View File

@ -1,95 +0,0 @@
From ede353ea720f07b7b19fa638d5a59a7471237e2d Mon Sep 17 00:00:00 2001
From: Sayan Chowdhury <schowdhury@microsoft.com>
Date: Fri, 16 Dec 2022 16:28:26 +0530
Subject: [PATCH 6/7] Revert "getty: Pass tty to use by agetty via stdin"
This reverts commit b4bf9007cbee7dc0b1356897344ae2a7890df84c.
This is to work around a SELinux denial that happens when setting up standard
input for serial consoles (which is used for SSH connections).
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
---
units/console-getty.service.in | 4 +---
units/container-getty@.service.in | 4 +---
units/getty@.service.in | 4 +---
units/serial-getty@.service.in | 4 +---
4 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/units/console-getty.service.in b/units/console-getty.service.in
index 606b7dbe16..54fd7c292d 100644
--- a/units/console-getty.service.in
+++ b/units/console-getty.service.in
@@ -22,12 +22,10 @@ ConditionPathExists=/dev/console
[Service]
# The '-o' option value tells agetty to replace 'login' arguments with an option to preserve environment (-p),
# followed by '--' for safety, and then the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud - 115200,38400,9600 $TERM
+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud console 115200,38400,9600 $TERM
Type=idle
Restart=always
UtmpIdentifier=cons
-StandardInput=tty
-StandardOutput=tty
TTYPath=/dev/console
TTYReset=yes
TTYVHangup=yes
diff --git a/units/container-getty@.service.in b/units/container-getty@.service.in
index 8d7e20d5ec..5f095f48b0 100644
--- a/units/container-getty@.service.in
+++ b/units/container-getty@.service.in
@@ -27,13 +27,11 @@ Before=rescue.service
[Service]
# The '-o' option value tells agetty to replace 'login' arguments with an option to preserve environment (-p),
# followed by '--' for safety, and then the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM
+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud pts/%I 115200,38400,9600 $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=pts/%I
-StandardInput=tty
-StandardOutput=tty
TTYPath=/dev/pts/%I
TTYReset=yes
TTYVHangup=yes
diff --git a/units/getty@.service.in b/units/getty@.service.in
index 21d66f9367..78deb7cffe 100644
--- a/units/getty@.service.in
+++ b/units/getty@.service.in
@@ -38,13 +38,11 @@ ConditionPathExists=/dev/tty0
# The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM
+ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear %I $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
-StandardInput=tty
-StandardOutput=tty
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
diff --git a/units/serial-getty@.service.in b/units/serial-getty@.service.in
index 2433124c55..bb7af3105d 100644
--- a/units/serial-getty@.service.in
+++ b/units/serial-getty@.service.in
@@ -33,12 +33,10 @@ Before=rescue.service
# The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,57600,38400,9600 - $TERM
+ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,57600,38400,9600 %I $TERM
Type=idle
Restart=always
UtmpIdentifier=%I
-StandardInput=tty
-StandardOutput=tty
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
--
2.25.1

View File

@ -1,40 +0,0 @@
From ff9f1aa2ab7d707c57008f406186c45cd9858228 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Tue, 7 Feb 2023 11:33:44 +0100
Subject: [PATCH 7/7] units: Keep using old journal file format
Systemd 252 made an incompatible change in journal file format. Temporarily
force journald to use the old journal format to give logging containers more
time to adapt to the new format.
---
units/systemd-journald.service.in | 1 +
units/systemd-journald@.service.in | 1 +
2 files changed, 2 insertions(+)
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
index 38ba3e2856..e7f671e070 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -22,6 +22,7 @@ IgnoreOnIsolate=yes
[Service]
DeviceAllow=char-* rw
+Environment=SYSTEMD_JOURNAL_COMPACT=0
ExecStart={{ROOTLIBEXECDIR}}/systemd-journald
FileDescriptorStoreMax=4224
IPAddressDeny=any
diff --git a/units/systemd-journald@.service.in b/units/systemd-journald@.service.in
index 35c998285f..9f7c6a2b3f 100644
--- a/units/systemd-journald@.service.in
+++ b/units/systemd-journald@.service.in
@@ -16,6 +16,7 @@ After=systemd-journald@%i.socket systemd-journald-varlink@%i.socket
[Service]
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE
DevicePolicy=closed
+Environment=SYSTEMD_JOURNAL_COMPACT=0
ExecStart={{ROOTLIBEXECDIR}}/systemd-journald %i
FileDescriptorStoreMax=4224
Group=systemd-journal
--
2.25.1

View File

@ -1,40 +0,0 @@
From 34e834f496338fdc2a8a8cc771cba4082079cf9a Mon Sep 17 00:00:00 2001
From: msizanoen <msizanoen@qtmlabs.xyz>
Date: Mon, 12 Jun 2023 10:30:12 +0700
Subject: [PATCH] Revert "core/service: when resetting PID also reset known
flag"
This reverts commit ff32060f2ed37b68dc26256b05e2e69013b0ecfe.
This change is incorrect as we don't want to mark the PID as invalid but
only mark it as dead.
The change in question also breaks user level socket activation for
`podman.service` as the termination of the main `podman system service`
process is not properly handled, causing any application accessing the
socket to hang.
This is because the user-level `podman.service` unit also hosts two
non-main processes: `rootlessport` and `rootlessport-child` which causes
the `cgroup_good` check to still succeed.
The original submitter of this commit is recommended to find another
more correct way to fix the cgroupsv1 issue on CentOS 8.
(cherry picked from commit f29f0877c5abfd03060838d1812ea6fdff3b0b37)
---
src/core/service.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/core/service.c b/src/core/service.c
index c05f13c765..211f72900e 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3529,7 +3529,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
return;
s->main_pid = 0;
- s->main_pid_known = false;
exec_status_exit(&s->main_exec_status, &s->exec_context, pid, code, status);
if (s->main_command) {

View File

@ -1,26 +0,0 @@
https://github.com/systemd/systemd/pull/26050
From d6a0784a350fb27698ed04f7ada17137324b31bb Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 13 Jan 2023 05:17:56 +0000
Subject: [PATCH] bpf: disable -fstack-protector in meson
In Gentoo, we recently started making Clang behave the same way as
our GCC, with -fstack-protector and some friends enabled by default.
SSP doesn't make sense for BPF, so disable it explicitly.
See also e.g. https://www.spinics.net/lists/netdev/msg556400.html.
Bug: https://bugs.gentoo.org/890004
--- a/src/core/bpf/meson.build
+++ b/src/core/bpf/meson.build
@@ -7,6 +7,7 @@ endif
bpf_clang_flags = [
'-std=gnu11',
'-Wno-compare-distinct-pointer-types',
+ '-fno-stack-protector',
'-O2',
'-target',
'bpf',

View File

@ -0,0 +1,242 @@
https://bugs.gentoo.org/920331
https://github.com/systemd/systemd/issues/30535
From 4a9e03aa6bb2cbd23dac00f2b2a7642cc79eaade Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Wed, 27 Sep 2023 11:55:59 +0200
Subject: [PATCH 1/2] core: Make private /dev read-only after populating it
---
src/core/namespace.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/core/namespace.c b/src/core/namespace.c
index e2304f5d066da..d1153f7690140 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -995,6 +995,11 @@ static int mount_private_dev(MountEntry *m) {
if (r < 0)
log_debug_errno(r, "Failed to set up basic device tree at '%s', ignoring: %m", temporary_mount);
+ /* Make the bind mount read-only. */
+ r = mount_nofollow_verbose(LOG_DEBUG, NULL, dev, NULL, MS_REMOUNT|MS_BIND|MS_RDONLY, NULL);
+ if (r < 0)
+ return r;
+
/* Create the /dev directory if missing. It is more likely to be missing when the service is started
* with RootDirectory. This is consistent with mount units creating the mount points when missing. */
(void) mkdir_p_label(mount_entry_path(m), 0755);
From cd7f3702eb47c82a50bf74c2b7c15c2e4e1f5c79 Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Wed, 27 Sep 2023 10:52:50 +0200
Subject: [PATCH 2/2] core: Use a subdirectory of /run/ for PrivateDevices=
When we're starting early boot services such as systemd-userdbd.service,
/tmp might not yet be mounted, so let's use a directory in /run instead
which is guaranteed to be available.
---
src/core/execute.c | 1 +
src/core/namespace.c | 61 +++++++++++++++++++++++++++++----------
src/core/namespace.h | 2 ++
src/test/test-namespace.c | 1 +
src/test/test-ns.c | 1 +
5 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/src/core/execute.c b/src/core/execute.c
index a52df64d01081..89c3868d55f6c 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -3307,6 +3307,7 @@ static int apply_mount_namespace(
extension_dir,
root_dir || root_image ? params->notify_socket : NULL,
host_os_release_stage,
+ params->runtime_scope,
error_path);
/* If we couldn't set up the namespace this is probably due to a missing capability. setup_namespace() reports
diff --git a/src/core/namespace.c b/src/core/namespace.c
index d1153f7690140..a0471ac8884bf 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -909,7 +909,19 @@ static int clone_device_node(
return 0;
}
-static int mount_private_dev(MountEntry *m) {
+static char *settle_runtime_dir(RuntimeScope scope) {
+ char *runtime_dir;
+
+ if (scope != RUNTIME_SCOPE_USER)
+ return strdup("/run/");
+
+ if (asprintf(&runtime_dir, "/run/user/" UID_FMT, geteuid()) < 0)
+ return NULL;
+
+ return runtime_dir;
+}
+
+static int mount_private_dev(MountEntry *m, RuntimeScope scope) {
static const char devnodes[] =
"/dev/null\0"
"/dev/zero\0"
@@ -918,13 +930,21 @@ static int mount_private_dev(MountEntry *m) {
"/dev/urandom\0"
"/dev/tty\0";
- char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
+ _cleanup_free_ char *runtime_dir = NULL, *temporary_mount = NULL;
const char *dev = NULL, *devpts = NULL, *devshm = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL;
bool can_mknod = true;
int r;
assert(m);
+ runtime_dir = settle_runtime_dir(scope);
+ if (!runtime_dir)
+ return log_oom_debug();
+
+ temporary_mount = path_join(runtime_dir, "systemd/namespace-dev-XXXXXX");
+ if (!temporary_mount)
+ return log_oom_debug();
+
if (!mkdtemp(temporary_mount))
return log_debug_errno(errno, "Failed to create temporary directory '%s': %m", temporary_mount);
@@ -1364,7 +1384,8 @@ static int apply_one_mount(
MountEntry *m,
const ImagePolicy *mount_image_policy,
const ImagePolicy *extension_image_policy,
- const NamespaceInfo *ns_info) {
+ const NamespaceInfo *ns_info,
+ RuntimeScope scope) {
_cleanup_free_ char *inaccessible = NULL;
bool rbind = true, make = false;
@@ -1379,8 +1400,7 @@ static int apply_one_mount(
switch (m->mode) {
case INACCESSIBLE: {
- _cleanup_free_ char *tmp = NULL;
- const char *runtime_dir;
+ _cleanup_free_ char *runtime_dir = NULL;
struct stat target;
/* First, get rid of everything that is below if there
@@ -1396,14 +1416,14 @@ static int apply_one_mount(
mount_entry_path(m));
}
- if (geteuid() == 0)
- runtime_dir = "/run";
- else {
- if (asprintf(&tmp, "/run/user/" UID_FMT, geteuid()) < 0)
- return -ENOMEM;
-
- runtime_dir = tmp;
- }
+ /* We don't pass the literal runtime scope through here but one based purely on our UID. This
+ * means that the root user's --user services will use the host's inaccessible inodes rather
+ * then root's private ones. This is preferable since it means device nodes that are
+ * overmounted to make them inaccessible will be overmounted with a device node, rather than
+ * an AF_UNIX socket inode. */
+ runtime_dir = settle_runtime_dir(geteuid() == 0 ? RUNTIME_SCOPE_SYSTEM : RUNTIME_SCOPE_USER);
+ if (!runtime_dir)
+ return log_oom_debug();
r = mode_to_inaccessible_node(runtime_dir, target.st_mode, &inaccessible);
if (r < 0)
@@ -1523,7 +1543,7 @@ static int apply_one_mount(
break;
case PRIVATE_DEV:
- return mount_private_dev(m);
+ return mount_private_dev(m, scope);
case BIND_DEV:
return mount_bind_dev(m);
@@ -1824,6 +1844,7 @@ static int apply_mounts(
const NamespaceInfo *ns_info,
MountEntry *mounts,
size_t *n_mounts,
+ RuntimeScope scope,
char **symlinks,
char **error_path) {
@@ -1875,7 +1896,7 @@ static int apply_mounts(
break;
}
- r = apply_one_mount(root, m, mount_image_policy, extension_image_policy, ns_info);
+ r = apply_one_mount(root, m, mount_image_policy, extension_image_policy, ns_info, scope);
if (r < 0) {
if (error_path && mount_entry_path(m))
*error_path = strdup(mount_entry_path(m));
@@ -2030,6 +2051,7 @@ int setup_namespace(
const char *extension_dir,
const char *notify_socket,
const char *host_os_release_stage,
+ RuntimeScope scope,
char **error_path) {
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
@@ -2490,7 +2512,14 @@ int setup_namespace(
(void) base_filesystem_create(root, UID_INVALID, GID_INVALID);
/* Now make the magic happen */
- r = apply_mounts(root, mount_image_policy, extension_image_policy, ns_info, mounts, &n_mounts, symlinks, error_path);
+ r = apply_mounts(root,
+ mount_image_policy,
+ extension_image_policy,
+ ns_info,
+ mounts, &n_mounts,
+ scope,
+ symlinks,
+ error_path);
if (r < 0)
goto finish;
diff --git a/src/core/namespace.h b/src/core/namespace.h
index b6132154c5132..581403d89826d 100644
--- a/src/core/namespace.h
+++ b/src/core/namespace.h
@@ -16,6 +16,7 @@ typedef struct MountImage MountImage;
#include "fs-util.h"
#include "macro.h"
#include "namespace-util.h"
+#include "runtime-scope.h"
#include "string-util.h"
typedef enum ProtectHome {
@@ -134,6 +135,7 @@ int setup_namespace(
const char *extension_dir,
const char *notify_socket,
const char *host_os_release_stage,
+ RuntimeScope scope,
char **error_path);
#define RUN_SYSTEMD_EMPTY "/run/systemd/empty"
diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c
index 25aafc35ca837..42ac65d08c87a 100644
--- a/src/test/test-namespace.c
+++ b/src/test/test-namespace.c
@@ -206,6 +206,7 @@ TEST(protect_kernel_logs) {
NULL,
NULL,
NULL,
+ RUNTIME_SCOPE_SYSTEM,
NULL);
assert_se(r == 0);
diff --git a/src/test/test-ns.c b/src/test/test-ns.c
index 77afd2f6b9eb8..eb3afed9e1c66 100644
--- a/src/test/test-ns.c
+++ b/src/test/test-ns.c
@@ -108,6 +108,7 @@ int main(int argc, char *argv[]) {
NULL,
NULL,
NULL,
+ RUNTIME_SCOPE_SYSTEM,
NULL);
if (r < 0) {
log_error_errno(r, "Failed to set up namespace: %m");

View File

@ -1,2 +0,0 @@
# Do not enable any services if /etc is detected as empty.
disable *

View File

@ -0,0 +1,51 @@
From 2de502ccff1cc780d9d29c4ff7e6c1e0f2d7a082 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Fri, 21 Aug 2020 13:16:17 -0400
Subject: [PATCH] journald: do not change the kernel audit setting by default
Bug: https://bugs.gentoo.org/736910
---
man/journald.conf.xml | 2 +-
src/journal/journald-server.c | 2 +-
src/journal/journald.conf | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index 50c33e4792..2e14674f42 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -427,7 +427,7 @@
kernel auditing on start-up. If disabled it will turn it off. If unset it will neither enable nor
disable it, leaving the previous state unchanged. This means if another tool turns on auditing even
if <command>systemd-journald</command> left it off, it will still collect the generated
- messages. Defaults to on.</para>
+ messages.</para>
<para>Note that this option does not control whether <command>systemd-journald</command> collects
generated audit records, it just controls whether it tells the kernel to generate them. If you need
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 022e12d83d..6b3d261af6 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2367,7 +2367,7 @@ int server_init(Server *s, const char *namespace) {
.compress.threshold_bytes = UINT64_MAX,
.seal = true,
- .set_audit = true,
+ .set_audit = -1,
.watchdog_usec = USEC_INFINITY,
diff --git a/src/journal/journald.conf b/src/journal/journald.conf
index 5a60a9d39c..64156d5463 100644
--- a/src/journal/journald.conf
+++ b/src/journal/journald.conf
@@ -44,4 +44,4 @@
#MaxLevelWall=emerg
#LineMax=48K
#ReadKMsg=yes
-#Audit=yes
+#Audit=
--
2.39.1

View File

@ -1,40 +0,0 @@
From 593db1c78011ddce551051ce17eda6feac079b3d Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Fri, 21 Aug 2020 13:16:17 -0400
Subject: [PATCH] journald: do not change the kernel audit setting by default
Bug: https://bugs.gentoo.org/736910
---
man/journald.conf.xml | 2 +-
src/journal/journald-server.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index bfd359a903..7e93d4050e 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -411,7 +411,7 @@
<command>systemd-journald</command> collects generated audit records, it just controls whether it
tells the kernel to generate them. This means if another tool turns on auditing even if
<command>systemd-journald</command> left it off, it will still collect the generated
- messages. Defaults to on.</para></listitem>
+ messages.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 5865bf9809..163be685a8 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2208,7 +2208,7 @@ int server_init(Server *s, const char *namespace) {
.compress.threshold_bytes = (uint64_t) -1,
.seal = true,
- .set_audit = true,
+ .set_audit = -1,
.watchdog_usec = USEC_INFINITY,
--
2.28.0

View File

@ -1,25 +0,0 @@
From d9059d2ef1b0d6034267cc8ff44871d0f82f840f Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Sun, 8 Nov 2020 12:34:11 -0500
Subject: [PATCH] systemctl: disable synchronizaion of sysv init scripts
---
src/systemctl/systemctl-sysv-compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl-sysv-compat.c b/src/systemctl/systemctl-sysv-compat.c
index 2dca9e480f..5dcf13ba17 100644
--- a/src/systemctl/systemctl-sysv-compat.c
+++ b/src/systemctl/systemctl-sysv-compat.c
@@ -111,7 +111,7 @@ int parse_shutdown_time_spec(const char *t, usec_t *ret) {
int enable_sysv_units(const char *verb, char **args) {
int r = 0;
-#if HAVE_SYSV_COMPAT
+#if 0
_cleanup_(lookup_paths_free) LookupPaths paths = {};
unsigned f = 0;
--
2.29.0

View File

@ -0,0 +1,3 @@
# Based on legacy.conf from systemd
d /run/lock
L /var/lock - - - - ../run/lock

View File

@ -0,0 +1,27 @@
# Sample nss configuration for systemd
# systemd-specific modules
# See the manual pages fore further information.
# nss-myhostname - host resolution for the local hostname
# nss-mymachines - host, user, group resolution for containers
# nss-resolve - host resolution using resolved
# nss-systemd - dynamic user/group resolution (DynamicUser in unit files)
passwd: files mymachines systemd
shadow: files
group: files mymachines systemd
gshadow: files
hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files
services: db files
protocols: db files
rpc: db files
ethers: db files
netmasks: files
netgroup: files
bootparams: files
automount: files
aliases: files

View File

@ -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;
}

View File

@ -1,19 +0,0 @@
# The list of directories is taken from Gentoo ebuild, where they use
# keepdir. The list isn't sorted, but tries to preserve the order of
# keepdir lines from Gentoo ebuild for easier comparisons. We skip the
# directories in /usr, though.
d /etc/binfmt.d - - - - -
d /etc/modules-load.d - - - - -
d /etc/tmpfiles.d - - - - -
d /etc/kernel/install.d - - - - -
d /etc/systemd/network - - - - -
d /etc/systemd/system - - - - -
d /etc/systemd/user - - - - -
d /etc/udev/rules.d - - - - -
d /etc/udev/hwdb.d - - - - -
d /var/lib/systemd - - - - -
d /var/log/journal - - - - -
d /etc/sysctl.d - - - - -
# This seems to be our own addition.
d /var/log/journal/remote - systemd-journal-remote systemd-journal-remote - -

View File

@ -1,2 +0,0 @@
d /run/systemd/network - - - - -
L /run/systemd/network/resolv.conf - - - - ../resolve/resolv.conf

View File

@ -0,0 +1,5 @@
account include system-auth
session required pam_loginuid.so
session include system-auth
session optional pam_systemd.so

View File

@ -10,11 +10,11 @@
</slots>
<use>
<flag name="audit">Enable support for <pkg>sys-process/audit</pkg></flag>
<flag name="boot">Enable EFI boot manager and stub loader</flag>
<flag name="cgroup-hybrid">Default to hybrid (legacy) cgroup hierarchy instead of unified (modern).</flag>
<flag name="curl">Enable support for uploading journals</flag>
<flag name="cryptsetup">Enable cryptsetup tools (includes unit generator for crypttab)</flag>
<flag name="dns-over-tls">Enable DNS-over-TLS support</flag>
<flag name="gnuefi">Enable EFI boot manager and stub loader (built using <pkg>sys-boot/gnu-efi</pkg>)</flag>
<flag name="elfutils">Enable coredump stacktraces in the journal</flag>
<flag name="fido2">Enable FIDO2 support</flag>
<flag name="gcrypt">Enable use of <pkg>dev-libs/libgcrypt</pkg> for various features</flag>
@ -22,6 +22,7 @@
<flag name="http">Enable embedded HTTP server in journald</flag>
<flag name="importd">Enable import daemon</flag>
<flag name="iptables">Use libiptc from <pkg>net-firewall/iptables</pkg> for NAT support in systemd-networkd; this is used only if the running kernel does not support nftables</flag>
<flag name="kernel-install">Enable kernel-install</flag>
<flag name="kmod">Enable kernel module loading via <pkg>sys-apps/kmod</pkg></flag>
<flag name="lz4">Enable lz4 compression for the journal</flag>
<flag name="openssl">Enable use of <pkg>dev-libs/openssl</pkg> for various features</flag>
@ -31,6 +32,7 @@
<flag name="resolvconf">Install resolvconf symlink for systemd-resolve</flag>
<flag name="sysv-utils">Install sysvinit compatibility symlinks and manpages for init, telinit, halt, poweroff, reboot, runlevel, and shutdown</flag>
<flag name="tpm">Enable TPM support</flag>
<flag name="ukify">Enable systemd-ukify</flag>
<flag name="vanilla">Disable Gentoo-specific behavior and compatibility quirks</flag>
<flag name="xkb">Depend on <pkg>x11-libs/libxkbcommon</pkg> to allow logind to control the X11 keymap</flag>
</use>

View File

@ -1,709 +0,0 @@
# Copyright 2011-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{9..11} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
# Flatcar: Mark as stable.
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
inherit bash-completion-r1 linux-info meson-multilib pam
# Flatcar: We don't use gen_usr_ldscript so dropping usr-ldscript.
# Adding tmpfiles, since we use it for installing some files.
inherit python-any-r1 systemd tmpfiles toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
acl apparmor audit cgroup-hybrid cryptsetup curl +dns-over-tls elfutils
fido2 +gcrypt gnuefi gnutls homed http idn importd iptables +kmod
+lz4 lzma +openssl pam pcre pkcs11 policykit pwquality qrcode
+resolvconf +seccomp selinux split-usr +sysv-utils test tpm vanilla xkb +zstd
"
REQUIRED_USE="
dns-over-tls? ( || ( gnutls openssl ) )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
"
# baselayout-2.2 has /run
#
# Flatcar: Drop sec-policy/selinux-ntp from deps (under selinux use
# flag). The image stage fails with "Failed to resolve
# typeattributeset statement at
# /var/lib/selinux/mcs/tmp/modules/400/ntp/cil:120"
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
selinux? (
sec-policy/selinux-base-policy[systemd]
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
#
# Flatcar: We don't have sys-fs/udev-init-scripts-34, so it's dropped.
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
$(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
$(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
"
python_check_deps() {
python_has_version "dev-python/jinja[${PYTHON_USEDEP}]" &&
python_has_version "dev-python/lxml[${PYTHON_USEDEP}]"
}
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK=" ~BINFMT_MISC ~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
:
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
"${FILESDIR}/252-no-stack-protector-bpf.patch"
# Flatcar: Adding our own patches here.
"${FILESDIR}/0001-wait-online-set-any-by-default.patch"
"${FILESDIR}/0002-networkd-default-to-kernel-IPForwarding-setting.patch"
"${FILESDIR}/0003-needs-update-don-t-require-strictly-newer-usr.patch"
"${FILESDIR}/0004-core-use-max-for-DefaultTasksMax.patch"
"${FILESDIR}/0005-systemd-Disable-SELinux-permissions-checks.patch"
"${FILESDIR}/0006-Revert-getty-Pass-tty-to-use-by-agetty-via-stdin.patch"
"${FILESDIR}/0007-units-Keep-using-old-journal-file-format.patch"
"${FILESDIR}/0008-Revert-core-service-when-resetting-PID-also-reset-known.patch"
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-systemctl-disable-sysv-sync-r1.patch"
"${FILESDIR}/gentoo-journald-audit.patch"
)
fi
# Fails with split-usr.
sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
# Flatcar: The Kubelet takes /etc/resolv.conf for, e.g.,
# CoreDNS which has dnsPolicy "default", but unless the
# kubelet --resolv-conf flag is set to point to
# /run/systemd/resolve/resolv.conf this won't work with
# /etc/resolv.conf pointing to
# /run/systemd/resolve/stub-resolv.conf which configures
# 127.0.0.53. See
# https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues
# This means that users who need split DNS to work should
# point /etc/resolv.conf back to
# /run/systemd/resolve/stub-resolv.conf (and if using K8s
# configure the kubelet resolvConf variable/--resolv-conf flag
# to /run/systemd/resolve/resolv.conf).
sed -i -e 's,/run/systemd/resolve/stub-resolv.conf,/run/systemd/resolve/resolv.conf,' tmpfiles.d/systemd-resolve.conf || die
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
# Flatcar: Our function, we use it in some places below.
get_rootprefix() {
usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr"
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
# Flatcar: Point to our user mailing list.
-Dsupport-url="https://groups.google.com/forum/#!forum/flatcar-linux-user"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
$(meson_use split-usr)
# Flatcar: Always set split-bin to true, we always
# have separate bin and sbin directories
-Dsplit-bin=true
# Flatcar: Use get_rootprefix. No functional change
# from upstream, just refactoring the common code used
# in some places.
-Drootprefix="$(get_rootprefix)"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnuefi gnu-efi)
$(meson_native_use_bool gnutls)
-Defi-includedir="${ESYSROOT}/usr/include/efi"
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool xkb xkbcommon)
# Flatcar: Use our ntp servers.
-Dntp-servers="0.flatcar.pool.ntp.org 1.flatcar.pool.ntp.org 2.flatcar.pool.ntp.org 3.flatcar.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
# Flatcar: TODO: Investigate if we want this.
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
# Flatcar: Specify this, or meson breaks due to no
# /etc/login.defs.
-Dsystem-gid-max=999
-Dsystem-uid-max=999
# Flatcar: DBus paths.
-Ddbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
-Ddbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
# Flatcar: PAM config directory.
-Dpamconfdir=/usr/share/pam.d
# Flatcar: The CoreOS epoch, Mon Jul 1 00:00:00 UTC
# 2013. Used by timesyncd as a sanity check for the
# minimum acceptable time. Explicitly set to avoid
# using the current build time.
-Dtime-epoch=1372636800
# Flatcar: No default name servers.
-Ddns-servers=
# Flatcar: Disable the "First Boot Wizard", it isn't
# very applicable to us.
-Dfirstboot=false
# Flatcar: Set latest network interface naming scheme
# for https://github.com/flatcar/Flatcar/issues/36
-Ddefault-net-naming-scheme=latest
# Flatcar: Combined log format: name plus description
-Dstatus-unit-format-default=combined
# Flatcar: Unported options, still needed?
-Dquotaon-path=/usr/sbin/quotaon
-Dquotacheck-path=/usr/sbin/quotacheck
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
meson_src_test
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
# Flatcar: We always have bin separate from sbin
# local sbin=$(usex split-usr sbin bin)
local sbin='sbin'
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
# Flatcar: Do not install sample nsswitch.conf, we don't
# provide it.
# dodoc "${FILESDIR}"/nsswitch.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
fi
rm "${ED}"/etc/init.d/README || die
rm "${ED}${rootprefix}"/lib/systemd/system-generators/systemd-sysv-generator || die
if ! use sysv-utils; then
rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
fi
# Flatcar: We always have bin separate from sbin, so drop the
# "&& use split-usr" part.
if ! use resolvconf && ! use sysv-utils; then
rmdir "${ED}${rootprefix}"/sbin || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Flatcar: Upstream uses keepdir commands to keep some empty
# directories. We use tmpfiles.
# # Preserve empty dirs in /etc & /var, bug #437008
# keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
# keepdir /etc/kernel/install.d
# keepdir /etc/systemd/{network,system,user}
# keepdir /etc/udev/rules.d
#
# keepdir /etc/udev/hwdb.d
#
# keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
# keepdir /usr/lib/{binfmt.d,modules-load.d}
# keepdir /usr/lib/systemd/user-generators
# keepdir /var/lib/systemd
# keepdir /var/log/journal
# Flatcar: No migrations happening here.
# # Symlink /etc/sysctl.conf for easy migration.
# dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
# Flatcar: Do not install a pam policy, we have our own.
# if use pam; then
# newpamd "${FILESDIR}"/systemd-user.pam systemd-user
# fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
# Flatcar: gen_usr_ldscript is likely for static libs, so we
# dropped it.
# gen_usr_ldscript -a systemd udev
# Flatcar: Ensure journal directory has correct ownership/mode
# in inital image. This is fixed by systemd-tmpfiles *but*
# journald starts before that and will create the journal if
# the filesystem is already read-write. Conveniently the
# systemd Makefile sets this up completely wrong.
#
# Flatcar: TODO: Is this still a problem?
dodir /var/log/journal
fowners root:systemd-journal /var/log/journal
fperms 2755 /var/log/journal
# Flatcar: Don't prune systemd dirs.
dotmpfiles "${FILESDIR}"/systemd-flatcar.conf
# Flatcar: Add tmpfiles rule for resolv.conf. This path has
# changed after v213 so it must be handled here instead of
# baselayout now.
dotmpfiles "${FILESDIR}"/systemd-resolv.conf
# Flatcar: Don't default to graphical.target.
local unitdir=$(builddir_systemd_get_systemunitdir)
dosym multi-user.target "${unitdir}"/default.target
# Flatcar: Don't set any extra environment variables by default.
rm "${ED}/usr/lib/environment.d/99-environment.conf" || die
# Flatcar: These lines more or less follow the systemd's
# preset file (90-systemd.preset). We do it that way, to avoid
# putting symlinks in /etc. Please keep the lines in the same
# order as the "enable" lines appear in the preset file. For a
# single enable line in preset, there may be more lines if the
# unit file had Also: clause which has units we enable here
# too.
# Flatcar: enable remote-fs.target
builddir_systemd_enable_service multi-user.target remote-fs.target
# Flatcar: enable remote-cryptsetup.target
if use cryptsetup; then
builddir_systemd_enable_service multi-user.target remote-cryptsetup.target
fi
# Flatcar: enable machines.target
builddir_systemd_enable_service multi-user.target machines.target
# Flatcar: enable getty@.service
dodir "${unitdir}/getty.target.wants"
dosym ../getty@.service "${unitdir}/getty.target.wants/getty@tty1.service"
# Flatcar: enable systemd-timesyncd.service
builddir_systemd_enable_service sysinit.target systemd-timesyncd.service
# Flatcar: enable systemd-networkd.service (Also: systemd-networkd.socket, systemd-networkd-wait-online.service)
builddir_systemd_enable_service multi-user.target systemd-networkd.service
builddir_systemd_enable_service sockets.target systemd-networkd.socket
builddir_systemd_enable_service network-online.target systemd-networkd-wait-online.service
# Flatcar: enable systemd-network-generator.service
builddir_systemd_enable_service sysinit.target systemd-network-generator.service
# Flatcar: enable systemd-resolved.service
builddir_systemd_enable_service multi-user.target systemd-resolved.service
# Flatcar: enable systemd-homed.service (Also: systemd-userdbd.service [not enabled - has no WantedBy entry])
if use homed; then
builddir_systemd_enable_service multi-user.target systemd-homed.target
fi
# Flatcar: enable systemd-userdbd.socket
builddir_systemd_enable_service sockets.target systemd-userdbd.socket
# Flatcar: enable systemd-pstore.service
builddir_systemd_enable_service sysinit.target systemd-pstore.service
# Flatcar: enable systemd-boot-update.service
if use gnuefi; then
builddir_systemd_enable_service sysinit.target systemd-boot-update.service
fi
# Flatcar: enable reboot.target (not enabled - has no WantedBy
# entry)
# Flatcar: enable systemd-sysext.service by default
builddir_systemd_enable_service sysinit.target systemd-sysext.service
# Flatcar: Use an empty preset file, because systemctl
# preset-all puts symlinks in /etc, not in /usr. We don't use
# /etc, because it is not autoupdated. We do the "preset" above.
rm "${ED}$(usex split-usr '' /usr)/lib/systemd/system-preset/90-systemd.preset" || die
insinto $(usex split-usr '' /usr)/lib/systemd/system-preset
doins "${FILESDIR}"/99-default.preset
# Flatcar: Do not ship distro-specific files (nsswitch.conf
# pam.d). This conflicts with our own configuration provided
# by baselayout.
rm -rf "${ED}"/usr/share/factory
sed -i "${ED}"/usr/lib/tmpfiles.d/etc.conf \
-e '/^C!* \/etc\/nsswitch\.conf/d' \
-e '/^C!* \/etc\/pam\.d/d' \
-e '/^C!* \/etc\/issue/d'
}
# Flatcar: Our own version of systemd_get_systemunitdir, that returns
# a path inside /usr, not /etc.
builddir_systemd_get_systemunitdir() {
echo "$(get_rootprefix)/lib/systemd/system"
}
# Flatcar: Our own version of systemd_enable_service, that does
# operations inside /usr, not /etc.
builddir_systemd_enable_service() {
local target=${1}
local service=${2}
local ud=$(builddir_systemd_get_systemunitdir)
local destname=${service##*/}
dodir "${ud}"/"${target}".wants && \
dosym ../"${service}" "${ud}"/"${target}".wants/"${destname}"
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if ! use split-usr; then
local dir
# Flatcar: We still use separate bin and sbin, so drop usr/sbin from the list.
for dir in bin sbin lib; do
if [[ ! -L ${EROOT}/${dir} ]]; then
eerror "'${EROOT}/${dir}' is not a symbolic link."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "installing ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
# Flatcar: We enable getty and remote-fs targets in /usr
# ourselves above.
# if [[ -z ${REPLACING_VERSIONS} ]]; then
# if type systemctl &>/dev/null; then
# systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
# fi
# elog "To enable a useful set of services, run the following:"
# elog " systemctl preset-all --preset-mode=enable-only"
# fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,650 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>~/code/work/gentoo/sys-apps/systemd/systemd-252.3.ebuild.html</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="bash">
<meta name="settings" content="number_lines,whole_filler,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="gruvbox">
<style>
<!--
pre { font-family: monospace; color: #ffd7af; background-color: #262626; }
body { font-family: monospace; color: #ffd7af; background-color: #262626; }
* { font-size: 1em; }
.GruvboxBlue { color: #87afaf; }
.GruvboxPurple { color: #d787af; }
.LineNr { color: #767676; }
.GruvboxAqua { color: #87af87; }
.Normal { color: #ffd7af; background-color: #262626; padding-bottom: 1px; }
.GruvboxOrange { color: #ff8700; }
.Comment { color: #8a8a8a; }
.Folded { color: #8a8a8a; background-color: #3a3a3a; padding-bottom: 1px; }
.String { color: #afaf00; }
.GruvboxRed { color: #d75f5f; }
.Error { color: #262626; background-color: #d75f5f; font-weight: bold; }
.GruvboxGreenBold { color: #afaf00; font-weight: bold; }
.DiffChange { color: #262626; background-color: #87af87; }
.DiffDelete { color: #262626; background-color: #d75f5f; }
.DiffText { color: #262626; background-color: #ffaf00; }
.DiffAdd { color: #262626; background-color: #afaf00; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<pre id='vimCodeElement'>
<span id="W2L1" class="LineNr"> 1 </span><span class="Comment"># Copyright 2011-2022 Gentoo Authors</span>
<span id="W2L2" class="LineNr"> 2 </span><span class="Comment"># Distributed under the terms of the GNU General Public License v2</span>
<span id="W2L3" class="LineNr"> 3 </span>
<span id="W2L4" class="LineNr"> 4 </span><span class="GruvboxBlue">EAPI</span>=<span class="GruvboxPurple">7</span>
<span id="W2L5" class="LineNr"> 5 </span><span class="GruvboxBlue DiffChange">PYTHON_COMPAT</span><span class="DiffChange">=</span><span class="GruvboxAqua DiffChange">(</span><span class="DiffChange"> python3_</span><span class="GruvboxOrange DiffChange">{</span><span class="GruvboxPurple DiffChange">8</span><span class="DiffChange">..</span><span class="GruvboxPurple DiffChange">1</span><span class="GruvboxPurple DiffText">1</span><span class="GruvboxOrange DiffChange">}</span><span class="DiffChange"> </span><span class="GruvboxAqua DiffChange">)</span><span class="DiffChange"> </span>
<span id="W2L6" class="LineNr"> 6 </span>
<span id="W2L7" class="LineNr"> 7 </span><span class="Comment"># Avoid QA warnings</span>
<span id="W2L8" class="LineNr"> 8 </span><span class="GruvboxBlue">TMPFILES_OPTIONAL</span>=<span class="GruvboxPurple">1</span>
<span id="W2L9" class="LineNr"> 9 </span><span class="GruvboxBlue DiffAdd">UDEV_OPTIONAL</span><span class="DiffAdd">=</span><span class="GruvboxPurple DiffAdd">1</span><span class="DiffAdd"> </span>
<span id="W2L10" class="LineNr"> 10 </span><span class="DiffAdd"> </span><span class="DiffAdd"> </span>
<span id="W2L11" class="LineNr"> 11 </span><span class="GruvboxBlue DiffAdd">QA_PKGCONFIG_VERSION</span><span class="DiffAdd">=</span><span class="GruvboxAqua DiffAdd">$(</span><span class="GruvboxOrange DiffAdd">ver_cut </span><span class="GruvboxPurple DiffAdd">1</span><span class="GruvboxAqua DiffAdd">)</span><span class="DiffAdd"> </span>
<span id="W2L12" class="LineNr"> 12 </span>
<span id="W2L13" class="LineNr"> 13 </span><span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">PV</span><span class="GruvboxAqua">}</span> <span class="GruvboxRed">==</span> <span class="GruvboxPurple">9999</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L14" class="LineNr"> 14 </span> <span class="GruvboxBlue">EGIT_REPO_URI</span>=<span class="Normal">&quot;</span><span class="String"><a href="https://github.com/systemd/systemd.git">https://github.com/systemd/systemd.git</a></span><span class="Normal">&quot;</span>
<span id="W2L15" class="LineNr"> 15 </span> inherit git-r3
<span id="W2L16" class="LineNr"> 16 </span><span class="GruvboxRed">else</span>
<span id="W2L17" class="LineNr"> 17 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">PV</span><span class="GruvboxAqua">}</span> <span class="GruvboxRed">==</span> <span class="String">*.*</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L18" class="Folded"> 18 </span><span class="Folded">+-- 2 lines: MY_PN=systemd-stable--------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L20" class="LineNr"> 20 </span> <span class="GruvboxBlue">MY_PN</span>=systemd
<span id="W2L21" class="LineNr"> 21 </span> <span class="GruvboxRed">fi</span>
<span id="W2L22" class="LineNr"> 22 </span> <span class="GruvboxBlue">MY_PV</span>=<span class="GruvboxAqua">${</span><span class="GruvboxAqua">PV</span><span class="Normal">/</span>_<span class="Normal">/</span>-<span class="GruvboxAqua">}</span>
<span id="W2L23" class="LineNr"> 23 </span> <span class="GruvboxBlue">MY_P</span>=<span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_PN</span><span class="GruvboxAqua">}</span>-<span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_PV</span><span class="GruvboxAqua">}</span>
<span id="W2L24" class="LineNr"> 24 </span> <span class="GruvboxBlue">S</span>=<span class="GruvboxAqua">${</span><span class="GruvboxAqua">WORKDIR</span><span class="GruvboxAqua">}</span>/<span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_P</span><span class="GruvboxAqua">}</span>
<span id="W2L25" class="LineNr"> 25 </span> <span class="GruvboxBlue">SRC_URI</span>=<span class="Normal">&quot;</span><span class="String"><a href="https://github.com/systemd/">https://github.com/systemd/</a></span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_PN</span><span class="GruvboxAqua">}</span><span class="String">/archive/v</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_PV</span><span class="GruvboxAqua">}</span><span class="String">/</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MY_P</span><span class="GruvboxAqua">}</span><span class="String">.tar.gz</span><span class="Normal">&quot;</span>
<span id="W2L26" class="LineNr"> 26 </span><span class="DiffChange"> </span><span class="GruvboxBlue DiffText">KEYWORDS</span><span class="DiffText">=</span><span class="Normal DiffText">&quot;</span><span class="String DiffText">~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86</span><span class="Normal DiffText">&quot;</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L27" class="LineNr"> 27 </span><span class="GruvboxRed">fi</span>
<span id="W2L28" class="LineNr"> 28 </span>
<span id="W2L29" class="LineNr"> 29 </span><span class="DiffText">inherit bash-completion-r1 flag-o-matic linux-info meson-multilib pam</span><span class="DiffChange"> </span>
<span id="W2L30" class="LineNr"> 30 </span><span class="DiffText">inherit python-any-r1 systemd toolchain-funcs udev usr-ldscript</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L31" class="LineNr"> 31 </span>
<span id="W2L32" class="LineNr"> 32 </span><span class="GruvboxBlue">DESCRIPTION</span>=<span class="Normal">&quot;</span><span class="String">System and service manager for Linux</span><span class="Normal">&quot;</span>
<span id="W2L33" class="LineNr"> 33 </span><span class="GruvboxBlue DiffChange">HOMEPAGE</span><span class="DiffChange">=</span><span class="Normal DiffChange">&quot;</span><span class="String DiffChange">http</span><span class="String DiffText">://systemd.io/</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L34" class="LineNr"> 34 </span>
<span id="W2L35" class="LineNr"> 35 </span><span class="GruvboxBlue">LICENSE</span>=<span class="Normal">&quot;</span><span class="String">GPL-2 LGPL-2.1 MIT public-domain</span><span class="Normal">&quot;</span>
<span id="W2L36" class="LineNr"> 36 </span><span class="GruvboxBlue">SLOT</span>=<span class="Normal">&quot;</span><span class="String">0/2</span><span class="Normal">&quot;</span>
<span id="W2L37" class="LineNr"> 37 </span><span class="GruvboxBlue">IUSE</span>=<span class="Normal">&quot;</span>
<span id="W2L38" class="LineNr"> 38 </span><span class="String DiffChange"> acl apparmor audit cgroup-hybrid cryptsetup curl +dns-over-tls elfutils</span><span class="DiffChange"> </span>
<span id="W2L39" class="LineNr"> 39 </span><span class="String DiffChange"> fido2 +gcrypt gnuefi gnutls homed h</span><span class="String DiffText">ttp idn importd iptables</span><span class="String DiffChange"> +kmod</span><span class="DiffChange"> </span>
<span id="W2L40" class="LineNr"> 40 </span><span class="String DiffChange"> +lz4 lzma +openssl pam pcre pkcs11 policykit pwquality qrcode</span><span class="DiffChange"> </span>
<span id="W2L41" class="LineNr"> 41 </span><span class="String"> +resolvconf +seccomp selinux split-usr +sysv-utils test tpm vanilla xkb +zstd</span>
<span id="W2L42" class="LineNr"> 42 </span><span class="Normal">&quot;</span>
<span id="W2L43" class="LineNr"> 43 </span><span class="GruvboxBlue">REQUIRED_USE</span>=<span class="Normal">&quot;</span>
<span id="W2L44" class="LineNr"> 44 </span><span class="String"> dns-over-tls? ( || ( gnutls openssl ) )</span>
<span id="W2L45" class="LineNr"> 45 </span><span class="String"> homed? ( cryptsetup pam openssl )</span>
<span id="W2L46" class="LineNr"> 46 </span><span class="String"> importd? ( curl lzma || ( gcrypt openssl ) )</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L47" class="LineNr"> 47 </span><span class="String"> pwquality? ( homed )</span>
<span id="W2L48" class="LineNr"> 48 </span><span class="Normal">&quot;</span>
<span id="W2L49" class="LineNr"> 49 </span><span class="GruvboxBlue">RESTRICT</span>=<span class="Normal">&quot;</span><span class="String">!test? ( test )</span><span class="Normal">&quot;</span>
<span id="W2L50" class="LineNr"> 50 </span>
<span id="W2L51" class="LineNr"> 51 </span><span class="GruvboxBlue DiffChange">MINKV</span><span class="DiffChange">=</span><span class="Normal DiffChange">&quot;</span><span class="String DiffText">4.15</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L52" class="LineNr"> 52 </span>
<span id="W2L53" class="LineNr"> 53 </span><span class="GruvboxBlue">COMMON_DEPEND</span>=<span class="Normal">&quot;</span>
<span id="W2L54" class="LineNr"> 54 </span><span class="String"> &gt;=sys-apps/util-linux-2.30:0=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">]</span>
<span id="W2L55" class="LineNr"> 55 </span><span class="String"> sys-libs/libcap:0=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">]</span>
<span id="W2L56" class="LineNr"> 56 </span><span class="String"> virtual/libcrypt:=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">]</span>
<span id="W2L57" class="LineNr"> 57 </span><span class="String"> acl? ( sys-apps/acl:0= )</span>
<span id="W2L58" class="Folded"> 58 </span><span class="Folded">+-- 11 lines: apparmor? ( sys-libs/libapparmor:0= )---------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L69" class="LineNr"> 69 </span><span class="String"> app-arch/bzip2:0=</span>
<span id="W2L70" class="LineNr"> 70 </span><span class="String"> sys-libs/zlib:0=</span>
<span id="W2L71" class="LineNr"> 71 </span><span class="String"> )</span>
<span id="W2L72" class="LineNr"> 72 </span><span class="String"> kmod? ( &gt;=sys-apps/kmod-15:0= )</span>
<span id="W2L73" class="LineNr"> 73 </span><span class="String"> lz4? ( &gt;=app-arch/lz4-0_p131:0=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">] )</span>
<span id="W2L74" class="LineNr"> 74 </span><span class="String"> lzma? ( &gt;=app-arch/xz-utils-5.0.5-r1:0=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">] )</span>
<span id="W2L75" class="LineNr"> 75 </span><span class="String DiffChange"> </span><span class="String DiffText">iptables</span><span class="String DiffChange">? ( net-firewall/iptables:0= )</span><span class="DiffChange"> </span>
<span id="W2L76" class="LineNr"> 76 </span><span class="String"> openssl? ( &gt;=dev-libs/openssl-1.1.0:0= )</span>
<span id="W2L77" class="LineNr"> 77 </span><span class="String"> pam? ( sys-libs/pam:=[</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">MULTILIB_USEDEP</span><span class="GruvboxAqua">}</span><span class="String">] )</span>
<span id="W2L78" class="LineNr"> 78 </span><span class="String"> pkcs11? ( app-crypt/p11-kit:0= )</span>
<span id="W2L79" class="LineNr"> 79 </span><span class="String"> pcre? ( dev-libs/libpcre2 )</span>
<span id="W2L80" class="LineNr"> 80 </span><span class="String"> pwquality? ( dev-libs/libpwquality:0= )</span>
<span id="W2L81" class="LineNr"> 81 </span><span class="String"> qrcode? ( media-gfx/qrencode:0= )</span>
<span id="W2L82" class="Folded"> 82 </span><span class="Folded">+-- 36 lines: seccomp? ( &gt;=sys-libs/libseccomp-2.3.3:0= )---------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L118" class="LineNr">118 </span><span class="String"> &gt;=acct-user/systemd-coredump-0-r1</span>
<span id="W2L119" class="LineNr">119 </span><span class="String"> &gt;=acct-user/systemd-network-0-r1</span>
<span id="W2L120" class="LineNr">120 </span><span class="String"> acct-user/systemd-oom</span>
<span id="W2L121" class="LineNr">121 </span><span class="String"> &gt;=acct-user/systemd-resolve-0-r1</span>
<span id="W2L122" class="LineNr">122 </span><span class="String"> &gt;=acct-user/systemd-timesync-0-r1</span>
<span id="W2L123" class="LineNr">123 </span><span class="String"> &gt;=sys-apps/baselayout-2.2</span>
<span id="W2L124" class="LineNr">124 </span><span class="String DiffChange"> </span><span class="String DiffText">selinux</span><span class="String DiffChange">? (</span><span class="DiffChange"> </span>
<span id="W2L125" class="LineNr">125 </span><span class="String DiffChange"> </span><span class="String DiffText">sec-policy/selinux-base-policy[systemd]</span><span class="DiffChange"> </span>
<span id="W2L126" class="LineNr">126 </span><span class="String DiffChange"> s</span><span class="String DiffText">ec-policy/selinux-ntp</span><span class="DiffChange"> </span>
<span id="W2L127" class="LineNr">127 </span><span class="String"> )</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L128" class="LineNr">128 </span><span class="String"> sysv-utils? (</span>
<span id="W2L129" class="LineNr">129 </span><span class="String"> !sys-apps/openrc[sysv-utils(-)]</span>
<span id="W2L130" class="LineNr">130 </span><span class="String"> !sys-apps/sysvinit</span>
<span id="W2L131" class="LineNr">131 </span><span class="String"> )</span>
<span id="W2L132" class="LineNr">132 </span><span class="String"> !sysv-utils? ( sys-apps/sysvinit )</span>
<span id="W2L133" class="LineNr">133 </span><span class="String"> resolvconf? ( !net-dns/openresolv )</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L134" class="LineNr">134 </span><span class="String"> !sys-apps/hwids[udev]</span>
<span id="W2L135" class="LineNr">135 </span><span class="String"> !sys-auth/nss-myhostname</span>
<span id="W2L136" class="LineNr">136 </span><span class="String"> !sys-fs/eudev</span>
<span id="W2L137" class="LineNr">137 </span><span class="String"> !sys-fs/udev</span>
<span id="W2L138" class="LineNr">138 </span><span class="Normal">&quot;</span>
<span id="W2L139" class="LineNr">139 </span>
<span id="W2L140" class="LineNr">140 </span><span class="Comment"># sys-apps/dbus: the daemon only (+ build-time lib dep for tests)</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L141" class="LineNr">141 </span><span class="GruvboxBlue">PDEPEND</span>=<span class="Normal">&quot;</span><span class="String">&gt;=sys-apps/dbus-1.9.8[systemd]</span>
<span id="W2L142" class="LineNr">142 </span><span class="String DiffAdd"> &gt;=sys-fs/udev-init-scripts-34</span><span class="DiffAdd"> </span>
<span id="W2L143" class="LineNr">143 </span><span class="String"> policykit? ( sys-auth/polkit )</span>
<span id="W2L144" class="LineNr">144 </span><span class="String"> !vanilla? ( sys-apps/gentoo-systemd-integration )</span><span class="Normal">&quot;</span>
<span id="W2L145" class="LineNr">145 </span>
<span id="W2L146" class="LineNr">146 </span><span class="GruvboxBlue">BDEPEND</span>=<span class="Normal">&quot;</span>
<span id="W2L147" class="LineNr">147 </span><span class="String"> app-arch/xz-utils:0</span>
<span id="W2L148" class="LineNr">148 </span><span class="String"> dev-util/gperf</span>
<span id="W2L149" class="Folded">149 </span><span class="Folded">+-- 12 lines: &gt;=dev-util/meson-0.46-------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L161" class="LineNr">161 </span><span class="String"> dev-libs/libxslt:0</span>
<span id="W2L162" class="LineNr">162 </span><span class="String"> </span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">python_gen_any_dep </span><span class="Normal">'</span><span class="String">dev-python/jinja[${PYTHON_USEDEP}]</span><span class="Normal">'</span><span class="GruvboxAqua">)</span>
<span id="W2L163" class="LineNr">163 </span><span class="String"> </span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">python_gen_any_dep </span><span class="Normal">'</span><span class="String">dev-python/lxml[${PYTHON_USEDEP}]</span><span class="Normal">'</span><span class="GruvboxAqua">)</span>
<span id="W2L164" class="LineNr">164 </span><span class="Normal">&quot;</span>
<span id="W2L165" class="LineNr">165 </span>
<span id="W2L166" class="LineNr">166 </span><span class="GruvboxGreenBold">python_check_deps() {</span>
<span id="W2L167" class="LineNr">167 </span><span class="DiffChange"> </span><span class="DiffText">python_has_version</span><span class="DiffChange"> </span><span class="Normal DiffChange">&quot;</span><span class="String DiffChange">dev-python/jinja[</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">PYTHON_USEDEP</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffChange">]</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span><span class="Normal DiffChange">&amp;&amp;</span><span class="DiffChange"> </span>
<span id="W2L168" class="LineNr">168 </span><span class="DiffChange"> </span><span class="DiffText">python_has_version</span><span class="DiffChange"> </span><span class="Normal DiffChange">&quot;</span><span class="String DiffChange">dev-python/lxml[</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">PYTHON_USEDEP</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffChange">]</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L169" class="LineNr">169 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L170" class="LineNr">170 </span>
<span id="W2L171" class="LineNr">171 </span><span class="GruvboxBlue">QA_FLAGS_IGNORED</span>=<span class="Normal">&quot;</span><span class="String">usr/lib/systemd/boot/efi/.*</span><span class="Normal">&quot;</span>
<span id="W2L172" class="LineNr">172 </span><span class="GruvboxBlue">QA_EXECSTACK</span>=<span class="Normal">&quot;</span><span class="String">usr/lib/systemd/boot/efi/*</span><span class="Normal">&quot;</span>
<span id="W2L173" class="LineNr">173 </span>
<span id="W2L174" class="LineNr">174 </span><span class="GruvboxGreenBold">pkg_pretend() {</span>
<span id="W2L175" class="LineNr">175 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">MERGE_TYPE</span><span class="GruvboxAqua">}</span> <span class="GruvboxRed">!=</span> <span class="String">buildonly</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L176" class="LineNr">176 </span> <span class="GruvboxRed">if </span>use <span class="GruvboxRed">test</span> <span class="Normal">&amp;&amp;</span> has pid-sandbox <span class="GruvboxAqua">${</span><span class="GruvboxAqua">FEATURES</span><span class="GruvboxAqua">}</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L177" class="LineNr">177 </span> ewarn <span class="Normal">&quot;</span><span class="String">Tests are known to fail with PID sandboxing enabled.</span><span class="Normal">&quot;</span>
<span id="W2L178" class="LineNr">178 </span> ewarn <span class="Normal">&quot;</span><span class="String">See <a href="https://bugs.gentoo.org/674458.">https://bugs.gentoo.org/674458.</a></span><span class="Normal">&quot;</span>
<span id="W2L179" class="LineNr">179 </span> <span class="GruvboxRed">fi</span>
<span id="W2L180" class="LineNr">180 </span>
<span id="W2L181" class="LineNr">181 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">local</span><span class="GruvboxBlue DiffChange"> CONFIG_CHECK</span><span class="Normal DiffChange">=</span><span class="Normal DiffChange">&quot;</span><span class="String DiffChange"> ~BINFMT_MISC ~BLK_DEV_BSG ~CGROUPS</span><span class="DiffChange"> </span>
<span id="W2L182" class="LineNr">182 </span><span class="String DiffChange"> ~</span><span class="String DiffText">CGROUP_BPF ~</span><span class="String DiffChange">DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE</span><span class="DiffChange"> </span>
<span id="W2L183" class="LineNr">183 </span><span class="String"> ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS</span>
<span id="W2L184" class="LineNr">184 </span><span class="String"> ~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS</span>
<span id="W2L185" class="LineNr">185 </span><span class="String"> ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH</span>
<span id="W2L186" class="LineNr">186 </span><span class="String"> ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED</span>
<span id="W2L187" class="LineNr">187 </span><span class="String"> ~!SYSFS_DEPRECATED_V2</span><span class="Normal">&quot;</span>
<span id="W2L188" class="LineNr">188 </span>
<span id="W2L189" class="LineNr">189 </span> use acl <span class="Normal">&amp;&amp;</span> CONFIG_CHECK<span class="Normal">+=</span><span class="Normal">&quot;</span><span class="String"> ~TMPFS_POSIX_ACL</span><span class="Normal">&quot;</span>
<span id="W2L190" class="LineNr">190 </span> use seccomp <span class="Normal">&amp;&amp;</span> CONFIG_CHECK<span class="Normal">+=</span><span class="Normal">&quot;</span><span class="String"> ~SECCOMP ~SECCOMP_FILTER</span><span class="Normal">&quot;</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L191" class="LineNr">191 </span>
<span id="W2L192" class="LineNr">192 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">if </span><span class="DiffChange">kernel_is </span><span class="GruvboxRed DiffChange">-</span><span class="GruvboxRed DiffText">ge</span><span class="DiffChange"> </span><span class="GruvboxPurple DiffChange">5</span><span class="DiffChange"> </span><span class="GruvboxPurple DiffChange">10</span><span class="DiffChange"> </span><span class="GruvboxPurple DiffChange">20</span><span class="Normal DiffChange">;</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">then</span><span class="DiffChange"> </span>
<span id="W2L193" class="LineNr">193 </span><span class="DiffAdd"> CONFIG_CHECK</span><span class="Normal DiffAdd">+=</span><span class="Normal DiffAdd">&quot;</span><span class="String DiffAdd"> ~KCMP</span><span class="Normal DiffAdd">&quot;</span><span class="DiffAdd"> </span>
<span id="W2L194" class="LineNr">194 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">else</span><span class="DiffAdd"> </span>
<span id="W2L195" class="LineNr">195 </span> CONFIG_CHECK<span class="Normal">+=</span><span class="Normal">&quot;</span><span class="String"> ~CHECKPOINT_RESTORE</span><span class="Normal">&quot;</span>
<span id="W2L196" class="LineNr">196 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">fi</span><span class="DiffAdd"> </span>
<span id="W2L197" class="LineNr">197 </span><span class="DiffAdd"> </span><span class="DiffAdd"> </span>
<span id="W2L198" class="LineNr">198 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">if </span><span class="DiffAdd">kernel_is </span><span class="GruvboxRed DiffAdd">-ge</span><span class="DiffAdd"> </span><span class="GruvboxPurple DiffAdd">4</span><span class="DiffAdd"> </span><span class="GruvboxPurple DiffAdd">18</span><span class="Normal DiffAdd">;</span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">then</span><span class="DiffAdd"> </span>
<span id="W2L199" class="LineNr">199 </span><span class="DiffAdd"> CONFIG_CHECK</span><span class="Normal DiffAdd">+=</span><span class="Normal DiffAdd">&quot;</span><span class="String DiffAdd"> ~AUTOFS_FS</span><span class="Normal DiffAdd">&quot;</span><span class="DiffAdd"> </span>
<span id="W2L200" class="LineNr">200 </span> <span class="GruvboxRed">else</span>
<span id="W2L201" class="LineNr">201 </span><span class="DiffChange"> CONFIG_CHECK</span><span class="Normal DiffChange">+=</span><span class="Normal DiffChange">&quot;</span><span class="String DiffChange"> ~</span><span class="String DiffText">AUTOFS4_FS</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L202" class="LineNr">202 </span> <span class="GruvboxRed">fi</span>
<span id="W2L203" class="LineNr">203 </span>
<span id="W2L204" class="LineNr">204 </span> <span class="GruvboxRed">if </span>linux_config_exists<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L205" class="LineNr">205 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> uevent_helper_path</span><span class="Normal">=</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">linux_chkconfig_string UEVENT_HELPER_PATH</span><span class="GruvboxAqua">)</span>
<span id="W2L206" class="LineNr">206 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxRed">-n</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">uevent_helper_path</span><span class="GruvboxAqua">}</span> <span class="GruvboxOrange">]]</span> <span class="Normal">&amp;&amp;</span> <span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">uevent_helper_path</span><span class="GruvboxAqua">}</span> <span class="GruvboxRed">!=</span> <span class="Normal">'</span><span class="String">&quot;&quot;</span><span class="Normal">'</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L207" class="LineNr">207 </span> ewarn <span class="Normal">&quot;</span><span class="String">It's recommended to set an empty value to the following kernel config option:</span><span class="Normal">&quot;</span>
<span id="W2L208" class="Folded">208 </span><span class="Folded">+-- 19 lines: ewarn &quot;CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}&quot;---------------------------------------------------------------------------------------------------------</span>
<span id="W2L227" class="LineNr">227 </span><span class="GruvboxGreenBold">src_unpack() {</span>
<span id="W2L228" class="LineNr">228 </span> default
<span id="W2L229" class="LineNr">229 </span> <span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">PV</span><span class="GruvboxAqua">}</span> <span class="GruvboxRed">!=</span> <span class="GruvboxPurple">9999</span> <span class="GruvboxOrange">]]</span> <span class="Normal">||</span> git-r3_src_unpack
<span id="W2L230" class="LineNr">230 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L231" class="LineNr">231 </span>
<span id="W2L232" class="LineNr">232 </span><span class="GruvboxGreenBold">src_prepare() {</span>
<span id="W2L233" class="LineNr">233 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">local</span><span class="GruvboxBlue DiffText"> PATCHES</span><span class="Normal DiffText">=</span><span class="GruvboxBlue DiffText">(</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L234" class="LineNr">234 </span> )
<span id="W2L235" class="LineNr">235 </span>
<span id="W2L236" class="LineNr">236 </span> <span class="GruvboxRed">if </span><span class="GruvboxRed">!</span> use vanilla<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L237" class="LineNr">237 </span> PATCHES<span class="Normal">+=</span>(
<span id="W2L238" class="LineNr">238 </span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">FILESDIR</span><span class="GruvboxAqua">}</span><span class="String">/gentoo-generator-path-r2.patch</span><span class="Normal">&quot;</span>
<span id="W2L239" class="LineNr">239 </span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">FILESDIR</span><span class="GruvboxAqua">}</span><span class="String">/gentoo-systemctl-disable-sysv-sync-r1.patch</span><span class="Normal">&quot;</span>
<span id="W2L240" class="LineNr">240 </span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">FILESDIR</span><span class="GruvboxAqua">}</span><span class="String">/gentoo-journald-audit.patch</span><span class="Normal">&quot;</span>
<span id="W2L241" class="LineNr">241 </span> <span class="Error">)</span>
<span id="W2L242" class="LineNr">242 </span> <span class="GruvboxRed">fi</span>
<span id="W2L243" class="LineNr">243 </span>
<span id="W2L244" class="LineNr">244 </span><span class="DiffChange"> </span><span class="Comment DiffChange"># F</span><span class="Comment DiffText">ails with split-usr.</span><span class="DiffChange"> </span>
<span id="W2L245" class="LineNr">245 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">sed</span><span class="DiffText"> </span><span class="GruvboxOrange DiffText">-i</span><span class="DiffText"> </span><span class="GruvboxOrange DiffText">-e</span><span class="DiffText"> </span><span class="Normal DiffText">'</span><span class="String DiffText">2i exit 77</span><span class="Normal DiffText">'</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">test</span><span class="DiffText">/test-rpm-macros.sh </span><span class="Normal DiffText">||</span><span class="DiffText"> di</span><span class="DiffChange">e</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L246" class="LineNr">246 </span>
<span id="W2L247" class="LineNr">247 </span> default
<span id="W2L248" class="LineNr">248 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L249" class="LineNr">249 </span>
<span id="W2L250" class="LineNr">250 </span><span class="GruvboxGreenBold">src_configure() {</span>
<span id="W2L251" class="LineNr">251 </span> <span class="Comment"># Prevent conflicts with i686 cross toolchain, bug 559726</span>
<span id="W2L252" class="LineNr">252 </span> tc-export AR CC NM OBJCOPY RANLIB
<span id="W2L253" class="LineNr">253 </span>
<span id="W2L254" class="LineNr">254 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># Broken with FORTIFY_SOURCE=3: bug #841770.</span><span class="DiffAdd"> </span>
<span id="W2L255" class="LineNr">255 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd">#</span><span class="DiffAdd"> </span>
<span id="W2L256" class="LineNr">256 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># Our toolchain sets F_S=2 by default w/ &gt;= -O2, so we need</span><span class="DiffAdd"> </span>
<span id="W2L257" class="LineNr">257 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># to unset F_S first, then explicitly set 2, to negate any default</span><span class="DiffAdd"> </span>
<span id="W2L258" class="LineNr">258 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># and anything set by the user if they're choosing 3 (or if they've</span><span class="DiffAdd"> </span>
<span id="W2L259" class="LineNr">259 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># modified GCC to set 3).</span><span class="DiffAdd"> </span>
<span id="W2L260" class="LineNr">260 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd">#</span><span class="DiffAdd"> </span>
<span id="W2L261" class="LineNr">261 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">if </span><span class="DiffAdd">is-flagq </span><span class="Normal DiffAdd">'</span><span class="String DiffAdd">-O[23]</span><span class="Normal DiffAdd">'</span><span class="DiffAdd"> </span><span class="Normal DiffAdd">||</span><span class="DiffAdd"> is-flagq </span><span class="Normal DiffAdd">'</span><span class="String DiffAdd">-Ofast</span><span class="Normal DiffAdd">'</span><span class="DiffAdd"> </span><span class="Normal DiffAdd">;</span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">then</span><span class="DiffAdd"> </span>
<span id="W2L262" class="LineNr">262 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># We can't unconditionally do this b/c we fortify needs</span><span class="DiffAdd"> </span>
<span id="W2L263" class="LineNr">263 </span><span class="DiffAdd"> </span><span class="Comment DiffAdd"># some level of optimisation.</span><span class="DiffAdd"> </span>
<span id="W2L264" class="LineNr">264 </span><span class="DiffAdd"> filter-flags </span><span class="GruvboxOrange DiffAdd">-D_FORTIFY_SOURCE</span><span class="Normal DiffAdd">=</span><span class="GruvboxPurple DiffAdd">3</span><span class="DiffAdd"> </span>
<span id="W2L265" class="LineNr">265 </span><span class="DiffAdd"> append-cppflags </span><span class="GruvboxOrange DiffAdd">-U_FORTIFY_SOURCE</span><span class="DiffAdd"> </span><span class="GruvboxOrange DiffAdd">-D_FORTIFY_SOURCE</span><span class="Normal DiffAdd">=</span><span class="GruvboxPurple DiffAdd">2</span><span class="DiffAdd"> </span>
<span id="W2L266" class="LineNr">266 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">fi</span><span class="DiffAdd"> </span>
<span id="W2L267" class="LineNr">267 </span><span class="DiffAdd"> </span><span class="DiffAdd"> </span>
<span id="W2L268" class="LineNr">268 </span> python_setup
<span id="W2L269" class="LineNr">269 </span>
<span id="W2L270" class="LineNr">270 </span> multilib-minimal_src_configure
<span id="W2L271" class="LineNr">271 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L272" class="LineNr">272 </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L273" class="LineNr">273 </span><span class="GruvboxGreenBold">multilib_src_configure() {</span>
<span id="W2L274" class="LineNr">274 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> myconf</span><span class="Normal">=</span><span class="GruvboxBlue">(</span>
<span id="W2L275" class="LineNr">275 </span> <span class="GruvboxOrange">--localstatedir</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EPREFIX</span><span class="GruvboxAqua">}</span><span class="String">/var</span><span class="Normal">&quot;</span>
<span id="W2L276" class="LineNr">276 </span><span class="DiffChange"> </span><span class="GruvboxOrange DiffText">-Dsupport-url</span><span class="Normal DiffText">=</span><span class="Normal DiffText">&quot;</span><span class="String DiffText"><a href="https://gentoo.org/support/">https://gentoo.org/support/</a></span><span class="Normal DiffText">&quot;</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L277" class="LineNr">277 </span> <span class="GruvboxOrange">-Dpamlibdir</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">getpam_mod_dir</span><span class="GruvboxAqua">)</span><span class="Normal">&quot;</span>
<span id="W2L278" class="LineNr">278 </span> <span class="Comment"># avoid bash-completion dep</span>
<span id="W2L279" class="LineNr">279 </span> <span class="GruvboxOrange">-Dbashcompletiondir</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">get_bashcompdir</span><span class="GruvboxAqua">)</span><span class="Normal">&quot;</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L280" class="LineNr">280 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_use split-usr</span><span class="GruvboxAqua">)</span>
<span id="W2L281" class="LineNr">281 </span><span class="DiffChange"> </span><span class="GruvboxAqua DiffText">$(</span><span class="GruvboxOrange DiffText">meson_use split-usr split-bin</span><span class="GruvboxAqua DiffText">)</span><span class="DiffChange"> </span>
<span id="W2L282" class="LineNr">282 </span><span class="DiffChange"> </span><span class="GruvboxOrange DiffChange">-Drootprefix</span><span class="Normal DiffChange">=</span><span class="Normal DiffChange">&quot;</span><span class="GruvboxAqua DiffChange">$(</span><span class="GruvboxOrange DiffText">usex split-usr </span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">EPREFIX</span><span class="Normal DiffText">:-</span><span class="DiffText">/</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="GruvboxOrange DiffText"> </span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">EPREFIX</span><span class="GruvboxAqua DiffText">}</span><span class="String DiffText">/usr</span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffChange">)</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L283" class="LineNr">283 </span> <span class="GruvboxOrange">-Drootlibdir</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EPREFIX</span><span class="GruvboxAqua">}</span><span class="String">/usr/</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">get_libdir</span><span class="GruvboxAqua">)</span><span class="Normal">&quot;</span>
<span id="W2L284" class="LineNr">284 </span> <span class="Comment"># Avoid infinite exec recursion, bug 642724</span>
<span id="W2L285" class="LineNr">285 </span> <span class="GruvboxOrange">-Dtelinit-path</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EPREFIX</span><span class="GruvboxAqua">}</span><span class="String">/lib/sysvinit/telinit</span><span class="Normal">&quot;</span>
<span id="W2L286" class="LineNr">286 </span> <span class="Comment"># no deps</span>
<span id="W2L287" class="LineNr">287 </span> <span class="GruvboxOrange">-Dima</span><span class="Normal">=</span><span class="GruvboxRed">true</span>
<span id="W2L288" class="LineNr">288 </span> <span class="GruvboxOrange">-Ddefault-hierarchy</span><span class="Normal">=</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">usex cgroup-hybrid hybrid unified</span><span class="GruvboxAqua">)</span>
<span id="W2L289" class="Folded">289 </span><span class="Folded">+-- 18 lines: Optional components/dependencies--------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L307" class="LineNr">307 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool importd bzip2</span><span class="GruvboxAqua">)</span>
<span id="W2L308" class="LineNr">308 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool importd zlib</span><span class="GruvboxAqua">)</span>
<span id="W2L309" class="LineNr">309 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool kmod</span><span class="GruvboxAqua">)</span>
<span id="W2L310" class="LineNr">310 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_use lz4</span><span class="GruvboxAqua">)</span>
<span id="W2L311" class="LineNr">311 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_use lzma xz</span><span class="GruvboxAqua">)</span>
<span id="W2L312" class="LineNr">312 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_use zstd</span><span class="GruvboxAqua">)</span>
<span id="W2L313" class="LineNr">313 </span><span class="DiffChange"> </span><span class="GruvboxAqua DiffChange">$(</span><span class="GruvboxOrange DiffChange">meson_native_use_bool </span><span class="GruvboxOrange DiffText">iptables</span><span class="GruvboxOrange DiffChange"> libiptc</span><span class="GruvboxAqua DiffChange">)</span><span class="DiffChange"> </span>
<span id="W2L314" class="LineNr">314 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool openssl</span><span class="GruvboxAqua">)</span>
<span id="W2L315" class="LineNr">315 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_use pam</span><span class="GruvboxAqua">)</span>
<span id="W2L316" class="LineNr">316 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool pkcs11 p11kit</span><span class="GruvboxAqua">)</span>
<span id="W2L317" class="LineNr">317 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool pcre pcre2</span><span class="GruvboxAqua">)</span>
<span id="W2L318" class="LineNr">318 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool policykit polkit</span><span class="GruvboxAqua">)</span>
<span id="W2L319" class="LineNr">319 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool pwquality</span><span class="GruvboxAqua">)</span>
<span id="W2L320" class="LineNr">320 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool qrcode qrencode</span><span class="GruvboxAqua">)</span>
<span id="W2L321" class="LineNr">321 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool seccomp</span><span class="GruvboxAqua">)</span>
<span id="W2L322" class="LineNr">322 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool selinux</span><span class="GruvboxAqua">)</span>
<span id="W2L323" class="LineNr">323 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool tpm tpm2</span><span class="GruvboxAqua">)</span>
<span id="W2L324" class="LineNr">324 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool </span><span class="GruvboxRed">test</span><span class="GruvboxOrange"> dbus</span><span class="GruvboxAqua">)</span>
<span id="W2L325" class="LineNr">325 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_use_bool xkb xkbcommon</span><span class="GruvboxAqua">)</span>
<span id="W2L326" class="LineNr">326 </span><span class="DiffChange"> </span><span class="GruvboxOrange DiffText">-Dntp-servers</span><span class="Normal DiffText">=</span><span class="Normal DiffText">&quot;</span><span class="String DiffText">0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org</span><span class="Normal DiffText">&quot;</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L327" class="LineNr">327 </span> <span class="Comment"># Breaks screen, tmux, etc.</span>
<span id="W2L328" class="LineNr">328 </span> <span class="GruvboxOrange">-Ddefault-kill-user-processes</span><span class="Normal">=</span><span class="GruvboxRed">false</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L329" class="LineNr">329 </span> <span class="GruvboxOrange">-Dcreate-log-dirs</span><span class="Normal">=</span><span class="GruvboxRed">false</span>
<span id="W2L330" class="LineNr">330 </span>
<span id="W2L331" class="LineNr">331 </span> <span class="Comment"># multilib options</span>
<span id="W2L332" class="LineNr">332 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true backlight</span><span class="GruvboxAqua">)</span>
<span id="W2L333" class="LineNr">333 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true binfmt</span><span class="GruvboxAqua">)</span>
<span id="W2L334" class="LineNr">334 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true coredump</span><span class="GruvboxAqua">)</span>
<span id="W2L335" class="Folded">335 </span><span class="Folded">+-- 10 lines: $(meson_native_true environment-d)------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L345" class="LineNr">345 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true rfkill</span><span class="GruvboxAqua">)</span>
<span id="W2L346" class="LineNr">346 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true sysusers</span><span class="GruvboxAqua">)</span>
<span id="W2L347" class="LineNr">347 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true timedated</span><span class="GruvboxAqua">)</span>
<span id="W2L348" class="LineNr">348 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true timesyncd</span><span class="GruvboxAqua">)</span>
<span id="W2L349" class="LineNr">349 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true tmpfiles</span><span class="GruvboxAqua">)</span>
<span id="W2L350" class="LineNr">350 </span> <span class="GruvboxAqua">$(</span><span class="GruvboxOrange">meson_native_true vconsole</span><span class="GruvboxAqua">)</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L351" class="LineNr">351 </span> )
<span id="W2L352" class="LineNr">352 </span>
<span id="W2L353" class="LineNr">353 </span> meson_src_configure <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">myconf</span><span class="GruvboxAqua">[</span>@<span class="GruvboxAqua">]</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>
<span id="W2L354" class="LineNr">354 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L355" class="LineNr">355 </span>
<span id="W2L356" class="LineNr">356 </span><span class="GruvboxGreenBold">multilib_src_test() {</span>
<span id="W2L357" class="LineNr">357 </span> <span class="GruvboxRed">unset</span><span class="GruvboxBlue"> DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR</span>
<span id="W2L358" class="LineNr">358 </span> meson_src_test
<span id="W2L359" class="LineNr">359 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L360" class="LineNr">360 </span>
<span id="W2L361" class="LineNr">361 </span><span class="GruvboxGreenBold">multilib_src_install_all() {</span>
<span id="W2L362" class="LineNr">362 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> rootprefix</span><span class="Normal">=</span><span class="GruvboxAqua">$(</span><span class="GruvboxOrange">usex split-usr </span><span class="Normal">''</span><span class="GruvboxOrange"> /usr</span><span class="GruvboxAqua">)</span>
<span id="W2L363" class="LineNr">363 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">local</span><span class="GruvboxBlue DiffAdd"> sbin</span><span class="Normal DiffAdd">=</span><span class="GruvboxAqua DiffAdd">$(</span><span class="GruvboxOrange DiffAdd">usex split-usr sbin bin</span><span class="GruvboxAqua DiffAdd">)</span><span class="DiffAdd"> </span>
<span id="W2L364" class="LineNr">364 </span>
<span id="W2L365" class="LineNr">365 </span> <span class="Comment"># meson doesn't know about docdir</span>
<span id="W2L366" class="LineNr">366 </span> <span class="GruvboxRed">mv</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/usr/share/doc/<span class="GruvboxOrange">{</span>systemd,<span class="GruvboxAqua">${</span><span class="GruvboxAqua">PF</span><span class="GruvboxAqua">}</span><span class="GruvboxOrange">}</span> <span class="Normal">||</span> die
<span id="W2L367" class="LineNr">367 </span>
<span id="W2L368" class="LineNr">368 </span> einstalldocs
<span id="W2L369" class="LineNr">369 </span><span class="DiffChange"> </span><span class="DiffText">dodoc </span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">FILESDIR</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="DiffText">/nsswitch.conf</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L370" class="LineNr">370 </span>
<span id="W2L371" class="LineNr">371 </span> <span class="GruvboxRed">if </span><span class="GruvboxRed">!</span> use resolvconf<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L372" class="LineNr">372 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">rm</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">-f</span><span class="DiffChange"> </span><span class="Normal DiffChange">&quot;</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">ED</span><span class="GruvboxAqua DiffChange">}${</span><span class="GruvboxAqua DiffChange">rootprefix</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffText">/</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">sbin</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="DiffChange">/resolvconf </span><span class="Normal DiffChange">||</span><span class="DiffChange"> die</span><span class="DiffChange"> </span>
<span id="W2L373" class="LineNr">373 </span> <span class="GruvboxRed">fi</span>
<span id="W2L374" class="LineNr">374 </span>
<span id="W2L375" class="LineNr">375 </span> <span class="GruvboxRed">rm</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/etc/init.d/README <span class="Normal">||</span> die
<span id="W2L376" class="LineNr">376 </span> <span class="GruvboxRed">rm</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}${</span><span class="GruvboxAqua">rootprefix</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/lib/systemd/system-generators/systemd-sysv-generator <span class="Normal">||</span> die
<span id="W2L377" class="LineNr">377 </span>
<span id="W2L378" class="LineNr">378 </span> <span class="GruvboxRed">if </span><span class="GruvboxRed">!</span> use sysv-utils<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L379" class="LineNr">379 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">rm</span><span class="DiffChange"> </span><span class="Normal DiffChange">&quot;</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">ED</span><span class="GruvboxAqua DiffChange">}${</span><span class="GruvboxAqua DiffChange">rootprefix</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffText">/</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">sbin</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="DiffChange">/</span><span class="GruvboxOrange DiffChange">{</span><span class="DiffChange">halt,init,poweroff,reboot,runlevel,shutdown,telinit</span><span class="GruvboxOrange DiffChange">}</span><span class="DiffChange"> </span><span class="Normal DiffChange">||</span><span class="DiffChange"> die</span><span class="DiffChange"> </span>
<span id="W2L380" class="LineNr">380 </span> <span class="GruvboxRed">rm</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/usr/share/man/man1/init.<span class="GruvboxPurple">1</span> <span class="Normal">||</span> die
<span id="W2L381" class="LineNr">381 </span> <span class="GruvboxRed">rm</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/usr/share/man/man8/<span class="GruvboxOrange">{</span>halt,poweroff,reboot,runlevel,shutdown,telinit<span class="GruvboxOrange">}</span>.<span class="GruvboxPurple">8</span> <span class="Normal">||</span> die
<span id="W2L382" class="LineNr">382 </span> <span class="GruvboxRed">fi</span>
<span id="W2L383" class="LineNr">383 </span>
<span id="W2L384" class="LineNr">384 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">if </span><span class="GruvboxRed DiffChange">!</span><span class="DiffChange"> use resolvconf </span><span class="Normal DiffChange">&amp;&amp;</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">!</span><span class="DiffChange"> use sysv-utils</span><span class="DiffText"> </span><span class="Normal DiffText">&amp;&amp;</span><span class="DiffText"> use split-usr</span><span class="Normal DiffChange">;</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">then</span><span class="DiffChange"> </span>
<span id="W2L385" class="LineNr">385 </span> <span class="GruvboxRed">rmdir</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}${</span><span class="GruvboxAqua">rootprefix</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/sbin <span class="Normal">||</span> die
<span id="W2L386" class="LineNr">386 </span> <span class="GruvboxRed">fi</span>
<span id="W2L387" class="LineNr">387 </span>
<span id="W2L388" class="LineNr">388 </span> <span class="Comment"># <a href="https://bugs.gentoo.org/761763">https://bugs.gentoo.org/761763</a></span>
<span id="W2L389" class="LineNr">389 </span> <span class="GruvboxRed">rm</span> <span class="GruvboxOrange">-r</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">ED</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span>/usr/lib/sysusers.d <span class="Normal">||</span> die
<span id="W2L390" class="LineNr">390 </span>
<span id="W2L391" class="LineNr">391 </span><span class="DiffChange"> </span><span class="Comment DiffChange"># </span><span class="Comment DiffText">Preserve empty dirs in /etc &amp; /var, bug #437008</span><span class="DiffChange"> </span>
<span id="W2L392" class="LineNr">392 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /etc/</span><span class="GruvboxOrange DiffText">{</span><span class="DiffText">binfmt.d,modules-load.d,tmpfiles.d</span><span class="GruvboxOrange DiffText">}</span><span class="DiffChange"> </span>
<span id="W2L393" class="LineNr">393 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /etc/kernel/install.d</span><span class="DiffChange"> </span>
<span id="W2L394" class="LineNr">394 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /etc/systemd/</span><span class="GruvboxOrange DiffText">{</span><span class="DiffText">network,system,user</span><span class="GruvboxOrange DiffChange">}</span><span class="DiffChange"> </span>
<span id="W2L395" class="LineNr">395 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /etc/udev/rules</span><span class="DiffChange">.d</span><span class="DiffChange"> </span>
<span id="W2L396" class="LineNr">396 </span><span class="DiffChange"> </span><span class="DiffChange"> </span>
<span id="W2L397" class="LineNr">397 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /etc/udev/hwdb</span><span class="DiffChange">.d</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L398" class="LineNr">398 </span>
<span id="W2L399" class="LineNr">399 </span><span class="DiffChange"> </span><span class="DiffText">keepdir </span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">rootprefix</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="DiffText">/lib/systemd/</span><span class="GruvboxOrange DiffText">{</span><span class="DiffText">system-sleep,system-shutdown</span><span class="GruvboxOrange DiffText">}</span><span class="DiffChange"> </span>
<span id="W2L400" class="LineNr">400 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /usr/lib/</span><span class="GruvboxOrange DiffText">{</span><span class="DiffText">binfmt.d,modules-load.d</span><span class="GruvboxOrange DiffText">}</span><span class="DiffChange"> </span>
<span id="W2L401" class="LineNr">401 </span><span class="DiffChange"> </span><span class="DiffText">keepdir /usr/lib/systemd/user-generators</span><span class="DiffChange"> </span>
<span id="W2L402" class="LineNr">402 </span><span class="DiffAdd"> keepdir /var/lib/systemd</span><span class="DiffAdd"> </span>
<span id="W2L403" class="LineNr">403 </span><span class="DiffAdd"> keepdir /var/log/journal</span><span class="DiffAdd"> </span>
<span id="W2L404" class="LineNr">404 </span>
<span id="W2L405" class="LineNr">405 </span><span class="DiffChange"> </span><span class="Comment DiffChange"># </span><span class="Comment DiffText">Symlink /etc/sysctl.conf for easy migratio</span><span class="Comment DiffChange">n.</span><span class="DiffChange"> </span>
<span id="W2L406" class="LineNr">406 </span><span class="DiffChange"> </span><span class="DiffText">dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf</span><span class="DiffChange"> </span>
<span id="W2L407" class="LineNr">407 </span><span class="DiffChange"> </span><span class="DiffChange"> </span>
<span id="W2L408" class="LineNr">408 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">if </span><span class="DiffText">use pam</span><span class="Normal DiffText">;</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">then</span><span class="DiffChange"> </span>
<span id="W2L409" class="LineNr">409 </span><span class="DiffAdd"> newpamd </span><span class="Normal DiffAdd">&quot;</span><span class="GruvboxAqua DiffAdd">${</span><span class="GruvboxAqua DiffAdd">FILESDIR</span><span class="GruvboxAqua DiffAdd">}</span><span class="Normal DiffAdd">&quot;</span><span class="DiffAdd">/systemd-user.pam systemd-user</span><span class="DiffAdd"> </span>
<span id="W2L410" class="LineNr">410 </span><span class="DiffAdd"> </span><span class="GruvboxRed DiffAdd">fi</span><span class="DiffAdd"> </span>
<span id="W2L411" class="LineNr">411 </span>
<span id="W2L412" class="LineNr">412 </span> <span class="GruvboxRed">if </span>use split-usr<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L413" class="LineNr">413 </span> <span class="Comment"># Avoid breaking boot/reboot</span>
<span id="W2L414" class="LineNr">414 </span> dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
<span id="W2L415" class="LineNr">415 </span> dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
<span id="W2L416" class="LineNr">416 </span> <span class="GruvboxRed">fi</span>
<span id="W2L417" class="LineNr">417 </span>
<span id="W2L418" class="LineNr">418 </span><span class="DiffChange"> </span><span class="DiffText">gen_usr_ldscript </span><span class="GruvboxOrange DiffText">-a</span><span class="DiffText"> systemd udev</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L419" class="LineNr">419 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L420" class="LineNr">420 </span>
<span id="W2L421" class="LineNr">421 </span><span class="GruvboxGreenBold">migrate_locale() {</span>
<span id="W2L422" class="LineNr">422 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> envd_locale_def</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EROOT</span><span class="GruvboxAqua">}</span><span class="String">/etc/env.d/02locale</span><span class="Normal">&quot;</span>
<span id="W2L423" class="LineNr">423 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> envd_locale</span><span class="Normal">=</span><span class="GruvboxBlue">( </span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EROOT</span><span class="GruvboxAqua">}</span><span class="Normal">&quot;</span><span class="GruvboxBlue">/etc/env.d/??locale </span>)
<span id="W2L424" class="LineNr">424 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> locale_conf</span><span class="Normal">=</span><span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EROOT</span><span class="GruvboxAqua">}</span><span class="String">/etc/locale.conf</span><span class="Normal">&quot;</span>
<span id="W2L425" class="Folded">425 </span><span class="Folded">+-- 37 lines: if [[ ! -L ${locale_conf} &amp;&amp; ! -e ${locale_conf} ]]; then-------------------------------------------------------------------------------------------------------</span>
<span id="W2L462" class="LineNr">462 </span> <span class="GruvboxRed">fi</span>
<span id="W2L463" class="LineNr">463 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L464" class="LineNr">464 </span>
<span id="W2L465" class="LineNr">465 </span><span class="GruvboxGreenBold">pkg_preinst() {</span>
<span id="W2L466" class="LineNr">466 </span> <span class="GruvboxRed">if </span><span class="GruvboxRed">!</span> use split-usr<span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L467" class="LineNr">467 </span> <span class="GruvboxRed">local</span><span class="GruvboxBlue"> dir</span>
<span id="W2L468" class="LineNr">468 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">for</span><span class="DiffChange"> dir </span><span class="GruvboxRed DiffChange">in</span><span class="DiffChange"> bin sbin lib</span><span class="DiffText"> usr/sbin</span><span class="Normal DiffChange">;</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">do</span><span class="DiffChange"> </span>
<span id="W2L469" class="LineNr">469 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">if </span><span class="GruvboxOrange DiffChange">[[</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">!</span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">-L</span><span class="DiffText"> </span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">EROOT</span><span class="GruvboxAqua DiffText">}</span><span class="String DiffChange">/</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">dir</span><span class="GruvboxAqua DiffChange">}</span><span class="DiffChange"> </span><span class="GruvboxOrange DiffChange">]]</span><span class="Normal DiffChange">;</span><span class="DiffChange"> </span><span class="GruvboxRed DiffChange">then</span><span class="DiffChange"> </span>
<span id="W2L470" class="LineNr">470 </span><span class="DiffChange"> eerror </span><span class="Normal DiffChange">&quot;</span><span class="String DiffText">'</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">EROOT</span><span class="GruvboxAqua DiffText">}</span><span class="String DiffText">/</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">dir</span><span class="GruvboxAqua DiffText">}</span><span class="String DiffText">' is not a symbolic link</span><span class="String DiffChange">.</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L471" class="LineNr">471 </span> <span class="GruvboxBlue">FAIL</span>=<span class="GruvboxPurple">1</span>
<span id="W2L472" class="LineNr">472 </span> <span class="GruvboxRed">fi</span>
<span id="W2L473" class="LineNr">473 </span> <span class="GruvboxRed">done</span>
<span id="W2L474" class="LineNr">474 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">FAIL</span><span class="GruvboxAqua">}</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L475" class="LineNr">475 </span> eerror <span class="Normal">&quot;</span><span class="String">Migration to system layout with merged directories must be performed before</span><span class="Normal">&quot;</span>
<span id="W2L476" class="LineNr">476 </span><span class="DiffChange"> eerror </span><span class="Normal DiffChange">&quot;</span><span class="String DiffText">install</span><span class="String DiffChange">ing </span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">CATEGORY</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffChange">/</span><span class="GruvboxAqua DiffChange">${</span><span class="GruvboxAqua DiffChange">PN</span><span class="GruvboxAqua DiffChange">}</span><span class="String DiffChange"> with USE=</span><span class="GruvboxOrange DiffChange">\&quot;</span><span class="String DiffChange">-split-usr</span><span class="GruvboxOrange DiffChange">\&quot;</span><span class="String DiffChange"> to avoid run-time breakage.</span><span class="Normal DiffChange">&quot;</span><span class="DiffChange"> </span>
<span id="W2L477" class="LineNr">477 </span> die <span class="Normal">&quot;</span><span class="String">System layout with split directories still used</span><span class="Normal">&quot;</span>
<span id="W2L478" class="LineNr">478 </span> <span class="GruvboxRed">fi</span>
<span id="W2L479" class="LineNr">479 </span> <span class="GruvboxRed">fi</span>
<span id="W2L480" class="LineNr">480 </span><span class="GruvboxGreenBold">}</span>
<span id="W2L481" class="LineNr">481 </span>
<span id="W2L482" class="LineNr">482 </span><span class="GruvboxGreenBold">pkg_postinst() {</span>
<span id="W2L483" class="Folded">483 </span><span class="Folded">+-- 6 lines: systemd_update_catalog------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L489" class="LineNr">489 </span> udev_reload <span class="Normal">||</span> <span class="GruvboxBlue">FAIL</span>=<span class="GruvboxPurple">1</span>
<span id="W2L490" class="LineNr">490 </span>
<span id="W2L491" class="LineNr">491 </span> <span class="Comment"># Bug 465468, make sure locales are respected, and ensure consistency</span>
<span id="W2L492" class="LineNr">492 </span> <span class="Comment"># between OpenRC &amp; systemd</span>
<span id="W2L493" class="LineNr">493 </span> migrate_locale
<span id="W2L494" class="LineNr">494 </span>
<span id="W2L495" class="LineNr">495 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">if </span><span class="GruvboxOrange DiffText">[[</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">-z</span><span class="DiffText"> </span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">REPLACING_VERSIONS</span><span class="GruvboxAqua DiffText">}</span><span class="DiffText"> </span><span class="GruvboxOrange DiffText">]]</span><span class="Normal DiffText">;</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">then</span><span class="DiffChange"> </span>
<span id="W2L496" class="LineNr">496 </span><span class="DiffChange"> </span><span class="DiffText"> </span><span class="GruvboxRed DiffText">if </span><span class="GruvboxRed DiffText">type</span><span class="DiffText"> systemctl </span><span class="Normal DiffText">&amp;</span><span class="GruvboxRed DiffText">&gt;</span><span class="DiffText">/dev/null</span><span class="Normal DiffText">;</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">then</span><span class="DiffChange"> </span>
<span id="W2L497" class="LineNr">497 </span><span class="DiffChange"> </span><span class="DiffText"> systemctl </span><span class="GruvboxOrange DiffText">--root</span><span class="Normal DiffText">=</span><span class="Normal DiffText">&quot;</span><span class="GruvboxAqua DiffText">${</span><span class="GruvboxAqua DiffText">ROOT</span><span class="Normal DiffText">:-</span><span class="DiffText">/</span><span class="GruvboxAqua DiffText">}</span><span class="Normal DiffText">&quot;</span><span class="DiffText"> </span><span class="GruvboxRed DiffText">enable</span><span class="DiffText"> getty@.service remote-fs.target </span><span class="Normal DiffText">||</span><span class="DiffText"> </span><span class="GruvboxBlue DiffText">FAIL</span><span class="DiffText">=</span><span class="GruvboxPurple DiffText">1</span><span class="DiffChange"> </span>
<span id="W2L498" class="LineNr">498 </span><span class="DiffChange"> </span><span class="DiffText"> </span><span class="GruvboxRed DiffText">fi</span><span class="DiffChange"> </span>
<span id="W2L499" class="LineNr">499 </span><span class="DiffChange"> </span><span class="DiffText"> elog </span><span class="Normal DiffText">&quot;</span><span class="String DiffText">To enable a useful set of services, run the following:</span><span class="Normal DiffText">&quot;</span><span class="DiffChange"> </span>
<span id="W2L500" class="LineNr">500 </span><span class="DiffChange"> </span><span class="DiffText"> elog </span><span class="Normal DiffText">&quot;</span><span class="String DiffText"> systemctl preset-all --preset-mode=enable-only</span><span class="Normal DiffText">&quot;</span><span class="DiffChange"> </span>
<span id="W2L501" class="LineNr">501 </span><span class="DiffChange"> </span><span class="GruvboxRed DiffText">fi</span><span class="DiffChange"> </span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span class="LineNr"> </span><span class="DiffDelete">--------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="W2L502" class="LineNr">502 </span>
<span id="W2L503" class="LineNr">503 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxRed">-L</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">EROOT</span><span class="GruvboxAqua">}</span><span class="String">/var/lib/systemd/timesync</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L504" class="LineNr">504 </span> <span class="GruvboxRed">rm</span> <span class="Normal">&quot;</span><span class="GruvboxAqua">${</span><span class="GruvboxAqua">EROOT</span><span class="GruvboxAqua">}</span><span class="String">/var/lib/systemd/timesync</span><span class="Normal">&quot;</span>
<span id="W2L505" class="LineNr">505 </span> <span class="GruvboxRed">fi</span>
<span id="W2L506" class="LineNr">506 </span>
<span id="W2L507" class="LineNr">507 </span> <span class="GruvboxRed">if </span><span class="GruvboxOrange">[[</span> <span class="GruvboxAqua">${</span><span class="GruvboxAqua">FAIL</span><span class="GruvboxAqua">}</span> <span class="GruvboxOrange">]]</span><span class="Normal">;</span> <span class="GruvboxRed">then</span>
<span id="W2L508" class="Folded">508 </span><span class="Folded">+-- 13 lines: eerror &quot;One of the postinst commands failed. Please check the postinst output&quot;----------------------------------------------------------------------------------</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -0,0 +1,539 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
"${FILESDIR}/systemd-253-initrd-generators.patch"
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
# Fails with split-usr.
sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
$(meson_use split-usr)
$(meson_use split-usr split-bin)
-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
local sbin=$(usex split-usr sbin bin)
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
gen_usr_ldscript -a systemd udev
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use split-usr; then
local dir
for dir in bin sbin lib usr/sbin; do
if [[ ! -L ${EROOT}/${dir} ]]; then
eerror "'${EROOT}/${dir}' is not a symbolic link."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "installing ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,539 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
"${FILESDIR}/systemd-253-initrd-generators.patch"
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
# Fails with split-usr.
sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
$(meson_use split-usr)
$(meson_use split-usr split-bin)
-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
local sbin=$(usex split-usr sbin bin)
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
gen_usr_ldscript -a systemd udev
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use split-usr; then
local dir
for dir in bin sbin lib usr/sbin; do
if [[ ! -L ${EROOT}/${dir} ]]; then
eerror "'${EROOT}/${dir}' is not a symbolic link."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "installing ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,540 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
"${FILESDIR}/systemd-253-initrd-generators.patch"
"${FILESDIR}/254-PrivateDevices-userdbd.patch"
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
# Fails with split-usr.
sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
$(meson_use split-usr)
$(meson_use split-usr split-bin)
-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
local sbin=$(usex split-usr sbin bin)
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
gen_usr_ldscript -a systemd udev
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use split-usr; then
local dir
for dir in bin sbin lib usr/sbin; do
if [[ ! -L ${EROOT}/${dir} ]]; then
eerror "'${EROOT}/${dir}' is not a symbolic link."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "installing ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,540 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
"${FILESDIR}/systemd-253-initrd-generators.patch"
"${FILESDIR}/254-PrivateDevices-userdbd.patch"
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
# Fails with split-usr.
sed -i -e '2i exit 77' test/test-rpm-macros.sh || die
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
$(meson_use split-usr)
$(meson_use split-usr split-bin)
-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
local sbin=$(usex split-usr sbin bin)
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}/${sbin}"/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}${rootprefix}/${sbin}"/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
gen_usr_ldscript -a systemd udev
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use split-usr; then
local dir
for dir in bin sbin lib usr/sbin; do
if [[ ! -L ${EROOT}/${dir} ]]; then
eerror "'${EROOT}/${dir}' is not a symbolic link."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "installing ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,524 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
if [[ ${PV} != *rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.32:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( >=sys-libs/libapparmor-2.13:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( >=net-misc/curl-7.32.0:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( >=app-crypt/p11-kit-0.23.3:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( >=dev-libs/libpwquality-1.4.1:0= )
qrcode? ( >=media-gfx/qrencode-3:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( >=sys-libs/libselinux-2.1.9:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
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
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
# default is developer, bug 918671
-Dmode=release
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
-Dsplit-bin=false
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
$(meson_native_enabled vmspawn)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}"/usr/bin/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}"/usr/bin/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir /usr/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
ebegin "Reexecuting system manager (systemd)"
systemctl daemon-reexec
eend $? || FAIL=1
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,524 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
if [[ ${PV} != *rc* ]] ; then
KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86"
fi
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.32:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( >=sys-libs/libapparmor-2.13:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( >=net-misc/curl-7.32.0:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( >=app-crypt/p11-kit-0.23.3:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( >=dev-libs/libpwquality-1.4.1:0= )
qrcode? ( >=media-gfx/qrencode-3:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( >=sys-libs/libselinux-2.1.9:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
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
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
# default is developer, bug 918671
-Dmode=release
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
-Dsplit-bin=false
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
$(meson_native_enabled vmspawn)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}"/usr/bin/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}"/usr/bin/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir /usr/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
ebegin "Reexecuting system manager (systemd)"
systemctl daemon-reexec
eend $? || FAIL=1
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}

View File

@ -0,0 +1,524 @@
# Copyright 2011-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
# Avoid QA warnings
TMPFILES_OPTIONAL=1
UDEV_OPTIONAL=1
QA_PKGCONFIG_VERSION=$(ver_cut 1)
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
if [[ ${PV} != *rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
fi
inherit bash-completion-r1 linux-info meson-multilib optfeature pam python-single-r1
inherit secureboot systemd toolchain-funcs udev
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="
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
"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
dns-over-tls? ( || ( gnutls openssl ) )
fido2? ( cryptsetup openssl )
homed? ( cryptsetup pam openssl )
importd? ( curl lzma || ( gcrypt openssl ) )
pwquality? ( homed )
boot? ( kernel-install )
ukify? ( boot )
"
RESTRICT="!test? ( test )"
MINKV="4.15"
COMMON_DEPEND="
>=sys-apps/util-linux-2.32:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
virtual/libcrypt:=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( >=sys-libs/libapparmor-2.13:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( >=net-misc/curl-7.32.0:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
fido2? ( dev-libs/libfido2:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
gnutls? ( >=net-libs/gnutls-3.6.0:0= )
http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] )
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
iptables? ( net-firewall/iptables:0= )
openssl? ( >=dev-libs/openssl-1.1.0:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( >=app-crypt/p11-kit-0.23.3:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( >=dev-libs/libpwquality-1.4.1:0= )
qrcode? ( >=media-gfx/qrencode-3:0= )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( >=sys-libs/libselinux-2.1.9:0= )
tpm? ( app-crypt/tpm2-tss:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] )
"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
"
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
>=acct-group/adm-0-r1
>=acct-group/wheel-0-r1
>=acct-group/kmem-0-r1
>=acct-group/tty-0-r1
>=acct-group/utmp-0-r1
>=acct-group/audio-0-r1
>=acct-group/cdrom-0-r1
>=acct-group/dialout-0-r1
>=acct-group/disk-0-r1
>=acct-group/input-0-r1
>=acct-group/kvm-0-r1
>=acct-group/lp-0-r1
>=acct-group/render-0-r1
acct-group/sgx
>=acct-group/tape-0-r1
acct-group/users
>=acct-group/video-0-r1
>=acct-group/systemd-journal-0-r1
>=acct-user/root-0-r1
acct-user/nobody
>=acct-user/systemd-journal-remote-0-r1
>=acct-user/systemd-coredump-0-r1
>=acct-user/systemd-network-0-r1
acct-user/systemd-oom
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
ukify? (
${PYTHON_DEPS}
$(python_gen_cond_dep "${PEFILE_DEPEND}")
)
selinux? (
sec-policy/selinux-base-policy[systemd]
sec-policy/selinux-ntp
)
sysv-utils? (
!sys-apps/openrc[sysv-utils(-)]
!sys-apps/sysvinit
)
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!sys-apps/hwids[udev]
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-build/meson-0.46
>=sys-apps/coreutils-8.16
sys-devel/gettext
virtual/pkgconfig
test? (
app-text/tree
dev-lang/perl
sys-apps/dbus
)
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
${PYTHON_DEPS}
$(python_gen_cond_dep "
dev-python/jinja[\${PYTHON_USEDEP}]
dev-python/lxml[\${PYTHON_USEDEP}]
boot? ( >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] )
ukify? ( test? ( ${PEFILE_DEPEND} ) )
")
"
QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*"
QA_EXECSTACK="usr/lib/systemd/boot/efi/*"
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
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~BLK_DEV_BSG ~CGROUPS
~CGROUP_BPF ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
if kernel_is -ge 5 10 20; then
CONFIG_CHECK+=" ~KCMP"
else
CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
fi
if kernel_is -ge 4 18; then
CONFIG_CHECK+=" ~AUTOFS_FS"
else
CONFIG_CHECK+=" ~AUTOFS4_FS"
fi
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
use boot && secureboot_pkg_setup
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
local PATCHES=(
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-journald-audit-r1.patch"
)
fi
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
# default is developer, bug 918671
-Dmode=release
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
-Dsplit-bin=false
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
$(meson_native_use_bool acl)
$(meson_native_use_bool apparmor)
$(meson_native_use_bool audit)
$(meson_native_use_bool boot bootloader)
$(meson_native_use_bool cryptsetup libcryptsetup)
$(meson_native_use_bool curl libcurl)
$(meson_native_use_bool dns-over-tls dns-over-tls)
$(meson_native_use_bool elfutils)
$(meson_native_use_bool fido2 libfido2)
$(meson_use gcrypt)
$(meson_native_use_bool gnutls)
$(meson_native_use_bool homed)
$(meson_native_use_bool http microhttpd)
$(meson_native_use_bool idn)
$(meson_native_use_bool importd)
$(meson_native_use_bool importd bzip2)
$(meson_native_use_bool importd zlib)
$(meson_native_use_bool kernel-install)
$(meson_native_use_bool kmod)
$(meson_use lz4)
$(meson_use lzma xz)
$(meson_use test tests)
$(meson_use zstd)
$(meson_native_use_bool iptables libiptc)
$(meson_native_use_bool openssl)
$(meson_use pam)
$(meson_native_use_bool pkcs11 p11kit)
$(meson_native_use_bool pcre pcre2)
$(meson_native_use_bool policykit polkit)
$(meson_native_use_bool pwquality)
$(meson_native_use_bool qrcode qrencode)
$(meson_native_use_bool seccomp)
$(meson_native_use_bool selinux)
$(meson_native_use_bool tpm tpm2)
$(meson_native_use_bool test dbus)
$(meson_native_use_bool ukify)
$(meson_native_use_bool xkb xkbcommon)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
$(meson_native_true backlight)
$(meson_native_true binfmt)
$(meson_native_true coredump)
$(meson_native_true environment-d)
$(meson_native_true firstboot)
$(meson_native_true hibernate)
$(meson_native_true hostnamed)
$(meson_native_true ldconfig)
$(meson_native_true localed)
$(meson_native_true man)
$(meson_native_true networkd)
$(meson_native_true quotacheck)
$(meson_native_true randomseed)
$(meson_native_true rfkill)
$(meson_native_true sysusers)
$(meson_native_true timedated)
$(meson_native_true timesyncd)
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
$(meson_native_enabled vmspawn)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
local -x COLUMNS=80
meson_src_test
}
multilib_src_install_all() {
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
if ! use resolvconf; then
rm -f "${ED}"/usr/bin/resolvconf || die
fi
if ! use sysv-utils; then
rm "${ED}"/usr/bin/{halt,init,poweroff,reboot,shutdown} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,shutdown}.8 || die
fi
# https://bugs.gentoo.org/761763
rm -r "${ED}"/usr/lib/sysusers.d || die
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
keepdir /etc/udev/hwdb.d
keepdir /usr/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
if use pam; then
newpamd "${FILESDIR}"/systemd-user.pam systemd-user
fi
if use kernel-install; then
# Dummy config, remove to make room for sys-kernel/installkernel
rm "${ED}/usr/lib/kernel/install.conf" || die
fi
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
pkg_preinst() {
if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
# Symlink /etc/sysctl.conf for easy migration.
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
if ! use boot && has_version "sys-apps/systemd[gnuefi(-)]"; then
ewarn "The 'gnuefi' USE flag has been renamed to 'boot'."
ewarn "Make sure to enable the 'boot' USE flag if you use systemd-boot."
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required.
systemd-hwdb --root="${ROOT}" update
udev_reload || FAIL=1
# Bug 465468, make sure locales are respected, and ensure consistency
# between OpenRC & systemd
migrate_locale
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
ebegin "Reexecuting system manager (systemd)"
systemctl daemon-reexec
eend $? || FAIL=1
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
if use boot; then
optfeature "automatically installing the kernels in systemd-boot's native layout and updating the bootloader configuration" \
"sys-kernel/installkernel[systemd-boot]"
fi
if use ukify; then
optfeature "automatically generating an unified kernel image on each kernel installation" \
"sys-kernel/installkernel[ukify]"
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}