Skip to contentSkip to conversation

upgrade systemd to 215 and other misc fixes

PATCH In review Chen Qi 4 participants 16 messages Aug 18, 2014 – Aug 29, 2014

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

v3 cover upgrade systemd to 215 and other misc fixes

The following changes since commit 4321c553d5ae816e566234e981a0815bba046d39:

SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09 +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 (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

 meta/classes/update-rc.d.bbclass                   |    2 +-
 meta/recipes-bsp/alsa-state/alsa-state.bb          |   11 +-
 meta/recipes-bsp/keymaps/keymaps_1.0.bb            |   17 ++-
 meta/recipes-bsp/v86d/v86d_0.1.10.bb               |    7 ++
 meta/recipes-connectivity/dhcp/dhcp.inc            |   18 ++-
 meta/recipes-connectivity/dhcp/files/dhcpd.service |   11 ++
 ...ort-for-executing-scripts-under-etc-rcS.d.patch |   93 ++++++++++++++++
 ...k-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch |  116 ++++++++++++++++++++
 ...icitly-include-endian.h-wherever-we-want-.patch |   52 +++++++++
 .../systemd/systemd/systemd-older-kernel.patch     |   56 ----------
 .../systemd/{systemd_213.bb => systemd_215.bb}     |   27 ++++-
 11 files changed, 338 insertions(+), 72 deletions(-)
 create mode 100644 meta/recipes-connectivity/dhcp/files/dhcpd.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-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0002-endian-explicitly-include-endian.h-wherever-we-want-.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/systemd-older-kernel.patch
 rename meta/recipes-core/systemd/{systemd_213.bb => systemd_215.bb} (89%)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 1/10 systemd: upgrade to 215

Upgrade systemd from 213 to 215.

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

Backport two patches to fix compilation problem for qemuppc.

    0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
    0002-endian-explicitly-include-endian.h-wherever-we-want-.patch

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

---
 ...k-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch |  116 ++++++++++++++++++++
 ...icitly-include-endian.h-wherever-we-want-.patch |   52 +++++++++
 .../systemd/systemd/systemd-older-kernel.patch     |   56 ----------
 .../systemd/{systemd_213.bb => systemd_215.bb}     |   10 +-
 4 files changed, 174 insertions(+), 60 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0002-endian-explicitly-include-endian.h-wherever-we-want-.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/systemd-older-kernel.patch
 rename meta/recipes-core/systemd/{systemd_213.bb => systemd_215.bb} (97%)
meta/recipes-core/systemd/systemd/0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch new file +116 -0
new file mode 100644
index 0000000..228d835
@@ -0,0 +1,116 @@
+Upstream-Status: Backport
+
+Subject: always check for __BYTE_ORDER == __BIG_ENDIAN when checking for endianess
+
+Let's always stick to glibc's way to determine byte order, and not mix
+autoconf-specific checks with gcc checks.
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/shared/architecture.h |   12 ++++++------
+ src/shared/gpt.h          |    4 ++--
+ src/shared/time-dst.c     |    6 +++---
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/src/shared/architecture.h b/src/shared/architecture.h
+index 4821d5d..58e97e5 100644
+--- a/src/shared/architecture.h
++++ b/src/shared/architecture.h
+@@ -80,7 +80,7 @@ Architecture uname_architecture(void);
+ #  define native_architecture() ARCHITECTURE_X86
+ #  define LIB_ARCH_TUPLE "i386-linux-gnu"
+ #elif defined(__powerpc64__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_PPC64
+ #    define LIB_ARCH_TUPLE "ppc64-linux-gnu"
+ #  else
+@@ -88,7 +88,7 @@ Architecture uname_architecture(void);
+ #    error "Missing LIB_ARCH_TUPLE for PPC64LE"
+ #  endif
+ #elif defined(__powerpc__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_PPC
+ #    define LIB_ARCH_TUPLE "powerpc-linux-gnu"
+ #  else
+@@ -117,7 +117,7 @@ Architecture uname_architecture(void);
+ #  define native_architecture() ARCHITECTURE_SPARC
+ #  define LIB_ARCH_TUPLE "sparc-linux-gnu"
+ #elif defined(__mips64__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_MIPS64
+ #    error "Missing LIB_ARCH_TUPLE for MIPS64"
+ #  else
+@@ -125,7 +125,7 @@ Architecture uname_architecture(void);
+ #    error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
+ #  endif
+ #elif defined(__mips__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_MIPS
+ #    define LIB_ARCH_TUPLE "mips-linux-gnu"
+ #  else
+@@ -136,7 +136,7 @@ Architecture uname_architecture(void);
+ #  define native_architecture() ARCHITECTURE_ALPHA
+ #  define LIB_ARCH_TUPLE "alpha-linux-gnu"
+ #elif defined(__aarch64__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_ARM64_BE
+ #    define LIB_ARCH_TUPLE "aarch64_be-linux-gnu"
+ #  else
+@@ -144,7 +144,7 @@ Architecture uname_architecture(void);
+ #    define LIB_ARCH_TUPLE "aarch64-linux-gnu"
+ #  endif
+ #elif defined(__arm__)
+-#  if defined(WORDS_BIGENDIAN)
++#  if __BYTE_ORDER == __BIG_ENDIAN
+ #    define native_architecture() ARCHITECTURE_ARM_BE
+ #    if defined(__ARM_EABI__)
+ #      if defined(__ARM_PCS_VFP)
+diff --git a/src/shared/gpt.h b/src/shared/gpt.h
+index 64090e0..278940b 100644
+--- a/src/shared/gpt.h
++++ b/src/shared/gpt.h
+@@ -42,10 +42,10 @@
+ #  define GPT_ROOT_NATIVE GPT_ROOT_X86
+ #endif
+ 
+-#if defined(__aarch64__) && !defined(WORDS_BIGENDIAN)
++#if defined(__aarch64__) && (__BYTE_ORDER != __BIG_ENDIAN)
+ #  define GPT_ROOT_NATIVE GPT_ROOT_ARM_64
+ #  define GPT_ROOT_SECONDARY GPT_ROOT_ARM
+-#elif defined(__arm__) && !defined(WORDS_BIGENDIAN)
++#elif defined(__arm__) && (__BYTE_ORDER != __BIG_ENDIAN)
+ #  define GPT_ROOT_NATIVE GPT_ROOT_ARM
+ #endif
+ 
+diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
+index ceca2fa..6195b11 100644
+--- a/src/shared/time-dst.c
++++ b/src/shared/time-dst.c
+@@ -207,8 +207,8 @@ read_again:
+                 if (type_idxs[i] >= num_types)
+                         return -EINVAL;
+ 
+-        if (BYTE_ORDER == BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
+-                                     : sizeof(time_t) == 4 || trans_width == 4) {
++        if (__BYTE_ORDER == __BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
++                                         : sizeof(time_t) == 4 || trans_width == 4) {
+                 /* Decode the transition times, stored as 4-byte integers in
+                    network (big-endian) byte order.  We work from the end of
+                    the array so as not to clobber the next element to be
+@@ -216,7 +216,7 @@ read_again:
+                 i = num_transitions;
+                 while (i-- > 0)
+                         transitions[i] = decode((char *)transitions + i * 4);
+-        } else if (BYTE_ORDER != BIG_ENDIAN && sizeof(time_t) == 8) {
++        } else if (__BYTE_ORDER != __BIG_ENDIAN && sizeof(time_t) == 8) {
+                 /* Decode the transition times, stored as 8-byte integers in
+                    network (big-endian) byte order.  */
+                 for (i = 0; i < num_transitions; ++i)
+-- 
+1.7.9.5
+
meta/recipes-core/systemd/systemd/0002-endian-explicitly-include-endian.h-wherever-we-want-.patch new file +52 -0

52 lines not on this page · raw message

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_215.bb renamed from meta/recipes-core/systemd/systemd_213.bb +6 -4
similarity index 97%
rename from meta/recipes-core/systemd/systemd_213.bb
rename to meta/recipes-core/systemd/systemd_215.bb
index 4fb7ffc..770787b 100644
@@ -17,9 +17,9 @@ SECTION = "base/shell"
 
 inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest
 
-SRCREV = "c9679c652b3c31f2510e8805d81630680ebc7e95"
+SRCREV = "252ff40a3827b4e8e62e03a5e2f80da3fe02bee6"
 
-PV = "213+git${SRCPV}"
+PV = "215+git${SRCPV}"
 
 SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \
            file://binfmt-install.patch \
@@ -31,12 +31,13 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
            file://uclibc-sysinfo_h.patch \
            file://uclibc-get-physmem.patch \
+           file://0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch \
+           file://0002-endian-explicitly-include-endian.h-wherever-we-want-.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
            file://run-ptest \
-           file://systemd-older-kernel.patch \
-          "
+         "
 
 S = "${WORKDIR}/git"
 
@@ -231,6 +232,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.7.9.5
author
#2 lore raw

PATCH v3 2/10 systemd: add PACKAGECONFIG for 'elfutils'

In reply to Chen Qi

Add PACKAGECONFIG for 'elfutils'.
This also fixes a build-deps QA warning about libdw.

---
 meta/recipes-core/systemd/systemd_215.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_215.bb +2 -0
index 770787b..f5e50fc 100644
@@ -58,6 +58,8 @@ DEPENDS += "libgcrypt"
 PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
 PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
 PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
+# Build with elfutils support
+PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
 
 CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
 
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH v3 3/10 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_215.bb |   12 ++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-core/systemd/systemd_215.bb +12 -0
index f5e50fc..7ed2124 100644
@@ -129,6 +129,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.7.9.5
author
#4 lore raw

PATCH v3 4/10 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.7.9.5
author
#5 lore raw

PATCH v3 5/10 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.7.9.5
author
#6 lore raw

PATCH v3 6/10 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.7.9.5
author
#7 lore raw

PATCH v3 7/10 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_215.bb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +1 -1
index 7ed2124..cde167e 100644
@@ -208,7 +208,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.7.9.5
author
#8 lore raw

PATCH v3 8/10 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.7.9.5
author
#9 lore raw

PATCH v3 9/10 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.

The patch references the patch below from Debian.
http://sources.debian.net/src/systemd/204-5/debian/patches/debian-changes/?hl=1391#L1391

[YOCTO #5159]

---
 ...ort-for-executing-scripts-under-etc-rcS.d.patch |   93 ++++++++++++++++++++
 meta/recipes-core/systemd/systemd_215.bb           |    1 +
 2 files changed, 94 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 +93 -0
new file mode 100644
index 0000000..c1b52f6
@@ -0,0 +1,93 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: add support for executing scripts under /etc/rcS.d/
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/sysv-generator/sysv-generator.c |   19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
+index 9a869ba..976f58a 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,7 @@ typedef struct SysvStub {
+         char **conflicts;
+         bool has_lsb;
+         bool reload;
++        bool default_dependencies;
+ } SysvStub;
+ 
+ const char *arg_dest = "/tmp";
+@@ -156,6 +161,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))
+@@ -725,6 +733,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+                                 return log_oom();
+ 
+                         service->sysv_start_priority = -1;
++                        service->default_dependencies = true;
+                         service->name = name;
+                         service->path = fpath;
+ 
+@@ -810,9 +819,10 @@ 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;
+                                         }
+ 
+                                         r = set_ensure_allocated(&runlevel_services[i],
+@@ -825,7 +835,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.7.9.5
+
meta/recipes-core/systemd/systemd_215.bb +1 -0
index cde167e..102eae0 100644
@@ -33,6 +33,7 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
            file://uclibc-get-physmem.patch \
            file://0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch \
            file://0002-endian-explicitly-include-endian.h-wherever-we-want-.patch \
+           file://0001-add-support-for-executing-scripts-under-etc-rcS.d.patch \
            file://touchscreen.rules \
            file://00-create-volatile.conf \
            file://init \
Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH v3 10/10 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.7.9.5
#11 lore raw
In reply to Chen Qi
Quoted 9 lines · Chen Qi

The following changes since commit 4321c553d5ae816e566234e981a0815bba046d39:

SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09 +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

Quoted 12 lines

Chen Qi (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

Testing with this patchset included resulted in:

https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/6/steps/Running%20Sanity%20Tests_2/logs/stdio

Could you have a look into this and see if we can figure out why some of these start failing please?

Cheers,

Richard

author
#12 lore raw
Quoted 24 lines · Richard Purdie
Quoted 9 lines · Chen Qi

The following changes since commit 4321c553d5ae816e566234e981a0815bba046d39:

   SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09 +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

Quoted 12 lines

Chen Qi (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

Testing with this patchset included resulted in:

Quoted 13 lines

https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/6/steps/Running%20Sanity%20Tests_2/logs/stdio

Could you have a look into this and see if we can figure out why some of these start failing please?

Cheers,

Richard

Got it.

I'm looking into the problem.

Thanks,
Chen Qi

#13 lore raw
Quoted 47 lines · ChenQi
Quoted 32 lines · Richard Purdie
Quoted 14 lines · Chen Qi

The following changes since commit
4321c553d5ae816e566234e981a0815bba046d39:

   SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09

+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

Quoted 12 lines

Chen Qi (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

Testing with this patchset included resulted in:

Quoted 13 lines

https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/6/steps/Running%20Sanity%20Tests_2/logs/stdio

Could you have a look into this and see if we can figure out why some of these start failing please?

Cheers,

Richard

Quoted 3 lines

Got it.

I'm looking into the problem.

where are we with this ? we shud have systemd 216 in 1.7. can you rebase

author
#14 lore raw
Quoted 44 lines · Khem Raj
Quoted 43 lines · ChenQi
Quoted 42 lines · Richard Purdie
Quoted 13 lines · Chen Qi

The following changes since commit
4321c553d5ae816e566234e981a0815bba046d39:

    SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09

+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

Quoted 12 lines

Chen Qi (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

Testing with this patchset included resulted in:

https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/6/steps/Running%20Sanity%20Tests_2/logs/stdio

Could you have a look into this and see if we can figure out why some of these start failing please?

Cheers,

Richard

Quoted 6 lines
Quoted 3 lines

Got it.

I'm looking into the problem.

where are we with this ? we shud have systemd 216 in 1.7. can you rebase

OK.
I'll do it.

Best Regards,
Chen Qi

#15 lore raw
In reply to Khem Raj

Op 29 aug. 2014, om 04:58 heeft Khem Raj <[email protected]> het volgende geschreven:

Quoted 48 lines · ChenQi
Quoted 47 lines · Richard Purdie
Quoted 45 lines · Chen Qi
Quoted 14 lines

The following changes since commit
4321c553d5ae816e566234e981a0815bba046d39:

SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:09
+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

Quoted 12 lines

Chen Qi (10):
systemd: upgrade to 215
systemd: add PACKAGECONFIG for 'elfutils'
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

Testing with this patchset included resulted in:

https://autobuilder.yoctoproject.org/main/builders/nightly-qa-systemd/builds/6/steps/Running%20Sanity%20Tests_2/logs/stdio

Could you have a look into this and see if we can figure out why some of these start failing please?

Cheers,

Richard

Quoted 5 lines
Quoted 3 lines

Got it.

I'm looking into the problem.

where are we with this ? we shud have systemd 216 in 1.7. can you rebase

Here's a recipe for 216 with the nss postinst fixed and proper CONFFILES: https://github.com/Angstrom-distribution/meta-angstrom/blob/master/recipes-tweaks/systemd/systemd_216.bb