Skip to contentSkip to conversation

upgrade systemd to 215 and other misc fixes

PATCH Superseded Chen Qi 4 participants 18 messages Aug 14, 2014 – Aug 15, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

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 libdw to RDEPENDS
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, 337 insertions(+), 73 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 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 2/10 systemd: add libdw to RDEPENDS

In reply to Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
 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 770787b..a52a042 100644
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
 FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
 RDEPENDS_${PN} += "volatile-binds"
 
 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units udev-hwdb\
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [PATCH 02/10] systemd: add libdw to RDEPENDS

Quoted 12 lines · Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
 meta/recipes-core/systemd/systemd_215.bb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +0 -0
index 770787b..a52a042 100644

meta/recipes-core/systemd/systemd_215.bb FILES_${PN} = " ${base_bindir}/* \ · line 247

Quoted 5 lines
meta/recipes-core/systemd/systemd_215.bb +1 -1
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
 FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"

Shouldn't it be build-time dependency?

If it's detected from sysroot in do_configure then it has to be in DEPENDS to get deterministic results.

Quoted 11 lines
meta/recipes-core/systemd/systemd_215.bb +0 -0
 RDEPENDS_${PN} += "volatile-binds"
 
 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units udev-hwdb\
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#4 lore raw

Re: [PATCH 02/10] systemd: add libdw to RDEPENDS

Quoted 16 lines · Martin Jansa
Quoted 15 lines · Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
 meta/recipes-core/systemd/systemd_215.bb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +0 -0
index 770787b..a52a042 100644
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
 FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
Quoted 7 lines

meta/recipes-core/systemd/systemd_215.bb FILES_${PN} = " ${base_bindir}/* \ · line 247

Quoted 2 lines
meta/recipes-core/systemd/systemd_215.bb +1 -1
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"

Shouldn't it be build-time dependency?

If it's detected from sysroot in do_configure then it has to be in DEPENDS to get deterministic results.

Right. Secondly, what benefit does this library bring us?

Cheers,

Richard

#5 lore raw

Re: [PATCH 02/10] systemd: add libdw to RDEPENDS

Quoted 22 lines · Richard Purdie
Quoted 21 lines · Martin Jansa
Quoted 12 lines · Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
 meta/recipes-core/systemd/systemd_215.bb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +0 -0
index 770787b..a52a042 100644

meta/recipes-core/systemd/systemd_215.bb FILES_${PN} = " ${base_bindir}/* \ · line 247

Quoted 5 lines
meta/recipes-core/systemd/systemd_215.bb +1 -1
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
 FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"

Shouldn't it be build-time dependency?

Quoted 4 lines
Quoted 2 lines

If it's detected from sysroot in do_configure then it has to be in DEPENDS to get deterministic results.

Right. Secondly, what benefit does this library bring us?

BTW: does someone know why libdw got picked by many components recenly (something changed in last 2 days).

today's world build failed in gst-plugins-good_0.10.31.bb because of missing libdw and there are at least 20 components autodetecting libdw now:
http://logs.nslu2-linux.org/buildlogs/oe/world/log.world.20140813_204024.log/qa.log

elfutils weren't changed recently, so it has to be something else

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#6 lore raw

Re: [PATCH 02/10] systemd: add libdw to RDEPENDS

In reply to Richard Purdie
Quoted 21 lines · Richard Purdie
Quoted 20 lines · Martin Jansa
Quoted 12 lines · Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
  meta/recipes-core/systemd/systemd_215.bb |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +0 -0
index 770787b..a52a042 100644

meta/recipes-core/systemd/systemd_215.bb FILES_${PN} = " ${base_bindir}/* \ · line 247

Quoted 5 lines
meta/recipes-core/systemd/systemd_215.bb +1 -1
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
  FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
  FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"

Shouldn't it be build-time dependency?

Quoted 10 lines
Quoted 2 lines

If it's detected from sysroot in do_configure then it has to be in DEPENDS to get deterministic results.

Right. Secondly, what benefit does this library bring us?

Cheers,

Richard

Richard & Martin,

Thanks for reminding me about this.
I shouldn't have rushed into fixing the QA warning without looking into the configure.ac file.

It should really be a PACKAGECONFIG for 'elfutils'.
PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,libelf libdw,libelf libdw"

I will send out V2 of this patchset.

Best Regards,
Chen Qi

#7 lore raw

Re: [PATCH 02/10] systemd: add libdw to RDEPENDS

Quoted 35 lines · ChenQi
Quoted 21 lines · Richard Purdie
Quoted 20 lines · Martin Jansa
Quoted 12 lines · Chen Qi

Add libdw to RDEPENDS of systemd to avoid build-deps QA warning.

---
  meta/recipes-core/systemd/systemd_215.bb |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_215.bb +0 -0
index 770787b..a52a042 100644

meta/recipes-core/systemd/systemd_215.bb FILES_${PN} = " ${base_bindir}/* \ · line 247

Quoted 5 lines
meta/recipes-core/systemd/systemd_215.bb +1 -1
@@ -244,7 +244,7 @@ FILES_${PN} = " ${base_bindir}/* \
  FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
  FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
-RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libdw kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"

Shouldn't it be build-time dependency?

Quoted 10 lines
Quoted 2 lines

If it's detected from sysroot in do_configure then it has to be in DEPENDS to get deterministic results.

Right. Secondly, what benefit does this library bring us?

Cheers,

Richard

Richard & Martin,

Quoted 7 lines

Thanks for reminding me about this.
I shouldn't have rushed into fixing the QA warning without looking into the configure.ac file.

It should really be a PACKAGECONFIG for 'elfutils'. PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,libelf libdw,libelf libdw"

I don't think there is libdw and libelf recipe, they are just packages created by elfutils recipe, so I think it should be:

PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"

the runtime dependency is added automatically by shlibs code (as the QA warning confirmed).

Quoted 4 lines

I will send out V2 of this patchset.

Best Regards,
Chen Qi

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#8 lore raw

PATCH 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 a52a042..10dab8e 100644
@@ -127,6 +127,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
#9 lore raw

PATCH 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
#10 lore raw

PATCH 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
#11 lore raw

PATCH 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
#12 lore raw

PATCH 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 10dab8e..bc5592a 100644
@@ -206,7 +206,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
#13 lore raw

PATCH 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
#14 lore raw

Re: [PATCH 08/10] v86d: set INHIBIT_UPDATERCD_BBCLASS if 'sysvinit' not in DISTRO_FEATURES

Quoted 9 lines · 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.

Shouldn't this be handled in systemd class?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
author
#15 lore raw

Re: [PATCH 08/10] v86d: set INHIBIT_UPDATERCD_BBCLASS if 'sysvinit' not in DISTRO_FEATURES

In reply to Chen Qi
Quoted 19 lines · 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 +0 -0
index 08438be..7ccb4ee 100644
@@ -49,4 +49,11 @@ do_install () {
          fi

meta/recipes-bsp/v86d/v86d_0.1.10.bb do_install () { · line 59

Quoted 10 lines
meta/recipes-bsp/v86d/v86d_0.1.10.bb +7 -0
  }
 
+# 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

This recipe doesn't inherit systemd.bbclass, it doesn't have a systemd unit file.

There are more related information in the commit message of the following patch. [OE-core] [PATCH 04/10] update-rc.d: fix logic in populate_packages_updatercd

Best Regards,
Chen Qi

author
#16 lore raw

PATCH 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 bc5592a..738babd 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
#17 lore raw

PATCH 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