Skip to contentSkip to conversation

hybrid systemd/sysvinit, and systemd fixes

PATCH In review Ross Burton 3 participants 28 messages Mar 26, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover hybrid systemd/sysvinit, and systemd fixes

Hi,

An iteration on the previous series, this fixes the issues that Saul and Martin noticed, removes the commit that is targetted at meta-yocto, and importantly fixes pure-systemd booting which was previously aborting dramatically when populate-volatiles copied the contents of /run to /var/volatile/run (and then deleted the originals). systemd really doesn't like having it's internal pipes and sockets deleted.

Ross

The following changes since commit f36926a264190e6202830e8520b41b30ae77ea43:

docbook-utils-native: Unbreak the build after source and build dir split (2013-03-25 20:51:19 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ross/systemd

for you to fetch changes up to a56f9f8d95194dc4365e83488a34f37a4ee0bce1:

udev: move /run volatile entry to udev instead of initscripts (2013-03-26 16:26:09 +0000)

----------------------------------------------------------------
Andreas Oberritter (1):
Revert "base-files: add fstab for systemd based systems"

Radu Moisan (1):
busybox: enable systemd integration for syslogd

Ross Burton (22):
busybox: add strictatime support to mount
systemd: make xz support (compressed journal) optional, defaulting to on.
systemd: merge udev-systemd into udev
core-image-minimal-initramfs: don't install busybox-syslog
systemd: don't depend on the PCI/USB databases
systemd: split out the hwdb data
default-providers: change udev selection logic
update-rcd.bbclass: handle both sysvinit and systemd features being present
util-linux: split uuidd into it's own package, and enable for systemd
update-rcd: drop depends to recommends, check for update-rcd in scripts
systemd: check for systemctl first, and don't force systemd to be installed.
systemd: add udev init script for hybrid sysvinit/systemd usage update-rc.d/systemd: change communication variable name
default-distrovars: don't add INITMAN to DISTRO_FEATURES and DISTRO_FEATURES_BACKFILL bitbake.conf: explicitly backfill sysvinit, not DISTRO_FEATURES_INITMAN
default-distrovars: remove obsolete DISTRO_FEATURES_INITMAN reference
packagegroup-core-boot: revert to specifying sysvinit as default init manager
systemd-compat-units: disable dbus-1
systemd: recommend systemd-compat-units
dbus: explicitly disable systemd when no systemd
busybox: order and group initscript variables logically
udev: move /run volatile entry to udev instead of initscripts

 meta/classes/systemd.bbclass                       |   38 ++++----
 meta/classes/update-rc.d.bbclass                   |   22 +++--
 meta/conf/bitbake.conf                             |    2 +-
 meta/conf/distro/include/default-distrovars.inc    |    3 +-
 meta/conf/distro/include/default-providers.inc     |    2 +-
 .../base-files/base-files/fstab.systemd            |    9 --
 meta/recipes-core/base-files/base-files_3.0.14.bb  |    7 +-
 .../busybox/busybox-1.20.2/strict-atime.patch      |   49 ++++++++++
 meta/recipes-core/busybox/busybox.inc              |   22 ++++-
 meta/recipes-core/busybox/busybox_1.20.2.bb        |    5 +-
 .../busybox/files/busybox-klogd.service.in         |    8 ++
 .../busybox/files/busybox-syslog.service.in        |   13 +++
 meta/recipes-core/dbus/dbus.inc                    |    4 +-
 .../images/core-image-minimal-initramfs.bb         |    2 +
 .../initscripts/initscripts-1.0/volatiles          |    1 -
 .../packagegroups/packagegroup-core-boot.bb        |    5 +-
 meta/recipes-core/systemd/systemd-compat-units.bb  |    1 +
 meta/recipes-core/systemd/systemd/init             |  101 ++++++++++++++++++++
 meta/recipes-core/systemd/systemd_197.bb           |   49 +++++++---
 meta/recipes-core/udev/udev.inc                    |    6 +-
 meta/recipes-core/udev/udev/volatiles              |    1 +
 meta/recipes-core/util-linux/util-linux.inc        |   11 ++-
 22 files changed, 289 insertions(+), 72 deletions(-)
 delete mode 100644 meta/recipes-core/base-files/base-files/fstab.systemd
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch
 create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in
 create mode 100644 meta/recipes-core/systemd/systemd/init
 create mode 100644 meta/recipes-core/udev/udev/volatiles

Andreas Oberritter (1):
Revert "base-files: add fstab for systemd based systems"

Radu Moisan (1):
busybox: enable systemd integration for syslogd

Ross Burton (22):
busybox: add strictatime support to mount
systemd: make xz support (compressed journal) optional, defaulting to

    on.

systemd: merge udev-systemd into udev core-image-minimal-initramfs: don't install busybox-syslog
systemd: don't depend on the PCI/USB databases
systemd: split out the hwdb data
default-providers: change udev selection logic update-rcd.bbclass: handle both sysvinit and systemd features being
present
util-linux: split uuidd into it's own package, and enable for systemd
update-rcd: drop depends to recommends, check for update-rcd in
scripts
systemd: check for systemctl first, and don't force systemd to be
installed.
systemd: add udev init script for hybrid sysvinit/systemd usage update-rc.d/systemd: change communication variable name
default-distrovars: don't add INITMAN to DISTRO_FEATURES and
DISTRO_FEATURES_BACKFILL
bitbake.conf: explicitly backfill sysvinit, not
DISTRO_FEATURES_INITMAN
default-distrovars: remove obsolete DISTRO_FEATURES_INITMAN reference
packagegroup-core-boot: revert to specifying sysvinit as default init
manager
systemd-compat-units: disable dbus-1
systemd: recommend systemd-compat-units
dbus: explicitly disable systemd when no systemd
busybox: order and group initscript variables logically
udev: move /run volatile entry to udev instead of initscripts

 meta/classes/systemd.bbclass                       |   38 ++++----
 meta/classes/update-rc.d.bbclass                   |   22 +++--
 meta/conf/bitbake.conf                             |    2 +-
 meta/conf/distro/include/default-distrovars.inc    |    3 +-
 meta/conf/distro/include/default-providers.inc     |    2 +-
 .../base-files/base-files/fstab.systemd            |    9 --
 meta/recipes-core/base-files/base-files_3.0.14.bb  |    7 +-
 .../busybox/busybox-1.20.2/strict-atime.patch      |   49 ++++++++++
 meta/recipes-core/busybox/busybox.inc              |   22 ++++-
 meta/recipes-core/busybox/busybox_1.20.2.bb        |    5 +-
 .../busybox/files/busybox-klogd.service.in         |    8 ++
 .../busybox/files/busybox-syslog.service.in        |   13 +++
 meta/recipes-core/dbus/dbus.inc                    |    4 +-
 .../images/core-image-minimal-initramfs.bb         |    2 +
 .../initscripts/initscripts-1.0/volatiles          |    1 -
 .../packagegroups/packagegroup-core-boot.bb        |    5 +-
 meta/recipes-core/systemd/systemd-compat-units.bb  |    1 +
 meta/recipes-core/systemd/systemd/init             |  101 ++++++++++++++++++++
 meta/recipes-core/systemd/systemd_197.bb           |   49 +++++++---
 meta/recipes-core/udev/udev.inc                    |    6 +-
 meta/recipes-core/udev/udev/volatiles              |    1 +
 meta/recipes-core/util-linux/util-linux.inc        |   11 ++-
 22 files changed, 289 insertions(+), 72 deletions(-)
 delete mode 100644 meta/recipes-core/base-files/base-files/fstab.systemd
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch
 create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in
 create mode 100644 meta/recipes-core/systemd/systemd/init
 create mode 100644 meta/recipes-core/udev/udev/volatiles
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/24 busybox: enable systemd integration for syslogd

From: Radu Moisan <[email protected]>

---
 meta/recipes-core/busybox/busybox.inc                |   18 ++++++++++++++++--
 meta/recipes-core/busybox/busybox_1.20.2.bb          |    2 ++
 .../busybox/files/busybox-klogd.service.in           |    8 ++++++++
 .../busybox/files/busybox-syslog.service.in          |   13 +++++++++++++
 4 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/busybox/files/busybox-klogd.service.in
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.service.in
meta/recipes-core/busybox/busybox.inc +16 -2
index fc6ca91..e936e59 100644
@@ -18,7 +18,7 @@ export EXTRA_LDFLAGS = "${LDFLAGS}"
 PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf*"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${systemd_unitdir}/system/syslog.service"
 FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
@@ -32,12 +32,16 @@ INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
 INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ."
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
+
+SYSTEMD_PACKAGES = "${PN}-syslog"
+SYSTEMD_SERVICE_${PN}-syslog = "${PN}-syslog.service"
+
 CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
 CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
 
 RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
 
-inherit cml1 update-rc.d
+inherit cml1 systemd update-rc.d
 
 # internal helper
 def busybox_cfg(feature, features, tokens, cnf, rem):
@@ -213,6 +217,16 @@ do_install () {
                fi
 	fi
 	install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+
+    if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+            > ${D}${systemd_unitdir}/system/busybox-syslog.service
+        sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
+            > ${D}${systemd_unitdir}/system/busybox-klogd.service
+
+        ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
+    fi
 }
 
 inherit update-alternatives
meta/recipes-core/busybox/busybox_1.20.2.bb +2 -0
index 783261e..a02cd38 100644
@@ -28,6 +28,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://fix-for-spurious-testsuite-failure.patch \
            file://busybox-1.20.2-kernel_ver.patch \
            file://stat-usr-bin.patch \
+           file://busybox-syslog.service.in \
+           file://busybox-klogd.service.in \
            file://testsuite-du-du-k-works-fix-false-positive.patch"
 
 SRC_URI[tarball.md5sum] = "e025414bc6cd79579cc7a32a45d3ae1c"
meta/recipes-core/busybox/files/busybox-klogd.service.in new file +8 -0
new file mode 100644
index 0000000..d7c7755
@@ -0,0 +1,8 @@
+[Unit]
+Description=Kernel Logging Service
+
+[Service]
+ExecStart=@base_sbindir@/klogd -n
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-core/busybox/files/busybox-syslog.service.in new file +13 -0
new file mode 100644
index 0000000..2e04321
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logging Service
+Wants=busybox-klogd.service
+
+[Service]
+EnvironmentFile=-/etc/default/busybox-syslog
+ExecStart=@base_sbindir@/syslogd -n $OPTIONS
+Sockets=syslog.socket
+
+[Install]
+WantedBy=multi-user.target
+Also=busybox-klogd.service
+Alias=syslog.service
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 2/24 busybox: add strictatime support to mount

In reply to Ross Burton

systemd uses strictatime when mounting tmpfs. Luckily this is already supported upstream, so backport the patch from git.

---
 .../busybox/busybox-1.20.2/strict-atime.patch      |   49 ++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.20.2.bb        |    3 +-
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch
meta/recipes-core/busybox/busybox-1.20.2/strict-atime.patch new file +49 -0
new file mode 100644
index 0000000..8696427
@@ -0,0 +1,49 @@
+Add support for the "strictatime" mount option.
+
+Upstream-Status: Backport [9ad8979ff15e1b894ee1f4bb6a2535a1a2c20d65]
+Signed-off-by: Ross Burton <[email protected]>
+
+Index: busybox-1.20.2/util-linux/mount.c
+===================================================================
+--- busybox-1.20.2.orig/util-linux/mount.c	2012-07-02 15:08:25.000000000 +0100
++++ busybox-1.20.2/util-linux/mount.c	2013-03-22 15:37:31.340277463 +0000
+@@ -113,6 +113,12 @@
+ #ifndef MS_RELATIME
+ # define MS_RELATIME    (1 << 21)
+ #endif
++#ifndef MS_STRICTATIME
++# define MS_STRICTATIME (1 << 24)
++#endif
++
++/* Any ~MS_FOO value has this bit set: */
++#define BB_MS_INVERTED_VALUE (1u << 31)
+ 
+ #include "libbb.h"
+ #if ENABLE_FEATURE_MOUNT_LABEL
+@@ -239,6 +245,7 @@
+ 		/* "nomand"      */ ~MS_MANDLOCK,
+ 		/* "relatime"    */ MS_RELATIME,
+ 		/* "norelatime"  */ ~MS_RELATIME,
++		/* "strictatime" */ MS_STRICTATIME,
+ 		/* "loud"        */ ~MS_SILENT,
+ 		/* "rbind"       */ MS_BIND|MS_RECURSIVE,
+ 
+@@ -295,6 +302,7 @@
+ 		"nomand\0"
+ 		"relatime\0"
+ 		"norelatime\0"
++		"strictatime\0"
+ 		"loud\0"
+ 		"rbind\0"
+ 
+@@ -466,8 +474,8 @@
+ 		// Find this option in mount_options
+ 		for (i = 0; i < ARRAY_SIZE(mount_options); i++) {
+ 			if (strcasecmp(option_str, options) == 0) {
+-				long fl = mount_options[i];
+-				if (fl < 0)
++				unsigned long fl = mount_options[i];
++				if (fl & BB_MS_INVERTED_VALUE)
+ 					flags &= fl;
+ 				else
+ 					flags |= fl;
meta/recipes-core/busybox/busybox_1.20.2.bb +2 -1
index a02cd38..c09a492 100644
@@ -30,7 +30,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://stat-usr-bin.patch \
            file://busybox-syslog.service.in \
            file://busybox-klogd.service.in \
-           file://testsuite-du-du-k-works-fix-false-positive.patch"
+           file://testsuite-du-du-k-works-fix-false-positive.patch \
+           file://strict-atime.patch"
 
 SRC_URI[tarball.md5sum] = "e025414bc6cd79579cc7a32a45d3ae1c"
 SRC_URI[tarball.sha256sum] = "eb13ff01dae5618ead2ef6f92ba879e9e0390f9583bd545d8789d27cf39b6882"
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH v2 3/24 systemd: make xz support (compressed journal) optional, defaulting to on.

In reply to Ross Burton

Compressed journals means using liblzma, sf the journal isn't going to be used this can be disabled.

---
 meta/recipes-core/systemd/systemd_197.bb |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_197.bb +4 -2
index 5180eef..dc54f36 100644
@@ -11,7 +11,7 @@ PROVIDES = "udev"
 PE = "1"
 PR = "r4"
 
-DEPENDS = "xz kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
 DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SECTION = "base/shell"
@@ -43,9 +43,11 @@ LDFLAGS_libc-uclibc_append = " -lrt"
 
 GTKDOC_DOCDIR = "${S}/docs/"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "xz"
 # Sign the journal for anti-tampering
 PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
+# Compress the journal
+PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
 
 CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
 
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH v2 4/24 systemd: merge udev-systemd into udev

In reply to Ross Burton

Merge the contents of udev-systemd, which is just the service files, into udev itself. This split wasn't intended to ever happen in oe-core.

---
 meta/recipes-core/systemd/systemd_197.bb |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
meta/recipes-core/systemd/systemd_197.bb +4 -5
index dc54f36..9a66a4e 100644
@@ -173,7 +173,7 @@ FILES_${PN} = " ${base_bindir}/* \
 FILES_${PN}-dbg += "${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} += "dbus udev-systemd"
+RDEPENDS_${PN} += "dbus"
 
 RRECOMMENDS_${PN} += "systemd-serialgetty \
                       util-linux-agetty \
@@ -181,7 +181,7 @@ RRECOMMENDS_${PN} += "systemd-serialgetty \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
 "
 
-PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-systemd"
+PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils"
 
 FILES_udev-dbg += "/lib/udev/.debug"
 
@@ -212,6 +212,8 @@ FILES_udev += "${base_sbindir}/udevd \
                /lib/udev/rules.d/95*.rules \
                ${base_libdir}/udev/hwdb.d \
                ${sysconfdir}/udev \
+               ${systemd_unitdir}/system/*udev* \
+               ${systemd_unitdir}/system/*.wants/*udev* \
               "
 
 FILES_udev-consolekit += "/lib/ConsoleKit"
@@ -219,9 +221,6 @@ RDEPENDS_udev-consolekit += "${@base_contains('DISTRO_FEATURES', 'x11', 'console
 
 FILES_udev-utils = "${bindir}/udevadm"
 
-FILES_udev-systemd = "${systemd_unitdir}/system/*udev* ${systemd_unitdir}/system/*.wants/*udev*"
-RDEPENDS_udev-systemd = "udev"
-
 # TODO:
 # u-a for runlevel and telinit
 
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH v2 5/24 core-image-minimal-initramfs: don't install busybox-syslog

In reply to Ross Burton

This uses BAD_RECOMMENDATIONS which isn't supported by all package backends, but it's a start.

---
 meta/recipes-core/images/core-image-minimal-initramfs.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/images/core-image-minimal-initramfs.bb +2 -0
index 7f6826c..6de24b3 100644
@@ -17,3 +17,5 @@ IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
 inherit core-image
 
 IMAGE_ROOTFS_SIZE = "8192"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
Signature · 1 line
1.7.10.4
#9 lore raw

PATCH v2 6/24 systemd: don't depend on the PCI/USB databases

In reply to Ross Burton

systemd ships its own databases (hwdb), so we don't need another copy. --with-pci-ids isn't recognised by configure, so remove it.

---
 meta/recipes-core/systemd/systemd_197.bb |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_197.bb +1 -2
index 9a66a4e..56ced66 100644
@@ -61,7 +61,6 @@ EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
                  --disable-manpages \
                  --disable-coredump \
                  --disable-introspection \
-                 --with-pci-ids-path=/usr/share/misc \
                  --disable-tcpwrap \
                  --enable-split-usr \
                  --disable-microhttpd \
@@ -187,7 +186,7 @@ FILES_udev-dbg += "/lib/udev/.debug"
 
 RDEPENDS_udev += "udev-utils"
 RPROVIDES_udev = "hotplug"
-RRECOMMENDS_udev += "udev-extraconf usbutils-ids pciutils-ids"
+RRECOMMENDS_udev += "udev-extraconf"
 
 FILES_udev += "${base_sbindir}/udevd \
                ${base_libdir}/systemd/systemd-udevd \
Signature · 1 line
1.7.10.4
#10 lore raw

PATCH v2 7/24 systemd: split out the hwdb data

In reply to Ross Burton

The hardware databases are not essential and also quite large, so split them out into udev-hwdb.

---
 meta/recipes-core/systemd/systemd_197.bb |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
meta/recipes-core/systemd/systemd_197.bb +19 -3
index 56ced66..a006ec8 100644
@@ -180,13 +180,13 @@ RRECOMMENDS_${PN} += "systemd-serialgetty \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
 "
 
-PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils"
+PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-hwdb"
 
 FILES_udev-dbg += "/lib/udev/.debug"
 
 RDEPENDS_udev += "udev-utils"
 RPROVIDES_udev = "hotplug"
-RRECOMMENDS_udev += "udev-extraconf"
+RRECOMMENDS_udev += "udev-extraconf udev-hwdb"
 
 FILES_udev += "${base_sbindir}/udevd \
                ${base_libdir}/systemd/systemd-udevd \
@@ -209,7 +209,6 @@ FILES_udev += "${base_sbindir}/udevd \
                /lib/udev/rules.d/78*.rules \
                /lib/udev/rules.d/8*.rules \
                /lib/udev/rules.d/95*.rules \
-               ${base_libdir}/udev/hwdb.d \
                ${sysconfdir}/udev \
                ${systemd_unitdir}/system/*udev* \
                ${systemd_unitdir}/system/*.wants/*udev* \
@@ -220,6 +219,8 @@ RDEPENDS_udev-consolekit += "${@base_contains('DISTRO_FEATURES', 'x11', 'console
 
 FILES_udev-utils = "${bindir}/udevadm"
 
+FILES_udev-hwdb = "${base_libdir}/udev/hwdb.d"
+
 # TODO:
 # u-a for runlevel and telinit
 
@@ -239,6 +240,21 @@ update-alternatives --remove shutdown ${base_bindir}/systemctl
 update-alternatives --remove poweroff ${base_bindir}/systemctl
 }
 
+pkg_postinst_udev-hwdb () {
+	if test -n "$D"; then
+		exit 1
+	fi
+
+	udevadm hwdb --update
+}
+
+pkg_prerm_udev-hwdb () {
+	if test -n "$D"; then
+		exit 1
+	fi
+
+	rm -f ${sysconfdir}/udev/hwdb.bin
+}
 
 # As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try
 # building udev and systemd in world builds.
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH v2 8/24 default-providers: change udev selection logic

In reply to Ross Burton

Change the logic so that the udev provider is the standalone udev, unless the systemd DISTRO_FEATURE is set. The previous logic was designed to fail if both sysvinit and systemd were enabled, which we're supporting now.

---
 meta/conf/distro/include/default-providers.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/distro/include/default-providers.inc +1 -1
index 39ce7cc..e3a44e6 100644
@@ -38,4 +38,4 @@ PREFERRED_PROVIDER_nativesdk-opkg ?= "nativesdk-opkg"
 PREFERRED_PROVIDER_console-tools ?= "kbd"
 PREFERRED_PROVIDER_gzip-native ?= "pigz-native"
 PREFERRED_PROVIDER_make ?= "make"
-PREFERRED_PROVIDER_udev ?= "${@base_contains('DISTRO_FEATURES','sysvinit','udev','',d)}${@base_contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PREFERRED_PROVIDER_udev ?= "${@base_contains('DISTRO_FEATURES','systemd','systemd','udev',d)}"
Signature · 1 line
1.7.10.4
#12 lore raw

PATCH v2 9/24 update-rcd.bbclass: handle both sysvinit and systemd features being present

In reply to Ross Burton

Run the helper if the sysvinit feature is present, or if the systemd feature is present but the systemd class hasn't been inherited. We want to run in the latter case as systemd has sysvinit compatibility, but we don't want to always run so that pure systemd images don't have redundant sysvinit files.

---
 meta/classes/update-rc.d.bbclass |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/classes/update-rc.d.bbclass +6 -3
index 65bf022..06b91c1 100644
@@ -75,9 +75,12 @@ python populate_packages_updatercd () {
         postrm += d.getVar('updatercd_postrm', True)
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 
-    # If the systemd class has also been inherited, then don't do anything as
-    # the systemd units will override anything created by update-rc.d.
-    if not d.getVar("SYSTEMD_BBCLASS_ENABLED", True):
+    # Run if the sysvinit feature is present, or if the systemd feature is present
+    # but the systemd class hasn't been inherited.  We want to run in the latter case
+    # as systemd has sysvinit compatibility, but we don't want to always so that
+    # pure systemd images don't have redundent sysvinit files.
+    if "sysvinit" in d.getVar("DISTRO_FEATURES").split() or \
+       ("systemd" in d.getVar("DISTRO_FEATURES").split() and not d.getVar("SYSTEMD_BBCLASS_ENABLED", True)):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
             pkgs = d.getVar('UPDATERCPN', True)
Signature · 1 line
1.7.10.4
#13 lore raw

PATCH v2 10/24 util-linux: split uuidd into it's own package, and enable for systemd

In reply to Ross Burton
---
 meta/recipes-core/util-linux/util-linux.inc |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +9 -2
index 41a5471..46daab7 100644
@@ -17,7 +17,7 @@ LIC_FILES_CHKSUM = "file://README.licensing;md5=679af3e410ee112a5ec94de6501bf5c3
                     file://libmount/COPYING;md5=152f98bc301a5ea649769ede7203ac82 \
                     file://libblkid/COPYING;md5=152f98bc301a5ea649769ede7203ac82"
 
-inherit autotools gettext pkgconfig
+inherit autotools gettext pkgconfig systemd
 DEPENDS = "zlib ncurses"
 DEPENDS_append_class-native = " lzo-native"
 
@@ -34,7 +34,7 @@ PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfd
              util-linux-libmount util-linux-libmount-dev \
              util-linux-libblkid-dev util-linux-libuuid util-linux-libuuid-dev \
              util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
-             util-linux-mkfs util-linux-mcookie util-linux-reset"
+             util-linux-mkfs util-linux-mcookie util-linux-reset util-linux-uuidd"
 
 EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
                 --disable-makeinstall-chown --enable-elvtune --enable-init \
@@ -46,6 +46,10 @@ EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
 		usrsbin_execdir='${sbindir}' \
 "
 
+# Respect the systemd feature for uuidd
+EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--enable-socket-activation', '--disable-socket-activation', d)}"
+EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
+
 EXTRA_OECONF_append_class-native = " --disable-login --disable-su"
 
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
@@ -61,6 +65,7 @@ FILES_util-linux-mcookie = "${bindir}/mcookie"
 FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
+FILES_util-linux-uuidd = "${sbindir}/uuidd"
 FILES_util-linux-reset = "${base_bindir}/reset"
 
 FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*"
@@ -88,6 +93,8 @@ RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-l
 RRECOMMENDS_${PN}_class-native = ""
 RDEPENDS_${PN}_class-native = ""
 
+SYSTEMD_PACKAGES = "util-linux-uuidd"
+SYSTEMD_SERVICE_util-linux-uuidd = "uuidd.service"
 
 do_compile () {
 	set -e
Signature · 1 line
1.7.10.4
#14 lore raw

PATCH v2 11/24 update-rcd: drop depends to recommends, check for update-rcd in scripts

In reply to Ross Burton
---
 meta/classes/update-rc.d.bbclass |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
meta/classes/update-rc.d.bbclass +10 -5
index 06b91c1..0997702 100644
@@ -6,7 +6,7 @@ UPDATERCD_virtclass-cross = ""
 UPDATERCD_class-native = ""
 UPDATERCD_class-nativesdk = ""
 
-RDEPENDS_${UPDATERCPN}_append = " ${UPDATERCD}"
+RRECOMMENDS_${UPDATERCPN}_append = " ${UPDATERCD}"
 
 INITSCRIPT_PARAMS ?= "defaults"
 
@@ -18,7 +18,9 @@ if test "x$D" != "x"; then
 else
 	OPT="-s"
 fi
-update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+if type update-rc.d >/dev/null; then
+	update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+fi
 }
 
 updatercd_prerm() {
@@ -28,10 +30,13 @@ fi
 }
 
 updatercd_postrm() {
-if [ "$D" != "" ]; then
-	update-rc.d -f -r $D ${INITSCRIPT_NAME} remove
+if test "$D" != ""; then
+	OPT="-f -r $D"
 else
-	update-rc.d ${INITSCRIPT_NAME} remove
+	OPT=""
+fi
+if type update-rc.d >/dev/null; then
+	update-rc.d $OPT ${INITSCRIPT_NAME} remove
 fi
 }
 
Signature · 1 line
1.7.10.4
#15 lore raw

PATCH v2 12/24 systemd: check for systemctl first, and don't force systemd to be installed.

In reply to Ross Burton

With both sysvinit and systemd features enabled these postinsts may actually run on a target without systemd, so check that systemctl is present before using it.

---
 meta/classes/systemd.bbclass |   27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)
meta/classes/systemd.bbclass +11 -16
index 564cd72..cca2152 100644
@@ -24,19 +24,23 @@ if [ -n "$D" ]; then
     OPTS="--root=$D"
 fi
 
-systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
+if type systemctl >/dev/null; then
+	systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
 
-if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
-    systemctl start ${SYSTEMD_SERVICE}
+	if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
+		systemctl start ${SYSTEMD_SERVICE}
+	fi
 fi
 }
 
 systemd_prerm() {
-if [ -z "$D" ]; then
-    systemctl stop ${SYSTEMD_SERVICE}
-fi
+if type systemctl >/dev/null; then
+	if [ -z "$D" ]; then
+		systemctl stop ${SYSTEMD_SERVICE}
+	fi
 
-systemctl disable ${SYSTEMD_SERVICE}
+	systemctl disable ${SYSTEMD_SERVICE}
+fi
 }
 
 python systemd_populate_packages() {
@@ -56,14 +60,6 @@ python systemd_populate_packages() {
             bb.error('%s does not appear in package list, please add it' % pkg_systemd)
 
 
-    # Add a runtime dependency on systemd to pkg
-    def systemd_add_rdepends(pkg):
-        rdepends = d.getVar('RDEPENDS_' + pkg, True) or ""
-        if not 'systemd' in rdepends.split():
-            rdepends = '%s %s' % (rdepends, 'systemd')
-        d.setVar('RDEPENDS_' + pkg, rdepends)
-
-
     def systemd_generate_package_scripts(pkg):
         bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
 
@@ -156,7 +152,6 @@ python systemd_populate_packages() {
             systemd_check_package(pkg)
             if d.getVar('SYSTEMD_SERVICE_' + pkg, True):
                 systemd_generate_package_scripts(pkg)
-                systemd_add_rdepends(pkg)
         systemd_check_services()
 }
 
Signature · 1 line
1.7.10.4
#16 lore raw

PATCH v2 13/24 systemd: add udev init script for hybrid sysvinit/systemd usage

In reply to Ross Burton

With both sysvinit and systemd features it's possible to use systemd's udev with sysvinit, so add the required init script.

---
 meta/recipes-core/systemd/systemd/init   |  101 ++++++++++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_197.bb |   13 +++-
 2 files changed, 113 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/systemd/systemd/init
meta/recipes-core/systemd/systemd/init new file +101 -0
new file mode 100644
index 0000000..0ddd043
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:          udev
+# Required-Start:    mountvirtfs
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+. /etc/init.d/functions
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x /lib/systemd/systemd-udevd ] || exit 1
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+readfile () {
+   filename=$1
+   READDATA=""
+   if [ -r $filename ]; then
+       while read line; do
+           READDATA="$READDATA$line"
+       done < $filename
+   fi
+}
+
+case "$1" in
+  start)
+    export ACTION=add
+    # propagate /dev from /sys
+    echo "Starting udev"
+
+    # mount the tmpfs on /dev, if not already done
+    LANG=C awk '$2 == "/dev" && ($3 == "tmpfs" || $3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+            mount -n -o mode=0755 -t tmpfs none "/dev"
+    }
+    [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+    [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+    mount -a -t tmpfs 2>/dev/null
+    mkdir -p /var/volatile/run
+
+    # cache handling
+    if [ "$DEVCACHE" != "" ]; then
+            readfile /proc/version
+            VERSION="$READDATA"
+            readfile /proc/cmdline
+            CMDLINE="$READDATA"
+            readfile /proc/devices
+            DEVICES="$READDATA"
+            readfile /proc/atags
+            ATAGS="$READDATA"
+
+            if [ -e $DEVCACHE ]; then
+                    readfile /etc/udev/cache.data
+                    if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
+                            (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
+                            not_first_boot=1
+                    fi
+
+                    echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+            fi
+    fi
+
+    # make_extra_nodes
+    killproc systemd-udevd > "/dev/null" 2>&1
+
+    # trigger the sorted events
+    echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+    /lib/systemd/systemd-udevd -d
+
+    /usr/bin/udevadm control --env=STARTUP=1
+    if [ "$not_first_boot" != "" ];then
+            /usr/bin/udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics	 --subsystem-nomatch=backlight --subsystem-nomatch=video4linux	--subsystem-nomatch=platform
+            (/usr/bin/udevadm settle --timeout=3; /usr/bin/udevadm control --env=STARTUP=)&
+    else
+            /usr/bin/udevadm trigger --action=add
+            /usr/bin/udevadm settle
+    fi
+    ;;
+  stop)
+    echo "Stopping udevd"
+    start-stop-daemon --stop --name udevd --quiet
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  status)
+    status udevd
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart}"
+    exit 1
+esac
+exit 0
meta/recipes-core/systemd/systemd_197.bb +12 -1
index a006ec8..d07fa95 100644
@@ -16,7 +16,7 @@ DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SECTION = "base/shell"
 
-inherit gtk-doc useradd pkgconfig autotools perlnative
+inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d
 
 SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://touchscreen.rules \
@@ -26,6 +26,7 @@ SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://00-create-volatile.conf \
            file://0001-systemd-analyze-rewrite-in-C.patch \
            file://udev-linkage.patch \
+           file://init \
           "
 SRC_URI[md5sum] = "56a860dceadfafe59f40141eb5223743"
 SRC_URI[sha256sum] = "e6857ea21ae24d7056e7b0f4c2aaaba73b8bf57025b8949c0a8af0c1bc9774b5"
@@ -100,6 +101,11 @@ do_install() {
 	install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
 
 	install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+
+	if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
+	fi
 }
 
 python populate_packages_prepend (){
@@ -210,6 +216,7 @@ FILES_udev += "${base_sbindir}/udevd \
                /lib/udev/rules.d/8*.rules \
                /lib/udev/rules.d/95*.rules \
                ${sysconfdir}/udev \
+               ${sysconfdir}/init.d/systemd-udevd \
                ${systemd_unitdir}/system/*udev* \
                ${systemd_unitdir}/system/*.wants/*udev* \
               "
@@ -221,6 +228,10 @@ FILES_udev-utils = "${bindir}/udevadm"
 
 FILES_udev-hwdb = "${base_libdir}/udev/hwdb.d"
 
+INITSCRIPT_PACKAGES = "udev"
+INITSCRIPT_NAME_udev = "systemd-udevd"
+INITSCRIPT_PARAMS_udev = "start 03 S ."
+
 # TODO:
 # u-a for runlevel and telinit
 
Signature · 1 line
1.7.10.4
#17 lore raw

PATCH v2 14/24 update-rc.d/systemd: change communication variable name

In reply to Ross Burton

Rename SYSTEMD_BBCLASS_ENABLED to INHIBIT_UPDATERCD_BBCLASS to reflect the action, for clarity.

---
 meta/classes/systemd.bbclass     |   11 +++++++----
 meta/classes/update-rc.d.bbclass |    8 +++-----
 2 files changed, 10 insertions(+), 9 deletions(-)
meta/classes/systemd.bbclass +7 -4
index cca2152..42fa554 100644
@@ -10,11 +10,14 @@ SYSTEMD_AUTO_ENABLE ??= "enable"
 # even if the systemd DISTRO_FEATURE isn't enabled.  As such don't make any
 # changes directly but check the DISTRO_FEATURES first.
 python __anonymous() {
-    if "systemd" in d.getVar("DISTRO_FEATURES", True).split():
+    features = d.getVar("DISTRO_FEATURES", True).split()
+    # If the distro features have systemd but not sysvinit, inhibit update-rcd
+    # from doing any work so that pure-systemd images don't have redundant init
+    # files.
+    if "systemd" in features:
         d.appendVar("DEPENDS", " systemd-systemctl-native")
-        # Set a variable so that update-rcd.bbclass knows we're active and can
-        # disable itself.
-        d.setVar("SYSTEMD_BBCLASS_ENABLED", "1")
+        if "sysvinit" not in features:
+            d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
 systemd_postinst() {
meta/classes/update-rc.d.bbclass +3 -5
index 0997702..9f1e28a 100644
@@ -80,12 +80,10 @@ python populate_packages_updatercd () {
         postrm += d.getVar('updatercd_postrm', True)
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 
-    # Run if the sysvinit feature is present, or if the systemd feature is present
-    # but the systemd class hasn't been inherited.  We want to run in the latter case
-    # as systemd has sysvinit compatibility, but we don't want to always so that
-    # pure systemd images don't have redundent sysvinit files.
+    # Check that this class isn't being inhibited (generally, by
+    # systemd.bbclass) before doing any work.
     if "sysvinit" in d.getVar("DISTRO_FEATURES").split() or \
-       ("systemd" in d.getVar("DISTRO_FEATURES").split() and not d.getVar("SYSTEMD_BBCLASS_ENABLED", True)):
+       not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
             pkgs = d.getVar('UPDATERCPN', True)
Signature · 1 line
1.7.10.4
#18 lore raw

PATCH v2 15/24 default-distrovars: don't add INITMAN to DISTRO_FEATURES and DISTRO_FEATURES_BACKFILL

In reply to Ross Burton

DISTRO_FEATURES_INITMAN is going away as it's not useful in a hybrid init script environment.

---
 meta/conf/distro/include/default-distrovars.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/distro/include/default-distrovars.inc +1 -1
index f0fec2a..eafbcc2 100644
@@ -18,7 +18,7 @@ DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-b
 DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
 DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
 DISTRO_FEATURES_INITMAN ?= "sysvinit"
-DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ${DISTRO_FEATURES_LIBC} ${DISTRO_FEATURES_INITMAN}"
+DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ${DISTRO_FEATURES_LIBC}"
 
 IMAGE_FEATURES ?= ""
 
Signature · 1 line
1.7.10.4
#19 lore raw

PATCH v2 16/24 bitbake.conf: explicitly backfill sysvinit, not DISTRO_FEATURES_INITMAN

In reply to Ross Burton

Reflect reality by backfilling sysvinit support, instead of whatever value was in DISTRO_FEATURES_INITMAN.

---
 meta/conf/bitbake.conf |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 01ebad4..cd5d61e 100644
@@ -730,7 +730,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
 IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 
-DISTRO_FEATURES_BACKFILL = "pulseaudio ${DISTRO_FEATURES_INITMAN}"
+DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit"
 MACHINE_FEATURES_BACKFILL = "rtc"
 
 COMBINED_FEATURES = "\
Signature · 1 line
1.7.10.4
#20 lore raw

PATCH v2 17/24 default-distrovars: remove obsolete DISTRO_FEATURES_INITMAN reference

In reply to Ross Burton
---
 meta/conf/distro/include/default-distrovars.inc |    1 -
 1 file changed, 1 deletion(-)
meta/conf/distro/include/default-distrovars.inc +0 -1
index eafbcc2..b0586d6 100644
@@ -17,7 +17,6 @@ DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-b
 					libc-posix-wchar-io"
 DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
 DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
-DISTRO_FEATURES_INITMAN ?= "sysvinit"
 DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ${DISTRO_FEATURES_LIBC}"
 
 IMAGE_FEATURES ?= ""
Signature · 1 line
1.7.10.4
#21 lore raw

PATCH v2 18/24 packagegroup-core-boot: revert to specifying sysvinit as default init manager

In reply to Ross Burton

Don't follow DISTRO_FEATURES_INITMAN as that makes the packagegroups rebuild if you switch init manager.

As in hybrid situations there's generally a clear primary and minimal init manager choice, so change VIRTUAL-RUNTIME_init_manager to set the primary init manager, and roll your own groups/images for the secondary.

---
 meta/recipes-core/packagegroups/packagegroup-core-boot.bb |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-core/packagegroups/packagegroup-core-boot.bb +2 -3
index b9183a8..9306a34 100644
@@ -26,8 +26,8 @@ RCONFLICTS_${PN} = "task-core-boot"
 # Distro can override the following VIRTUAL-RUNTIME providers:
 VIRTUAL-RUNTIME_dev_manager ?= "udev"
 VIRTUAL-RUNTIME_login_manager ?= "tinylogin"
-VIRTUAL-RUNTIME_init_manager ?= "${DISTRO_FEATURES_INITMAN}"
-VIRTUAL-RUNTIME_initscripts ?= "${@base_contains('DISTRO_FEATURES', 'sysvinit', 'initscripts', '',d)}"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
 VIRTUAL-RUNTIME_keymaps ?= "keymaps"
 
 RDEPENDS_${PN} = "\
@@ -42,7 +42,6 @@ RDEPENDS_${PN} = "\
     ${VIRTUAL-RUNTIME_login_manager} \
     ${VIRTUAL-RUNTIME_init_manager} \
     ${VIRTUAL-RUNTIME_initscripts} \
-    ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd-compat-units', '',d)} \
     ${VIRTUAL-RUNTIME_dev_manager} \
     ${VIRTUAL-RUNTIME_update-alternatives} \
     ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
Signature · 1 line
1.7.10.4
#22 lore raw

PATCH v2 19/24 Revert "base-files: add fstab for systemd based systems"

In reply to Ross Burton

From: Andreas Oberritter <[email protected]>

For hybrid systemd/sysvinit builds, only one fstab can be used. The default fstab used by sysvinit should work fine with systemd.

Since virtually every machine will ship its own fstab in its bsp layer, the bsp layer may decide how to override the fstab based on distro features.

This reverts commit 77bbb839ba25b974a538b90d346b454ccd5deefd.

---
 meta/recipes-core/base-files/base-files/fstab.systemd |    9 ---------
 meta/recipes-core/base-files/base-files_3.0.14.bb     |    7 +------
 2 files changed, 1 insertion(+), 15 deletions(-)
 delete mode 100644 meta/recipes-core/base-files/base-files/fstab.systemd
meta/recipes-core/base-files/base-files/fstab.systemd deleted +0 -9
deleted file mode 100644
index cb48a0d..0000000
@@ -1,9 +0,0 @@
-# stock fstab - you probably want to override this with a machine specific one
-
-rootfs               /                    auto       defaults              1  1
-tmpfs                /var/volatile        tmpfs      defaults              0  0
-tmpfs                /media/ram           tmpfs      defaults              0  0
-
-# uncomment this if your device has a SD/MMC/Transflash slot
-#/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0
-
meta/recipes-core/base-files/base-files_3.0.14.bb +1 -6
index e7a9d82..a56450d 100644
@@ -18,7 +18,6 @@ SRC_URI = "file://rotation \
            file://profile \
            file://shells \
            file://fstab \
-           file://fstab.systemd \
            file://filesystems \
            file://issue.net \
            file://issue \
@@ -92,11 +91,7 @@ do_install () {
  		install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation
 	fi
 
-	if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-		install -m 0644 ${WORKDIR}/fstab.systemd ${D}${sysconfdir}/fstab
-	else
-		install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
-	fi
+	install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
 	install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
 	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
 	sed -i "s#ROOTHOME#${ROOT_HOME}#" ${WORKDIR}/profile
Signature · 1 line
1.7.10.4
#23 lore raw

PATCH v2 20/24 systemd-compat-units: disable dbus-1

In reply to Ross Burton
---
 meta/recipes-core/systemd/systemd-compat-units.bb |    1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd-compat-units.bb +1 -0
index 19a1ea1..9b4a8a4 100644
@@ -34,6 +34,7 @@ SYSTEMD_DISABLED_SYSV_SERVICES = " \
   hwclock \
   networking \
   syslog.busybox \
+  dbus-1 \
 "
 
 pkg_postinst_${PN} () {
Signature · 1 line
1.7.10.4
#24 lore raw

PATCH v2 21/24 systemd: recommend systemd-compat-units

In reply to Ross Burton

These are more than useful as they ensure some services are not started twice, and cause the first-boot postinstalls to run.

---
 meta/recipes-core/systemd/systemd_197.bb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_197.bb +1 -1
index d07fa95..5ba3a23 100644
@@ -180,7 +180,7 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
 
 RDEPENDS_${PN} += "dbus"
 
-RRECOMMENDS_${PN} += "systemd-serialgetty \
+RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       util-linux-agetty \
                       util-linux-fsck e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
Signature · 1 line
1.7.10.4
#25 lore raw

PATCH v2 22/24 dbus: explicitly disable systemd when no systemd

In reply to Ross Burton

If systemd isn't a distro feature, explicitly disable the systemd unit path check as otherwise it will search the sysroot.

---
 meta/recipes-core/dbus/dbus.inc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/dbus/dbus.inc +2 -2
index affffbc..c64084f 100644
@@ -68,8 +68,8 @@ pkg_postinst_dbus() {
 EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
 EXTRA_OECONF_X_class-native = "--without-x --disable-x11-autolaunch"
 # TODO: would like to --enable-systemd but that's a circular build-dependency
-# between systemd <->dbus
-EXTRA_OECONF_SYSTEMD = "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '', d)}"
+# between systemd<->dbus
+EXTRA_OECONF_SYSTEMD = "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
 
 EXTRA_OECONF = "--disable-tests \
                 --disable-checks \
Signature · 1 line
1.7.10.4
#26 lore raw

PATCH v2 23/24 busybox: order and group initscript variables logically

In reply to Ross Burton
---
 meta/recipes-core/busybox/busybox.inc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/busybox.inc +2 -2
index e936e59..655cb3c 100644
@@ -27,10 +27,10 @@ FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
 INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
 
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
-INITSCRIPT_NAME_${PN}-syslog = "syslog"
-INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
+INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ."
+INITSCRIPT_NAME_${PN}-syslog = "syslog"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
 
 SYSTEMD_PACKAGES = "${PN}-syslog"
Signature · 1 line
1.7.10.4
#27 lore raw

PATCH v2 24/24 udev: move /run volatile entry to udev instead of initscripts

In reply to Ross Burton

initscripts is generally installed on systemd-using images, but because it specifies that /run is a symlink to /var/run managed by volatiles it totally breaks systemd by copying/deleting /run from underneath systemd. Deleting sockets mid-boot doesn't leave systemd in a happy place.

As this volatile reference of /run was introduced by udev 182, move it's reference to the udev recipe. This way it will never be present on systemd images, as systemd manages /run as a tmpfs itself.

---
 meta/recipes-core/initscripts/initscripts-1.0/volatiles |    1 -
 meta/recipes-core/udev/udev.inc                         |    6 +++++-
 meta/recipes-core/udev/udev/volatiles                   |    1 +
 3 files changed, 6 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/udev/udev/volatiles
meta/recipes-core/initscripts/initscripts-1.0/volatiles +0 -1
index f0c796c..270f128 100644
@@ -35,4 +35,3 @@ f root root 0664 /var/log/wtmp none
 f root root 0664 /var/run/utmp none
 l root root 0644 /etc/resolv.conf /var/run/resolv.conf
 f root root 0644 /var/run/resolv.conf none
-l root root 0755 /run /var/run
meta/recipes-core/udev/udev.inc +5 -1
index bd82c34..e358d2d 100644
@@ -27,7 +27,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
            file://local.rules \
            file://udev-cache \
            file://udev-cache.default \
-           file://init"
+           file://init \
+           file://volatiles"
 
 inherit autotools pkgconfig update-rc.d
 
@@ -81,6 +82,9 @@ do_install_append () {
 	install -d ${D}${sysconfdir}/default
 	install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
 
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_udev
+
 	touch ${D}${sysconfdir}/udev/cache.data
 
 	install -d ${D}${sysconfdir}/udev/rules.d/
meta/recipes-core/udev/udev/volatiles new file +1 -0
new file mode 100644
index 0000000..e33561b
@@ -0,0 +1 @@
+l root root 0755 /run /var/run
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH 05/24] core-image-minimal-initramfs: don't install busybox-syslog

In reply to Ross Burton
Quoted 2 lines · Ross Burton

This uses BAD_RECOMMENDATIONS which isn't supported by all package backends, but it's a start.

Since it's not supported in all backends, can you add a bugzilla to add support to the various backends?

--Mark

Quoted 16 lines
---
  meta/recipes-core/images/core-image-minimal-initramfs.bb |    2 ++
  1 file changed, 2 insertions(+)
meta/recipes-core/images/core-image-minimal-initramfs.bb +2 -0
index 7f6826c..6de24b3 100644
@@ -17,3 +17,5 @@ IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
  inherit core-image
 
  IMAGE_ROOTFS_SIZE = "8192"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
#7 lore raw

Re: [PATCH 05/24] core-image-minimal-initramfs: don't install busybox-syslog

Quoted 6 lines · On Tuesday 26 March 2013 12:05:33 Mark Hatle wrote:
Quoted 2 lines · Ross Burton

This uses BAD_RECOMMENDATIONS which isn't supported by all package backends, but it's a start.

Since it's not supported in all backends, can you add a bugzilla to add support to the various backends?

FYI, Ross already filed one for RPM:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=3916

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#8 lore raw

Re: [PATCH 05/24] core-image-minimal-initramfs: don't install busybox-syslog

In reply to Mark Hatle
Quoted 8 lines · Mark Hatle
Quoted 4 lines · Ross Burton

This uses BAD_RECOMMENDATIONS which isn't supported by all package backends, but
it's a start.

Since it's not supported in all backends, can you add a bugzilla to add support to the various backends?

I'd previously filed #3916 for rootfs_rpm, but failed to do the same for rootfs_deb (now done, #4120).

Ross