Skip to contentSkip to conversation

systemd: Backports fixes to 216

PATCH Superseded Khem Raj 2 participants 3 messages Jan 29, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 systemd: Backports fixes to 216

Fix systemd-timesyncd assertion

when networkd is disabled then we now do not
create /run/systemd/netif/links but timesyncd needs it. So lets manually create this file when networkd is disabled so timesyncd can still function

When enabling systemd-timesyncd we need systemd-timesync user

Backport patches to enable timesyncd when resolved and networkd are disabled

replace the resolv.conf symlinink patch with a proper backport

Change-Id I53f1a53eec4e4a4dbdfb7e8cd155d544ee5d81ec
---
 ...onfigure-the-list-of-system-users-files-a.patch | 175 +++++++++++++++++++++
 ...o-not-install-tmpfiles-and-sysusers-files.patch |  53 +++++++
 ...ke-resolv.conf-entry-conditional-on-resol.patch | 141 +++++++++++++++++
 ...es.d-etc.conf-disable-resolv.conf-symlink.patch |  35 -----
 meta/recipes-core/systemd/systemd_216.bb           |  12 +-
 5 files changed, 379 insertions(+), 37 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-tmpfiles.d-etc.conf-disable-resolv.conf-symlink.patch
meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch new file +175 -0
new file mode 100644
index 0000000..c0febd3
@@ -0,0 +1,175 @@
+From 5a16bc264c32237e38a844d55e7a1820a31b8440 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <[email protected]>
+Date: Fri, 28 Nov 2014 15:59:59 +0100
+Subject: [PATCH] build-sys: configure the list of system users, files and
+ directories
+
+Choose which system users defined in sysusers.d/systemd.conf and files
+or directories in tmpfiles.d/systemd.conf, should be provided depending
+on comile-time configuration.
+
+Upstream-Status: Backport
+---
+ Makefile.am                                  | 4 ++++
+ configure.ac                                 | 2 ++
+ sysusers.d/.gitignore                        | 1 +
+ sysusers.d/{systemd.conf => systemd.conf.m4} | 8 ++++++++
+ tmpfiles.d/.gitignore                        | 3 ++-
+ tmpfiles.d/{systemd.conf => systemd.conf.m4} | 2 ++
+ 6 files changed, 19 insertions(+), 1 deletion(-)
+ rename sysusers.d/{systemd.conf => systemd.conf.m4} (77%)
+ rename tmpfiles.d/{systemd.conf => systemd.conf.m4} (96%)
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am	2015-01-23 21:23:04.000000000 +0000
++++ git/Makefile.am	2015-01-23 21:23:04.000000000 +0000
+@@ -5698,6 +5698,10 @@
+ 	$(AM_V_at)$(MKDIR_P) $(dir $@)
+ 	$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
+ 
++sysusers.d/%: sysusers.d/%.m4
++	$(AM_V_at)$(MKDIR_P) $(dir $@)
++	$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
++
+ tmpfiles.d/%: tmpfiles.d/%.m4
+ 	$(AM_V_at)$(MKDIR_P) $(dir $@)
+ 	$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac	2015-01-23 21:23:04.000000000 +0000
++++ git/configure.ac	2015-01-23 21:23:04.000000000 +0000
+@@ -971,6 +971,7 @@
+ AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
+ if test "x$enable_timesyncd" != "xno"; then
+         have_timesyncd=yes
++        M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD"
+ fi
+ AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
+ 
+@@ -1060,6 +1061,7 @@
+ AS_IF([test "x$enable_networkd" != "xno"], [
+         AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
+         have_networkd=yes
++        M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD"
+ ])
+ AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
+ 
+Index: git/sysusers.d/systemd.conf
+===================================================================
+--- git.orig/sysusers.d/systemd.conf	2015-01-23 21:23:02.000000000 +0000
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,12 +0,0 @@
+-#  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.
+-
+-g systemd-journal   - -
+-u systemd-bus-proxy - "systemd Bus Proxy"
+-u systemd-network   - "systemd Network Management"
+-u systemd-resolve   - "systemd Resolver"
+-u systemd-timesync  - "systemd Time Synchronization"
+Index: git/sysusers.d/systemd.conf.m4
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ git/sysusers.d/systemd.conf.m4	2015-01-23 21:26:30.000000000 +0000
+@@ -0,0 +1,20 @@
++#  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.
++
++g systemd-journal   - -
++m4_ifdef(`ENABLE_KDBUS',
++u systemd-bus-proxy - "systemd Bus Proxy"
++)m4_dnl
++m4_ifdef(`ENABLE_NETWORKD',
++u systemd-network   - "systemd Network Management"
++)m4_dnl
++m4_ifdef(`ENABLE_RESOLVED',
++u systemd-resolve   - "systemd Resolver"
++)m4_dnl
++m4_ifdef(`ENABLE_TIMESYNCD',
++u systemd-timesync  - "systemd Time Synchronization"
++)m4_dnl
+Index: git/tmpfiles.d/systemd.conf
+===================================================================
+--- git.orig/tmpfiles.d/systemd.conf	2015-01-23 21:23:02.000000000 +0000
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,32 +0,0 @@
+-#  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/user 0755 root root -
+-F! /run/utmp 0664 root utmp -
+-
+-d /run/systemd/ask-password 0755 root root -
+-d /run/systemd/seats 0755 root root -
+-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 -
+-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/log 0755 root root -
+-
+-z /run/log/journal 2755 root systemd-journal - -
+-Z /run/log/journal/%m ~2750 root systemd-journal - -
+-
+-z /var/log/journal 2755 root systemd-journal - -
+-z /var/log/journal/%m 2755 root systemd-journal - -
+-
+-d /var/lib/systemd 0755 root root -
+-d /var/lib/systemd/coredump 0755 root root 3d
+Index: git/tmpfiles.d/systemd.conf.m4
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ git/tmpfiles.d/systemd.conf.m4	2015-01-23 21:26:46.000000000 +0000
+@@ -0,0 +1,34 @@
++#  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/user 0755 root root -
++F! /run/utmp 0664 root utmp -
++
++d /run/systemd/ask-password 0755 root root -
++d /run/systemd/seats 0755 root root -
++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 -
++m4_ifdef(`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 -
++)m4_dnl
++
++d /run/log 0755 root root -
++
++z /run/log/journal 2755 root systemd-journal - -
++Z /run/log/journal/%m ~2750 root systemd-journal - -
++
++z /var/log/journal 2755 root systemd-journal - -
++z /var/log/journal/%m 2755 root systemd-journal - -
++
++d /var/lib/systemd 0755 root root -
++d /var/lib/systemd/coredump 0755 root root 3d
meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch new file +53 -0

53 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch new file +141 -0

141 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0001-tmpfiles.d-etc.conf-disable-resolv.conf-symlink.patch deleted +0 -35
deleted file mode 100644
index 7218322..0000000
@@ -1,35 +0,0 @@
-From f0ab1600fb56d680e6aba3d0d51dfb9ffa3d9403 Mon Sep 17 00:00:00 2001
-From: "Peter A. Bigot" <[email protected]>
-Date: Thu, 18 Sep 2014 08:36:54 -0500
-Subject: [PATCH] tmpfiles.d/etc.conf: disable resolv.conf symlink
-
-This link is valid only if ENABLE_RESOLVED is configured for systemd.
-If left unconditional, the symlink is created preventing connman from
-storing the configuration it received from DHCP or other sources.
-
-Upstream has a TODO to fix this, but has not done so as of this date.
-Provide a temporary workaround for OE until this is done properly
-upstream.
-
-Upstream-Status: Inappropriate [OE-specific]
-Signed-off-by: Peter A. Bigot <[email protected]>
----
- tmpfiles.d/etc.conf | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/tmpfiles.d/etc.conf b/tmpfiles.d/etc.conf
-index b23272c..5364dd8 100644
---- a/tmpfiles.d/etc.conf
-+++ b/tmpfiles.d/etc.conf
-@@ -10,6 +10,7 @@
- L /etc/os-release - - - - ../usr/lib/os-release
- L /etc/localtime - - - - ../usr/share/zoneinfo/UTC
- L+ /etc/mtab - - - - ../proc/self/mounts
--L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
-+# TODO: conditional on ENABLE_RESOLVED
-+#L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
- C /etc/nsswitch.conf - - - -
- C /etc/pam.d - - - -
--- 
-1.8.5.5
-
meta/recipes-core/systemd/systemd_216.bb +10 -2
index bfd5544..47691a9 100644
@@ -35,11 +35,13 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://0001-Make-root-s-home-directory-configurable.patch \
            file://0001-systemd-user-avoid-using-system-auth.patch \
            file://0001-journal-Fix-navigating-backwards-missing-entries.patch \
+           file://0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch \
+           file://0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch \
+           file://0001-build-sys-configure-the-list-of-system-users-files-a.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
            file://run-ptest \
-           ${@bb.utils.contains('PACKAGECONFIG', 'resolved', '', 'file://0001-tmpfiles.d-etc.conf-disable-resolv.conf-symlink.patch', d)} \
           "
 
 S = "${WORKDIR}/git"
@@ -151,6 +153,12 @@ do_install() {
 
 	# Enable journal to forward message to syslog daemon
 	sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+	# its needed in 216 upstream has fixed it with 919699ec301ea507edce4a619141ed22e789ac0d
+	# don't order journal flushing afte remote-fs.target
+	sed -i -e 's/ remote-fs.target$//' ${D}${systemd_unitdir}/system/systemd-journal-flush.service
+	# this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
+	# for existence else it fails
+	${@bb.utils.contains('PACKAGECONFIG', 'networkd', '', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)}
 }
 
 do_install_ptest () {
@@ -182,7 +190,7 @@ SYSTEMD_PACKAGES = "${PN}-binfmt"
 SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
 
 USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} += "--system systemd-journal-gateway"
+USERADD_PARAM_${PN} += "--system systemd-journal-gateway; --system systemd-timesync"
 GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
 
 FILES_${PN}-analyze = "${bindir}/systemd-analyze"
Signature · 1 line
2.1.1
#1 lore raw
Quoted 7 lines · Khem Raj

Fix systemd-timesyncd assertion

when networkd is disabled then we now do not
create /run/systemd/netif/links but timesyncd needs it. So lets manually create this file when networkd is disabled so timesyncd can still function

Quoted 7 lines

When enabling systemd-timesyncd we need systemd-timesync user

Backport patches to enable timesyncd when resolved and networkd are disabled

replace the resolv.conf symlinink patch with a proper backport

Awesome, but the patches need you to add your Signed-off-by tag.

Ross

author
#2 lore raw
Quoted 12 lines · Ross

On 29 January 2015 at 04:54, Khem Raj <[email protected] <mailto:[email protected]>> wrote:
Fix systemd-timesyncd assertion

when networkd is disabled then we now do not
create /run/systemd/netif/links but timesyncd needs it. So lets manually create this file when networkd is disabled so timesyncd can still function

Quoted 9 lines

When enabling systemd-timesyncd we need systemd-timesync user

Backport patches to enable timesyncd when resolved and networkd are disabled

replace the resolv.conf symlinink patch with a proper backport

Awesome, but the patches need you to add your Signed-off-by tag.

They are straight back ports and have original authors sign-offs so someone can bug him/her in case its needed :) secondly I have added upstream-status which will make it easy for someone working on systemd to get an idea about the patch. none the less I will send a v2.

Quoted 1 line

Ross