Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd: Add patch to split networkd tmpfiles into a separate file #2832

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From abdd268ab3c16c606a1578e5d40d5847a1d99523 Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Wed, 27 Apr 2022 10:25:22 +0100
Subject: [PATCH] tmpfiles: Split networkd entries into a separate file

Many distributions ship systemd-networkd as a separate file so we
need to be able to ship the tmpfiles networkd entries as part of
that separate networkd package. Let's split the networkd entries
into a separate file to make that possible.
---
tmpfiles.d/meson.build | 1 +
tmpfiles.d/systemd-network.conf | 13 +++++++++++++
tmpfiles.d/systemd.conf.in | 6 ------
3 files changed, 14 insertions(+), 6 deletions(-)
create mode 100644 tmpfiles.d/systemd-network.conf

diff --git a/tmpfiles.d/meson.build b/tmpfiles.d/meson.build
index b8d3919025..7c2604cfe1 100644
--- a/tmpfiles.d/meson.build
+++ b/tmpfiles.d/meson.build
@@ -13,6 +13,7 @@ files = [['README', ''],
['systemd-pstore.conf', 'ENABLE_PSTORE'],
['tmp.conf', ''],
['x11.conf', ''],
+ ['systemd-network.conf', 'ENABLE_NETWORKD'],
]

foreach pair : files
diff --git a/tmpfiles.d/systemd-network.conf b/tmpfiles.d/systemd-network.conf
new file mode 100644
index 0000000000..b30bc914a5
--- /dev/null
+++ b/tmpfiles.d/systemd-network.conf
@@ -0,0 +1,13 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# See tmpfiles.d(5) for details
+
+d /run/systemd/netif 0755 systemd-network systemd-network -
+d /run/systemd/netif/links 0755 systemd-network systemd-network -
+d /run/systemd/netif/leases 0755 systemd-network systemd-network -
+d /run/systemd/netif/lldp 0755 systemd-network systemd-network -
diff --git a/tmpfiles.d/systemd.conf.in b/tmpfiles.d/systemd.conf.in
index 9b2357cd31..e23e102782 100644
--- a/tmpfiles.d/systemd.conf.in
+++ b/tmpfiles.d/systemd.conf.in
@@ -18,12 +18,6 @@ d /run/systemd/sessions 0755 root root -
d /run/systemd/users 0755 root root -
d /run/systemd/machines 0755 root root -
d /run/systemd/shutdown 0755 root root -
-{% if ENABLE_NETWORKD %}
-d /run/systemd/netif 0755 systemd-network systemd-network -
-d /run/systemd/netif/links 0755 systemd-network systemd-network -
-d /run/systemd/netif/leases 0755 systemd-network systemd-network -
-d /run/systemd/netif/lldp 0755 systemd-network systemd-network -
-{% endif %}

d /run/log 0755 root root -

--
2.38.1

6 changes: 6 additions & 0 deletions packages/systemd/systemd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Patch9010: 9010-sysusers-set-root-shell-to-sbin-nologin.patch
# Local patch to keep modprobe units running to avoid repeated log entries.
Patch9011: 9011-units-keep-modprobe-service-units-running.patch

# Local patch to split the systemd-networkd tmpfiles into a separate file which
# allows us to exclude them when not using networkd.
Patch9012: 9012-tmpfiles-Split-networkd-entries-into-a-separate-file.patch

BuildRequires: gperf
BuildRequires: intltool
BuildRequires: meson
Expand Down Expand Up @@ -327,6 +331,7 @@ install -p -m 0644 %{S:4} %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}/i
%{_cross_libdir}/sysusers.d/*
%{_cross_libdir}/systemd/*
%{_cross_libdir}/udev/*
%exclude %{_cross_libdir}/tmpfiles.d/systemd-network.conf
%exclude %{_cross_libdir}/sysusers.d/systemd-network.conf
%exclude %{_cross_libdir}/systemd/systemd-networkd
%exclude %{_cross_libdir}/systemd/systemd-networkd-wait-online
Expand Down Expand Up @@ -421,5 +426,6 @@ install -p -m 0644 %{S:4} %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}/i
%{_cross_libdir}/sysusers.d/systemd-network.conf
%{_cross_datadir}/dbus-1/system-services/org.freedesktop.network1.service
%{_cross_datadir}/dbus-1/system.d/org.freedesktop.network1.conf
%{_cross_libdir}/tmpfiles.d/systemd-network.conf

%changelog