Skip to contentSkip to conversation

busybox: Add support for busybox-init

PATCH In review Khem Raj 7 participants 15 messages Jan 22, 2016 – Mar 3, 2018

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 busybox: Add support for busybox-init

in config metadata we can configure busybox based init and device initializer ( mdev ) using e.g.

VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
VIRTUAL-RUNTIME_login_manager = "busybox"
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_initscripts = "initscripts"
VIRTUAL-RUNTIME_keymaps = "keymaps"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

busybox can be used to provide init system
combined with mdev it makes it a complete init
system for really tiny systems.

This patch uses above defines to configure features in busybox to enable the init system and mdev in a configurable manner

---
 meta/recipes-core/busybox/busybox.inc       | 15 +++++++++++++++
 meta/recipes-core/busybox/busybox/init.cfg  |  3 +++
 meta/recipes-core/busybox/busybox/mdev.cfg  | 11 +++++++++++
 meta/recipes-core/busybox/busybox_1.24.1.bb |  6 ++++++
 meta/recipes-core/busybox/files/inittab     | 24 ++++++++++++++++++++++++
 meta/recipes-core/busybox/files/rcK         | 25 +++++++++++++++++++++++++
 meta/recipes-core/busybox/files/rcS         | 26 ++++++++++++++++++++++++++
 meta/recipes-core/busybox/files/runlevel    | 11 +++++++++++
 8 files changed, 121 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/init.cfg
 create mode 100644 meta/recipes-core/busybox/busybox/mdev.cfg
 create mode 100644 meta/recipes-core/busybox/files/inittab
 create mode 100644 meta/recipes-core/busybox/files/rcK
 create mode 100644 meta/recipes-core/busybox/files/rcS
 create mode 100644 meta/recipes-core/busybox/files/runlevel
meta/recipes-core/busybox/busybox.inc +15 -0
index 9541123..e5710f0 100644
@@ -275,6 +275,21 @@ do_install () {
                        install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
                fi
 	fi
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
+                install -D -m 0777 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
+                install -D -m 0755 ${WORKDIR}/runlevel ${D}${base_sbindir}/runlevel
+                if grep "CONFIG_FEATURE_USE_INITTAB=y" ${B}/.config; then
+                        install -D -m 0777 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+                                echo "tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+                        done
+                fi
+        fi
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
meta/recipes-core/busybox/busybox/init.cfg new file +3 -0
new file mode 100644
index 0000000..006d4c6
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
meta/recipes-core/busybox/busybox/mdev.cfg new file +11 -0
new file mode 100644
index 0000000..6aefe90
@@ -0,0 +1,11 @@
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
+
+CONFIG_SETSID=y
+CONFIG_CTTYHACK=y
+
+CONFIG_FEATURE_SHADOWPASSWDS=y
meta/recipes-core/busybox/busybox_1.24.1.bb +6 -0
index 5e19d9c..8adee53 100644
@@ -39,6 +39,12 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://sha256sum.cfg \
            file://getopts.cfg \
            file://resize.cfg \
+           ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'busybox')]} \
+           ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
+           file://inittab \
+           file://rcS \
+           file://rcK \
+           file://runlevel \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
meta/recipes-core/busybox/files/inittab new file +24 -0
new file mode 100644
index 0000000..bfec4a7
@@ -0,0 +1,24 @@
+# This is run first except when booting in single-user mode.
+
+# Startup the system
+null::sysinit:/bin/mount -t proc proc /proc
+null::sysinit:/bin/mount -t sysfs sysfs /sys
+null::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+null::sysinit:/bin/mount -o remount,rw /
+null::sysinit:/bin/mkdir -p /dev/pts
+null::sysinit:/bin/mount -t devpts devpts /dev/pts
+null::sysinit:/bin/mount -a
+
+::sysinit:/etc/init.d/rcS
+
+# Stuff to do before rebooting
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rcK
+::shutdown:/sbin/swapoff -a
+::shutdown:/bin/umount -a -r
+
+# Stuff to do when restarting the init process
+::restart:/sbin/init
+
+# set hostname
+null::sysinit:/bin/busybox hostname -F /etc/hostname
meta/recipes-core/busybox/files/rcK new file +25 -0
new file mode 100644
index 0000000..050086e
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.
+#
+for i in /etc/rc6.d/K??*; do
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+	*.sh)
+	    # Source shell script for speed.
+	    (
+		trap - INT QUIT TSTP
+		set stop
+		. $i
+	    )
+	    ;;
+	*)
+	    # No sh extension, so fork subprocess.
+	    $i stop
+	    ;;
+    esac
+done
+
meta/recipes-core/busybox/files/rcS new file +26 -0
new file mode 100644
index 0000000..d18c26b
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.
+#
+
+for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+	*.sh)
+	    # Source shell script for speed.
+	    (
+		trap - INT QUIT TSTP
+		set stop
+		. $i
+	    )
+	    ;;
+	*)
+	    # No sh extension, so fork subprocess.
+	    $i start
+	    ;;
+    esac
+done
+
meta/recipes-core/busybox/files/runlevel new file +11 -0
new file mode 100644
index 0000000..866f3b5
@@ -0,0 +1,11 @@
+#!/bin/sh
+# busybox init does not have LSB ( sysvinit ) like initlevels
+# so lets fake it to 5 which is what we default anyway
+# this helps with opkg post installs where it tries to invoke
+# update-rc.d ad post install step.
+# for package upgrades
+# See code in update-rc.d around line 190 where it calls runlevel
+# program
+#
+echo "5"
+
Signature · 1 line
2.7.0
author
#1 lore raw

PATCH 2/2 local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit

OE core provides systemd,busybox as options for system init system along with sysvinit being the default. Document the needed settings to enable systemd and busybox as options if user wishes.

---
 meta/conf/local.conf.sample | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
meta/conf/local.conf.sample +17 -0
index a662f4d..b760546 100644
@@ -209,6 +209,23 @@ PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 #ASSUME_PROVIDED += "libsdl-native"
 
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
+#
+#DISTRO_FEATURES_append = " systemd sysvinit"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+#VIRTUAL-RUNTIME_init_manager = "systemd"
+#VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
 
 # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
 # track the version of this file when it was generated. This can safely be ignored if
Signature · 1 line
2.7.0
#2 lore raw

Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit

Quoted 22 lines · Khem Raj

OE core provides systemd,busybox as options for system init system along with sysvinit being the default. Document the needed settings to enable systemd and busybox as options if user wishes.

---
 meta/conf/local.conf.sample | 17 +++++++++++++++++

 1 file changed, 17 insertions(+)
meta/conf/local.conf.sample +0 -0
index a662f4d..b760546 100644
@@ -209,6 +209,23 @@ PACKAGECONFIG_append_pn-qemu-native = " sdl"

 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 #ASSUME_PROVIDED += "libsdl-native"

meta/conf/local.conf.sample +5 -0
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"

meta/conf/local.conf.sample PACKAGECONFIG_append_pn-qemu-native = " sdl" · line 226

Quoted 10 lines
meta/conf/local.conf.sample +10 -0
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
+#
+#DISTRO_FEATURES_append = " systemd sysvinit"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

Why is sysvinit included in both DISTRO_FEATURES and DISTRO_FEATURES_BACKFILL_CONSIDERED? My understanding is that BACKFILL_CONSIDERED only makes sense when the value is not included in DISTRO_FEATURES.

Signature · 1 line
Tanu
author
#3 lore raw

Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit

Quoted 33 lines · Tanu Kaskinen
Quoted 29 lines · Khem Raj

OE core provides systemd,busybox as options for system init system along with sysvinit being the default. Document the needed settings to enable systemd and busybox as options if user wishes.

---
 meta/conf/local.conf.sample | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
meta/conf/local.conf.sample +12 -0
index a662f4d..b760546 100644
@@ -209,6 +209,23 @@ PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 #ASSUME_PROVIDED += "libsdl-native"
 
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
Quoted 8 lines

meta/conf/local.conf.sample PACKAGECONFIG_append_pn-qemu-native = " sdl" · line 226

Quoted 3 lines
meta/conf/local.conf.sample +3 -0
+#
+#DISTRO_FEATURES_append = " systemd sysvinit"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

Why is sysvinit included in both DISTRO_FEATURES and DISTRO_FEATURES_BACKFILL_CONSIDERED? My understanding is that BACKFILL_CONSIDERED only makes sense when the value is not included in DISTRO_FEATURES.

There are two possibilities. one where its pure systemd no sysvinit, in this case we should have DISTRO_FEATURES_BACKFILL_CONSIDERED += “sysvinit” and remove DISTRO_FEATURES_append.

In case where we want sysvinit scripts also be there and systemd can execute on them then above setting is needed as it is. Option 2 is what I have tried to put in there

Quoted 3 lines

--
Tanu

#4 lore raw

Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit

In reply to Khem Raj
Quoted 36 lines · On Fri, 22 Jan 2016 20:49:10 Khem Raj wrote:

OE core provides systemd,busybox as options for system init system along with sysvinit being the default. Document the needed settings to enable systemd and busybox as options if user wishes.

---
 meta/conf/local.conf.sample | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
meta/conf/local.conf.sample +17 -0
index a662f4d..b760546 100644
@@ -209,6 +209,23 @@ PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 #ASSUME_PROVIDED += "libsdl-native"
 
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
+#
+#DISTRO_FEATURES_append = " systemd sysvinit"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+#VIRTUAL-RUNTIME_init_manager = "systemd"
+#VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
 
 # CONF_VERSION is increased each time build/conf/ changes incompatibly and
Quoted 2 lines

is used to # track the version of this file when it was generated. This can safely be ignored if

Is this sort of thing really appropriate for local.conf though? Shouldn't we be encouraging people to create a distro config for this level of customisation?

Cheers,
Paul

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

Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit

Quoted 36 lines · Paul Eggleton
Quoted 35 lines · On Fri, 22 Jan 2016 20:49:10 Khem Raj wrote:

OE core provides systemd,busybox as options for system init system along with sysvinit being the default. Document the needed settings to enable systemd and busybox as options if user wishes.

---
 meta/conf/local.conf.sample | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
meta/conf/local.conf.sample +17 -0
index a662f4d..b760546 100644
@@ -209,6 +209,23 @@ PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
 #ASSUME_PROVIDED += "libsdl-native"
 
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
+#
+#DISTRO_FEATURES_append = " systemd sysvinit"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+#VIRTUAL-RUNTIME_init_manager = "systemd"
+#VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
 
Quoted 7 lines
Quoted 3 lines
meta/conf/local.conf.sample +0 -0
 # CONF_VERSION is increased each time build/conf/ changes incompatibly and

is used to # track the version of this file when it was generated. This can safely be ignored if

Is this sort of thing really appropriate for local.conf though? Shouldn't we be encouraging people to create a distro config for this level of customisation?

with IRC feedback from RP and others. Its more of local.conf.extended item. So I have moved it in there in my v2 patch currently under test.

https://github.com/kraj/openembedded-core/commit/78edec042a47814ffb465d3c6c326fcd2e45447f

poky .e.g works well with both sysvinit and systemd
and some other derived distros as well. So think more it may be that putting this sort of information in nodistro conf in OE-Core may be another option but extended local conf is quite advanced user experience as well

Quoted 8 lines

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

#6 lore raw
In reply to Khem Raj
Quoted 140 lines · Khem Raj

in config metadata we can configure busybox based init and device initializer ( mdev ) using e.g.

VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
VIRTUAL-RUNTIME_login_manager = "busybox"
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_initscripts = "initscripts"
VIRTUAL-RUNTIME_keymaps = "keymaps"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

busybox can be used to provide init system
combined with mdev it makes it a complete init
system for really tiny systems.

This patch uses above defines to configure features in busybox to enable the init system and mdev in a configurable manner

---
 meta/recipes-core/busybox/busybox.inc       | 15 +++++++++++++++
 meta/recipes-core/busybox/busybox/init.cfg  |  3 +++
 meta/recipes-core/busybox/busybox/mdev.cfg  | 11 +++++++++++
 meta/recipes-core/busybox/busybox_1.24.1.bb |  6 ++++++
 meta/recipes-core/busybox/files/inittab     | 24 ++++++++++++++++++++++++
 meta/recipes-core/busybox/files/rcK         | 25 +++++++++++++++++++++++++
 meta/recipes-core/busybox/files/rcS         | 26 ++++++++++++++++++++++++++
 meta/recipes-core/busybox/files/runlevel    | 11 +++++++++++
 8 files changed, 121 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/init.cfg
 create mode 100644 meta/recipes-core/busybox/busybox/mdev.cfg
 create mode 100644 meta/recipes-core/busybox/files/inittab
 create mode 100644 meta/recipes-core/busybox/files/rcK
 create mode 100644 meta/recipes-core/busybox/files/rcS
 create mode 100644 meta/recipes-core/busybox/files/runlevel
meta/recipes-core/busybox/busybox.inc +15 -0
index 9541123..e5710f0 100644
@@ -275,6 +275,21 @@ do_install () {
                        install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
                fi
        fi
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
+                install -D -m 0777 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
+                install -D -m 0755 ${WORKDIR}/runlevel ${D}${base_sbindir}/runlevel
+                if grep "CONFIG_FEATURE_USE_INITTAB=y" ${B}/.config; then
+                        install -D -m 0777 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+                                echo "tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+                        done
+                fi
+        fi
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
meta/recipes-core/busybox/busybox/init.cfg new file +3 -0
new file mode 100644
index 0000000..006d4c6
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
meta/recipes-core/busybox/busybox/mdev.cfg new file +11 -0
new file mode 100644
index 0000000..6aefe90
@@ -0,0 +1,11 @@
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
+
+CONFIG_SETSID=y
+CONFIG_CTTYHACK=y
+
+CONFIG_FEATURE_SHADOWPASSWDS=y
meta/recipes-core/busybox/busybox_1.24.1.bb +6 -0
index 5e19d9c..8adee53 100644
@@ -39,6 +39,12 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://sha256sum.cfg \
            file://getopts.cfg \
            file://resize.cfg \
+           ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'busybox')]} \
+           ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
+           file://inittab \
+           file://rcS \
+           file://rcK \
+           file://runlevel \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
meta/recipes-core/busybox/files/inittab new file +24 -0
new file mode 100644
index 0000000..bfec4a7
@@ -0,0 +1,24 @@
+# This is run first except when booting in single-user mode.
+
+# Startup the system
+null::sysinit:/bin/mount -t proc proc /proc
+null::sysinit:/bin/mount -t sysfs sysfs /sys
+null::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+null::sysinit:/bin/mount -o remount,rw /
+null::sysinit:/bin/mkdir -p /dev/pts
+null::sysinit:/bin/mount -t devpts devpts /dev/pts
+null::sysinit:/bin/mount -a
+
+::sysinit:/etc/init.d/rcS
+
+# Stuff to do before rebooting
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rcK
+::shutdown:/sbin/swapoff -a
+::shutdown:/bin/umount -a -r
+
+# Stuff to do when restarting the init process
+::restart:/sbin/init
+
+# set hostname
+null::sysinit:/bin/busybox hostname -F /etc/hostname
meta/recipes-core/busybox/files/rcK new file +0 -0
new file mode 100644
index 0000000..050086e

meta/recipes-core/busybox/files/rcK line 6

Quoted 6 lines
meta/recipes-core/busybox/files/rcK new file +6 -0
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.
+#
+for i in /etc/rc6.d/K??*; do

Running the K?? scripts here is different to the way the Buildroot initscipts work. It's also not clear how the order is going to be reversed?

Maybe try to work with the Buildroot version as-is, or add some comments to the commit message explaining why the OE and Buildroot versions need to differ.

https://git.busybox.net/buildroot/tree/package/initscripts/init.d/rcK

Quoted 25 lines
meta/recipes-core/busybox/files/rcK new file +19 -0
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+       *.sh)
+           # Source shell script for speed.
+           (
+               trap - INT QUIT TSTP
+               set stop
+               . $i
+           )
+           ;;
+       *)
+           # No sh extension, so fork subprocess.
+           $i stop
+           ;;
+    esac
+done
+
meta/recipes-core/busybox/files/rcS new file +0 -0
new file mode 100644
index 0000000..d18c26b

meta/recipes-core/busybox/files/rcS line 4

Quoted 4 lines
meta/recipes-core/busybox/files/rcS new file +4 -0
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.

This is a copy of the comment from rcK.

meta/recipes-core/busybox/files/rcS line 16

Quoted 11 lines
meta/recipes-core/busybox/files/rcS new file +11 -0
+
+for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+       *.sh)
+           # Source shell script for speed.
+           (
+               trap - INT QUIT TSTP
+               set stop

Should that be start? The Buildroot original is:

https://git.busybox.net/buildroot/tree/package/initscripts/init.d/rcS

Quoted 35 lines
meta/recipes-core/busybox/files/rcS new file +10 -0
+               . $i
+           )
+           ;;
+       *)
+           # No sh extension, so fork subprocess.
+           $i start
+           ;;
+    esac
+done
+
meta/recipes-core/busybox/files/runlevel new file +11 -1
new file mode 100644
index 0000000..866f3b5
@@ -0,0 +1,11 @@
+#!/bin/sh
+# busybox init does not have LSB ( sysvinit ) like initlevels
+# so lets fake it to 5 which is what we default anyway
+# this helps with opkg post installs where it tries to invoke
+# update-rc.d ad post install step.
+# for package upgrades
+# See code in update-rc.d around line 190 where it calls runlevel
+# program
+#
+echo "5"
+
--

2.7.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#7 lore raw

We have lsb compliant scripts unlike buildroot. Ditto wont work here

Quoted 267 lines · Andre McCurdy
Quoted 17 lines · Khem Raj

in config metadata we can configure busybox based init and device initializer ( mdev ) using e.g.

VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
VIRTUAL-RUNTIME_login_manager = "busybox"
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_initscripts = "initscripts"
VIRTUAL-RUNTIME_keymaps = "keymaps"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

busybox can be used to provide init system
combined with mdev it makes it a complete init
system for really tiny systems.

This patch uses above defines to configure features in busybox to enable the init system and mdev in a configurable manner

Quoted 7 lines
---
 meta/recipes-core/busybox/busybox.inc       | 15 +++++++++++++++
 meta/recipes-core/busybox/busybox/init.cfg  |  3 +++
 meta/recipes-core/busybox/busybox/mdev.cfg  | 11 +++++++++++
 meta/recipes-core/busybox/busybox_1.24.1.bb |  6 ++++++
 meta/recipes-core/busybox/files/inittab     | 24

++++++++++++++++++++++++

Quoted 1 line
 meta/recipes-core/busybox/files/rcK         | 25

+++++++++++++++++++++++++

Quoted 1 line
 meta/recipes-core/busybox/files/rcS         | 26

++++++++++++++++++++++++++

Review

Quoted 10 lines
 meta/recipes-core/busybox/files/runlevel    | 11 +++++++++++
 8 files changed, 121 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/init.cfg
 create mode 100644 meta/recipes-core/busybox/busybox/mdev.cfg
 create mode 100644 meta/recipes-core/busybox/files/inittab
 create mode 100644 meta/recipes-core/busybox/files/rcK
 create mode 100644 meta/recipes-core/busybox/files/rcS
 create mode 100644 meta/recipes-core/busybox/files/runlevel
(quoted diff) +0 -0

b/meta/recipes-core/busybox/busybox.inc

meta/recipes-core/busybox/busybox.inc do_install () { · line 275

Quoted 5 lines

index 9541123..e5710f0 100644

meta/recipes-core/busybox/busybox.inc +0 -0
@@ -275,6 +275,21 @@ do_install () {
                        install -m 0755 ${WORKDIR}/mdev-mount.sh

${D}${sysconfdir}/mdev

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 4 lines
meta/recipes-core/busybox/busybox.inc +2 -0
                fi
        fi
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

meta/recipes-core/busybox/busybox.inc do_install () { · line 280

Quoted 1 line
meta/recipes-core/busybox/busybox.inc +1 -0
+                install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

meta/recipes-core/busybox/busybox.inc do_install () { · line 281

Quoted 1 line
meta/recipes-core/busybox/busybox.inc +1 -0
+                install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

meta/recipes-core/busybox/busybox.inc do_install () { · line 282

Quoted 1 line
meta/recipes-core/busybox/busybox.inc +1 -0
+                if grep "CONFIG_FEATURE_USE_INITTAB=y" ${B}/.config;

then

meta/recipes-core/busybox/busybox.inc do_install () { · line 283

Quoted 1 line
meta/recipes-core/busybox/busybox.inc +1 -0
+                        install -D -m 0777 ${WORKDIR}/inittab

${D}${sysconfdir}/inittab

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 5 lines
meta/recipes-core/busybox/busybox.inc +5 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//' -e

's/^.*;//' -e 's/;.*//'`

meta/recipes-core/busybox/busybox.inc do_install () { · line 289

Quoted 1 line
meta/recipes-core/busybox/busybox.inc +1 -0
+                                echo

"tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 5 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi
 
     if

${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then

Review

Quoted 2 lines
meta/recipes-core/busybox/busybox.inc +0 -0
         if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
(quoted diff) +0 -0

b/meta/recipes-core/busybox/busybox/init.cfg

Review

Quoted 9 lines

new file mode 100644
index 0000000..006d4c6

meta/recipes-core/busybox/busybox/init.cfg new file +3 -0
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
(quoted diff) +0 -0

b/meta/recipes-core/busybox/busybox/mdev.cfg

Review

Quoted 17 lines

new file mode 100644
index 0000000..6aefe90

meta/recipes-core/busybox/busybox/mdev.cfg new file +11 -0
@@ -0,0 +1,11 @@
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
+
+CONFIG_SETSID=y
+CONFIG_CTTYHACK=y
+
+CONFIG_FEATURE_SHADOWPASSWDS=y
(quoted diff) +0 -0

b/meta/recipes-core/busybox/busybox_1.24.1.bb

meta/recipes-core/busybox/busybox_1.24.1.bb SRC_URI = "

Quoted 4 lines

index 5e19d9c..8adee53 100644

meta/recipes-core/busybox/busybox_1.24.1.bb +0 -0
@@ -39,6 +39,12 @@ SRC_URI = "

http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \

meta/recipes-core/busybox/busybox_1.24.1.bb SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \

Quoted 4 lines
meta/recipes-core/busybox/busybox_1.24.1.bb +1 -0
            file://sha256sum.cfg \
            file://getopts.cfg \
            file://resize.cfg \
+           ${@["",

"file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'busybox')]} \

meta/recipes-core/busybox/busybox_1.24.1.bb SRC_URI = " · line 43

Quoted 1 line
meta/recipes-core/busybox/busybox_1.24.1.bb +1 -0
+           ${@["",

"file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \

Review

Quoted 8 lines
meta/recipes-core/busybox/busybox_1.24.1.bb +4 -0
+           file://inittab \
+           file://rcS \
+           file://rcK \
+           file://runlevel \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
(quoted diff) +0 -0

b/meta/recipes-core/busybox/files/inittab

Review

Quoted 30 lines

new file mode 100644
index 0000000..bfec4a7

meta/recipes-core/busybox/files/inittab new file +24 -0
@@ -0,0 +1,24 @@
+# This is run first except when booting in single-user mode.
+
+# Startup the system
+null::sysinit:/bin/mount -t proc proc /proc
+null::sysinit:/bin/mount -t sysfs sysfs /sys
+null::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+null::sysinit:/bin/mount -o remount,rw /
+null::sysinit:/bin/mkdir -p /dev/pts
+null::sysinit:/bin/mount -t devpts devpts /dev/pts
+null::sysinit:/bin/mount -a
+
+::sysinit:/etc/init.d/rcS
+
+# Stuff to do before rebooting
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rcK
+::shutdown:/sbin/swapoff -a
+::shutdown:/bin/umount -a -r
+
+# Stuff to do when restarting the init process
+::restart:/sbin/init
+
+# set hostname
+null::sysinit:/bin/busybox hostname -F /etc/hostname
(quoted diff) +0 -0

b/meta/recipes-core/busybox/files/rcK

meta/recipes-core/busybox/files/rcK line 6

Quoted 11 lines

new file mode 100644
index 0000000..050086e

meta/recipes-core/busybox/files/rcK new file +6 -0
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.
+#
+for i in /etc/rc6.d/K??*; do

Running the K?? scripts here is different to the way the Buildroot initscipts work. It's also not clear how the order is going to be reversed?

Maybe try to work with the Buildroot version as-is, or add some comments to the commit message explaining why the OE and Buildroot versions need to differ.

https://git.busybox.net/buildroot/tree/package/initscripts/init.d/rcK

Review

Quoted 20 lines
meta/recipes-core/busybox/files/rcK new file +19 -0
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+       *.sh)
+           # Source shell script for speed.
+           (
+               trap - INT QUIT TSTP
+               set stop
+               . $i
+           )
+           ;;
+       *)
+           # No sh extension, so fork subprocess.
+           $i stop
+           ;;
+    esac
+done
+
(quoted diff) +0 -0

b/meta/recipes-core/busybox/files/rcS

meta/recipes-core/busybox/files/rcS line 4

Quoted 9 lines

new file mode 100644
index 0000000..d18c26b

meta/recipes-core/busybox/files/rcS new file +4 -0
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/init.d
+# executing them in reversed numerical order.

This is a copy of the comment from rcK.

meta/recipes-core/busybox/files/rcS line 16

Quoted 11 lines
meta/recipes-core/busybox/files/rcS new file +11 -0
+
+for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+       *.sh)
+           # Source shell script for speed.
+           (
+               trap - INT QUIT TSTP
+               set stop

Should that be start? The Buildroot original is:

https://git.busybox.net/buildroot/tree/package/initscripts/init.d/rcS

Review

Quoted 11 lines
meta/recipes-core/busybox/files/rcS new file +10 -0
+               . $i
+           )
+           ;;
+       *)
+           # No sh extension, so fork subprocess.
+           $i start
+           ;;
+    esac
+done
+
(quoted diff) +0 -0

b/meta/recipes-core/busybox/files/runlevel

Quoted 24 lines

new file mode 100644
index 0000000..866f3b5

meta/recipes-core/busybox/files/runlevel new file +11 -1
@@ -0,0 +1,11 @@
+#!/bin/sh
+# busybox init does not have LSB ( sysvinit ) like initlevels
+# so lets fake it to 5 which is what we default anyway
+# this helps with opkg post installs where it tries to invoke
+# update-rc.d ad post install step.
+# for package upgrades
+# See code in update-rc.d around line 190 where it calls runlevel
+# program
+#
+echo "5"
+
--

2.7.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw
In reply to Andre McCurdy
Quoted 11 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/inittab

${D}${sysconfdir}/inittab

Quoted 11 lines

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 5 lines
meta/recipes-core/busybox/busybox.inc +5 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//'

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi

SERIAL_CONSOLES is typically set differently for different machines. But busybox is not machine-specific, therefore using SERIAL_CONSOLE like this prevents sstate/package reuse or worse, causes package versioning problems.

This probably was not noticed by the auto-testers because it only causes tests to fail when SERIAL_CONSOLES is really set differently. I'm wondering whether there should be variable flag for machine-specific
variables: then using such variables in machine-independent recipes could trigger a QA warning.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
author
#9 lore raw
Quoted 20 lines · Patrick Ohly
Quoted 19 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/inittab

${D}${sysconfdir}/inittab

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 5 lines
meta/recipes-core/busybox/busybox.inc +5 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//'

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 8 lines
Quoted 3 lines

meta/recipes-core/busybox/busybox.inc do_install () { · line 292

Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi

SERIAL_CONSOLES is typically set differently for different machines. But busybox is not machine-specific, therefore using SERIAL_CONSOLE like this prevents sstate/package reuse or worse, causes package versioning problems.

when busybox is used as init system then it becomes machine specific and we have a choice to do so which is disabled by default.

Quoted 19 lines

This probably was not noticed by the auto-testers because it only causes tests to fail when SERIAL_CONSOLES is really set differently. I'm wondering whether there should be variable flag for machine-specific
variables: then using such variables in machine-independent recipes could trigger a QA warning.

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

#10 lore raw
Quoted 25 lines · Khem Raj
Quoted 24 lines · Patrick Ohly
Quoted 22 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/inittab

${D}${sysconfdir}/inittab

meta/recipes-core/busybox/busybox.inc do_install () {

Quoted 5 lines
meta/recipes-core/busybox/busybox.inc +5 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\ /g`
+                                label=`echo ${i} | sed -e 's/tty//'

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi
Quoted 7 lines
Quoted 4 lines

SERIAL_CONSOLES is typically set differently for different machines. But busybox is not machine-specific, therefore using SERIAL_CONSOLE like this prevents sstate/package reuse or worse, causes package versioning problems.

when busybox is used as init system then it becomes machine specific and we have a choice to do so which is disabled by default.

In my case, busybox is not the init system and the recipe is therefore not machine specific. But the code above is active and thus introduces a sstate dependency on the machine-specific SERIAL_CONSOLES anyway, even though the code is dead (if check never reaches it).

The code would have to be added conditionally, and only when it is okay to reference ${SERIAL_CONSOLES}.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#11 lore raw
Quoted 50 lines · Patrick Ohly
Quoted 37 lines · Khem Raj
Quoted 27 lines · Patrick Ohly
Quoted 19 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 2 lines

+ install -D -m 0777
${WORKDIR}/inittab

${D}${sysconfdir}/inittab

Quoted 7 lines
meta/recipes-core/busybox/busybox.inc +4 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\

/g`
+ label=`echo ${i} | sed -e
's/tty//'

Quoted 6 lines

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi
Quoted 7 lines

SERIAL_CONSOLES is typically set differently for different machines. But
busybox is not machine-specific, therefore using SERIAL_CONSOLE like
this prevents sstate/package reuse or worse, causes package versioning
problems.

Quoted 3 lines

when busybox is used as init system then it becomes machine specific and we have
a choice to do so which is disabled by default.

In my case, busybox is not the init system and the recipe is therefore
not machine specific. But the code above is active and thus introduces a
sstate dependency on the machine-specific SERIAL_CONSOLES anyway, even
though the code is dead (if check never reaches it).

Quoted 3 lines

The code would have to be added conditionally, and only when it is okay
to reference ${SERIAL_CONSOLES}.

I think we should split this init piece out into a separate recipe, which busybox can depend on if/as/when needed.

Cheers,

Richard

#12 lore raw
Quoted 51 lines · Richard Purdie
Quoted 50 lines · Patrick Ohly
Quoted 37 lines · Khem Raj
Quoted 27 lines · Patrick Ohly
Quoted 19 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 2 lines

+ install -D -m 0777
${WORKDIR}/inittab

${D}${sysconfdir}/inittab

Quoted 7 lines
meta/recipes-core/busybox/busybox.inc +4 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\

/g`
+ label=`echo ${i} | sed -e
's/tty//'

Quoted 6 lines

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
meta/recipes-core/busybox/busybox.inc +3 -0
+                        done
+                fi
+        fi
Quoted 7 lines

SERIAL_CONSOLES is typically set differently for different machines. But
busybox is not machine-specific, therefore using SERIAL_CONSOLE like
this prevents sstate/package reuse or worse, causes package versioning
problems.

Quoted 3 lines

when busybox is used as init system then it becomes machine specific and we have
a choice to do so which is disabled by default.

In my case, busybox is not the init system and the recipe is therefore
not machine specific. But the code above is active and thus introduces a
sstate dependency on the machine-specific SERIAL_CONSOLES anyway, even
though the code is dead (if check never reaches it).

Quoted 6 lines
Quoted 3 lines

The code would have to be added conditionally, and only when it is okay
to reference ${SERIAL_CONSOLES}.

I think we should split this init piece out into a separate recipe, which busybox can depend on if/as/when needed.

What is the status of this request? Currently busybox is wreaking havoc in our multi-machine builds due to SERIAL_CONSOLE reference...

Signature · 1 line
Denys
#13 lore raw
Quoted 56 lines · Denys Dmytriyenko
Quoted 55 lines · Richard Purdie
Quoted 53 lines · Patrick Ohly
Quoted 37 lines · Khem Raj
Quoted 27 lines · Patrick Ohly
Quoted 19 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 2 lines

+ install -D -m 0777
${WORKDIR}/inittab

${D}${sysconfdir}/inittab

Quoted 7 lines
(quoted diff) +4 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\

/g`
+ label=`echo ${i} | sed -e
's/tty//'

Quoted 6 lines

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
(quoted diff) +3 -0
+                        done
+                fi
+        fi
Quoted 7 lines

SERIAL_CONSOLES is typically set differently for different machines. But
busybox is not machine-specific, therefore using SERIAL_CONSOLE like
this prevents sstate/package reuse or worse, causes package versioning
problems.

Quoted 3 lines

when busybox is used as init system then it becomes machine specific and we have
a choice to do so which is disabled by default.

In my case, busybox is not the init system and the recipe is therefore
not machine specific. But the code above is active and thus introduces a
sstate dependency on the machine-specific SERIAL_CONSOLES anyway, even
though the code is dead (if check never reaches it).

The code would have to be added conditionally, and only when it is okay
to reference ${SERIAL_CONSOLES}.

Quoted 5 lines
Quoted 2 lines

I think we should split this init piece out into a separate recipe, which busybox can depend on if/as/when needed.

What is the status of this request? Currently busybox is wreaking havoc in our multi-machine builds due to SERIAL_CONSOLE reference...

2 years later this is still an issue...

Signature · 1 line
Denys
#14 lore raw
Quoted 57 lines · Denys Dmytriyenko
Quoted 56 lines · Denys Dmytriyenko
Quoted 55 lines · Richard Purdie
Quoted 53 lines · Patrick Ohly
Quoted 37 lines · Khem Raj
Quoted 27 lines · Patrick Ohly
Quoted 19 lines · Andre McCurdy

Review

Quoted 2 lines
(quoted diff) +2 -0
+        if grep "CONFIG_INIT=y" ${B}/.config; then
+                install -D -m 0777 ${WORKDIR}/rcS

${D}${sysconfdir}/init.d/rcS

Quoted 1 line

+ install -D -m 0777 ${WORKDIR}/rcK

${D}${sysconfdir}/init.d/rcK

Quoted 1 line

+ install -D -m 0755 ${WORKDIR}/runlevel

${D}${base_sbindir}/runlevel

Quoted 1 line

+ if grep "CONFIG_FEATURE_USE_INITTAB=y"

${B}/.config; then

Quoted 2 lines

+ install -D -m 0777
${WORKDIR}/inittab

${D}${sysconfdir}/inittab

Quoted 7 lines
(quoted diff) +4 -0
+                        tmp="${SERIAL_CONSOLES}"
+                        for i in $tmp
+                        do
+                                j=`echo ${i} | sed s/\;/\

/g`
+ label=`echo ${i} | sed -e
's/tty//'

Quoted 6 lines

-e 's/^.*;//' -e 's/;.*//'`

Quoted 1 line

+ echo "tty$label::respawn:

${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab

Quoted 3 lines
(quoted diff) +3 -0
+                        done
+                fi
+        fi
Quoted 7 lines

SERIAL_CONSOLES is typically set differently for different machines. But
busybox is not machine-specific, therefore using SERIAL_CONSOLE like
this prevents sstate/package reuse or worse, causes package versioning
problems.

Quoted 3 lines

when busybox is used as init system then it becomes machine specific and we have
a choice to do so which is disabled by default.

In my case, busybox is not the init system and the recipe is therefore
not machine specific. But the code above is active and thus introduces a
sstate dependency on the machine-specific SERIAL_CONSOLES anyway, even
though the code is dead (if check never reaches it).

The code would have to be added conditionally, and only when it is okay
to reference ${SERIAL_CONSOLES}.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I think we should split this init piece out into a separate recipe, which busybox can depend on if/as/when needed.

What is the status of this request? Currently busybox is wreaking havoc in our multi-machine builds due to SERIAL_CONSOLE reference...

2 years later this is still an issue...

Ok, just sent the patches to fix this.

Signature · 1 line
Denys