Skip to contentSkip to conversation

systemd upgrade to 216 and other misc fixes

PATCH Superseded Chen Qi 4 participants 45 messages Sep 2, 2014 – Sep 8, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover systemd upgrade to 216 and other misc fixes

systemd upgrade has been tested on
*) qemuarm
*) qemumips
*) qemuppc
*) qemux86
*) qemux86-64

The whole patchset has passed the following test case on qemux86-64. bitbake core-image-sato -ctestimage

//Chen Qi

The following changes since commit a57b24f848a7cb89cf57830e07682224f8bbc96f:

tzcode: update to 2014g (2014-08-31 23:39:13 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/systemd-misc-fixes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/systemd-misc-fixes

Chen Qi (25):
systemd: upgrade to 216
systemd: add PACKAGECONFIG for curl
systemd: make runlevel work in non-runlevel targets update-rc.d: fix logic in populate_packages_updatercd
alsa-state: fix pkg_postinst and set INHIBIT_UPDATERCD_BBCLASS
keymaps: fix for systemd
systemd: add kbd-keymaps to RRECOMMENDS of systemd-vconsole-setup
v86d: set INHIBIT_UPDATERCD_BBCLASS if 'sysvinit' not in
DISTRO_FEATURES
systemd: add support for executing scripts under /etc/rcS.d
dhcp: add dhcpd.service
dhcp: add dhcrelay.service
acpid: upgrade to 2.0.22 and add systemd support
cups: add systemd support
rpcbind: avoid entering failed status after stopping daemon
at: remove dependency on initscripts
at: inherit update-rc.d to handle sysv init script
keymaps: remove dependency on initscripts
packagegroup-core-boot: conditionally rdepend on
VIRTUAL-RUNTIME_initscripts
initscripts: mask several init scripts
keymaps: mask keymap when necessary
v86d: mask fbsetup when necessary
psplash: mask psplash in case of systemd
modutils-initscripts: mask modutils in case of systemd run-postinsts.service: remove redundant line
systemd: enable forwarding messages to syslog daemon

In Long (1):
cups: make cups daemon start correctly

 meta/classes/update-rc.d.bbclass                   |   2 +-
 meta/recipes-bsp/acpid/acpid.inc                   |  24 ++--
 meta/recipes-bsp/acpid/acpid/acpid.service         |  10 ++
 .../acpid/acpid/set_socket_noblock.patch           |  10 --
 .../acpid/{acpid_1.0.10.bb => acpid_2.0.22.bb}     |   5 +-
 meta/recipes-bsp/alsa-state/alsa-state.bb          |  11 +-
 meta/recipes-bsp/keymaps/keymaps_1.0.bb            |  32 ++++-
 meta/recipes-bsp/v86d/v86d_0.1.10.bb               |  17 +++
 meta/recipes-connectivity/dhcp/dhcp.inc            |  23 +++-
 meta/recipes-connectivity/dhcp/files/dhcpd.service |  11 ++
 .../dhcp/files/dhcrelay.service                    |   9 ++
 meta/recipes-core/initscripts/initscripts_1.0.bb   |   4 +
 .../packagegroups/packagegroup-core-boot.bb        |   2 +-
 meta/recipes-core/psplash/psplash_git.bb           |  10 ++
 ...ort-for-executing-scripts-under-etc-rcS.d.patch | 138 +++++++++++++++++++++
 ...ing.h-add-fake-__NR_memfd_create-for-MIPS.patch |  29 +++++
 ...1-uClibc-doesn-t-implement-pwritev-preadv.patch |  34 -----
 ...-Including-missing.h-to-get-MAX_HANDLE_SZ.patch |  29 -----
 .../systemd/systemd/systemd-older-kernel.patch     |  56 ---------
 .../systemd/{systemd_213.bb => systemd_216.bb}     |  34 +++--
 .../run-postinsts/run-postinsts.service            |   1 -
 meta/recipes-extended/at/at/{S99at => atd.init}    |   0
 meta/recipes-extended/at/at_3.1.15.bb              |  13 +-
 meta/recipes-extended/cups/cups.inc                |  22 +++-
 meta/recipes-extended/cups/cups/cups.path          |   8 ++
 meta/recipes-extended/cups/cups/cups.service       |  10 ++
 meta/recipes-extended/cups/cups/cups.socket        |   8 ++
 .../rpcbind/rpcbind/rpcbind.service                |   1 +
 .../modutils-initscripts/modutils-initscripts.bb   |  10 ++
 29 files changed, 386 insertions(+), 177 deletions(-)
 create mode 100644 meta/recipes-bsp/acpid/acpid/acpid.service
 delete mode 100644 meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
 rename meta/recipes-bsp/acpid/{acpid_1.0.10.bb => acpid_2.0.22.bb} (55%)
 create mode 100644 meta/recipes-connectivity/dhcp/files/dhcpd.service
 create mode 100644 meta/recipes-connectivity/dhcp/files/dhcrelay.service
 create mode 100644 meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-util-Including-missing.h-to-get-MAX_HANDLE_SZ.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/systemd-older-kernel.patch
 rename meta/recipes-core/systemd/{systemd_213.bb => systemd_216.bb} (87%)
 rename meta/recipes-extended/at/at/{S99at => atd.init} (100%)
 create mode 100644 meta/recipes-extended/cups/cups/cups.path
 create mode 100644 meta/recipes-extended/cups/cups/cups.service
 create mode 100644 meta/recipes-extended/cups/cups/cups.socket
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/26 systemd: upgrade to 216

Upgrade systemd from 213 to 216.

systemd-older-kernel.patch is removed as it's fixed in 216.

0001-uClibc-doesn-t-implement-pwritev-preadv.patch is removed because the file it patches has been removed from the project.

0001-util-Including-missing.h-to-get-MAX_HANDLE_SZ.patch is removed because it has been merged.

0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch is backported to fix compilation error for mips.

Below are the required kernel versions for systemd 216.
Linux kernel >= 3.0
Linux kernel >= 3.3 for loop device partition support features with nspawn Linux kernel >= 3.8 for Smack support

---
 ...ing.h-add-fake-__NR_memfd_create-for-MIPS.patch | 29 +++++++++++
 ...1-uClibc-doesn-t-implement-pwritev-preadv.patch | 34 -------------
 ...-Including-missing.h-to-get-MAX_HANDLE_SZ.patch | 29 -----------
 .../systemd/systemd/systemd-older-kernel.patch     | 56 ----------------------
 .../systemd/{systemd_213.bb => systemd_216.bb}     | 15 +++---
 5 files changed, 38 insertions(+), 125 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-util-Including-missing.h-to-get-MAX_HANDLE_SZ.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/systemd-older-kernel.patch
 rename meta/recipes-core/systemd/{systemd_213.bb => systemd_216.bb} (96%)
meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch new file +29 -0
new file mode 100644
index 0000000..448ef1a
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+
+Subject: missing.h: add fake __NR_memfd_create for MIPS
+
+We don't have the correct __NR_memfd_create syscall number yet, so set it to
+0xffffffff for now to prevent compile time errors.
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/shared/missing.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/shared/missing.h b/src/shared/missing.h
+index 3ff1a21..3051cb5 100644
+--- a/src/shared/missing.h
++++ b/src/shared/missing.h
+@@ -167,6 +167,9 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
+ #      define __NR_fanotify_mark 5296
+ #    endif
+ #  endif
++#  ifndef __NR_memfd_create
++#    define __NR_memfd_create 0xffffffff /* FIXME */
++#  endif
+ #else
+ #  ifndef __NR_fanotify_init
+ #    define __NR_fanotify_init 338
+-- 
+1.9.1
+
meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch deleted +0 -34
deleted file mode 100644
index 9fdb3c9..0000000
@@ -1,34 +0,0 @@
-Upstream-Status: Inappropriate [uclibc specific]
-
-From 7be9273548bcb1f57d011fc252965e45dd2a058c Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 21 Aug 2013 19:09:27 -0700
-Subject: [PATCH] uClibc doesn't implement pwritev/preadv
-
-Lets stub out the testcase for building.
-
-Signed-off-by: Khem Raj <[email protected]>
----
- src/libsystemd-bus/test-bus-memfd.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c
-===================================================================
---- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c	2014-02-19 15:03:09.983254602 -0800
-+++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c	2014-02-19 23:42:10.636652864 -0800
-@@ -151,6 +151,7 @@
-         /* check content */
-         assert_se(memcmp(buf, "ll", 2) == 0);
- 
-+#ifndef __UCLIBC__
-         /* writev it out*/
-         iov[0].iov_base = (char *)"ABC";
-         iov[0].iov_len = 3;
-@@ -173,6 +174,7 @@
-         assert_se(memcmp(bufv[0], "ABC", 3) == 0);
-         assert_se(memcmp(bufv[1], "DEF", 3) == 0);
-         assert_se(memcmp(bufv[2], "GHI", 3) == 0);
-+#endif /* __UCLIBC__ */
- 
-         sd_memfd_free(m);
- 
meta/recipes-core/systemd/systemd/0001-util-Including-missing.h-to-get-MAX_HANDLE_SZ.patch deleted +0 -29
deleted file mode 100644
index ba4a21b..0000000
@@ -1,29 +0,0 @@
-From 764ecbeda4813f33eafd45fdc3ccb9376356f475 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Mon, 25 Aug 2014 15:40:31 -0700
-Subject: [PATCH] util: Including missing.h to get MAX_HANDLE_SZ
-
-Helps compiling on uclibc
-
-Signed-off-by: Khem Raj <[email protected]>
-
-Upstream-Status: [Backport]
----
- src/shared/util.h |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/shared/util.h b/src/shared/util.h
-index 62eb604..036fc59 100644
---- a/src/shared/util.h
-+++ b/src/shared/util.h
-@@ -84,6 +84,7 @@
- #endif
- 
- #include "macro.h"
-+#include "missing.h"
- #include "time-util.h"
- 
- /* What is interpreted as whitespace? */
--- 
-1.7.10.4
-
meta/recipes-core/systemd/systemd/systemd-older-kernel.patch deleted +0 -56

56 lines not on this page · raw message

meta/recipes-core/systemd/systemd_216.bb renamed from meta/recipes-core/systemd/systemd_213.bb +9 -6
similarity index 96%
rename from meta/recipes-core/systemd/systemd_213.bb
rename to meta/recipes-core/systemd/systemd_216.bb
index ca071c1..df4a217 100644
@@ -17,9 +17,9 @@ SECTION = "base/shell"
 
 inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext
 
-SRCREV = "c9679c652b3c31f2510e8805d81630680ebc7e95"
+SRCREV = "5d0ae62c665262c4c55536457e84e278c252cc0b"
 
-PV = "213+git${SRCPV}"
+PV = "216+git${SRCPV}"
 
 SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \
            file://binfmt-install.patch \
@@ -28,15 +28,13 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://systemd-pam-fix-fallocate.patch \
            file://systemd-pam-fix-mkostemp.patch \
            file://optional_secure_getenv.patch \
-           file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
            file://uclibc-sysinfo_h.patch \
            file://uclibc-get-physmem.patch \
-           file://0001-util-Including-missing.h-to-get-MAX_HANDLE_SZ.patch \
+           file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
            file://run-ptest \
-           file://systemd-older-kernel.patch \
           "
 
 S = "${WORKDIR}/git"
@@ -126,6 +124,9 @@ do_install() {
 		sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
 	fi
 
+	# Move libgudev back to ${rootlibdir} to keep backward compatibility
+	[ ${rootlibdir} != ${exec_prefix}/lib ] && mv -t ${D}${rootlibdir} ${D}${exec_prefix}/lib/libgudev*
+
         # Delete journal README, as log can be symlinked inside volatile.
         rm -f ${D}/${localstatedir}/log/README
 }
@@ -208,6 +209,7 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${datadir}/dbus-1/system-services \
                 ${datadir}/polkit-1 \
                 ${datadir}/${BPN} \
+                ${datadir}/factory \
                 ${sysconfdir}/bash_completion.d/ \
                 ${sysconfdir}/dbus-1/ \
                 ${sysconfdir}/machine-id \
@@ -220,7 +222,7 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${rootlibexecdir}/systemd/* \
                 ${systemd_unitdir}/* \
                 ${base_libdir}/security/*.so \
-                ${libdir}/libnss_myhostname.so.2 \
+                ${exec_prefix}/lib/libnss_* \
                 /cgroup \
                 ${bindir}/systemd* \
                 ${bindir}/busctl \
@@ -233,6 +235,7 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${exec_prefix}/lib/systemd \
                 ${exec_prefix}/lib/modules-load.d \
                 ${exec_prefix}/lib/sysctl.d \
+                ${exec_prefix}/lib/sysusers.d \
                 ${localstatedir} \
                 /lib/udev/rules.d/70-uaccess.rules \
                 /lib/udev/rules.d/71-seat.rules \
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 01/26] systemd: upgrade to 216

Quoted 1 line · Chen Qi

Upgrade systemd from 213 to 216.

This broke me, because by 216 systemd started managing /etc/resolv.conf which is fine except that it uses a static configuration in /etc/systemd/resolved.conf, whereas in the 213 days I was getting /etc/resolv.conf managed by connman which set up the nameservers based on information it received from dhcp meaning one less per-host configuration file I need to manage.

I was able to get working behavior again by doing systemctl disable systemd-resolved, removing the /etc/resolv.conf symlink, and rebooting.

Further investigation suggests that systemd-networkd is intended to do the same sort of thing as connman, though so maybe I need to shoot that instead.

I have no answers, but just wanted to note that there now appears to be some conflict between connman and systemd that didn't used to be there. Maybe systemd-networkd and its constituent pieces need to be pulled out as a separate package? Or some sort of conflict detection if both connman and systemd-networkd are in the same image?

Peter

#3 lore raw

Re: [PATCH 01/26] systemd: upgrade to 216

Quoted 8 lines · Peter A. Bigot

Further investigation suggests that systemd-networkd is intended to do the same sort of thing as connman, though so maybe I need to shoot that instead.

I have no answers, but just wanted to note that there now appears to be some conflict between connman and systemd that didn't used to be there. Maybe systemd-networkd and its constituent pieces need to be pulled out as a separate package? Or some sort of conflict detection if both connman and systemd-networkd are in the same image?

systemd-networkd is meant for early init or "simple" configuration and there's meant to be handover from systemd to connman. At least that's what I was told, and the connman authors have contributed code to systemd...

Chen, can you look into this? I'll chase when I'm up tomorrow if you've not managed to resolve this already.

Ross

#4 lore raw

Re: [PATCH 01/26] systemd: upgrade to 216

In reply to Peter A. Bigot
Quoted 2 lines · Peter A. Bigot

Maybe systemd-networkd and its constituent pieces need to be pulled out as a separate package?

Yes; I think this is necessary. systemd gets larger and larger with each release and is providing functionality which is either not needed (logind, the network stuff, nspawn, nss modules) or which is solved by other parts of the system and is conflicting with them.

Enrico

Signature · 3 lines
SIGMA Chemnitz GmbH       Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13           Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz
#5 lore raw

Re: [PATCH 01/26] systemd: upgrade to 216

Quoted 7 lines · Enrico Scholz
Quoted 2 lines

Maybe systemd-networkd and its constituent pieces need to be pulled out as a separate package?

Yes; I think this is necessary. systemd gets larger and larger with each release and is providing functionality which is either not needed (logind, the network stuff, nspawn, nss modules) or which is solved by other parts of the system and is conflicting with them.

Considering the number of patches still landing in resolved and networkd, I think just disabling them right now is safest. I just sent a patch to do this.

Ross

author
#6 lore raw

PATCH 2/26 systemd: add PACKAGECONFIG for curl

In reply to Chen Qi

Add PACKAGECONFIG for curl and disable it by default.

---
 meta/recipes-core/systemd/systemd_216.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_216.bb +1 -0
index df4a217..cccecf5 100644
@@ -47,6 +47,7 @@ LDFLAGS_append_libc-uclibc = " -lrt"
 GTKDOC_DOCDIR = "${S}/docs/"
 
 PACKAGECONFIG ??= "xz"
+PACKAGECONFIG[curl] = "--enable-libcurl,--disable-libcurl,curl"
 # Sign the journal for anti-tampering
 PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
 # regardless of PACKAGECONFIG, libgcrypt is always required to expand
Signature · 1 line
1.9.1
#7 lore raw

Re: [PATCH 02/26] systemd: add PACKAGECONFIG for curl

Quoted 1 line · Chen Qi

Add PACKAGECONFIG for curl and disable it by default.

It isn't clear what the curl dependency is for without reading the source, so naming the option "journal-upload" would be self-documenting.

Ross

author
#8 lore raw

Re: [PATCH 02/26] systemd: add PACKAGECONFIG for curl

Quoted 9 lines · Ross
Quoted 1 line · Chen Qi

Add PACKAGECONFIG for curl and disable it by default.

It isn't clear what the curl dependency is for without reading the source, so naming the option "journal-upload" would be self-documenting.

Ross

Got it!

Thanks,
Chen Qi

author
#9 lore raw

PATCH 3/26 systemd: make runlevel work in non-runlevel targets

In reply to Chen Qi

Previously, after booting into the targets like multi-user.target or graphical.target, the output of `runlevel' command is 'unknown'.

This is confusing for users. Normally, we would expect mutli-user.target would have a `runlevel' output of 'N 3'.
This is the behaviour of Fedora20.

This patch installs symlinks for systemd-update-utmp-runlevel.service in do_install task to fix the above problem.

---
 meta/recipes-core/systemd/systemd_216.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-core/systemd/systemd_216.bb +12 -0
index cccecf5..eef1359 100644
@@ -130,6 +130,18 @@ do_install() {
 
         # Delete journal README, as log can be symlinked inside volatile.
         rm -f ${D}/${localstatedir}/log/README
+
+	# Create symlinks for systemd-update-utmp-runlevel.service
+	install -d ${D}${systemd_unitdir}/system/graphical.target.wants
+	install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+	install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
+	install -d ${D}${systemd_unitdir}/system/reboot.target.wants
+	install -d ${D}${systemd_unitdir}/system/rescue.target.wants
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
 }
 
 do_install_ptest () {
Signature · 1 line
1.9.1
author
#10 lore raw

PATCH 4/26 update-rc.d: fix logic in populate_packages_updatercd

In reply to Chen Qi

The 'and' logic for the check is wrong. To make things clear, please see the example below.

Say that we have a recipe A, which has a sysv-init style init script named initA and no corresponding service file. The recipe inherits update-rc.d, but it doesn't inherit systemd.bbclass. The DISTRO_FEATURES has 'systemd' inside it, but it doesn't have 'sysvinit'. Now if we build an image, with the 'and' logic in the check, the symlinks for initA would not be installed into /etc/rc?.d directory.
This is incorrect. Because there's no corresponding service. The symlinks in /etc/rc?.d/ should be created so that the service would be correctly started at boot time.

The logic should really be 'or' in the check. This is actually what the code was when it was originally written.

Several different situations are listed below to prove the correctness of the 'or' logic.

If 'sysvinit' is in DISTRO_FEATURES, the initA script would always be installed with corresponding preisnt/postinst generated and added.

If 'sysvinit' is not in DISTRO_FEATURES, we have three situations.
1) A has initA and A.service.
In such situation, systemd.bbclass would set INHIBIT_UPDATERCD_BBCLASS, so no preinst/postinst about update-rc.d would be added and the symlinks for initA would not be created.

2) A has initA, and the functionality of initA is not implemented internally in systemd.
In such situation, symlinks for initA would be installed.

3) A has initA, and the functionality of initA is implemented internally in systemd or in some other recipe.
Examples for such situation are alsa-state and keymaps in OE. In such situation, we need to set INHIBIT_UPDATERCD_BBCLASS in the recipe so that there would be no preinst/postinst scripts about update-rc.d added.

---
 meta/classes/update-rc.d.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/update-rc.d.bbclass +1 -1
index 19b081d..3c5414b 100644
@@ -121,7 +121,7 @@ python populate_packages_updatercd () {
 
     # Check that this class isn't being inhibited (generally, by
     # systemd.bbclass) before doing any work.
-    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
        not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
Signature · 1 line
1.9.1
author
#11 lore raw

PATCH 5/26 alsa-state: fix pkg_postinst and set INHIBIT_UPDATERCD_BBCLASS

In reply to Chen Qi

As alsa-state inherits update-rc.d, the update-rc.d part inpostinst script has already been handled in update-rc.d.bbclass.

Besides, we need to set INHIBIT_UPDATERCD_BBCLASS to "1" if 'sysvinit' is not in DISTRO_FEATURES. This is because the init script is not installed in such situation, adding update-rc.d part in the preinst/postinst scripts just makes no sense.

---
 meta/recipes-bsp/alsa-state/alsa-state.bb | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
meta/recipes-bsp/alsa-state/alsa-state.bb +7 -4
index d2f8ea2..17c2d00 100644
@@ -18,6 +18,13 @@ SRC_URI = "\
   file://alsa-state-init \
 "
 
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
 inherit update-rc.d
 
 INITSCRIPT_NAME = "alsa-state"
@@ -54,9 +61,5 @@ pkg_postinst_${PN}() {
 		then
 			${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
 		fi
-		# INITSCRIPT_PARAMS changed, so remove the old and
-		# install the new setting.
-		update-rc.d -f ${INITSCRIPT_NAME} remove
-		update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
 	fi
 }
Signature · 1 line
1.9.1
author
#12 lore raw

PATCH 6/26 keymaps: fix for systemd

In reply to Chen Qi

Only install 'keymap.sh' script if 'sysvinit' is in DISTRO_FEATURES. This is because systemd internally provides a mechanism to implement the functionality this script tries to implement. Please see systemd-vconsole-setup.service for more details.

Also we set 'INHIBIT_UPDATERCD_BBCLASS' to "1" if 'sysvinit' is not in DISTRO_FEATURES.

---
 meta/recipes-bsp/keymaps/keymaps_1.0.bb | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
meta/recipes-bsp/keymaps/keymaps_1.0.bb +15 -2
index 123db3e..5a3f974 100644
@@ -14,6 +14,13 @@ PR = "r31"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
 inherit update-rc.d
 
 SRC_URI = "file://keymap.sh \
@@ -23,6 +30,12 @@ INITSCRIPT_NAME = "keymap.sh"
 INITSCRIPT_PARAMS = "start 01 S ."
 
 do_install () {
-    install -d ${D}${sysconfdir}/init.d/
-    install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/
+    # Only install the script if 'sysvinit' is in DISTRO_FEATURES
+    # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/
+    fi
 }
+
+ALLOW_EMPTY_${PN} = "1"
Signature · 1 line
1.9.1
author
#13 lore raw

PATCH 7/26 systemd: add kbd-keymaps to RRECOMMENDS of systemd-vconsole-setup

In reply to Chen Qi

systemd-vconsole-setup.service not only configures font but also keymaps.

---
 meta/recipes-core/systemd/systemd_216.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_216.bb +1 -1
index eef1359..8fc79e4 100644
@@ -209,7 +209,7 @@ FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
                       ${systemd_unitdir}/system/systemd-binfmt.service"
 RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
 
-RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
+RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
 
 CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
                 ${sysconfdir}/systemd/logind.conf \
Signature · 1 line
1.9.1
author
#14 lore raw

PATCH 8/26 v86d: set INHIBIT_UPDATERCD_BBCLASS if 'sysvinit' not in DISTRO_FEATURES

In reply to Chen Qi

Set INHIBIT_UPDATERCD_BBCLASS to "1" if 'sysvinit' is not in DISTRO_FEATURES.

The functionality of the init script 'fbsetup' is implemented internally in systemd. So fbsetup is not installed if 'sysvinit' is in DISTRO_FEATURES.

That's why we need to set INHIBIT_UPDATERCD_BBCLASS to "1" to avoid generation of update-rc.d related preinst/postinst scripts.

---
 meta/recipes-bsp/v86d/v86d_0.1.10.bb | 7 +++++++
 1 file changed, 7 insertions(+)
meta/recipes-bsp/v86d/v86d_0.1.10.bb +7 -0
index 08438be..7ccb4ee 100644
@@ -49,4 +49,11 @@ do_install () {
         fi
 }
 
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
 inherit update-rc.d
Signature · 1 line
1.9.1
author
#15 lore raw

PATCH 9/26 systemd: add support for executing scripts under /etc/rcS.d

In reply to Chen Qi

This patch adds support for systemd to execute scripts under /etc/rcS.d.

To be compitable, all services translated from /etc/rcS.d/ scripts would run before services translated from /etc/rcN.d scripts.

[YOCTO #5159]

---
 ...ort-for-executing-scripts-under-etc-rcS.d.patch | 138 +++++++++++++++++++++
 meta/recipes-core/systemd/systemd_216.bb           |   1 +
 2 files changed, 139 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch
meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch new file +138 -0
new file mode 100644
index 0000000..9aa07c1
@@ -0,0 +1,138 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: add support for executing scripts under /etc/rcS.d/
+
+To be compatible, all services translated from scripts under /etc/rcS.d would
+run before services translated from scripts under /etc/rcN.d.
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/sysv-generator/sysv-generator.c | 50 ++++++++++++++++++++++++++++---------
+ 1 file changed, 38 insertions(+), 12 deletions(-)
+
+diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
+index 9a869ba..10c55c0 100644
+--- a/src/sysv-generator/sysv-generator.c
++++ b/src/sysv-generator/sysv-generator.c
+@@ -43,7 +43,8 @@
+ 
+ typedef enum RunlevelType {
+         RUNLEVEL_UP,
+-        RUNLEVEL_DOWN
++        RUNLEVEL_DOWN,
++        RUNLEVEL_SYSINIT
+ } RunlevelType;
+ 
+ static const struct {
+@@ -58,6 +59,9 @@ static const struct {
+         { "rc4.d",  SPECIAL_RUNLEVEL4_TARGET, RUNLEVEL_UP },
+         { "rc5.d",  SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP },
+ 
++        /* Debian style rcS.d, also adopted by OE */
++        { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT},
++
+         /* Standard SysV runlevels for shutdown */
+         { "rc0.d",  SPECIAL_POWEROFF_TARGET,  RUNLEVEL_DOWN },
+         { "rc6.d",  SPECIAL_REBOOT_TARGET,    RUNLEVEL_DOWN }
+@@ -66,7 +70,7 @@ static const struct {
+            directories in this order, and we want to make sure that
+            sysv_start_priority is known when we first load the
+            unit. And that value we only know from S links. Hence
+-           UP must be read before DOWN */
++           UP/SYSINIT must be read before DOWN */
+ };
+ 
+ typedef struct SysvStub {
+@@ -82,6 +86,8 @@ typedef struct SysvStub {
+         char **conflicts;
+         bool has_lsb;
+         bool reload;
++        bool default_dependencies;
++        bool from_rcsd;
+ } SysvStub;
+ 
+ const char *arg_dest = "/tmp";
+@@ -156,6 +162,9 @@ static int generate_unit_file(SysvStub *s) {
+                 "Description=%s\n",
+                 s->path, s->description);
+ 
++        if (!s->default_dependencies)
++                fprintf(f, "DefaultDependencies=no\n");
++
+         if (!isempty(before))
+                 fprintf(f, "Before=%s\n", before);
+         if (!isempty(after))
+@@ -661,18 +670,30 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
+                 if (s->has_lsb && other->has_lsb)
+                         continue;
+ 
+-                if (other->sysv_start_priority < s->sysv_start_priority) {
+-                        r = strv_extend(&s->after, other->name);
++                /* All scripts under /etc/rcS.d should execute before scripts under
++                 * /etc/rcN.d */
++                if (!other->from_rcsd && s->from_rcsd) {
++                        r = strv_extend(&s->before, other->name);
+                         if (r < 0)
+                                 return log_oom();
+-                }
+-                else if (other->sysv_start_priority > s->sysv_start_priority) {
+-                        r = strv_extend(&s->before, other->name);
++                } else if (other->from_rcsd && !s->from_rcsd) {
++                        r = strv_extend(&s->after, other->name);
+                         if (r < 0)
+                                 return log_oom();
+-                }
+-                else
+-                        continue;
++                } else {
++                        if (other->sysv_start_priority < s->sysv_start_priority) {
++                                r = strv_extend(&s->after, other->name);
++                                if (r < 0)
++                                        return log_oom();
++                        }
++                        else if (other->sysv_start_priority > s->sysv_start_priority) {
++                                r = strv_extend(&s->before, other->name);
++                                if (r < 0)
++                                        return log_oom();
++                        }
++                        else
++                                continue;
++                 }
+ 
+                 /* FIXME: Maybe we should compare the name here lexicographically? */
+         }
+@@ -725,6 +746,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+                                 return log_oom();
+ 
+                         service->sysv_start_priority = -1;
++                        service->default_dependencies = true;
++                        service->from_rcsd = false;
+                         service->name = name;
+                         service->path = fpath;
+ 
+@@ -810,9 +833,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+ 
+                                 if (de->d_name[0] == 'S')  {
+ 
+-                                        if (rcnd_table[i].type == RUNLEVEL_UP) {
++                                        if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
+                                                 service->sysv_start_priority =
+                                                         MAX(a*10 + b, service->sysv_start_priority);
++                                                service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true;
++                                                service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false;
+                                         }
+ 
+                                         r = set_ensure_allocated(&runlevel_services[i],
+@@ -825,7 +850,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+                                                 goto finish;
+ 
+                                 } else if (de->d_name[0] == 'K' &&
+-                                           (rcnd_table[i].type == RUNLEVEL_DOWN)) {
++                                           (rcnd_table[i].type == RUNLEVEL_DOWN ||
++                                            rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
+ 
+                                         r = set_ensure_allocated(&shutdown_services,
+                                                                  trivial_hash_func, trivial_compare_func);
+-- 
+1.9.1
+
meta/recipes-core/systemd/systemd_216.bb +1 -0
index 8fc79e4..776006f 100644
@@ -30,6 +30,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://optional_secure_getenv.patch \
            file://uclibc-sysinfo_h.patch \
            file://uclibc-get-physmem.patch \
+           file://0001-add-support-for-executing-scripts-under-etc-rcS.d.patch \
            file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
Signature · 1 line
1.9.1
#16 lore raw

Re: [PATCH 09/26] systemd: add support for executing scripts under /etc/rcS.d

Quoted 1 line · Chen Qi

This patch adds support for systemd to execute scripts under /etc/rcS.d.

Did this patch come from the Debian package? If so please state this and include a link so we can keep in sync with their patch.

Ross

author
#17 lore raw

Re: [PATCH 09/26] systemd: add support for executing scripts under /etc/rcS.d

Quoted 8 lines · Ross
Quoted 1 line · Chen Qi

This patch adds support for systemd to execute scripts under /etc/rcS.d.

Did this patch come from the Debian package? If so please state this and include a link so we can keep in sync with their patch.

Ross

Hi Ross,

The patch is different from that from Debian.
The difference mainly comes from the fact that Debian init scripts all have proper LSB header while a lot of our init scripts do not.

Below is a link to Debian's patch to systemd.
http://sources.debian.net/src/systemd/204-5/debian/patches/debian-changes/?hl=1391#L1391

Best Regards,
Chen Qi

author
#18 lore raw

PATCH 10/26 dhcp: add dhcpd.service

In reply to Chen Qi

Add dhcpd.service to support systemd systems.

---
 meta/recipes-connectivity/dhcp/dhcp.inc            | 18 ++++++++++++++----
 meta/recipes-connectivity/dhcp/files/dhcpd.service | 11 +++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-connectivity/dhcp/files/dhcpd.service
meta/recipes-connectivity/dhcp/dhcp.inc +14 -4
index 512127c..b281f94 100644
@@ -14,11 +14,16 @@ DEPENDS = "openssl bind"
 
 SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
            file://site.h \
-	   file://init-relay file://default-relay \
-	   file://init-server file://default-server \
-	   file://dhclient.conf file://dhcpd.conf"
+           file://init-relay file://default-relay \
+           file://init-server file://default-server \
+           file://dhclient.conf file://dhcpd.conf \
+           file://dhcpd.service"
 
-inherit autotools
+inherit autotools systemd
+
+SYSTEMD_PACKAGES = "dhcp-server"
+SYSTEMD_SERVICE_dhcp-server = "dhcpd.service"
+SYSTEMD_AUTO_ENABLE_dhcp-server = "disable"
 
 TARGET_CFLAGS += "-D_GNU_SOURCE"
 EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
@@ -51,6 +56,11 @@ do_install_append () {
 		mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
 	fi
 	install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service
 }
 
 PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
meta/recipes-connectivity/dhcp/files/dhcpd.service new file +11 -0
new file mode 100644
index 0000000..5c9ef6f
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCP Server Daemon
+After=network.target
+After=time-sync.target
+
+[Service]
+EnvironmentFile=/etc/default/dhcp-server
+ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
1.9.1
#19 lore raw

Re: [PATCH 10/26] dhcp: add dhcpd.service

meta/recipes-connectivity/dhcp/files/dhcpd.service line 8

Quoted 11 lines · Chen Qi
meta/recipes-connectivity/dhcp/files/dhcpd.service new file +8 -0
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCP Server Daemon
+After=network.target
+After=time-sync.target
+
+[Service]
+EnvironmentFile=/etc/default/dhcp-server
+ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES

Hard-coded /etc, replace in $sysconfdir.

Ross

author
#20 lore raw

Re: [PATCH 10/26] dhcp: add dhcpd.service

Quoted 14 lines · Ross

meta/recipes-connectivity/dhcp/files/dhcpd.service line 8

Quoted 11 lines · Chen Qi
meta/recipes-connectivity/dhcp/files/dhcpd.service new file +8 -0
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCP Server Daemon
+After=network.target
+After=time-sync.target
+
+[Service]
+EnvironmentFile=/etc/default/dhcp-server
+ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES

Hard-coded /etc, replace in $sysconfdir.

Quoted 3 lines

Ross

Got it!

Thanks,
Chen Qi

author
#21 lore raw

PATCH 11/26 dhcp: add dhcrelay.service

In reply to Chen Qi

Add dhcrelay.service to support systemd systems.

---
 meta/recipes-connectivity/dhcp/dhcp.inc               | 9 +++++++--
 meta/recipes-connectivity/dhcp/files/dhcrelay.service | 9 +++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/dhcp/files/dhcrelay.service
meta/recipes-connectivity/dhcp/dhcp.inc +7 -2
index b281f94..f2b25a5 100644
@@ -17,14 +17,17 @@ SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
            file://init-relay file://default-relay \
            file://init-server file://default-server \
            file://dhclient.conf file://dhcpd.conf \
-           file://dhcpd.service"
+           file://dhcpd.service file://dhcrelay.service"
 
 inherit autotools systemd
 
-SYSTEMD_PACKAGES = "dhcp-server"
+SYSTEMD_PACKAGES = "dhcp-server dhcp-relay"
 SYSTEMD_SERVICE_dhcp-server = "dhcpd.service"
 SYSTEMD_AUTO_ENABLE_dhcp-server = "disable"
 
+SYSTEMD_SERVICE_dhcp-relay = "dhcrelay.service"
+SYSTEMD_AUTO_ENABLE_dhcp-relay = "disable"
+
 TARGET_CFLAGS += "-D_GNU_SOURCE"
 EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
                 --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
@@ -60,7 +63,9 @@ do_install_append () {
 	# Install systemd unit files
 	install -d ${D}${systemd_unitdir}/system
 	install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
 	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
 }
 
 PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
meta/recipes-connectivity/dhcp/files/dhcrelay.service new file +9 -0
new file mode 100644
index 0000000..a2d8189
@@ -0,0 +1,9 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
1.9.1
author
#22 lore raw

PATCH 12/26 acpid: upgrade to 2.0.22 and add systemd support

In reply to Chen Qi

For acpid needs to upgrade to work correctly with the new kernel. Also add systemd unit file.

---
 meta/recipes-bsp/acpid/acpid.inc                   | 24 ++++++++++------------
 meta/recipes-bsp/acpid/acpid/acpid.service         | 10 +++++++++
 .../acpid/acpid/set_socket_noblock.patch           | 10 ---------
 .../acpid/{acpid_1.0.10.bb => acpid_2.0.22.bb}     |  5 ++---
 4 files changed, 23 insertions(+), 26 deletions(-)
 create mode 100644 meta/recipes-bsp/acpid/acpid/acpid.service
 delete mode 100644 meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
 rename meta/recipes-bsp/acpid/{acpid_1.0.10.bb => acpid_2.0.22.bb} (55%)
meta/recipes-bsp/acpid/acpid.inc +11 -13
index fad7afd..9b4c3a5 100644
@@ -4,30 +4,28 @@ BUGTRACKER = "http://sourceforge.net/tracker/?group_id=33140&atid=407341"
 SECTION = "base"
 LICENSE = "GPLv2+"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/acpid/acpid-${PV}.tar.gz \
+SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \
            file://init \
-           file://set_socket_noblock.patch "
+           file://acpid.service \
+          "
 
-inherit update-rc.d
+inherit autotools update-rc.d systemd
 
 INITSCRIPT_NAME = "acpid"
 INITSCRIPT_PARAMS = "defaults"
 
-# Makefile ignores our CFLAGS, so override it.
-#
-EXTRA_OEMAKE = "CFLAGS='-W -Wall -Werror -Wundef -Wshadow ${CFLAGS} $(DEFS)'"
+SYSTEMD_PACKAGES = "acpid"
+SYSTEMD_SERVICE_acpid = "acpid.service"
 
-do_compile () {
-	oe_runmake 'CC=${CC} -D_GNU_SOURCE' 'CROSS=${HOST_PREFIX}'
-}
-
-do_install () {
-	install -d ${D}${bindir} 
-	oe_runmake 'INSTPREFIX=${D}' install
+do_install_append () {
 	install -d ${D}${sysconfdir}/init.d
 	sed -e 's,/usr/sbin,${sbindir},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/acpid
 	chmod 755 ${D}${sysconfdir}/init.d/acpid
 
 	install -d ${D}${sysconfdir}/acpi
 	install -d ${D}${sysconfdir}/acpi/events
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/acpid.service
 }
meta/recipes-bsp/acpid/acpid/acpid.service new file +10 -0
new file mode 100644
index 0000000..f70e740
@@ -0,0 +1,10 @@
+[Unit]
+Description=ACPI Event Daemon
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/acpid
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch deleted +0 -10
deleted file mode 100644
index 54d6435..0000000
@@ -1,10 +0,0 @@
---- a/acpid.c
-+++ b/acpid.c
-@@ -307,6 +307,7 @@ main(int argc, char **argv)
- 				non_root_clients++;
- 			}
- 			fcntl(cli_fd, F_SETFD, FD_CLOEXEC);
-+			fcntl(cli_fd, F_SETFL, O_NONBLOCK);
- 			snprintf(buf, sizeof(buf)-1, "%d[%d:%d]",
- 				creds.pid, creds.uid, creds.gid);
- 			acpid_add_client(cli_fd, buf);
meta/recipes-bsp/acpid/acpid_2.0.22.bb renamed from meta/recipes-bsp/acpid/acpid_1.0.10.bb +2 -3
similarity index 55%
rename from meta/recipes-bsp/acpid/acpid_1.0.10.bb
rename to meta/recipes-bsp/acpid/acpid_2.0.22.bb
index df55bad..603fc2b 100644
@@ -3,6 +3,5 @@ require acpid.inc
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
                     file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
 
-
-SRC_URI[md5sum] = "61156ef32015c56dc0f2e3317f4ae09e"
-SRC_URI[sha256sum] = "22703ce0dd7305aca01bc9ac741659c32b1593f1d6fde492df7f01067a534760"
+SRC_URI[md5sum] = "c8ba756030d1b21fc973ec3d640f27f1"
+SRC_URI[sha256sum] = "3d11454f4283c8f771d8dbd5eb6b5f2bbd9d94d9f77d68bab89e35d98b67ab31"
Signature · 1 line
1.9.1
#23 lore raw

Re: [PATCH 12/26] acpid: upgrade to 2.0.22 and add systemd support

Quoted 5 lines · Chen Qi
meta/recipes-bsp/acpid/acpid.inc +1 -1
-inherit update-rc.d
+inherit autotools update-rc.d systemd
 
 INITSCRIPT_NAME = "acpid"
 INITSCRIPT_PARAMS = "defaults"

meta/recipes-bsp/acpid/acpid.inc BUGTRACKER = "http://sourceforge.net/tracker/?group_id=33140&atid=407341" · line 22

Quoted 10 lines
meta/recipes-bsp/acpid/acpid.inc +2 -6
 
-# Makefile ignores our CFLAGS, so override it.
-#
-EXTRA_OEMAKE = "CFLAGS='-W -Wall -Werror -Wundef -Wshadow ${CFLAGS} $(DEFS)'"
+SYSTEMD_PACKAGES = "acpid"
+SYSTEMD_SERVICE_acpid = "acpid.service"
 
-do_compile () {
-       oe_runmake 'CC=${CC} -D_GNU_SOURCE' 'CROSS=${HOST_PREFIX}'
-}

In general it would be nice if the commit mentioned "upstream now uses autotools" to make it clear that changes to the build were intentional.

Ross

author
#24 lore raw

Re: [PATCH 12/26] acpid: upgrade to 2.0.22 and add systemd support

Quoted 13 lines · Ross
Quoted 12 lines · Chen Qi
meta/recipes-bsp/acpid/acpid.inc +3 -4
-inherit update-rc.d
+inherit autotools update-rc.d systemd
 
  INITSCRIPT_NAME = "acpid"
  INITSCRIPT_PARAMS = "defaults"
 
-# Makefile ignores our CFLAGS, so override it.
-#
-EXTRA_OEMAKE = "CFLAGS='-W -Wall -Werror -Wundef -Wshadow ${CFLAGS} $(DEFS)'"
+SYSTEMD_PACKAGES = "acpid"
+SYSTEMD_SERVICE_acpid = "acpid.service"
Quoted 10 lines

meta/recipes-bsp/acpid/acpid.inc BUGTRACKER = "http://sourceforge.net/tracker/?group_id=33140&atid=407341" · line 22

Quoted 3 lines
meta/recipes-bsp/acpid/acpid.inc +0 -3
-do_compile () {
-       oe_runmake 'CC=${CC} -D_GNU_SOURCE' 'CROSS=${HOST_PREFIX}'
-}

In general it would be nice if the commit mentioned "upstream now uses autotools" to make it clear that changes to the build were intentional.

Ross

Got it!

Thanks,
Chen Qi

author
#25 lore raw

PATCH 13/26 cups: make cups daemon start correctly

In reply to Chen Qi

From: In Long <[email protected]>

The cups daemon needs the lpadmin group to start correctly.

---
 meta/recipes-extended/cups/cups.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-extended/cups/cups.inc +5 -1
index adf21eb..d29b875 100644
@@ -12,7 +12,10 @@ SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
 
 LEAD_SONAME = "libcupsdriver.so"
 
-inherit autotools-brokensep binconfig
+inherit autotools-brokensep binconfig useradd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system lpadmin"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
@@ -79,6 +82,7 @@ python do_package_append() {
 
 PACKAGES =+ "${PN}-lib ${PN}-libimage"
 
+RDEPENDS_${PN} += "procps"
 FILES_${PN} += "${libdir}/cups/backend \
 		${libdir}/cups/cgi-bin \
 		${libdir}/cups/filter \
Signature · 1 line
1.9.1
#26 lore raw

Re: [PATCH 13/26] cups: make cups daemon start correctly

Quoted 1 line · Chen Qi

+RDEPENDS_${PN} += "procps"

Presumably the init script needs procps for some reason? Is this a sysvinit-specific dependency, or something the daemon does itself?

Ross

author
#27 lore raw

Re: [PATCH 13/26] cups: make cups daemon start correctly

Quoted 8 lines · Ross
Quoted 1 line · Chen Qi

+RDEPENDS_${PN} += "procps"

Presumably the init script needs procps for some reason? Is this a sysvinit-specific dependency, or something the daemon does itself?

Ross

It's sysvinit-specific. Thanks for pointing it out.

I will fix it by using bb.utils.contian statement.

Best Regards,
Chen Qi

author
#28 lore raw

PATCH 14/26 cups: add systemd support

In reply to Chen Qi

Add systemd unit files.

---
 meta/recipes-extended/cups/cups.inc          | 18 +++++++++++++++++-
 meta/recipes-extended/cups/cups/cups.path    |  8 ++++++++
 meta/recipes-extended/cups/cups/cups.service | 10 ++++++++++
 meta/recipes-extended/cups/cups/cups.socket  |  8 ++++++++
 4 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/cups/cups/cups.path
 create mode 100644 meta/recipes-extended/cups/cups/cups.service
 create mode 100644 meta/recipes-extended/cups/cups/cups.socket
meta/recipes-extended/cups/cups.inc +17 -1
index d29b875..42a4b46 100644
@@ -8,15 +8,20 @@ SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
            file://0001-don-t-try-to-run-generated-binaries.patch \
            file://cups_serverbin.patch \
            file://cups-no-gcrypt.patch \
+           file://cups.socket \
+           file://cups.path \
+           file://cups.service \
 	  "
 
 LEAD_SONAME = "libcupsdriver.so"
 
-inherit autotools-brokensep binconfig useradd
+inherit autotools-brokensep binconfig useradd systemd
 
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "--system lpadmin"
 
+SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service"
+
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
 PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
@@ -71,6 +76,17 @@ fakeroot do_install () {
 	# Remove /var/run from package as cupsd will populate it on startup
 	rm -fr ${D}/${localstatedir}/run
 	rmdir ${D}/${libdir}/${BPN}/driver
+
+	# Remove sysinit script and symlinks
+	rm -rf ${D}${sysconfdir}/init.d/
+	rm -rf ${D}${sysconfdir}/rc*
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service
 }
 
 python do_package_append() {
meta/recipes-extended/cups/cups/cups.path new file +8 -0
new file mode 100644
index 0000000..de8cc57
@@ -0,0 +1,8 @@
+[Unit]
+Description=CUPS Printer Service Spool
+
+[Path]
+PathExistsGlob=/var/spool/cups/d*
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-extended/cups/cups/cups.service new file +10 -0
new file mode 100644
index 0000000..7d3e839
@@ -0,0 +1,10 @@
+[Unit]
+Description=CUPS Printing Service
+
+[Service]
+ExecStart=@SBINDIR@/cupsd -f
+PrivateTmp=true
+
+[Install]
+Also=cups.socket cups.path
+WantedBy=printer.target
meta/recipes-extended/cups/cups/cups.socket new file +8 -0
new file mode 100644
index 0000000..3314870
@@ -0,0 +1,8 @@
+[Unit]
+Description=CUPS Printing Service Sockets
+
+[Socket]
+ListenStream=/var/run/cups/cups.sock
+
+[Install]
+WantedBy=sockets.target
Signature · 1 line
1.9.1
#29 lore raw

Re: [PATCH 14/26] cups: add systemd support

meta/recipes-extended/cups/cups.inc fakeroot do_install () { · line 82

Quoted 3 lines · Chen Qi
meta/recipes-extended/cups/cups.inc +3 -0
+       # Remove sysinit script and symlinks
+       rm -rf ${D}${sysconfdir}/init.d/
+       rm -rf ${D}${sysconfdir}/rc*

Pretty sure you don't mean to unconditionally do that.

Ross

author
#30 lore raw

Re: [PATCH 14/26] cups: add systemd support

Quoted 9 lines · Ross

meta/recipes-extended/cups/cups.inc fakeroot do_install () { · line 82

Quoted 3 lines · Chen Qi
meta/recipes-extended/cups/cups.inc +3 -0
+       # Remove sysinit script and symlinks
+       rm -rf ${D}${sysconfdir}/init.d/
+       rm -rf ${D}${sysconfdir}/rc*

Pretty sure you don't mean to unconditionally do that.

Ross

Thanks for pointing it out.

Best Regards,
Chen Qi

author
#31 lore raw

PATCH 15/26 rpcbind: avoid entering failed status after stopping daemon

In reply to Chen Qi

Exiting with '2' is actually expected with rpcbind, because it catches SIGTERM and exits with '2' explicitly.

The related code is as follows.

(void) signal(SIGTERM, terminate);

/*
* Catch the signal and die
*/
static void
terminate(int dummy /*__unused*/)

{
        close(rpcbindlockfd);
        unlink(_PATH_RPCBINDSOCK);
        unlink(RPCBINDDLOCK);
        syslog(LOG_ERR,
                "rpcbind terminating on signal. Restart with \"rpcbind -w\"");
        write_warmstart(); /* Dump yourself */
        exit(2);
}
---
 meta/recipes-extended/rpcbind/rpcbind/rpcbind.service | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/rpcbind/rpcbind/rpcbind.service +1 -0
index 4de28d4..33ee268 100644
@@ -9,6 +9,7 @@ Type=forking
 EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
 ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS
 Restart=always
+SuccessExitStatus=2
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
1.9.1
author
#32 lore raw

PATCH 16/26 at: remove dependency on initscripts

In reply to Chen Qi

The 'at' package actually doesn't have runtime dependency on VIRTUAL-RUNTIME_initscripts, so remove this dependency.

---
 meta/recipes-extended/at/at_3.1.15.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-extended/at/at_3.1.15.bb +0 -2
index a465a76..1080df4 100644
@@ -7,9 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
 DEPENDS = "flex flex-native \
            ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
-VIRTUAL-RUNTIME_initscripts ?= "initscripts"                                                                                                                 
 RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
-                  ${VIRTUAL-RUNTIME_initscripts} \
 "
 
 PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
Signature · 1 line
1.9.1
author
#33 lore raw

PATCH 17/26 at: inherit update-rc.d to handle sysv init script

In reply to Chen Qi

Inherit update-rc.d.bbclass to handle sysv init script. Also make the 'at' daemon start in runlevel 2,3,4,5 instead of S.

---
 meta/recipes-extended/at/at/{S99at => atd.init} |  0
 meta/recipes-extended/at/at_3.1.15.bb           | 11 ++++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
 rename meta/recipes-extended/at/at/{S99at => atd.init} (100%)
meta/recipes-extended/at/at/atd.init renamed from meta/recipes-extended/at/at/S99at +0 -0
similarity index 100%
rename from meta/recipes-extended/at/at/S99at
rename to meta/recipes-extended/at/at/atd.init
meta/recipes-extended/at/at_3.1.15.bb +6 -5
index 1080df4..0c37d6d 100644
@@ -20,7 +20,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz \
     file://posixtm.c \
     file://posixtm.h \
     file://file_replacement_with_gplv2.patch \
-    file://S99at \
+    file://atd.init \
     file://atd.service \
     ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
 
@@ -37,7 +37,10 @@ EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
                  --with-atspool=/var/spool/at/spool \
                  ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
 
-inherit autotools-brokensep systemd
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "atd"
+INITSCRIPT_PARAMS = "defaults"
 
 SYSTEMD_SERVICE_${PN} = "atd.service"
 
@@ -51,9 +54,7 @@ do_install () {
 	oe_runmake -e "IROOT=${D}" install
 
 	install -d ${D}${sysconfdir}/init.d
-	install -d ${D}${sysconfdir}/rcS.d
-	install -m 0755    ${WORKDIR}/S99at		${D}${sysconfdir}/init.d/atd
-	ln -sf ../init.d/atd ${D}${sysconfdir}/rcS.d/S99at
+	install -m 0755    ${WORKDIR}/atd.init		${D}${sysconfdir}/init.d/atd
 
 	# install systemd unit files
 	install -d ${D}${systemd_unitdir}/system
Signature · 1 line
1.9.1
author
#34 lore raw

PATCH 18/26 keymaps: remove dependency on initscripts

In reply to Chen Qi

The 'keymaps' package actually doesn't have runtime dependency on VIRTUAL-RUNTIME_initscripts, thus removing this dependency.

---
 meta/recipes-bsp/keymaps/keymaps_1.0.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
meta/recipes-bsp/keymaps/keymaps_1.0.bb +1 -4
index 5a3f974..a3f2d89 100644
@@ -2,10 +2,7 @@ SUMMARY = "Keyboard maps"
 DESCRIPTION = "Keymaps and initscript to set the keymap on bootup."
 SECTION = "base"
 
-# Distro can override initscripts provider
-VIRTUAL-RUNTIME_initscripts ?= "initscripts"
-
-RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_initscripts} kbd"
+RDEPENDS_${PN} = "kbd"
 
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
Signature · 1 line
1.9.1
author
#35 lore raw

PATCH 19/26 packagegroup-core-boot: conditionally rdepend on VIRTUAL-RUNTIME_initscripts

In reply to Chen Qi

If we are building a systemd image with 'sysvinit' not in DISTRO_FEATURES, the initscripts should not be installed into the image, as they are useless. What's more, we as now support executing scripts under /etc/rcS.d, the boot time will be increased by these scripts as the systemd will try to translate them into temporary service files.

These init scritps are actually needed only when 'sysvinit' is in DISTRO_FEATURES.

---
 meta/recipes-core/packagegroups/packagegroup-core-boot.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/packagegroups/packagegroup-core-boot.bb +1 -1
index 886c334..09f5373 100644
@@ -27,6 +27,7 @@ VIRTUAL-RUNTIME_keymaps ?= "keymaps"
 SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', 'busybox-hwclock', '', d)} \
                     modutils-initscripts \
                     init-ifupdown \
+                    ${VIRTUAL-RUNTIME_initscripts} \
                    "
 
 RDEPENDS_${PN} = "\
@@ -38,7 +39,6 @@ RDEPENDS_${PN} = "\
     netbase \
     ${VIRTUAL-RUNTIME_login_manager} \
     ${VIRTUAL-RUNTIME_init_manager} \
-    ${VIRTUAL-RUNTIME_initscripts} \
     ${VIRTUAL-RUNTIME_dev_manager} \
     ${VIRTUAL-RUNTIME_update-alternatives} \
     ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
Signature · 1 line
1.9.1
author
#36 lore raw

PATCH 20/26 initscripts: mask several init scripts

In reply to Chen Qi

We now support executing scripts under /etc/rcS.d. So we need to mask several more init scripts here to prevent them from running at boot time.

---
 meta/recipes-core/initscripts/initscripts_1.0.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-core/initscripts/initscripts_1.0.bb +4 -0
index 7273a82..a665acf 100644
@@ -139,11 +139,15 @@ do_install () {
 MASKED_SCRIPTS = " \
   banner \
   bootmisc \
+  checkfs \
   checkroot \
   devpts \
+  dmesg \
   hostname \
   mountall \
   mountnfs \
+  populate-volatile \
+  read-only-rootfs-hook \
   rmnologin \
   sysfs \
   urandom"
Signature · 1 line
1.9.1
author
#37 lore raw

PATCH 21/26 keymaps: mask keymap when necessary

In reply to Chen Qi

When 'sysvinit' and 'systemd' are both in DISTRO_FEATURES, we need to prevent the init script from running via systemd.
This is because that the functionality of the init script has implemented in systemd internally.

---
 meta/recipes-bsp/keymaps/keymaps_1.0.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-bsp/keymaps/keymaps_1.0.bb +10 -0
index a3f2d89..925161b 100644
@@ -35,4 +35,14 @@ do_install () {
     fi
 }
 
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask keymap.service
+	fi
+}
+
 ALLOW_EMPTY_${PN} = "1"
Signature · 1 line
1.9.1
author
#38 lore raw

PATCH 22/26 v86d: mask fbsetup when necessary

In reply to Chen Qi

When 'sysvinit' and 'systemd' are both in DISTRO_FEATURES, we need to prevent the init script from running via systemd.
This is because that the functionality has been implemented internally in systemd.

---
 meta/recipes-bsp/v86d/v86d_0.1.10.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-bsp/v86d/v86d_0.1.10.bb +10 -0
index 7ccb4ee..f502072 100644
@@ -57,3 +57,13 @@ python __anonymous() {
 }
 
 inherit update-rc.d
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask fbsetup.service
+	fi
+}
Signature · 1 line
1.9.1
author
#39 lore raw

PATCH 23/26 psplash: mask psplash in case of systemd

In reply to Chen Qi

We need to prevent the psplash init script from running via systemd because the script is supposed to be used by sysvinit system and it doesn't have any real effect in a systemd based system.

---
 meta/recipes-core/psplash/psplash_git.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-core/psplash/psplash_git.bb +10 -0
index 628ced4..4e8f071 100644
@@ -109,3 +109,13 @@ FILES_${PN} += "/mnt/.psplash"
 
 INITSCRIPT_NAME = "psplash.sh"
 INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask psplash.service
+	fi
+}
Signature · 1 line
1.9.1
author
#40 lore raw

PATCH 24/26 modutils-initscripts: mask modutils in case of systemd

In reply to Chen Qi

We need to prevent the init script from running via systemd because its functionality has been implemented interanlly in systemd.

In a systemd system, we can add configuration files under /etc/modules-load.d/ to make things work.

---
 .../modutils-initscripts/modutils-initscripts.bb               | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb +10 -0
index 125f5fb..7031ba1 100644
@@ -18,3 +18,13 @@ do_install () {
 	install -d ${D}${sysconfdir}/init.d/
 	install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
 }
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask modutils.service
+	fi
+}
Signature · 1 line
1.9.1
author
#41 lore raw

PATCH 25/26 run-postinsts.service: remove redundant line

In reply to Chen Qi

The basic.target itself requires sysinit.target, so there's no need to write this redundant line in the run-postinsts unit file.

---
 meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +0 -1
index 822327a..85a0439 100644
@@ -13,5 +13,4 @@ RemainAfterExit=No
 TimeoutSec=0
 
 [Install]
-WantedBy=basic.target
 WantedBy=sysinit.target
Signature · 1 line
1.9.1
#42 lore raw

Re: [PATCH 25/26] run-postinsts.service: remove redundant line

Quoted 13 lines · Chen Qi

The basic.target itself requires sysinit.target, so there's no need to write this redundant line in the run-postinsts unit file.

---
 meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +0 -0
index 822327a..85a0439 100644

meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service RemainAfterExit=No · line 16

Quoted 5 lines
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +0 -1
@@ -13,5 +13,4 @@ RemainAfterExit=No
 TimeoutSec=0
 
 [Install]
-WantedBy=basic.target
 WantedBy=sysinit.target

From the commit message it sounds like you meant to remove sysinit.target. What is correct?

Ross

author
#43 lore raw

Re: [PATCH 25/26] run-postinsts.service: remove redundant line

Quoted 16 lines · Ross
Quoted 15 lines · Chen Qi

The basic.target itself requires sysinit.target, so there's no need to write this redundant line in the run-postinsts unit file.

---
  meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service | 1 -
  1 file changed, 1 deletion(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +0 -0
index 822327a..85a0439 100644
@@ -13,5 +13,4 @@ RemainAfterExit=No
  TimeoutSec=0
 
Quoted 9 lines
Quoted 4 lines
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service +0 -1
  [Install]
-WantedBy=basic.target
  WantedBy=sysinit.target

From the commit message it sounds like you meant to remove

sysinit.target. What is correct?

Ross

Removing 'WantedBy=basic.target' is correct.

As sysinit.target is required by basic.target, and run-postinsts.service is required by sysinit.target, then run-postinsts.service has been in the dependency chain of basic.target.
So there's no need to write 'WantedBy=basic.target'.

Best Regards,
Chen Qi

author
#44 lore raw

PATCH 26/26 systemd: enable forwarding messages to syslog daemon

In reply to Chen Qi

In systemd_216, journald by default doesn't forward messages to syslog daemon. This breaks the oeqa testing cases. So we enable forwarding the messages for now.

---
 meta/recipes-core/systemd/systemd_216.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd_216.bb +3 -0
index 776006f..43bba9c 100644
@@ -143,6 +143,9 @@ do_install() {
 	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
 	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
 	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
+
+	# Enable journal to forward message to syslog daemon
+	sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
 }
 
 do_install_ptest () {
Signature · 1 line
1.9.1