* [PATCH 1/2] busybox: Add support for busybox-init
@ 2016-01-22 20:49 Khem Raj
2016-01-22 20:49 ` [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit Khem Raj
2016-01-25 19:39 ` [PATCH 1/2] busybox: Add support for busybox-init Andre McCurdy
0 siblings, 2 replies; 15+ messages in thread
From: Khem Raj @ 2016-01-22 20:49 UTC (permalink / raw)
To: openembedded-core
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
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
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
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 9541123..e5710f0 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -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
diff --git a/meta/recipes-core/busybox/busybox/init.cfg b/meta/recipes-core/busybox/busybox/init.cfg
new file mode 100644
index 0000000..006d4c6
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/init.cfg
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
diff --git a/meta/recipes-core/busybox/busybox/mdev.cfg b/meta/recipes-core/busybox/busybox/mdev.cfg
new file mode 100644
index 0000000..6aefe90
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/mdev.cfg
@@ -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
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb
index 5e19d9c..8adee53 100644
--- a/meta/recipes-core/busybox/busybox_1.24.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -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 "
diff --git a/meta/recipes-core/busybox/files/inittab b/meta/recipes-core/busybox/files/inittab
new file mode 100644
index 0000000..bfec4a7
--- /dev/null
+++ b/meta/recipes-core/busybox/files/inittab
@@ -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
diff --git a/meta/recipes-core/busybox/files/rcK b/meta/recipes-core/busybox/files/rcK
new file mode 100644
index 0000000..050086e
--- /dev/null
+++ b/meta/recipes-core/busybox/files/rcK
@@ -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
+
diff --git a/meta/recipes-core/busybox/files/rcS b/meta/recipes-core/busybox/files/rcS
new file mode 100644
index 0000000..d18c26b
--- /dev/null
+++ b/meta/recipes-core/busybox/files/rcS
@@ -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
+
diff --git a/meta/recipes-core/busybox/files/runlevel b/meta/recipes-core/busybox/files/runlevel
new file mode 100644
index 0000000..866f3b5
--- /dev/null
+++ b/meta/recipes-core/busybox/files/runlevel
@@ -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
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit
2016-01-22 20:49 [PATCH 1/2] busybox: Add support for busybox-init Khem Raj
@ 2016-01-22 20:49 ` Khem Raj
2016-01-22 20:57 ` Tanu Kaskinen
2016-01-24 19:21 ` Paul Eggleton
2016-01-25 19:39 ` [PATCH 1/2] busybox: Add support for busybox-init Andre McCurdy
1 sibling, 2 replies; 15+ messages in thread
From: Khem Raj @ 2016-01-22 20:49 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/conf/local.conf.sample | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
index a662f4d..b760546 100644
--- a/meta/conf/local.conf.sample
+++ b/meta/conf/local.conf.sample
@@ -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
--
2.7.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit
2016-01-22 20:49 ` [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit Khem Raj
@ 2016-01-22 20:57 ` Tanu Kaskinen
2016-01-22 21:06 ` Khem Raj
2016-01-24 19:21 ` Paul Eggleton
1 sibling, 1 reply; 15+ messages in thread
From: Tanu Kaskinen @ 2016-01-22 20:57 UTC (permalink / raw)
To: Khem Raj, openembedded-core
On Fri, 2016-01-22 at 20:49 +0000, 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.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/conf/local.conf.sample | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
> index a662f4d..b760546 100644
> --- a/meta/conf/local.conf.sample
> +++ b/meta/conf/local.conf.sample
> @@ -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"
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.
--
Tanu
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit
2016-01-22 20:57 ` Tanu Kaskinen
@ 2016-01-22 21:06 ` Khem Raj
0 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2016-01-22 21:06 UTC (permalink / raw)
To: Tanu Kaskinen; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]
> On Jan 22, 2016, at 12:57 PM, Tanu Kaskinen <tanuk@iki.fi> wrote:
>
> On Fri, 2016-01-22 at 20:49 +0000, 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.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> meta/conf/local.conf.sample | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
>> index a662f4d..b760546 100644
>> --- a/meta/conf/local.conf.sample
>> +++ b/meta/conf/local.conf.sample
>> @@ -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"
>
> 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
>
> --
> Tanu
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit
2016-01-22 20:49 ` [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit Khem Raj
2016-01-22 20:57 ` Tanu Kaskinen
@ 2016-01-24 19:21 ` Paul Eggleton
2016-01-24 20:20 ` Khem Raj
1 sibling, 1 reply; 15+ messages in thread
From: Paul Eggleton @ 2016-01-24 19:21 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
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.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/conf/local.conf.sample | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
> index a662f4d..b760546 100644
> --- a/meta/conf/local.conf.sample
> +++ b/meta/conf/local.conf.sample
> @@ -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
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
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit
2016-01-24 19:21 ` Paul Eggleton
@ 2016-01-24 20:20 ` Khem Raj
0 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2016-01-24 20:20 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Patches and discussions about the oe-core layer
On Sun, Jan 24, 2016 at 11:21 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> 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.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> meta/conf/local.conf.sample | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample
>> index a662f4d..b760546 100644
>> --- a/meta/conf/local.conf.sample
>> +++ b/meta/conf/local.conf.sample
>> @@ -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
>
> 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
>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-01-22 20:49 [PATCH 1/2] busybox: Add support for busybox-init Khem Raj
2016-01-22 20:49 ` [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit Khem Raj
@ 2016-01-25 19:39 ` Andre McCurdy
2016-01-25 20:11 ` Khem Raj
2016-02-01 8:14 ` Patrick Ohly
1 sibling, 2 replies; 15+ messages in thread
From: Andre McCurdy @ 2016-01-25 19:39 UTC (permalink / raw)
To: Khem Raj; +Cc: OE Core mailing list
On Fri, Jan 22, 2016 at 12:49 PM, Khem Raj <raj.khem@gmail.com> wrote:
> 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
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> 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
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 9541123..e5710f0 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -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
> diff --git a/meta/recipes-core/busybox/busybox/init.cfg b/meta/recipes-core/busybox/busybox/init.cfg
> new file mode 100644
> index 0000000..006d4c6
> --- /dev/null
> +++ b/meta/recipes-core/busybox/busybox/init.cfg
> @@ -0,0 +1,3 @@
> +CONFIG_INIT=y
> +CONFIG_FEATURE_USE_INITTAB=y
> +
> diff --git a/meta/recipes-core/busybox/busybox/mdev.cfg b/meta/recipes-core/busybox/busybox/mdev.cfg
> new file mode 100644
> index 0000000..6aefe90
> --- /dev/null
> +++ b/meta/recipes-core/busybox/busybox/mdev.cfg
> @@ -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
> diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb
> index 5e19d9c..8adee53 100644
> --- a/meta/recipes-core/busybox/busybox_1.24.1.bb
> +++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
> @@ -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 "
>
> diff --git a/meta/recipes-core/busybox/files/inittab b/meta/recipes-core/busybox/files/inittab
> new file mode 100644
> index 0000000..bfec4a7
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/inittab
> @@ -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
> diff --git a/meta/recipes-core/busybox/files/rcK b/meta/recipes-core/busybox/files/rcK
> new file mode 100644
> index 0000000..050086e
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/rcK
> @@ -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
> + # 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
> +
> diff --git a/meta/recipes-core/busybox/files/rcS b/meta/recipes-core/busybox/files/rcS
> new file mode 100644
> index 0000000..d18c26b
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/rcS
> @@ -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.
> +
> +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
> + . $i
> + )
> + ;;
> + *)
> + # No sh extension, so fork subprocess.
> + $i start
> + ;;
> + esac
> +done
> +
> diff --git a/meta/recipes-core/busybox/files/runlevel b/meta/recipes-core/busybox/files/runlevel
> new file mode 100644
> index 0000000..866f3b5
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/runlevel
> @@ -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
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-01-25 19:39 ` [PATCH 1/2] busybox: Add support for busybox-init Andre McCurdy
@ 2016-01-25 20:11 ` Khem Raj
2016-02-01 8:14 ` Patrick Ohly
1 sibling, 0 replies; 15+ messages in thread
From: Khem Raj @ 2016-01-25 20:11 UTC (permalink / raw)
To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 9706 bytes --]
We have lsb compliant scripts unlike buildroot. Ditto wont work here
On Jan 25, 2016 12:39 PM, "Andre McCurdy" <armccurdy@gmail.com> wrote:
> On Fri, Jan 22, 2016 at 12:49 PM, Khem Raj <raj.khem@gmail.com> wrote:
> > 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
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > 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
> >
> > diff --git a/meta/recipes-core/busybox/busybox.inc
> b/meta/recipes-core/busybox/busybox.inc
> > index 9541123..e5710f0 100644
> > --- a/meta/recipes-core/busybox/busybox.inc
> > +++ b/meta/recipes-core/busybox/busybox.inc
> > @@ -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
> > diff --git a/meta/recipes-core/busybox/busybox/init.cfg
> b/meta/recipes-core/busybox/busybox/init.cfg
> > new file mode 100644
> > index 0000000..006d4c6
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/busybox/init.cfg
> > @@ -0,0 +1,3 @@
> > +CONFIG_INIT=y
> > +CONFIG_FEATURE_USE_INITTAB=y
> > +
> > diff --git a/meta/recipes-core/busybox/busybox/mdev.cfg
> b/meta/recipes-core/busybox/busybox/mdev.cfg
> > new file mode 100644
> > index 0000000..6aefe90
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/busybox/mdev.cfg
> > @@ -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
> > diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb
> b/meta/recipes-core/busybox/busybox_1.24.1.bb
> > index 5e19d9c..8adee53 100644
> > --- a/meta/recipes-core/busybox/busybox_1.24.1.bb
> > +++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
> > @@ -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 "
> >
> > diff --git a/meta/recipes-core/busybox/files/inittab
> b/meta/recipes-core/busybox/files/inittab
> > new file mode 100644
> > index 0000000..bfec4a7
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/files/inittab
> > @@ -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
> > diff --git a/meta/recipes-core/busybox/files/rcK
> b/meta/recipes-core/busybox/files/rcK
> > new file mode 100644
> > index 0000000..050086e
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/files/rcK
> > @@ -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
>
> > + # 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
> > +
> > diff --git a/meta/recipes-core/busybox/files/rcS
> b/meta/recipes-core/busybox/files/rcS
> > new file mode 100644
> > index 0000000..d18c26b
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/files/rcS
> > @@ -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.
>
> > +
> > +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
>
> > + . $i
> > + )
> > + ;;
> > + *)
> > + # No sh extension, so fork subprocess.
> > + $i start
> > + ;;
> > + esac
> > +done
> > +
> > diff --git a/meta/recipes-core/busybox/files/runlevel
> b/meta/recipes-core/busybox/files/runlevel
> > new file mode 100644
> > index 0000000..866f3b5
> > --- /dev/null
> > +++ b/meta/recipes-core/busybox/files/runlevel
> > @@ -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
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 12791 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-01-25 19:39 ` [PATCH 1/2] busybox: Add support for busybox-init Andre McCurdy
2016-01-25 20:11 ` Khem Raj
@ 2016-02-01 8:14 ` Patrick Ohly
2016-02-01 16:57 ` Khem Raj
1 sibling, 1 reply; 15+ messages in thread
From: Patrick Ohly @ 2016-02-01 8:14 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE Core mailing list
On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> > + 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
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.
--
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.
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-02-01 8:14 ` Patrick Ohly
@ 2016-02-01 16:57 ` Khem Raj
2016-02-02 15:00 ` Patrick Ohly
0 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2016-02-01 16:57 UTC (permalink / raw)
To: Patrick Ohly; +Cc: OE Core mailing list
On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <patrick.ohly@intel.com> wrote:
> On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
>> > + 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
>
> 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.
>
> 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.
>
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-02-01 16:57 ` Khem Raj
@ 2016-02-02 15:00 ` Patrick Ohly
2016-02-02 15:29 ` Richard Purdie
0 siblings, 1 reply; 15+ messages in thread
From: Patrick Ohly @ 2016-02-02 15:00 UTC (permalink / raw)
To: Khem Raj; +Cc: OE Core mailing list
On Mon, 2016-02-01 at 08:57 -0800, Khem Raj wrote:
> On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <patrick.ohly@intel.com> wrote:
> > On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> >> > + 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
> >
> > 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}.
--
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.
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-02-02 15:00 ` Patrick Ohly
@ 2016-02-02 15:29 ` Richard Purdie
2016-05-02 16:43 ` Denys Dmytriyenko
0 siblings, 1 reply; 15+ messages in thread
From: Richard Purdie @ 2016-02-02 15:29 UTC (permalink / raw)
To: Patrick Ohly, Khem Raj; +Cc: OE Core mailing list
On Tue, 2016-02-02 at 16:00 +0100, Patrick Ohly wrote:
> On Mon, 2016-02-01 at 08:57 -0800, Khem Raj wrote:
> > On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <
> > patrick.ohly@intel.com> wrote:
> > > On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> > > > > + 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
> > >
> > > 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}.
I think we should split this init piece out into a separate recipe,
which busybox can depend on if/as/when needed.
Cheers,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-02-02 15:29 ` Richard Purdie
@ 2016-05-02 16:43 ` Denys Dmytriyenko
2018-03-02 21:19 ` Denys Dmytriyenko
0 siblings, 1 reply; 15+ messages in thread
From: Denys Dmytriyenko @ 2016-05-02 16:43 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE Core mailing list
On Tue, Feb 02, 2016 at 03:29:43PM +0000, Richard Purdie wrote:
> On Tue, 2016-02-02 at 16:00 +0100, Patrick Ohly wrote:
> > On Mon, 2016-02-01 at 08:57 -0800, Khem Raj wrote:
> > > On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <
> > > patrick.ohly@intel.com> wrote:
> > > > On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> > > > > > + 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
> > > >
> > > > 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}.
>
> 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...
--
Denys
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2016-05-02 16:43 ` Denys Dmytriyenko
@ 2018-03-02 21:19 ` Denys Dmytriyenko
2018-03-03 1:48 ` Denys Dmytriyenko
0 siblings, 1 reply; 15+ messages in thread
From: Denys Dmytriyenko @ 2018-03-02 21:19 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE Core mailing list
On Mon, May 02, 2016 at 12:43:58PM -0400, Denys Dmytriyenko wrote:
> On Tue, Feb 02, 2016 at 03:29:43PM +0000, Richard Purdie wrote:
> > On Tue, 2016-02-02 at 16:00 +0100, Patrick Ohly wrote:
> > > On Mon, 2016-02-01 at 08:57 -0800, Khem Raj wrote:
> > > > On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <
> > > > patrick.ohly@intel.com> wrote:
> > > > > On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> > > > > > > + 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
> > > > >
> > > > > 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}.
> >
> > 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...
--
Denys
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] busybox: Add support for busybox-init
2018-03-02 21:19 ` Denys Dmytriyenko
@ 2018-03-03 1:48 ` Denys Dmytriyenko
0 siblings, 0 replies; 15+ messages in thread
From: Denys Dmytriyenko @ 2018-03-03 1:48 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE Core mailing list
On Fri, Mar 02, 2018 at 04:19:38PM -0500, Denys Dmytriyenko wrote:
> On Mon, May 02, 2016 at 12:43:58PM -0400, Denys Dmytriyenko wrote:
> > On Tue, Feb 02, 2016 at 03:29:43PM +0000, Richard Purdie wrote:
> > > On Tue, 2016-02-02 at 16:00 +0100, Patrick Ohly wrote:
> > > > On Mon, 2016-02-01 at 08:57 -0800, Khem Raj wrote:
> > > > > On Mon, Feb 1, 2016 at 12:14 AM, Patrick Ohly <
> > > > > patrick.ohly@intel.com> wrote:
> > > > > > On Mon, 2016-01-25 at 11:39 -0800, Andre McCurdy wrote:
> > > > > > > > + 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
> > > > > >
> > > > > > 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}.
> > >
> > > 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.
--
Denys
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-03-03 1:48 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 20:49 [PATCH 1/2] busybox: Add support for busybox-init Khem Raj
2016-01-22 20:49 ` [PATCH 2/2] local.conf.sample: Document HOW-TO enable systemd or busbox to replace sysvinit Khem Raj
2016-01-22 20:57 ` Tanu Kaskinen
2016-01-22 21:06 ` Khem Raj
2016-01-24 19:21 ` Paul Eggleton
2016-01-24 20:20 ` Khem Raj
2016-01-25 19:39 ` [PATCH 1/2] busybox: Add support for busybox-init Andre McCurdy
2016-01-25 20:11 ` Khem Raj
2016-02-01 8:14 ` Patrick Ohly
2016-02-01 16:57 ` Khem Raj
2016-02-02 15:00 ` Patrick Ohly
2016-02-02 15:29 ` Richard Purdie
2016-05-02 16:43 ` Denys Dmytriyenko
2018-03-02 21:19 ` Denys Dmytriyenko
2018-03-03 1:48 ` Denys Dmytriyenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox