project-edgeos: Delete fork of systemd.
The custom patches have been put in project-lakitu.
BUG=b/180686339
TEST=none
RELEASE_NOTE=none
Change-Id: I248799e80c7ffd0121112f4b0c9d4d6e23c9c78a
Reviewed-on: https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/22071
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Roy Yang <royyang@google.com>
diff --git a/project-edgeos/sys-apps/systemd/Manifest b/project-edgeos/sys-apps/systemd/Manifest
deleted file mode 100644
index 5e197ea..0000000
--- a/project-edgeos/sys-apps/systemd/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST systemd-stable-247.tar.gz 9887738 BLAKE2B 9232e17c73aec4c7409db0fe522443f0a9d3a897009493feec233473f4d0eaee3913fcacc1210f6a9432d5393d0efc3fbd0963ce4ad7619774f5d511900aee6f SHA512 ea2f4c27a129b0c23ded02241e349f1fe4acb1ff4d0515f0f2a69e08ad4427a88795d483ea42414bbfbc5960f979db6fb1ed5f1ae9ef8e09586206de399f4e56
-DIST systemd-stable-248.tar.gz 10307470 BLAKE2B 2506354bc739dbf5706622f14656d9745f2e794e819846ebc57d0107eaa88461cd1c3049c260ebec2523e2f4da3343e161c81fc8f3c76dd98b5e6c0fb6a8212b SHA512 1aa3f30a387a3c3b54aacbe9c01f9de02d740e9d23dbd8d01c365a1047963169155480b4002fffa641baec8b0437e7ad2b04b132939b6169df4728a5ed7cca22
diff --git a/project-edgeos/sys-apps/systemd/files/00-lakitu.preset b/project-edgeos/sys-apps/systemd/files/00-lakitu.preset
deleted file mode 100644
index a0a6bde..0000000
--- a/project-edgeos/sys-apps/systemd/files/00-lakitu.preset
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Lakitu specific systemd configuration. Disable everything.
-disable *
diff --git a/project-edgeos/sys-apps/systemd/files/225-Force-re-creation-of-etc-localtime-symlink.patch b/project-edgeos/sys-apps/systemd/files/225-Force-re-creation-of-etc-localtime-symlink.patch
deleted file mode 100644
index 04a3b0f..0000000
--- a/project-edgeos/sys-apps/systemd/files/225-Force-re-creation-of-etc-localtime-symlink.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 04376c6c1710a8136469e8b26398856d7ed1511d Mon Sep 17 00:00:00 2001
-From: Aditya Kali <adityakali@google.com>
-Date: Mon, 25 Apr 2016 15:41:21 -0700
-Subject: [PATCH] Force re-creation of /etc/localtime symlink
-
-Signed-off-by: Aditya Kali <adityakali@google.com>
----
- tmpfiles.d/etc.conf.m4 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tmpfiles.d/etc.conf.m4 b/tmpfiles.d/etc.conf.m4
-index f82e0b82ce..a11e970a88 100644
---- a/tmpfiles.d/etc.conf.m4
-+++ b/tmpfiles.d/etc.conf.m4
-@@ -9,6 +9,7 @@
-
- L /etc/os-release - - - - ../usr/lib/os-release
- L+ /etc/mtab - - - - ../proc/self/mounts
-+L+ /etc/localtime - - - - ../usr/share/zoneinfo/UTC
- m4_ifdef(`HAVE_SMACK_RUN_LABEL',
- t /etc/mtab - - - - security.SMACK64=_
- )m4_dnl
diff --git a/project-edgeos/sys-apps/systemd/files/225-allow-networkd-to-hostnamed.patch b/project-edgeos/sys-apps/systemd/files/225-allow-networkd-to-hostnamed.patch
deleted file mode 100644
index 51574dc..0000000
--- a/project-edgeos/sys-apps/systemd/files/225-allow-networkd-to-hostnamed.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-commit e58597b091dc48ef81ecd361e6f0f9ae3561a44c
-Author: Amey Deshpande <ameyd@google.com>
-Date: Wed Feb 17 12:08:40 2016 -0800
-
- hostnamed: allow systemd-network user to call SetHostname
-
- systemd-networkd runs as a non-root user and does not have CAP_SYS_ADMIN.
- systemd-hostnamed requires that for SetHostname method, either the
- caller should have CAP_SYS_ADMIN or a PolKit rule should whitelist the
- caller uid.
-
- Lakitu doesn't ship with PolKit. This patch tweaks systemd-hostnamed to
- whitelist the well-known user of systemd-networkd to call SetHostname
- method. All other Set methods remain unchanged.
-
-diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
-index a78516c..1a12509 100644
---- a/src/hostname/hostnamed.c
-+++ b/src/hostname/hostnamed.c
-@@ -37,6 +37,8 @@
-
- #define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:")
-
-+#define ALLOW_NETWORKD_TO_SET_HOSTNAME 1
-+
- enum {
- PROP_HOSTNAME,
- PROP_STATIC_HOSTNAME,
-@@ -404,6 +406,19 @@ static int property_get_chassis(
- return sd_bus_message_append(reply, "s", name);
- }
-
-+static uid_t get_good_user_uid(void) {
-+#ifdef ALLOW_NETWORKD_TO_SET_HOSTNAME
-+ const char *username = "systemd-network";
-+ uid_t uid;
-+ if (get_user_creds(&username, &uid, NULL, NULL, NULL, 0)) {
-+ return UID_INVALID;
-+ }
-+ return uid;
-+#else
-+ return UID_INVALID;
-+#endif
-+}
-+
- static int method_set_hostname(sd_bus_message *m, void *userdata, sd_bus_error *error) {
- Context *c = userdata;
- const char *name;
-@@ -435,7 +450,7 @@ static int method_set_hostname(sd_bus_message *m, void *userdata, sd_bus_error *
- CAP_SYS_ADMIN,
- "org.freedesktop.hostname1.set-hostname",
- interactive,
-- UID_INVALID,
-+ get_good_user_uid(),
- &c->polkit_registry,
- error);
- if (r < 0)
diff --git a/project-edgeos/sys-apps/systemd/files/225-audit-set-pid.patch b/project-edgeos/sys-apps/systemd/files/225-audit-set-pid.patch
deleted file mode 100644
index 3d6de86..0000000
--- a/project-edgeos/sys-apps/systemd/files/225-audit-set-pid.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-commit a355bea478bd9171ddb902cc1ad0af1468662501
-Author: Andrey Ulanov <andreyu@google.com>
-Date: Thu Feb 23 17:41:37 2017 -0800
-
- journald: When enabling audit also set audit PID.
-
- When audit PID is set kernel will not log audit messages to dmesg
- as long as that process is running.
- When the PID is set we no longer need to receive the same messages via
- multicast.
-
----
- src/journal/journald-audit.c | 51 ++++++++++++++++++++++++++++----------------
- 1 file changed, 33 insertions(+), 18 deletions(-)
-
-diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
-index 744f750ca3..a35dc3ae67 100644
---- a/src/journal/journald-audit.c
-+++ b/src/journal/journald-audit.c
-@@ -1,5 +1,7 @@
- /* SPDX-License-Identifier: LGPL-2.1-or-later */
-
-+#include <unistd.h>
-+
- #include "alloc-util.h"
- #include "audit-type.h"
- #include "errno-util.h"
-@@ -435,6 +437,14 @@ void server_process_audit_message(
- return;
- }
-
-+ /* Even though we did not join multicast group the kernel may
-+ * still send us messages addressed to the group. This leads
-+ * to messages being duplicated twice. So here we ignore multicast messages. */
-+ if (sa->nl.nl_groups) {
-+ log_debug("Audit netlink message via multicast group.");
-+ return;
-+ }
-+
- if (!ucred || ucred->pid != 0) {
- log_debug("Audit netlink message with invalid credentials.");
- return;
-@@ -456,7 +466,7 @@ void server_process_audit_message(
- process_audit_string(s, nl->nlmsg_type, NLMSG_DATA(nl), nl->nlmsg_len - ALIGN(sizeof(struct nlmsghdr)));
- }
-
--static int enable_audit(int fd, bool b) {
-+static int audit_set_status(int fd, struct audit_status *status) {
- struct {
- union {
- struct nlmsghdr header;
-@@ -469,12 +479,12 @@ static int enable_audit(int fd, bool b) {
- .header.nlmsg_flags = NLM_F_REQUEST,
- .header.nlmsg_seq = 1,
- .header.nlmsg_pid = 0,
-- .body.mask = AUDIT_STATUS_ENABLED,
-- .body.enabled = b,
-+ .body = *status
- };
- union sockaddr_union sa = {
- .nl.nl_family = AF_NETLINK,
- .nl.nl_pid = 0,
-+ .nl.nl_groups = 0,
- };
- struct iovec iovec = {
- .iov_base = &request,
-@@ -501,16 +511,26 @@ static int enable_audit(int fd, bool b) {
- return 0;
- }
-
-+static int enable_audit(int fd, bool b) {
-+ struct audit_status status = {
-+ .mask = AUDIT_STATUS_ENABLED,
-+ .enabled = b,
-+ };
-+ return audit_set_status(fd, &status);
-+}
-+
-+static int set_audit_pid(int fd, pid_t pid) {
-+ struct audit_status status = {
-+ .mask = AUDIT_STATUS_PID,
-+ .pid = pid,
-+ };
-+ return audit_set_status(fd, &status);
-+}
-+
- int server_open_audit(Server *s) {
- int r;
-
- if (s->audit_fd < 0) {
-- static const union sockaddr_union sa = {
-- .nl.nl_family = AF_NETLINK,
-- .nl.nl_pid = 0,
-- .nl.nl_groups = AUDIT_NLGRP_READLOG,
-- };
--
- s->audit_fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
- if (s->audit_fd < 0) {
- if (ERRNO_IS_NOT_SUPPORTED(errno))
-@@ -520,15 +540,6 @@ int server_open_audit(Server *s) {
-
- return 0;
- }
--
-- if (bind(s->audit_fd, &sa.sa, sizeof(sa.nl)) < 0) {
-- log_warning_errno(errno,
-- "Failed to join audit multicast group. "
-- "The kernel is probably too old or multicast reading is not supported. "
-- "Ignoring: %m");
-- s->audit_fd = safe_close(s->audit_fd);
-- return 0;
-- }
- } else
- (void) fd_nonblock(s->audit_fd, true);
-
-@@ -551,5 +562,9 @@ int server_open_audit(Server *s) {
- log_debug("Auditing in kernel turned off.");
- }
-
-+ r = set_audit_pid(s->audit_fd, getpid());
-+ if (r < 0)
-+ log_warning_errno(r, "Failed to issue set audit pid: %m");
-+
- return 0;
- }
diff --git a/project-edgeos/sys-apps/systemd/files/225-networkd-default-ip-forwarding-to-kernel.patch b/project-edgeos/sys-apps/systemd/files/225-networkd-default-ip-forwarding-to-kernel.patch
deleted file mode 100644
index 39ecad2..0000000
--- a/project-edgeos/sys-apps/systemd/files/225-networkd-default-ip-forwarding-to-kernel.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From 7f7152350c5a96fa3a73f4258a3294fe5b9c8e20 Mon Sep 17 00:00:00 2001
-From: Daniel Wang <wonderfly@google.com>
-Date: Mon, 19 Dec 2016 15:23:59 -0800
-Subject: [PATCH] networkd: default to not touch ip forwarding 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 3254641461..d95db8fad9 100644
---- a/src/network/networkd-network.c
-+++ b/src/network/networkd-network.c
-@@ -407,6 +407,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
-
- /* If LinkLocalAddressing= is not set, then set to ADDRESS_FAMILY_IPV6 later. */
- .link_local = _ADDRESS_FAMILY_INVALID,
-+ .ip_forward = ADDRESS_FAMILY_NO,
- .ipv6ll_address_gen_mode = _IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID,
-
- .ipv4_accept_local = -1,
diff --git a/project-edgeos/sys-apps/systemd/files/228-noclean-tmp.patch b/project-edgeos/sys-apps/systemd/files/228-noclean-tmp.patch
deleted file mode 100644
index 1497f21..0000000
--- a/project-edgeos/sys-apps/systemd/files/228-noclean-tmp.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From b23c098d5787e06770872b19f83fffa14d8a7d14 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Fri, 25 Sep 2015 10:26:18 -0400
-Subject: [PATCH] tmpfiles: Disable cleaning of /tmp and /var/tmp
-
-Bug: https://bugs.gentoo.org/490676
----
- tmpfiles.d/tmp.conf | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tmpfiles.d/tmp.conf b/tmpfiles.d/tmp.conf
-index fe5225d751..3e0c75ae5e 100644
---- a/tmpfiles.d/tmp.conf
-+++ b/tmpfiles.d/tmp.conf
-@@ -8,5 +8,5 @@
- # See tmpfiles.d(5) for details
-
- # Clear tmp directories separately, to make them easier to override
--q /tmp 1777 root root 10d
--q /var/tmp 1777 root root 30d
-+q /tmp 1777 root root
-+q /var/tmp 1777 root root
diff --git a/project-edgeos/sys-apps/systemd/files/232-single-label-hostname.patch b/project-edgeos/sys-apps/systemd/files/232-single-label-hostname.patch
deleted file mode 100644
index 828e13d..0000000
--- a/project-edgeos/sys-apps/systemd/files/232-single-label-hostname.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From d4b37f7a7b4d7ee2f8c23d63093ac32810bf0621 Mon Sep 17 00:00:00 2001
-From: Daniel Wang <wonderfly@google.com>
-Date: Mon, 6 Mar 2017 15:35:13 -0800
-Subject: [PATCH 1/1] libsystemd-networkd: use single-label hostname.
-
----
- src/libsystemd-network/sd-dhcp-lease.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
-index 8387b185c..2d60d4223 100644
---- a/src/libsystemd-network/sd-dhcp-lease.c
-+++ b/src/libsystemd-network/sd-dhcp-lease.c
-@@ -141,12 +141,27 @@ int sd_dhcp_lease_get_domainname(sd_dhcp_lease *lease, const char **domainname)
- }
-
- int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname) {
-+ char *firstdot = NULL;
-+
- assert_return(lease, -EINVAL);
- assert_return(hostname, -EINVAL);
-
- if (!lease->hostname)
- return -ENODATA;
-
-+ // Lakitu-specific behavior: always use single-label hostname
-+ // or unqualified domain-name instead of FQDN.
-+ // Lakitu configures systemd-networkd to set the hostname via
-+ // DHCP. RFC 1497 says the DHCP server may send a
-+ // fully-qualified domain name as the hostname. The FQDN can
-+ // be 255 bytes long, but the hostname on Linux is typically
-+ // limited to 64 bytes. To avoid dropping the FQDN as
-+ // "invalid" for its length, we mutate |hostname| such that it
-+ // contains only the single-label hostname.
-+ if ((firstdot = strchr(lease->hostname, '.')) != NULL) {
-+ *firstdot = 0;
-+ }
-+
- *hostname = lease->hostname;
- return 0;
- }
---
-2.12.0.rc1.440.g5b76565f74-goog
-
diff --git a/project-edgeos/sys-apps/systemd/files/232-tmpfiles-no-srv.patch b/project-edgeos/sys-apps/systemd/files/232-tmpfiles-no-srv.patch
deleted file mode 100644
index 0531a5c..0000000
--- a/project-edgeos/sys-apps/systemd/files/232-tmpfiles-no-srv.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-diff --git a/tmpfiles.d/home.conf b/tmpfiles.d/home.conf
-index aa652b1..b111167 100644
---- a/tmpfiles.d/home.conf
-+++ b/tmpfiles.d/home.conf
-@@ -8,4 +8,3 @@
- # See tmpfiles.d(5) for details
-
- Q /home 0755 - - -
--q /srv 0755 - - -
diff --git a/project-edgeos/sys-apps/systemd/files/239-Use-chronyd-as-the-default-NTP-service.patch b/project-edgeos/sys-apps/systemd/files/239-Use-chronyd-as-the-default-NTP-service.patch
deleted file mode 100644
index ede5a8ea..0000000
--- a/project-edgeos/sys-apps/systemd/files/239-Use-chronyd-as-the-default-NTP-service.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From 5665e543a7a6d56892e5517cbd897d5a89f3ef2c Mon Sep 17 00:00:00 2001
-From: Roy Yang <royyang@google.com>
-Date: Thu, 25 Jun 2020 13:59:31 -0700
-Subject: [PATCH] Use chronyd as the default NTP service
-
----
- units/systemd-timedated.service.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/units/systemd-timedated.service.in b/units/systemd-timedated.service.in
-index 6f476173b6..31f0b11b2f 100644
---- a/units/systemd-timedated.service.in
-+++ b/units/systemd-timedated.service.in
-@@ -17,6 +17,7 @@ Documentation=man:org.freedesktop.timedate1(5)
- BusName=org.freedesktop.timedate1
- CapabilityBoundingSet=CAP_SYS_TIME
- DeviceAllow=char-rtc r
-+Environment=SYSTEMD_TIMEDATED_NTP_SERVICES=chronyd.service
- ExecStart=@rootlibexecdir@/systemd-timedated
- IPAddressDeny=any
- LockPersonality=yes
diff --git a/project-edgeos/sys-apps/systemd/files/239-avoid-render-and-kvm-group.patch b/project-edgeos/sys-apps/systemd/files/239-avoid-render-and-kvm-group.patch
deleted file mode 100644
index 188d766..0000000
--- a/project-edgeos/sys-apps/systemd/files/239-avoid-render-and-kvm-group.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From afbe8a6246228ee10e60bdbe5f03c18d94a13214 Mon Sep 17 00:00:00 2001
-From: vaibhavrustagi <vaibhavrustagi@google.com>
-Date: Mon, 15 Apr 2019 16:16:21 -0700
-Subject: [PATCH] lakitu: Avoid render and kvm group
-
-These groups are not available and generates a
-warning during boot-up:
-
- systemd-udevd: Specified group 'render' unknown
- systemd-udevd: Specified group 'kvm' unknown
----
- rules.d/50-udev-default.rules.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/rules.d/50-udev-default.rules.in b/rules.d/50-udev-default.rules.in
-index 50747a1988..8c6e80885b 100644
---- a/rules.d/50-udev-default.rules.in
-+++ b/rules.d/50-udev-default.rules.in
-@@ -36,8 +36,8 @@ SUBSYSTEM=="dvb", GROUP="video"
- SUBSYSTEM=="media", GROUP="video"
- SUBSYSTEM=="cec", GROUP="video"
-
--SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="@GROUP_RENDER_MODE@"
--SUBSYSTEM=="kfd", GROUP="render", MODE="@GROUP_RENDER_MODE@"
-+#SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="@GROUP_RENDER_MODE@"
-+#SUBSYSTEM=="kfd", GROUP="render", MODE="@GROUP_RENDER_MODE@"
-
- # When using static_node= with non-default permissions, also update
- # tmpfiles.d/static-nodes-permissions.conf.in to keep permissions synchronized.
-@@ -82,7 +82,7 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
- KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
-
- # The static_node is required on s390x and ppc (they are using MODULE_ALIAS)
--KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=kvm"
-+#KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=kvm"
-
- KERNEL=="udmabuf", GROUP="kvm"
-
diff --git a/project-edgeos/sys-apps/systemd/files/239-change-paths-for-udev-rules-init-reboot.patch b/project-edgeos/sys-apps/systemd/files/239-change-paths-for-udev-rules-init-reboot.patch
deleted file mode 100644
index 2ee7cfa..0000000
--- a/project-edgeos/sys-apps/systemd/files/239-change-paths-for-udev-rules-init-reboot.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From a6f4ba1ce464697103d1e752be7db1545ae69957 Mon Sep 17 00:00:00 2001
-From: vaibhavrustagi <vaibhavrustagi@google.com>
-Date: Wed, 24 Apr 2019 08:38:01 -0700
-Subject: [PATCH] Change paths for udev rules, init, halt, reboot, shutdown
- telinit, poweroff
-
----
- meson.build | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 04331dd41a..7dac9e251c 100644
---- a/meson.build
-+++ b/meson.build
-@@ -124,6 +124,6 @@ systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
- systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
- systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
- systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
--udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
-+udevlibexecdir = '/lib/udev'
- udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
- udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
-@@ -1466,7 +1466,7 @@ executable('systemd',
-
- meson.add_install_script(meson_make_symlink,
- join_paths(rootlibexecdir, 'systemd'),
-- join_paths(rootsbindir, 'init'))
-+ join_paths('/sbin', 'init'))
-
- exe = executable('systemd-analyze',
- systemd_analyze_sources,
-@@ -1773,7 +1773,7 @@ endif
- foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit']
- meson.add_install_script(meson_make_symlink,
- join_paths(rootbindir, 'systemctl'),
-- join_paths(rootsbindir, alias))
-+ join_paths('/sbin', alias))
- endforeach
-
- if conf.get('ENABLE_BACKLIGHT') == 1
---
-2.21.0.593.g511ec345e18-goog
-
diff --git a/project-edgeos/sys-apps/systemd/files/239-default-target.patch b/project-edgeos/sys-apps/systemd/files/239-default-target.patch
deleted file mode 100644
index 22c009a..0000000
--- a/project-edgeos/sys-apps/systemd/files/239-default-target.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 9997ff71a7ffbdfc00adabea882d79c25e1abe24 Mon Sep 17 00:00:00 2001
-From: Daniel Wang <wonderfly@google.com>
-Date: Fri, 14 Feb 2020 14:39:06 -0800
-Subject: [PATCH] systemd: Make default.target point to multi-user.target
-
-The upstream default, graphical.target, doesn't make sense for us.
----
- units/meson.build | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/units/meson.build b/units/meson.build
-index ba60eb7fc1..9664c034fd 100644
---- a/units/meson.build
-+++ b/units/meson.build
-@@ -22,7 +22,7 @@ units = [
- 'multi-user.target.wants/'],
- ['getty-pre.target', ''],
- ['graphical.target', '',
-- 'default.target' + (with_runlevels ? ' runlevel5.target' : '')],
-+ (with_runlevels ? ' runlevel5.target' : '')],
- ['halt.target', ''],
- ['hibernate.target', 'ENABLE_HIBERNATE'],
- ['hybrid-sleep.target', 'ENABLE_HIBERNATE'],
-@@ -45,7 +45,7 @@ units = [
- ['machines.target', 'ENABLE_MACHINED'],
- ['modprobe@.service', ''],
- ['multi-user.target', '',
-- (with_runlevels ? 'runlevel2.target runlevel3.target runlevel4.target' : '')],
-+ 'default.target' + (with_runlevels ? 'runlevel2.target runlevel3.target runlevel4.target' : '')],
- ['network-online.target', ''],
- ['network-pre.target', ''],
- ['network.target', ''],
diff --git a/project-edgeos/sys-apps/systemd/files/247-do-not-set-broadcast.patch b/project-edgeos/sys-apps/systemd/files/247-do-not-set-broadcast.patch
deleted file mode 100644
index 2744117..0000000
--- a/project-edgeos/sys-apps/systemd/files/247-do-not-set-broadcast.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit df8aa086420e6ce61e32898b2bb7c88b87fd1c43
-Author: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Wed Dec 2 19:19:06 2020 +0900
-
- network: do not set broadcast if prefixlen is 31 or 32
-
- After fe841414ef157f7f01d339c5d5730126e7b5fe0a, broadcast address is
- also compared with existing one to determine whether the address is
- foregin or not. So, the address object should not contain unnecessary
- information.
-
- Fixes #17803.
-
-diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
-index 8f661c646f..14e7a28774 100644
---- a/src/network/networkd-dhcp4.c
-+++ b/src/network/networkd-dhcp4.c
-@@ -865,7 +865,8 @@ static int dhcp4_update_address(Link *link, bool announce) {
- addr->cinfo.ifa_prefered = lifetime;
- addr->cinfo.ifa_valid = lifetime;
- addr->prefixlen = prefixlen;
-- addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
-+ if (prefixlen <= 30)
-+ addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
- SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
-
- /* allow reusing an existing address and simply update its lifetime
diff --git a/project-edgeos/sys-apps/systemd/files/247-fix-broadcast-verification.patch b/project-edgeos/sys-apps/systemd/files/247-fix-broadcast-verification.patch
deleted file mode 100644
index 587a86d..0000000
--- a/project-edgeos/sys-apps/systemd/files/247-fix-broadcast-verification.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-commit 05a7023d242b9012216c661f253df1c9c3d45b39
-Author: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Wed Dec 2 19:26:41 2020 +0900
-
- network: fix verification for broadcast address
-
- Fixes a bug caused by fe841414ef157f7f01d339c5d5730126e7b5fe0a.
-
-diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
-index 92237c4e0f..0eb47f6e65 100644
---- a/src/network/networkd-address.c
-+++ b/src/network/networkd-address.c
-@@ -1809,10 +1809,12 @@ static int address_section_verify(Address *address) {
- address->section->filename, address->section->line);
- }
-
-- if (address->family == AF_INET && in_addr_is_null(address->family, &address->in_addr_peer) &&
-- address->broadcast.s_addr == 0 && address->prefixlen <= 30)
-- address->broadcast.s_addr = address->in_addr.in.s_addr | htobe32(0xfffffffflu >> address->prefixlen);
-- else if (address->broadcast.s_addr != 0) {
-+ if (address->family == AF_INET &&
-+ in_addr_is_null(address->family, &address->in_addr_peer) &&
-+ address->prefixlen <= 30) {
-+ if (address->broadcast.s_addr == 0)
-+ address->broadcast.s_addr = address->in_addr.in.s_addr | htobe32(0xfffffffflu >> address->prefixlen);
-+ } else if (address->broadcast.s_addr != 0) {
- log_warning("%s: broadcast address is set for IPv6 address or IPv4 address with prefixlength larger than 30. "
- "Ignoring Broadcast= setting in the [Address] section from line %u.",
- address->section->filename, address->section->line);
diff --git a/project-edgeos/sys-apps/systemd/files/247-ignore-broadcast.patch b/project-edgeos/sys-apps/systemd/files/247-ignore-broadcast.patch
deleted file mode 100644
index aca979a..0000000
--- a/project-edgeos/sys-apps/systemd/files/247-ignore-broadcast.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-commit 2a236f9fc0ff8fb2152032551436fde74da7217a
-Author: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Thu Dec 3 10:19:35 2020 +0900
-
- network: ignore broadcast address for /31 or /32 addresses
-
- As they do not have broadcast address.
- See https://tools.ietf.org/html/rfc3021
-
-diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
-index 0eb47f6e65..0c32ab8ff3 100644
---- a/src/network/networkd-address.c
-+++ b/src/network/networkd-address.c
-@@ -144,29 +144,35 @@ Address *address_free(Address *address) {
- return mfree(address);
- }
-
-+static bool address_may_have_broadcast(const Address *a) {
-+ assert(a);
-+
-+ /* A /31 or /32 IPv4 address does not have a broadcast address.
-+ * See https://tools.ietf.org/html/rfc3021 */
-+
-+ return a->family == AF_INET && in4_addr_is_null(&a->in_addr_peer.in) && a->prefixlen <= 30;
-+}
-+
- void address_hash_func(const Address *a, struct siphash *state) {
- assert(a);
-
- siphash24_compress(&a->family, sizeof(a->family), state);
-
-- switch (a->family) {
-- case AF_INET:
-- siphash24_compress(&a->broadcast, sizeof(a->broadcast), state);
-+ if (!IN_SET(a->family, AF_INET, AF_INET6))
-+ /* treat non-IPv4 or IPv6 address family as AF_UNSPEC */
-+ return;
-+
-+ if (a->family == AF_INET)
- siphash24_compress_string(a->label, state);
-
-- _fallthrough_;
-- case AF_INET6:
-- siphash24_compress(&a->prefixlen, sizeof(a->prefixlen), state);
-- /* local address */
-- siphash24_compress(&a->in_addr, FAMILY_ADDRESS_SIZE(a->family), state);
-- /* peer address */
-- siphash24_compress(&a->in_addr_peer, FAMILY_ADDRESS_SIZE(a->family), state);
-+ siphash24_compress(&a->prefixlen, sizeof(a->prefixlen), state);
-+ /* local address */
-+ siphash24_compress(&a->in_addr, FAMILY_ADDRESS_SIZE(a->family), state);
-+ /* peer address */
-+ siphash24_compress(&a->in_addr_peer, FAMILY_ADDRESS_SIZE(a->family), state);
-
-- break;
-- default:
-- /* treat any other address family as AF_UNSPEC */
-- break;
-- }
-+ if (address_may_have_broadcast(a))
-+ siphash24_compress(&a->broadcast, sizeof(a->broadcast), state);
- }
-
- int address_compare_func(const Address *a1, const Address *a2) {
-@@ -176,32 +182,32 @@ int address_compare_func(const Address *a1, const Address *a2) {
- if (r != 0)
- return r;
-
-- switch (a1->family) {
-- /* use the same notion of equality as the kernel does */
-- case AF_INET:
-- r = CMP(a1->broadcast.s_addr, a2->broadcast.s_addr);
-- if (r != 0)
-- return r;
-+ if (!IN_SET(a1->family, AF_INET, AF_INET6))
-+ /* treat non-IPv4 or IPv6 address family as AF_UNSPEC */
-+ return 0;
-
-+ if (a1->family == AF_INET) {
- r = strcmp_ptr(a1->label, a2->label);
- if (r != 0)
- return r;
-+ }
-
-- _fallthrough_;
-- case AF_INET6:
-- r = CMP(a1->prefixlen, a2->prefixlen);
-- if (r != 0)
-- return r;
-+ r = CMP(a1->prefixlen, a2->prefixlen);
-+ if (r != 0)
-+ return r;
-
-- r = memcmp(&a1->in_addr, &a2->in_addr, FAMILY_ADDRESS_SIZE(a1->family));
-- if (r != 0)
-- return r;
-+ r = memcmp(&a1->in_addr, &a2->in_addr, FAMILY_ADDRESS_SIZE(a1->family));
-+ if (r != 0)
-+ return r;
-
-- return memcmp(&a1->in_addr_peer, &a2->in_addr_peer, FAMILY_ADDRESS_SIZE(a1->family));
-- default:
-- /* treat any other address family as AF_UNSPEC */
-- return 0;
-- }
-+ r = memcmp(&a1->in_addr_peer, &a2->in_addr_peer, FAMILY_ADDRESS_SIZE(a1->family));
-+ if (r != 0)
-+ return r;
-+
-+ if (address_may_have_broadcast(a1))
-+ return CMP(a1->broadcast.s_addr, a2->broadcast.s_addr);
-+
-+ return 0;
- }
-
- DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(address_hash_ops, Address, address_hash_func, address_compare_func, address_free);
-@@ -222,18 +228,21 @@ static int address_copy(Address *dest, const Address *src) {
- assert(dest);
- assert(src);
-
-- r = free_and_strdup(&dest->label, src->label);
-- if (r < 0)
-- return r;
-+ if (src->family == AF_INET) {
-+ r = free_and_strdup(&dest->label, src->label);
-+ if (r < 0)
-+ return r;
-+ }
-
- dest->family = src->family;
- dest->prefixlen = src->prefixlen;
- dest->scope = src->scope;
- dest->flags = src->flags;
-- dest->broadcast = src->broadcast;
- dest->cinfo = src->cinfo;
- dest->in_addr = src->in_addr;
- dest->in_addr_peer = src->in_addr_peer;
-+ if (address_may_have_broadcast(src))
-+ dest->broadcast = src->broadcast;
- dest->duplicate_address_detection = src->duplicate_address_detection;
-
- return 0;
-@@ -840,13 +849,13 @@ int address_configure(
- r = netlink_message_append_in_addr_union(req, IFA_ADDRESS, address->family, &address->in_addr_peer);
- if (r < 0)
- return log_link_error_errno(link, r, "Could not append IFA_ADDRESS attribute: %m");
-- } else if (address->family == AF_INET && address->prefixlen <= 30) {
-+ } else if (address_may_have_broadcast(address)) {
- r = sd_netlink_message_append_in_addr(req, IFA_BROADCAST, &address->broadcast);
- if (r < 0)
- return log_link_error_errno(link, r, "Could not append IFA_BROADCAST attribute: %m");
- }
-
-- if (address->label) {
-+ if (address->family == AF_INET && address->label) {
- r = sd_netlink_message_append_string(req, IFA_LABEL, address->label);
- if (r < 0)
- return log_link_error_errno(link, r, "Could not append IFA_LABEL attribute: %m");
-@@ -1809,9 +1818,7 @@ static int address_section_verify(Address *address) {
- address->section->filename, address->section->line);
- }
-
-- if (address->family == AF_INET &&
-- in_addr_is_null(address->family, &address->in_addr_peer) &&
-- address->prefixlen <= 30) {
-+ if (address_may_have_broadcast(address)) {
- if (address->broadcast.s_addr == 0)
- address->broadcast.s_addr = address->in_addr.in.s_addr | htobe32(0xfffffffflu >> address->prefixlen);
- } else if (address->broadcast.s_addr != 0) {
diff --git a/project-edgeos/sys-apps/systemd/files/248-do-not-use-strdupa-on-a-patch.patch b/project-edgeos/sys-apps/systemd/files/248-do-not-use-strdupa-on-a-patch.patch
deleted file mode 100644
index 8f3083b..0000000
--- a/project-edgeos/sys-apps/systemd/files/248-do-not-use-strdupa-on-a-patch.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 441e0115646d54f080e5c3bb0ba477c892861ab9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Wed, 23 Jun 2021 11:46:41 +0200
-Subject: [PATCH] basic/unit-name: do not use strdupa() on a path
-
-The path may have unbounded length, for example through a fuse mount.
-
-CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and
-ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo
-and each mountpoint is passed to mount_setup_unit(), which calls
-unit_name_path_escape() underneath. A local attacker who is able to mount a
-filesystem with a very long path can crash systemd and the whole system.
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1970887
-
-The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we
-can't easily check the length after simplification before doing the
-simplification, which in turns uses a copy of the string we can write to.
-So we can't reject paths that are too long before doing the duplication.
-Hence the most obvious solution is to switch back to strdup(), as before
-7410616cd9dbbec97cf98d75324da5cda2b2f7a2.
----
- src/basic/unit-name.c | 13 +++++--------
- 1 file changed, 5 insertions(+), 8 deletions(-)
-
-diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
-index 284a77348316..a22763443fdd 100644
---- a/src/basic/unit-name.c
-+++ b/src/basic/unit-name.c
-@@ -378,12 +378,13 @@ int unit_name_unescape(const char *f, char **ret) {
- }
-
- int unit_name_path_escape(const char *f, char **ret) {
-- char *p, *s;
-+ _cleanup_free_ char *p = NULL;
-+ char *s;
-
- assert(f);
- assert(ret);
-
-- p = strdupa(f);
-+ p = strdup(f);
- if (!p)
- return -ENOMEM;
-
-@@ -395,13 +396,9 @@ int unit_name_path_escape(const char *f, char **ret) {
- if (!path_is_normalized(p))
- return -EINVAL;
-
-- /* Truncate trailing slashes */
-+ /* Truncate trailing slashes and skip leading slashes */
- delete_trailing_chars(p, "/");
--
-- /* Truncate leading slashes */
-- p = skip_leading_chars(p, "/");
--
-- s = unit_name_escape(p);
-+ s = unit_name_escape(skip_leading_chars(p, "/"));
- }
- if (!s)
- return -ENOMEM;
diff --git a/project-edgeos/sys-apps/systemd/files/249-foreignroutingpolicy.patch b/project-edgeos/sys-apps/systemd/files/249-foreignroutingpolicy.patch
deleted file mode 100644
index f1b3ea8..0000000
--- a/project-edgeos/sys-apps/systemd/files/249-foreignroutingpolicy.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-commit d94dfe7053d49fa62c4bfc07b7f3fc2227c10aff
-Author: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Sun Apr 11 21:33:51 2021 +0900
-
- network: introduce ManageForeignRoutingPolicyRules= boolean setting in networkd.conf
-
- The commit 0b81225e5791f660506f7db0ab88078cf296b771 makes that networkd
- remove all foreign rules except those with "proto kernel".
-
- But, in some situation, people may want to manage routing policy rules
- with other tools, e.g. 'ip' command. To support such the situation,
- this introduce ManageForeignRoutingPolicyRules= boolean setting.
-
- Closes #19106.
-
-diff --git a/man/networkd.conf.xml b/man/networkd.conf.xml
-index dcce2095ed..23422c6c94 100644
---- a/man/networkd.conf.xml
-+++ b/man/networkd.conf.xml
-@@ -62,6 +62,15 @@
- If <varname>SpeedMeter=no</varname>, the value is ignored. Defaults to 10sec.</para></listitem>
- </varlistentry>
-
-+ <varlistentry>
-+ <term><varname>ManageForeignRoutingPolicyRules=</varname></term>
-+ <listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove rules
-+ that are not configured in .network files (except for rules with protocol
-+ <literal>kernel</literal>). When false, it will not remove any foreign rules, keeping them even
-+ if they are not configured in a .network file. Defaults to yes.
-+ </para></listitem>
-+ </varlistentry>
-+
- <varlistentry>
- <term><varname>ManageForeignRoutes=</varname></term>
- <listitem><para>A boolean. When true, <command>systemd-networkd</command> will store any routes
-diff --git a/src/network/networkd-gperf.gperf b/src/network/networkd-gperf.gperf
-index b2a2f55790..74d509896a 100644
---- a/src/network/networkd-gperf.gperf
-+++ b/src/network/networkd-gperf.gperf
-@@ -20,9 +20,10 @@ struct ConfigPerfItem;
- %struct-type
- %includes
- %%
--Network.SpeedMeter, config_parse_bool, 0, offsetof(Manager, use_speed_meter)
--Network.SpeedMeterIntervalSec, config_parse_sec, 0, offsetof(Manager, speed_meter_interval_usec)
--Network.ManageForeignRoutes, config_parse_bool, 0, offsetof(Manager, manage_foreign_routes)
--Network.RouteTable, config_parse_route_table_names, 0, 0
--DHCP.DUIDType, config_parse_duid_type, 0, offsetof(Manager, duid)
--DHCP.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Manager, duid)
-+Network.SpeedMeter, config_parse_bool, 0, offsetof(Manager, use_speed_meter)
-+Network.SpeedMeterIntervalSec, config_parse_sec, 0, offsetof(Manager, speed_meter_interval_usec)
-+Network.ManageForeignRoutingPolicyRules, config_parse_bool, 0, offsetof(Manager, manage_foreign_rules)
-+Network.ManageForeignRoutes, config_parse_bool, 0, offsetof(Manager, manage_foreign_routes)
-+Network.RouteTable, config_parse_route_table_names, 0, 0
-+DHCP.DUIDType, config_parse_duid_type, 0, offsetof(Manager, duid)
-+DHCP.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Manager, duid)
-diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
-index a8db2cc44b..20957ecd89 100644
---- a/src/network/networkd-manager.c
-+++ b/src/network/networkd-manager.c
-@@ -380,6 +380,7 @@ int manager_new(Manager **ret) {
- *m = (Manager) {
- .speed_meter_interval_usec = SPEED_METER_DEFAULT_TIME_INTERVAL,
- .manage_foreign_routes = true,
-+ .manage_foreign_rules = true,
- .ethtool_fd = -1,
- };
-
-@@ -655,6 +656,9 @@ static int manager_enumerate_rules(Manager *m) {
- assert(m);
- assert(m->rtnl);
-
-+ if (!m->manage_foreign_rules)
-+ return 0;
-+
- r = sd_rtnl_message_new_routing_policy_rule(m->rtnl, &req, RTM_GETRULE, 0);
- if (r < 0)
- return r;
-diff --git a/src/network/networkd-manager.h b/src/network/networkd-manager.h
-index 7f630fccc7..0fae7a5c2e 100644
---- a/src/network/networkd-manager.h
-+++ b/src/network/networkd-manager.h
-@@ -32,6 +32,7 @@ struct Manager {
- bool dirty;
- bool restarting;
- bool manage_foreign_routes;
-+ bool manage_foreign_rules;
-
- Set *dirty_links;
-
-diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c
-index a7fddfd58f..03bdd4e640 100644
---- a/src/network/networkd-routing-policy-rule.c
-+++ b/src/network/networkd-routing-policy-rule.c
-@@ -977,6 +977,8 @@ int manager_rtnl_process_rule(sd_netlink *rtnl, sd_netlink_message *message, Man
- case RTM_NEWRULE:
- if (rule)
- log_routing_policy_rule_debug(tmp, tmp->family, "Received remembered", NULL, m);
-+ else if (!m->manage_foreign_routes)
-+ log_routing_policy_rule_debug(tmp, tmp->family, "Ignoring received foreign", NULL, m);
- else {
- log_routing_policy_rule_debug(tmp, tmp->family, "Remembering foreign", NULL, m);
- r = routing_policy_rule_consume_foreign(m, TAKE_PTR(tmp));
-diff --git a/src/network/networkd.conf b/src/network/networkd.conf
-index 0eac327314..4e4e8b8d07 100644
---- a/src/network/networkd.conf
-+++ b/src/network/networkd.conf
-@@ -15,6 +15,7 @@
- [Network]
- #SpeedMeter=no
- #SpeedMeterIntervalSec=10sec
-+#ManageForeignRoutingPolicyRules=yes
- #ManageForeignRoutes=yes
- #RouteTable=
-
diff --git a/project-edgeos/sys-apps/systemd/files/99-virtio.network b/project-edgeos/sys-apps/systemd/files/99-virtio.network
deleted file mode 100644
index 8c0c18b..0000000
--- a/project-edgeos/sys-apps/systemd/files/99-virtio.network
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2017 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-[Match]
-Driver=virtio_net
-
-[Network]
-DHCP=ipv4
-# Disable IPv6 completely.
-# https://github.com/systemd/systemd/issues/1982#issuecomment-158779777
-IPv6AcceptRA=no
-
-[DHCP]
-UseMTU=true
-UseDomains=true
diff --git a/project-edgeos/sys-apps/systemd/files/gentoo-systemd-user-pam.patch b/project-edgeos/sys-apps/systemd/files/gentoo-systemd-user-pam.patch
deleted file mode 100644
index 71db78d..0000000
--- a/project-edgeos/sys-apps/systemd/files/gentoo-systemd-user-pam.patch
+++ /dev/null
@@ -1,20 +0,0 @@
- src/login/systemd-user.m4 | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/src/login/systemd-user.m4 b/src/login/systemd-user.m4
-index f6313f79fe..52d43fb448 100644
---- a/src/login/systemd-user.m4
-+++ b/src/login/systemd-user.m4
-@@ -8,10 +8,8 @@ m4_ifdef(`ENABLE_HOMED',
- account sufficient pam_unix.so
- account required pam_permit.so
-
--m4_ifdef(`HAVE_SELINUX',
--session required pam_selinux.so close
--session required pam_selinux.so nottys open
--)m4_dnl
-+account include system-auth
-+session include system-auth
- session required pam_loginuid.so
- session optional pam_keyinit.so force revoke
- m4_ifdef(`ENABLE_HOMED',
diff --git a/project-edgeos/sys-apps/systemd/files/gentoo-uucp-group-r1.patch b/project-edgeos/sys-apps/systemd/files/gentoo-uucp-group-r1.patch
deleted file mode 100644
index 4c917a2..0000000
--- a/project-edgeos/sys-apps/systemd/files/gentoo-uucp-group-r1.patch
+++ /dev/null
@@ -1,16 +0,0 @@
- rules.d/50-udev-default.rules.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/rules.d/50-udev-default.rules.in b/rules.d/50-udev-default.rules.in
-index 50747a1988..7c4af8c0e9 100644
---- a/rules.d/50-udev-default.rules.in
-+++ b/rules.d/50-udev-default.rules.in
-@@ -22,7 +22,7 @@ SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"
- SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
- SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
- SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
--KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
-+KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp"
-
- SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
-
diff --git a/project-edgeos/sys-apps/systemd/files/zz-default.network b/project-edgeos/sys-apps/systemd/files/zz-default.network
deleted file mode 100644
index c8bd62e..0000000
--- a/project-edgeos/sys-apps/systemd/files/zz-default.network
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2019 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-[Match]
-Name=eth*
-
-[Network]
-DHCP=ipv4
-# Disable IPv6 completely.
-# https://github.com/systemd/systemd/issues/1982#issuecomment-158779777
-IPv6AcceptRA=no
-LLMNR=false
-MulticastDNS=false
-
-[DHCP]
-UseMTU=true
-UseDomains=true
diff --git a/project-edgeos/sys-apps/systemd/metadata.xml b/project-edgeos/sys-apps/systemd/metadata.xml
deleted file mode 100644
index b6b6f47..0000000
--- a/project-edgeos/sys-apps/systemd/metadata.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-<upstream>
- <remote-id type="cpe">cpe:/a:systemd_project:systemd</remote-id>
-</upstream>
-</pkgmetadata>
diff --git a/project-edgeos/sys-apps/systemd/systemd-247-r1.ebuild b/project-edgeos/sys-apps/systemd/systemd-247-r1.ebuild
deleted file mode 120000
index fec6d11..0000000
--- a/project-edgeos/sys-apps/systemd/systemd-247-r1.ebuild
+++ /dev/null
@@ -1 +0,0 @@
-systemd-247.ebuild
\ No newline at end of file
diff --git a/project-edgeos/sys-apps/systemd/systemd-247.ebuild b/project-edgeos/sys-apps/systemd/systemd-247.ebuild
deleted file mode 100644
index 130e464..0000000
--- a/project-edgeos/sys-apps/systemd/systemd-247.ebuild
+++ /dev/null
@@ -1,592 +0,0 @@
-#
-# Copyright 2021 Google LLC
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# version 2 as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://github.com/systemd/systemd.git"
- inherit git-r3
-else
- SRC_URI="https://github.com/systemd/systemd-stable/archive/v${PV}.tar.gz -> systemd-stable-${PV}.tar.gz"
- KEYWORDS="*"
- S=${WORKDIR}/systemd-stable-${PV}
-fi
-
-PYTHON_COMPAT=( python{3_4,3_5,3_6,3_7} )
-
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev user
-
-DESCRIPTION="System and service manager for Linux"
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
-
-LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
-SLOT="0/2"
-
-# lakitu: Added "doc" USE flag to conditionalize the installation of docs.
-IUSE="acl apparmor audit build cryptsetup curl doc elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux +split-usr ssl +sysv-utils test vanilla vtconsole xkb predictable-interface-name +networkd-wait-online"
-
-REQUIRED_USE="importd? ( curl gcrypt lzma )"
-RESTRICT="!test? ( test )"
-
-MINKV="3.11"
-
-COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
- sys-libs/libcap:0=[${MULTILIB_USEDEP}]
- !<sys-libs/glibc-2.16
- acl? ( sys-apps/acl:0= )
- apparmor? ( sys-libs/libapparmor:0= )
- audit? ( >=sys-process/audit-2:0= )
- cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
- curl? ( net-misc/curl:0= )
- elfutils? ( >=dev-libs/elfutils-0.158:0= )
- gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
- http? (
- >=net-libs/libmicrohttpd-0.9.33:0=
- ssl? ( >=net-libs/gnutls-3.1.4:0= )
- )
- idn? (
- libidn2? ( net-dns/libidn2:= )
- !libidn2? ( net-dns/libidn:= )
- )
- 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}] )
- nat? ( net-firewall/iptables:0= )
- pam? ( virtual/pam:=[${MULTILIB_USEDEP}] )
- pcre? ( dev-libs/libpcre2 )
- qrcode? ( media-gfx/qrencode:0= )
- seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
- selinux? ( sys-libs/libselinux:0= )
- xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
-
-# baselayout-2.2 has /run
-RDEPEND="${COMMON_DEPEND}
- >=sys-apps/baselayout-2.2
- selinux? ( sec-policy/selinux-base-policy[systemd] )
- sysv-utils? ( !sys-apps/sysvinit )
- !sysv-utils? ( sys-apps/sysvinit )
- resolvconf? ( !net-dns/openresolv )
- !build? ( || (
- sys-apps/util-linux[kill(-)]
- sys-process/procps[kill(+)]
- sys-apps/coreutils[kill(-)]
- ) )
- !sys-auth/nss-myhostname
- !<sys-kernel/dracut-044
- !sys-fs/eudev
- !sys-fs/udev"
-
-# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
-# The following PDEPENDs are present in Gentoo upstream but don't make sense for
-# lakitu:
-# >=sys-fs/udev-init-scripts-25
-# udev-init-scripts: startup scripts for OpenRC
-PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
- >=sys-apps/hwids-20150417[udev]
- policykit? ( sys-auth/polkit )
- !vanilla? ( sys-apps/gentoo-systemd-integration )"
-
-# Newer linux-headers needed by ia64, bug #480218
-# lakitu: Added conditional doc dependency
-DEPEND="${COMMON_DEPEND}
- app-arch/xz-utils:0
- dev-util/gperf
- >=dev-util/intltool-0.50
- >=sys-apps/coreutils-8.16
- >=sys-kernel/linux-headers-${MINKV}
- virtual/pkgconfig[${MULTILIB_USEDEP}]
- gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
- test? ( sys-apps/dbus )
- doc? (
- app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-libs/libxslt:0
- $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
- )
-"
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != buildonly ]]; then
- local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
- ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
- ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
- ~TIMERFD ~TMPFS_XATTR ~UNIX
- ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
- ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
- ~!SYSFS_DEPRECATED_V2"
-
- use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
- use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
- kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
- kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
- kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
-
- if linux_config_exists; then
- local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
- if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
- ewarn "It's recommended to set an empty value to the following kernel config option:"
- ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
- fi
- if linux_chkconfig_present X86; then
- CONFIG_CHECK+=" ~DMIID"
- fi
- fi
-
- if kernel_is -lt ${MINKV//./ }; then
- ewarn "Kernel version at least ${MINKV} required"
- fi
-
- check_extra_config
- fi
-}
-
-pkg_setup() {
- :
-}
-
-src_unpack() {
- default
- [[ ${PV} != 9999 ]] || git-r3_src_unpack
-}
-
-src_prepare() {
- # Do NOT add patches here
- local PATCHES=()
-
- [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
-
- # Add local patches here
- # lakitu: To want some gentoo patches if not vanilla and to keep the
- # code aligned with gentoo's ebuild file
- #if ! use vanilla; then
- # PATCHES+=(
- # "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch"
- # "${FILESDIR}/gentoo-systemd-user-pam.patch"
- # "${FILESDIR}/gentoo-uucp-group-r1.patch"
- # "${FILESDIR}/gentoo-generator-path.patch"
- # )
- #fi
- PATCHES+=(
- # Gentoo patches
- "${FILESDIR}/gentoo-uucp-group-r1.patch"
- "${FILESDIR}/gentoo-systemd-user-pam.patch"
- "${FILESDIR}/228-noclean-tmp.patch"
- # Lakitu patches
- # CL:*250967
- "${FILESDIR}"/232-tmpfiles-no-srv.patch
- # CL:*256679
- "${FILESDIR}"/225-Force-re-creation-of-etc-localtime-symlink.patch
- # This prevents the kernel from logging all audit messages to
- # both dmesg and audit log. b/29581598.
- "${FILESDIR}"/225-audit-set-pid.patch
- # Allow networkd => hostnamed communication w/o polkit.
- "${FILESDIR}"/225-allow-networkd-to-hostnamed.patch
- # Work around the 64 bit restriction of hostname length from
- # kernel. b/27702816.
- "${FILESDIR}"/232-single-label-hostname.patch
- # Make networkd default to not touch IP forwarding setting.
- # b/33257712
- "${FILESDIR}"/225-networkd-default-ip-forwarding-to-kernel.patch
- # Avoid render and kvm group
- "${FILESDIR}"/239-avoid-render-and-kvm-group.patch
- # Change paths for udev rules, init, halt, poweroff
- # shutdown and reboot to minimize the effect of systemd upgrade
- # TODO(vaibhavrustagi): Need to check to use default paths provided
- # by systemd or not
- "${FILESDIR}"/239-change-paths-for-udev-rules-init-reboot.patch
- # Boot into multi-user.target instead of graphical.target.
- "${FILESDIR}"/239-default-target.patch
- # https://github.com/systemd/systemd/issues/17803
- "${FILESDIR}"/247-do-not-set-broadcast.patch
- "${FILESDIR}"/247-fix-broadcast-verification.patch
- "${FILESDIR}"/247-ignore-broadcast.patch
- )
- default
-}
-
-src_configure() {
- # Prevent conflicts with i686 cross toolchain, bug 559726
- tc-export AR CC NM OBJCOPY RANLIB
-
- # lakitu: Need python setup only when doc USE flag is
- # enabled
- use doc && python_setup
-
- multilib-minimal_src_configure
-}
-
-meson_use() {
- usex "$1" true false
-}
-
-meson_multilib() {
- if multilib_is_native_abi; then
- echo true
- else
- echo false
- fi
-}
-
-meson_multilib_native_use() {
- if multilib_is_native_abi && use "$1"; then
- echo true
- else
- echo false
- fi
-}
-
-multilib_src_configure() {
- local myconf=(
- --localstatedir="${EPREFIX}/var"
- -Dpamlibdir="$(getpam_mod_dir)"
- # avoid bash-completion dep
- -Dbashcompletiondir="$(get_bashcompdir)"
- # lakitu: Do not want the "split-usr" USE flag
- # as it uses rootprefix as "/" and lakitu currently
- # uses "/usr"
- # make sure we get /bin:/sbin in PATH
- -Dsplit-usr=true
- -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
- # lakitu: Install libraries at /usr/lib instead of /lib
- -Drootlibdir="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr/$(get_libdir)")"
- -Dsysvinit-path=
- -Dsysvrcnd-path=
- # Avoid infinite exec recursion, bug 642724
- -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
- # no deps
- # lakitu: no efi
- # -Defi=$(meson_multilib)
- -Dima=true
- # Optional components/dependencies
- -Dacl=$(meson_multilib_native_use acl)
- -Dapparmor=$(meson_multilib_native_use apparmor)
- -Daudit=$(meson_multilib_native_use audit)
- -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
- -Dlibcurl=$(meson_multilib_native_use curl)
- -Delfutils=$(meson_multilib_native_use elfutils)
- -Dgcrypt=$(meson_use gcrypt)
- -Dgnu-efi=$(meson_multilib_native_use gnuefi)
- -Defi-libdir="${EPREFIX}/usr/$(get_libdir)"
- -Dmicrohttpd=$(meson_multilib_native_use http)
- $(usex http -Dgnutls=$(meson_multilib_native_use ssl) -Dgnutls=false)
- -Dimportd=$(meson_multilib_native_use importd)
- -Dbzip2=$(meson_multilib_native_use importd)
- -Dzlib=$(meson_multilib_native_use importd)
- -Dkmod=$(meson_multilib_native_use kmod)
- -Dlz4=$(meson_use lz4)
- -Dxz=$(meson_use lzma)
- -Dlibiptc=$(meson_multilib_native_use nat)
- -Dpam=$(meson_use pam)
- -Dpcre2=$(meson_multilib_native_use pcre)
- -Dpolkit=$(meson_multilib_native_use policykit)
- -Dqrencode=$(meson_multilib_native_use qrcode)
- -Dseccomp=$(meson_multilib_native_use seccomp)
- -Dselinux=$(meson_multilib_native_use selinux)
- #-Dtests=$(meson_multilib_native_use test)
- -Ddbus=$(meson_multilib_native_use test)
- -Dxkbcommon=$(meson_multilib_native_use xkb)
- # hardcode a few paths to spare some deps
- -Dkill-path=/bin/kill
- # lakitu: specifying dbus policy dir path
- -Ddbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
- # Breaks screen, tmux, etc.
- -Ddefault-kill-user-processes=false
- )
-
- # lakitu specific enabled features
- myconf+=(
- -Dbinfmt=true
- -Dcoredump=true
- -Dhostnamed=true
- -Dldconfig=true
- -Dnetworkd=true
- -Dutmp=true
- -Dtimedated=true
- -Dtmpfiles=true
- )
-
- # lakitu: disable all features not used and not disabled by USE flags.
- # multilib options
- myconf+=(
- -Dbacklight=false
- -Defi=false
- -Denvironment-d=false
- -Dfirstboot=false
- -Dhibernate=false
- -Dhwdb=false
- -Dlocaled=false
- -Dmachined=false
- -Dman=false
- -Dquotacheck=false
- -Drandomseed=false
- -Drfkill=false
- -Dsysusers=false
- -Dtimesyncd=false
- -Dvconsole=false
- )
-
- if multilib_is_native_abi && use idn; then
- myconf+=(
- -Dlibidn2=$(usex libidn2 true false)
- -Dlibidn=$(usex libidn2 false true)
- )
- else
- myconf+=(
- -Dlibidn2=false
- -Dlibidn=false
- )
- fi
-
- meson_src_configure "${myconf[@]}"
-}
-
-multilib_src_compile() {
- eninja
-}
-
-multilib_src_test() {
- unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
- eninja test
-}
-
-multilib_src_install() {
- DESTDIR="${D}" eninja install
-}
-
-# lakitu specific src_install customizations.
-lakitu_src_install() {
- dosym /usr/bin/udevadm sbin/udevadm
- dosym /usr/lib/systemd/systemd-udevd sbin/udevd
- dosym /run/systemd/resolve/resolv.conf etc/resolv.conf
-
- # Disable all sysctl settings. In ChromeOS sysctl.conf is
- # provided by chromeos-base.
- rm "${D}"/usr/lib/sysctl.d/*
-
- # Install our systemd-preset file.
- insinto /usr/lib/systemd/system-preset
- rm -f "${D}"/usr/lib/systemd/system-preset/*
- doins "${FILESDIR}"/00-lakitu.preset
-
- # lakitu: Disable getty on tty1 if VT console is not enabled.
- if ! use vtconsole; then
- rm -f "${D}"/etc/systemd/system/getty.target.wants/getty@tty1.service
- fi
-
- # lakitu: Disable systemd-networkd-wait-line if networkd-wait-online is not enabled.
- # TODO: Remove this patch when we upgraded systemd to version greater
- # than 241.
- if ! use networkd-wait-online; then
- rm -f "${D}"/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
- fi
-
- # Install network files.
- insinto /usr/lib/systemd/network
- doins "${FILESDIR}"/*.network
-
- if ! use predictable-interface-name; then
- # Turn off Predictable Network Interface Names to minimize the
- # upgrade side-effects.
- # https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
- dosym /dev/null /etc/systemd/network/99-default.link
- fi
-
- # Enable accounting for all supported controllers (CPU, Memory and Block)
- sed -i 's/#DefaultCPUAccounting=no/DefaultCPUAccounting=yes/' "${ED}"/etc/systemd/system.conf
- sed -i 's/#DefaultBlockIOAccounting=no/DefaultBlockIOAccounting=yes/' "${ED}"/etc/systemd/system.conf
- sed -i 's/#DefaultMemoryAccounting=no/DefaultMemoryAccounting=yes/' "${ED}"/etc/systemd/system.conf
-
- # Set default log rotation policy: 100M for each journal; 1G total.
- sed -i 's/#SystemMaxUse=/SystemMaxUse=1G/' "${ED}"/etc/systemd/journald.conf
- sed -i 's/#SystemMaxFileSize=/SystemMaxFileSize=100M/' "${ED}"/etc/systemd/journald.conf
-
- # Enable persistent storage for the journal
- sed -i 's/#Storage=auto/Storage=persistent/' "${ED}"/etc/systemd/journald.conf
-
- # These used to be enabled automatically during build, but since v242 systemd no longer
- # enables these by default. See
- # https://github.com/systemd/systemd-stable/commit/01d2041e41f4886a6dff16a53a950ae8d5b66bc7
- systemd_enable_service multi-user.target remote-fs.target
- systemd_enable_service sockets.target systemd-networkd.socket
- systemd_enable_service multi-user.target systemd-networkd.service
- systemd_enable_service multi-user.target systemd-resolved.service
- systemd_enable_service network-online.target systemd-networkd-wait-online.service
-
-}
-
-multilib_src_install_all() {
- local rootprefix=$(usex split-usr '' /usr)
- # meson doesn't know about docdir
- mv "${ED%/}"/usr/share/doc/{systemd,${PF}} || die
-
- use doc && einstalldocs
-
- # lakitu: Do not use nsswitch.conf
- # dodoc "${FILESDIR}"/nsswitch.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,runlevel,shutdown,telinit} || die
- rm "${ED%/}"/usr/share/man/man1/init.1 || die
- rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
- fi
-
- if ! use resolvconf && ! use sysv-utils; then
- rmdir "${ED%/}${rootprefix}"/sbin || die
- fi
-
- # Preserve empty dirs in /etc & /var, bug #437008
- keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
- keepdir /etc/systemd/{ntp-units.d,user} /var/lib/systemd
- # lakitu: Remove hwdb.d as it is not present at /etc/udev
- keepdir /etc/udev/rules.d
- keepdir /var/log/journal/remote
-
- # lakitu: Comment out this symlink since Lakitu board depends
- # on /etc/sysctl.d/00-sysctl.conf, and this is a broken link.
- # After our recent reflactoring, we can use 99-sysctl.conf in
- # the board only so that the board derivied from project-lakitu
- # can override the settings using board specific ones.
- # Symlink /etc/sysctl.conf for easy migration.
- # dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
-
- # lakitu: Following lines from Gentoo Upstream, but lakitu wants
- # networkd and resolved to start on boot
- # If we install these symlinks, there is no way for the sysadmin to remove them
- # permanently.
- #rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
- #rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.network1.service || die
- #rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
- #rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.resolve1.service || die
- #rm -fr "${ED%/}"/etc/systemd/system/network-online.target.wants || die
- #rm -fr "${ED%/}"/etc/systemd/system/sockets.target.wants || die
- #rm -fr "${ED%/}"/etc/systemd/system/sysinit.target.wants || die
-
- # lakitu specific
- lakitu_src_install
-
- # lakitu: Don't remove as these are present in systemd-232
- #local udevdir=/lib/udev
- #rm -r "${ED%/}${udevdir}/hwdb.d" || die
-
- 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
-}
-
-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_postinst() {
- newusergroup() {
- enewgroup "$1"
- enewuser "$1" -1 -1 -1 "$1"
- }
-
- enewgroup input
- enewgroup systemd-journal
- newusergroup systemd-network
- newusergroup systemd-resolve
- newusergroup systemd-timesync
-
- # lakitu: disable groups not used
- # enewgroup kvm 78
- # enewgroup render
- # newusergroup systemd-bus-proxy
- # newusergroup systemd-coredump
- # newusergroup systemd-journal-gateway
- # newusergroup systemd-journal-remote
- # newusergroup systemd-journal-upload
-
- systemd_update_catalog
-
- # Keep this here in case the database format changes so it gets updated
- # when required. Despite that this file is owned by sys-apps/hwids.
- if has_version "sys-apps/hwids[udev]"; then
- udevadm hwdb --update --root="${EROOT%/}"
- fi
-
- udev_reload || FAIL=1
-
- # Bug 465468, make sure locales are respect, and ensure consistency
- # between OpenRC & systemd
- migrate_locale
-
- # lakitu: No need to reenable as the symlinks were not disabled above
- # systemd_reenable systemd-networkd.service systemd-resolved.service
-
- if [[ ${FAIL} ]]; then
- eerror "One of the postinst commands failed. Please check the postinst output"
- eerror "for errors. You may need to clean up your system and/or try installing"
- eerror "systemd again."
- eerror
- fi
-}
-
-pkg_prerm() {
- # If removing systemd completely, remove the catalog database.
- if [[ ! ${REPLACED_BY_VERSION} ]]; then
- rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
- fi
-}
diff --git a/project-edgeos/sys-apps/systemd/systemd-248-r5.ebuild b/project-edgeos/sys-apps/systemd/systemd-248-r5.ebuild
deleted file mode 120000
index 7eeacca..0000000
--- a/project-edgeos/sys-apps/systemd/systemd-248-r5.ebuild
+++ /dev/null
@@ -1 +0,0 @@
-systemd-248.ebuild
\ No newline at end of file
diff --git a/project-edgeos/sys-apps/systemd/systemd-248.ebuild b/project-edgeos/sys-apps/systemd/systemd-248.ebuild
deleted file mode 100644
index 7fc31e2..0000000
--- a/project-edgeos/sys-apps/systemd/systemd-248.ebuild
+++ /dev/null
@@ -1,595 +0,0 @@
-#
-# Copyright 2021 Google LLC
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# version 2 as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://github.com/systemd/systemd.git"
- inherit git-r3
-else
- SRC_URI="https://github.com/systemd/systemd-stable/archive/v${PV}.tar.gz -> systemd-stable-${PV}.tar.gz"
- KEYWORDS="*"
- S=${WORKDIR}/systemd-stable-${PV}
-fi
-
-PYTHON_COMPAT=( python{3_4,3_5,3_6,3_7} )
-
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev user
-
-DESCRIPTION="System and service manager for Linux"
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
-
-LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
-SLOT="0/2"
-
-# lakitu: Added "doc" USE flag to conditionalize the installation of docs.
-IUSE="acl apparmor audit build cryptsetup curl doc elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux +split-usr ssl +sysv-utils test vanilla vtconsole xkb predictable-interface-name +networkd-wait-online"
-
-REQUIRED_USE="importd? ( curl gcrypt lzma )"
-RESTRICT="!test? ( test )"
-
-MINKV="3.11"
-
-COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
- sys-libs/libcap:0=[${MULTILIB_USEDEP}]
- !<sys-libs/glibc-2.16
- acl? ( sys-apps/acl:0= )
- apparmor? ( sys-libs/libapparmor:0= )
- audit? ( >=sys-process/audit-2:0= )
- cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
- curl? ( net-misc/curl:0= )
- elfutils? ( >=dev-libs/elfutils-0.158:0= )
- gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
- http? (
- >=net-libs/libmicrohttpd-0.9.33:0=
- ssl? ( >=net-libs/gnutls-3.1.4:0= )
- )
- idn? (
- libidn2? ( net-dns/libidn2:= )
- !libidn2? ( net-dns/libidn:= )
- )
- 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}] )
- nat? ( net-firewall/iptables:0= )
- pam? ( virtual/pam:=[${MULTILIB_USEDEP}] )
- pcre? ( dev-libs/libpcre2 )
- qrcode? ( media-gfx/qrencode:0= )
- seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
- selinux? ( sys-libs/libselinux:0= )
- xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
-
-# baselayout-2.2 has /run
-RDEPEND="${COMMON_DEPEND}
- >=sys-apps/baselayout-2.2
- selinux? ( sec-policy/selinux-base-policy[systemd] )
- sysv-utils? ( !sys-apps/sysvinit )
- !sysv-utils? ( sys-apps/sysvinit )
- resolvconf? ( !net-dns/openresolv )
- !build? ( || (
- sys-apps/util-linux[kill(-)]
- sys-process/procps[kill(+)]
- sys-apps/coreutils[kill(-)]
- ) )
- !sys-auth/nss-myhostname
- !<sys-kernel/dracut-044
- !sys-fs/eudev
- !sys-fs/udev"
-
-# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
-# The following PDEPENDs are present in Gentoo upstream but don't make sense for
-# lakitu:
-# >=sys-fs/udev-init-scripts-25
-# udev-init-scripts: startup scripts for OpenRC
-PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
- >=sys-apps/hwids-20150417[udev]
- policykit? ( sys-auth/polkit )
- !vanilla? ( sys-apps/gentoo-systemd-integration )"
-
-# Newer linux-headers needed by ia64, bug #480218
-# lakitu: Added conditional doc dependency
-DEPEND="${COMMON_DEPEND}
- app-arch/xz-utils:0
- dev-util/gperf
- >=dev-util/intltool-0.50
- >=sys-apps/coreutils-8.16
- >=sys-kernel/linux-headers-${MINKV}
- virtual/pkgconfig[${MULTILIB_USEDEP}]
- gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
- test? ( sys-apps/dbus )
- doc? (
- app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-libs/libxslt:0
- $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
- )
-"
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != buildonly ]]; then
- local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
- ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
- ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
- ~TIMERFD ~TMPFS_XATTR ~UNIX
- ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
- ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
- ~!SYSFS_DEPRECATED_V2"
-
- use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
- use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
- kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
- kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
- kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
-
- if linux_config_exists; then
- local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
- if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
- ewarn "It's recommended to set an empty value to the following kernel config option:"
- ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
- fi
- if linux_chkconfig_present X86; then
- CONFIG_CHECK+=" ~DMIID"
- fi
- fi
-
- if kernel_is -lt ${MINKV//./ }; then
- ewarn "Kernel version at least ${MINKV} required"
- fi
-
- check_extra_config
- fi
-}
-
-pkg_setup() {
- :
-}
-
-src_unpack() {
- default
- [[ ${PV} != 9999 ]] || git-r3_src_unpack
-}
-
-src_prepare() {
- # Do NOT add patches here
- local PATCHES=()
-
- [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
-
- # Add local patches here
- # lakitu: To want some gentoo patches if not vanilla and to keep the
- # code aligned with gentoo's ebuild file
- #if ! use vanilla; then
- # PATCHES+=(
- # "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch"
- # "${FILESDIR}/gentoo-systemd-user-pam.patch"
- # "${FILESDIR}/gentoo-uucp-group-r1.patch"
- # "${FILESDIR}/gentoo-generator-path.patch"
- # )
- #fi
- PATCHES+=(
- # Gentoo patches
- "${FILESDIR}/gentoo-uucp-group-r1.patch"
- "${FILESDIR}/gentoo-systemd-user-pam.patch"
- "${FILESDIR}/228-noclean-tmp.patch"
- # Lakitu patches
- # CL:*250967
- "${FILESDIR}"/232-tmpfiles-no-srv.patch
- # CL:*256679
- "${FILESDIR}"/225-Force-re-creation-of-etc-localtime-symlink.patch
- # This prevents the kernel from logging all audit messages to
- # both dmesg and audit log. b/29581598.
- "${FILESDIR}"/225-audit-set-pid.patch
- # Allow networkd => hostnamed communication w/o polkit.
- "${FILESDIR}"/225-allow-networkd-to-hostnamed.patch
- # Work around the 64 bit restriction of hostname length from
- # kernel. b/27702816.
- "${FILESDIR}"/232-single-label-hostname.patch
- # Make networkd default to not touch IP forwarding setting.
- # b/33257712
- "${FILESDIR}"/225-networkd-default-ip-forwarding-to-kernel.patch
- # Avoid render and kvm group
- "${FILESDIR}"/239-avoid-render-and-kvm-group.patch
- # Change paths for udev rules, init, halt, poweroff
- # shutdown and reboot to minimize the effect of systemd upgrade
- # TODO(vaibhavrustagi): Need to check to use default paths provided
- # by systemd or not
- "${FILESDIR}"/239-change-paths-for-udev-rules-init-reboot.patch
- # Boot into multi-user.target instead of graphical.target.
- "${FILESDIR}"/239-default-target.patch
- # Support ManageForeignRoutingPolicy option.
- "${FILESDIR}"/249-foreignroutingpolicy.patch
- "${FILESDIR}"/248-do-not-use-strdupa-on-a-patch.patch
- )
- default
-}
-
-src_configure() {
- # Prevent conflicts with i686 cross toolchain, bug 559726
- tc-export AR CC NM OBJCOPY RANLIB
-
- # lakitu: Need python setup only when doc USE flag is
- # enabled
- use doc && python_setup
-
- multilib-minimal_src_configure
-}
-
-meson_use() {
- usex "$1" true false
-}
-
-meson_multilib() {
- if multilib_is_native_abi; then
- echo true
- else
- echo false
- fi
-}
-
-meson_multilib_native_use() {
- if multilib_is_native_abi && use "$1"; then
- echo true
- else
- echo false
- fi
-}
-
-multilib_src_configure() {
- local myconf=(
- --localstatedir="${EPREFIX}/var"
- -Dpamlibdir="$(getpam_mod_dir)"
- # avoid bash-completion dep
- -Dbashcompletiondir="$(get_bashcompdir)"
- # lakitu: Do not want the "split-usr" USE flag
- # as it uses rootprefix as "/" and lakitu currently
- # uses "/usr"
- # make sure we get /bin:/sbin in PATH
- -Dsplit-usr=true
- -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
- # lakitu: Install libraries at /usr/lib instead of /lib
- -Drootlibdir="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr/$(get_libdir)")"
- -Dsysvinit-path=
- -Dsysvrcnd-path=
- # Avoid infinite exec recursion, bug 642724
- -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
- # no deps
- # lakitu: no efi
- # -Defi=$(meson_multilib)
- -Dima=true
- # Optional components/dependencies
- -Dacl=$(meson_multilib_native_use acl)
- -Dapparmor=$(meson_multilib_native_use apparmor)
- -Daudit=$(meson_multilib_native_use audit)
- -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
- -Dlibcurl=$(meson_multilib_native_use curl)
- -Delfutils=$(meson_multilib_native_use elfutils)
- -Dgcrypt=$(meson_use gcrypt)
- -Dgnu-efi=$(meson_multilib_native_use gnuefi)
- -Defi-libdir="${EPREFIX}/usr/$(get_libdir)"
- -Dmicrohttpd=$(meson_multilib_native_use http)
- $(usex http -Dgnutls=$(meson_multilib_native_use ssl) -Dgnutls=false)
- -Dimportd=$(meson_multilib_native_use importd)
- -Dbzip2=$(meson_multilib_native_use importd)
- -Dzlib=$(meson_multilib_native_use importd)
- -Dkmod=$(meson_multilib_native_use kmod)
- -Dlz4=$(meson_use lz4)
- -Dxz=$(meson_use lzma)
- -Dlibiptc=$(meson_multilib_native_use nat)
- -Dpam=$(meson_use pam)
- -Dpcre2=$(meson_multilib_native_use pcre)
- -Dpolkit=$(meson_multilib_native_use policykit)
- -Dqrencode=$(meson_multilib_native_use qrcode)
- -Dseccomp=$(meson_multilib_native_use seccomp)
- -Dselinux=$(meson_multilib_native_use selinux)
- #-Dtests=$(meson_multilib_native_use test)
- -Ddbus=$(meson_multilib_native_use test)
- -Dxkbcommon=$(meson_multilib_native_use xkb)
- # hardcode a few paths to spare some deps
- -Dkill-path=/bin/kill
- # lakitu: specifying dbus policy dir path
- -Ddbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
- # Breaks screen, tmux, etc.
- -Ddefault-kill-user-processes=false
- )
-
- # lakitu specific enabled features
- myconf+=(
- -Dbinfmt=true
- -Dcoredump=true
- -Dhostnamed=true
- -Dldconfig=true
- -Dnetworkd=true
- -Dutmp=true
- -Dtimedated=true
- -Dtmpfiles=true
- )
-
- # lakitu: disable all features not used and not disabled by USE flags.
- # multilib options
- myconf+=(
- -Dbacklight=false
- -Defi=false
- -Denvironment-d=false
- -Dfirstboot=false
- -Dhibernate=false
- -Dhwdb=false
- -Dlocaled=false
- -Dmachined=false
- -Dman=false
- -Dquotacheck=false
- -Drandomseed=false
- -Drfkill=false
- -Dsysusers=false
- -Dtimesyncd=false
- -Dvconsole=false
- )
-
- if multilib_is_native_abi && use idn; then
- myconf+=(
- -Dlibidn2=$(usex libidn2 true false)
- -Dlibidn=$(usex libidn2 false true)
- )
- else
- myconf+=(
- -Dlibidn2=false
- -Dlibidn=false
- )
- fi
-
- meson_src_configure "${myconf[@]}"
-}
-
-multilib_src_compile() {
- eninja
-}
-
-multilib_src_test() {
- unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
- eninja test
-}
-
-multilib_src_install() {
- DESTDIR="${D}" eninja install
-}
-
-# lakitu specific src_install customizations.
-lakitu_src_install() {
- dosym /usr/bin/udevadm sbin/udevadm
- dosym /usr/lib/systemd/systemd-udevd sbin/udevd
- dosym /run/systemd/resolve/resolv.conf etc/resolv.conf
-
- # Disable all sysctl settings. In ChromeOS sysctl.conf is
- # provided by chromeos-base.
- rm "${D}"/usr/lib/sysctl.d/*
-
- # Install our systemd-preset file.
- insinto /usr/lib/systemd/system-preset
- rm -f "${D}"/usr/lib/systemd/system-preset/*
- doins "${FILESDIR}"/00-lakitu.preset
-
- # lakitu: Disable getty on tty1 if VT console is not enabled.
- if ! use vtconsole; then
- rm -f "${D}"/etc/systemd/system/getty.target.wants/getty@tty1.service
- fi
-
- # lakitu: Disable systemd-networkd-wait-line if networkd-wait-online is not enabled.
- # TODO: Remove this patch when we upgraded systemd to version greater
- # than 241.
- if ! use networkd-wait-online; then
- rm -f "${D}"/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
- fi
-
- # Install network files.
- insinto /usr/lib/systemd/network
- doins "${FILESDIR}"/*.network
-
- # Install modprobe.d files.
- insinto /etc/modprobe.d
- doins modprobe.d/systemd.conf
-
- if ! use predictable-interface-name; then
- # Turn off Predictable Network Interface Names to minimize the
- # upgrade side-effects.
- # https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
- dosym /dev/null /etc/systemd/network/99-default.link
- fi
-
- # Enable accounting for all supported controllers (CPU, Memory and Block)
- sed -i 's/#DefaultCPUAccounting=no/DefaultCPUAccounting=yes/' "${ED}"/etc/systemd/system.conf
- sed -i 's/#DefaultBlockIOAccounting=no/DefaultBlockIOAccounting=yes/' "${ED}"/etc/systemd/system.conf
- sed -i 's/#DefaultMemoryAccounting=no/DefaultMemoryAccounting=yes/' "${ED}"/etc/systemd/system.conf
-
- # Set default log rotation policy: 100M for each journal; 1G total.
- sed -i 's/#SystemMaxUse=/SystemMaxUse=1G/' "${ED}"/etc/systemd/journald.conf
- sed -i 's/#SystemMaxFileSize=/SystemMaxFileSize=100M/' "${ED}"/etc/systemd/journald.conf
-
- # Enable persistent storage for the journal
- sed -i 's/#Storage=auto/Storage=persistent/' "${ED}"/etc/systemd/journald.conf
-
- # These used to be enabled automatically during build, but since v242 systemd no longer
- # enables these by default. See
- # https://github.com/systemd/systemd-stable/commit/01d2041e41f4886a6dff16a53a950ae8d5b66bc7
- systemd_enable_service multi-user.target remote-fs.target
- systemd_enable_service sockets.target systemd-networkd.socket
- systemd_enable_service multi-user.target systemd-networkd.service
- systemd_enable_service multi-user.target systemd-resolved.service
- systemd_enable_service network-online.target systemd-networkd-wait-online.service
-
-}
-
-multilib_src_install_all() {
- local rootprefix=$(usex split-usr '' /usr)
- # meson doesn't know about docdir
- mv "${ED%/}"/usr/share/doc/{systemd,${PF}} || die
-
- use doc && einstalldocs
-
- # lakitu: Do not use nsswitch.conf
- # dodoc "${FILESDIR}"/nsswitch.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,runlevel,shutdown,telinit} || die
- rm "${ED%/}"/usr/share/man/man1/init.1 || die
- rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
- fi
-
- if ! use resolvconf && ! use sysv-utils; then
- rmdir "${ED%/}${rootprefix}"/sbin || die
- fi
-
- # Preserve empty dirs in /etc & /var, bug #437008
- keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
- keepdir /etc/systemd/{ntp-units.d,user} /var/lib/systemd
- # lakitu: Remove hwdb.d as it is not present at /etc/udev
- keepdir /etc/udev/rules.d
- keepdir /var/log/journal/remote
-
- # lakitu: Comment out this symlink since Lakitu board depends
- # on /etc/sysctl.d/00-sysctl.conf, and this is a broken link.
- # After our recent reflactoring, we can use 99-sysctl.conf in
- # the board only so that the board derivied from project-lakitu
- # can override the settings using board specific ones.
- # Symlink /etc/sysctl.conf for easy migration.
- # dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
-
- # lakitu: Following lines from Gentoo Upstream, but lakitu wants
- # networkd and resolved to start on boot
- # If we install these symlinks, there is no way for the sysadmin to remove them
- # permanently.
- #rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
- #rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.network1.service || die
- #rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
- #rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.resolve1.service || die
- #rm -fr "${ED%/}"/etc/systemd/system/network-online.target.wants || die
- #rm -fr "${ED%/}"/etc/systemd/system/sockets.target.wants || die
- #rm -fr "${ED%/}"/etc/systemd/system/sysinit.target.wants || die
-
- # lakitu specific
- lakitu_src_install
-
- # lakitu: Don't remove as these are present in systemd-232
- #local udevdir=/lib/udev
- #rm -r "${ED%/}${udevdir}/hwdb.d" || die
-
- 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
-}
-
-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_postinst() {
- newusergroup() {
- enewgroup "$1"
- enewuser "$1" -1 -1 -1 "$1"
- }
-
- enewgroup input
- enewgroup systemd-journal
- newusergroup systemd-network
- newusergroup systemd-resolve
- newusergroup systemd-timesync
-
- # lakitu: disable groups not used
- # enewgroup kvm 78
- # enewgroup render
- # newusergroup systemd-bus-proxy
- # newusergroup systemd-coredump
- # newusergroup systemd-journal-gateway
- # newusergroup systemd-journal-remote
- # newusergroup systemd-journal-upload
-
- systemd_update_catalog
-
- # Keep this here in case the database format changes so it gets updated
- # when required. Despite that this file is owned by sys-apps/hwids.
- if has_version "sys-apps/hwids[udev]"; then
- udevadm hwdb --update --root="${EROOT%/}"
- fi
-
- udev_reload || FAIL=1
-
- # Bug 465468, make sure locales are respect, and ensure consistency
- # between OpenRC & systemd
- migrate_locale
-
- # lakitu: No need to reenable as the symlinks were not disabled above
- # systemd_reenable systemd-networkd.service systemd-resolved.service
-
- if [[ ${FAIL} ]]; then
- eerror "One of the postinst commands failed. Please check the postinst output"
- eerror "for errors. You may need to clean up your system and/or try installing"
- eerror "systemd again."
- eerror
- fi
-}
-
-pkg_prerm() {
- # If removing systemd completely, remove the catalog database.
- if [[ ! ${REPLACED_BY_VERSION} ]]; then
- rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
- fi
-}