sys-apps/systemd: Apply Flatcar patches

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
This commit is contained in:
Sayan Chowdhury 2024-02-06 15:28:05 +05:30 committed by Adrian Vladu
parent 756b4225c2
commit 6b2771eb2d
21 changed files with 635 additions and 3919 deletions

View File

@ -0,0 +1,32 @@
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

@ -0,0 +1,24 @@
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

@ -0,0 +1,58 @@
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

@ -0,0 +1,64 @@
From 4cdbcf5df9a2fd165385465bd5be9b8cdb78f83a Mon Sep 17 00:00:00 2001
From: Adrian Vladu <avladu@cloudbasesolutions.com>
Date: Fri, 16 Feb 2024 11:22:08 +0000
Subject: [PATCH] [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: Adrian Vladu <avladu@cloudbasesolutions.com>
---
man/systemd-system.conf.xml | 2 +-
src/core/manager.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 31b6421399..52819ae8b7 100644
--- a/man/systemd-system.conf.xml
+++ b/man/systemd-system.conf.xml
@@ -515,7 +515,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/manager.c b/src/core/manager.c
index e8c747d96d..df9269aab8 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -114,7 +114,7 @@
/* How many units and jobs to process of the bus queue before returning to the event loop. */
#define MANAGER_BUS_MESSAGE_BUDGET 100U
-#define DEFAULT_TASKS_MAX ((CGroupTasksMax) { 15U, 100U }) /* 15% */
+#define DEFAULT_TASKS_MAX ((CGroupTasksMax) { 100U, 100U }) /* 15% */
static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata);
static int manager_dispatch_cgroups_agent_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata);
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
index 9b89a6aa77..5a7e92ab5a 100644
--- a/src/core/system.conf.in
+++ b/src/core/system.conf.in
@@ -59,7 +59,7 @@
#DefaultIPAccounting=no
#DefaultMemoryAccounting={{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }}
#DefaultTasksAccounting=yes
-#DefaultTasksMax=15%
+#DefaultTasksMax=100%
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
--
2.34.1

View File

@ -0,0 +1,29 @@
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

@ -0,0 +1,95 @@
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

@ -0,0 +1,42 @@
From 44374d98fb65ff5fdbc2a7d07a076b50b8f2b003 Mon Sep 17 00:00:00 2001
From: Adrian Vladu <avladu@cloudbasesolutions.com>
Date: Fri, 16 Feb 2024 11:29:04 +0000
Subject: [PATCH] [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.
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
---
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 37eeabc510..e5030a81bd 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -27,6 +27,7 @@ IgnoreOnIsolate=yes
[Service]
DeviceAllow=char-* rw
+Environment=SYSTEMD_JOURNAL_COMPACT=0
ExecStart={{LIBEXECDIR}}/systemd-journald
FileDescriptorStoreMax=4224
IPAddressDeny=any
diff --git a/units/systemd-journald@.service.in b/units/systemd-journald@.service.in
index c3bcb08533..8780783cf6 100644
--- a/units/systemd-journald@.service.in
+++ b/units/systemd-journald@.service.in
@@ -21,6 +21,7 @@ Conflicts=soft-reboot.target
[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={{LIBEXECDIR}}/systemd-journald %i
FileDescriptorStoreMax=4224
Group=systemd-journal
--
2.34.1

View File

@ -0,0 +1,40 @@
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

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

View File

@ -1,27 +0,0 @@
# 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,10 @@
# 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 /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

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

View File

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

View File

@ -1,650 +0,0 @@
<!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

@ -1,539 +0,0 @@
# 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

@ -1,539 +0,0 @@
# 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

@ -1,540 +0,0 @@
# 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

@ -1,540 +0,0 @@
# 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

@ -1,524 +0,0 @@
# 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

@ -24,13 +24,12 @@ else
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
# Flatcar: mark as stable
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~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
inherit secureboot systemd tmpfiles toolchain-funcs udev
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="http://systemd.io/"
@ -101,6 +100,11 @@ DEPEND="${COMMON_DEPEND}
PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]'
# 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
@ -129,13 +133,13 @@ RDEPEND="${COMMON_DEPEND}
>=acct-user/systemd-resolve-0-r1
>=acct-user/systemd-timesync-0-r1
>=sys-apps/baselayout-2.2
sys-apps/kbd
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(-)]
@ -184,11 +188,6 @@ 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."
@ -248,6 +247,14 @@ src_unpack() {
src_prepare() {
local PATCHES=(
# 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"
)
if ! use vanilla; then
@ -257,6 +264,23 @@ src_prepare() {
)
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
}
@ -269,16 +293,27 @@ src_configure() {
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"
# default is developer, bug 918671
-Dmode=release
-Dsupport-url="https://gentoo.org/support/"
# 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)"
-Dsplit-bin=false
$(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)"
# Disable compatibility with sysvinit
-Dsysvinit-path=
-Dsysvrcnd-path=
@ -325,9 +360,11 @@ multilib_src_configure() {
$(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"
# 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
@ -351,6 +388,42 @@ multilib_src_configure() {
$(meson_native_true tmpfiles)
$(meson_native_true vconsole)
$(meson_native_enabled vmspawn)
# 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
-Ddefault-mdns=no
)
meson_src_configure "${myconf[@]}"
@ -363,11 +436,16 @@ multilib_src_test() {
}
multilib_src_install_all() {
# 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
dodoc "${FILESDIR}"/nsswitch.conf
# Flatcar: Do not install sample nsswitch.conf, we don't
# provide it.
# dodoc "${FILESDIR}"/nsswitch.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/legacy.conf
@ -385,6 +463,8 @@ multilib_src_install_all() {
# 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
@ -393,25 +473,134 @@ multilib_src_install_all() {
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
# 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 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
# 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 boot; 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}/usr/lib/systemd/system-preset/90-systemd.preset" || die
insinto /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'
use ukify && python_fix_shebang "${ED}"
use boot && secureboot_auto_sign
}
# 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}"
if use boot; then
python_fix_shebang "${ED}"
secureboot_auto_sign
fi
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
@ -462,6 +651,21 @@ pkg_preinst() {
dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
fi
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
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."
@ -481,13 +685,15 @@ pkg_postinst() {
# 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
# 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"

View File

@ -1,524 +0,0 @@
# 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
}