* [RFC PATCH 0/3] poky-tiny: Add tiny-init mechanism for poky-tiny distro
@ 2012-06-14 5:19 Darren Hart
2012-06-14 5:19 ` [PATCH 1/3] poky-tiny: Define the "tiny" DISTRO_FEATURE Darren Hart
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:19 UTC (permalink / raw)
To: Yocto Project; +Cc: Darren Hart
Provide a basic functional init mechanism for poky-tiny. This defines a new
"tiny" DISTRO_FEATURE in poky-tiny.conf, updates the busybox config based on
this DISTRO_FEATURE, and creates a new tiny-init recipe which is made the
default VIRTUAL-RUNTIME_init_manager for poky-tiny.
The busybox changes are for oe-core to avoide a bbappend in meta-yocto. That
one patch is CC'd to oe-core.
The following changes since commit 7f017cab0b3e4d5a4fc356eccd8eb8429b0531d0:
connman: bump PR and add some comments (2012-06-13 13:11:23 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dvhart/tiny
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/tiny
Darren Hart (3):
poky-tiny: Define the "tiny" DISTRO_FEATURE
busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
tiny-init: Basic init mechanism for poky-tiny
meta-yocto/conf/distro/poky-tiny.conf | 8 ++----
meta-yocto/recipes-core/tiny-init/files/init | 21 ++++++++++++++++
.../recipes-core/tiny-init/files/rc.local.sample | 23 +++++++++++++++++
meta-yocto/recipes-core/tiny-init/tiny-init.bb | 26 ++++++++++++++++++++
meta/recipes-core/busybox/busybox.inc | 2 +
5 files changed, 75 insertions(+), 5 deletions(-)
create mode 100644 meta-yocto/recipes-core/tiny-init/files/init
create mode 100644 meta-yocto/recipes-core/tiny-init/files/rc.local.sample
create mode 100644 meta-yocto/recipes-core/tiny-init/tiny-init.bb
--
1.7.5.4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/3] poky-tiny: Define the "tiny" DISTRO_FEATURE
2012-06-14 5:19 [RFC PATCH 0/3] poky-tiny: Add tiny-init mechanism for poky-tiny distro Darren Hart
@ 2012-06-14 5:19 ` Darren Hart
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
2012-06-14 5:19 ` [PATCH 3/3] tiny-init: Basic init mechanism for poky-tiny Darren Hart
2 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:19 UTC (permalink / raw)
To: Yocto Project; +Cc: Darren Hart
Enable recipes such as busybox to modify their configuration based on
a DISTRO_FEATURE for tiny distributions.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
meta-yocto/conf/distro/poky-tiny.conf | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/meta-yocto/conf/distro/poky-tiny.conf b/meta-yocto/conf/distro/poky-tiny.conf
index a34c7dc..d6295f7 100644
--- a/meta-yocto/conf/distro/poky-tiny.conf
+++ b/meta-yocto/conf/distro/poky-tiny.conf
@@ -31,9 +31,6 @@
require conf/distro/poky.conf
DISTRO = "poky-tiny"
-# FIXME: consider adding a new "tiny" feature
-#DISTRO_FEATURES_append = " tiny"
-
# Distro config is evaluated after the machine config, so we have to explicitly
# set the kernel provider to override a machine config.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
@@ -84,7 +81,8 @@ DISTRO_FEATURES_USB = "usbhost"
#DISTRO_FEATURES_USBGADGET = "usbgadget"
#DISTRO_FEATURES_WIFI = "wifi"
-DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \
+DISTRO_FEATURES = "tiny \
+ ${DISTRO_FEATURES_TINY} \
${DISTRO_FEATURES_NET} \
${DISTRO_FEATURES_USB} \
${DISTRO_FEATURES_USBGADGET} \
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 5:19 [RFC PATCH 0/3] poky-tiny: Add tiny-init mechanism for poky-tiny distro Darren Hart
2012-06-14 5:19 ` [PATCH 1/3] poky-tiny: Define the "tiny" DISTRO_FEATURE Darren Hart
@ 2012-06-14 5:19 ` Darren Hart
2012-06-14 5:21 ` [OE-core] " Darren Hart
` (2 more replies)
2012-06-14 5:19 ` [PATCH 3/3] tiny-init: Basic init mechanism for poky-tiny Darren Hart
2 siblings, 3 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:19 UTC (permalink / raw)
To: Yocto Project; +Cc: Darren Hart, OE Core
When building very small systems, it can be useful to spawn
a shell from a simple init script, rather than a full System V Init
process. This requires the shell be the session leader and be able to
open the controlling terminal if it is to have job control.
Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for distros
defining the "tiny" DISTRO_FEATURE.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: OE Core <openembedded-core@lists.openembedded.org>
---
meta/recipes-core/busybox/busybox.inc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 5b83d32..d07ba7e 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
+ busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
+ busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
return "\n".join(cnf), "\n".join(rem)
# X, Y = ${@features_to_uclibc_settings(d)}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/3] tiny-init: Basic init mechanism for poky-tiny
2012-06-14 5:19 [RFC PATCH 0/3] poky-tiny: Add tiny-init mechanism for poky-tiny distro Darren Hart
2012-06-14 5:19 ` [PATCH 1/3] poky-tiny: Define the "tiny" DISTRO_FEATURE Darren Hart
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
@ 2012-06-14 5:19 ` Darren Hart
2 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:19 UTC (permalink / raw)
To: Yocto Project; +Cc: Darren Hart
Currently poky-tiny images will boot and run /bin/sh, which results in
error messages to the console about being unable to open the tty and job
control being disabled.
The shell must be session leader to open the tty, and the tty must not
be /dev/console (it should be a vt or a physical tty like ttyS0), the
tty is required for job control (handling signals, etc.).
The goals of poky-tiny are to be an initial starting point from which to
build a distribution that does what you want, and NOTHING more.
This patch results in a system that boots with the virtual filesystems
mounted, the local network interface up, and a shell with job control
running, and a hook (/etc/rc.local) for easy customization. Nothing
else.
Thanks to Tim Bird for his suggestion to include support for rc.local by
default.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tim Bird <tim.bird@am.sony.com>
---
meta-yocto/conf/distro/poky-tiny.conf | 2 +-
meta-yocto/recipes-core/tiny-init/files/init | 21 ++++++++++++++++
.../recipes-core/tiny-init/files/rc.local.sample | 23 +++++++++++++++++
meta-yocto/recipes-core/tiny-init/tiny-init.bb | 26 ++++++++++++++++++++
4 files changed, 71 insertions(+), 1 deletions(-)
create mode 100644 meta-yocto/recipes-core/tiny-init/files/init
create mode 100644 meta-yocto/recipes-core/tiny-init/files/rc.local.sample
create mode 100644 meta-yocto/recipes-core/tiny-init/tiny-init.bb
diff --git a/meta-yocto/conf/distro/poky-tiny.conf b/meta-yocto/conf/distro/poky-tiny.conf
index d6295f7..541e194 100644
--- a/meta-yocto/conf/distro/poky-tiny.conf
+++ b/meta-yocto/conf/distro/poky-tiny.conf
@@ -93,7 +93,7 @@ DISTRO_FEATURES = "tiny \
# Use tmpdevfs and the busybox runtime services
VIRTUAL-RUNTIME_dev_manager = ""
VIRTUAL-RUNTIME_login_manager = ""
-VIRTUAL-RUNTIME_init_manager = ""
+VIRTUAL-RUNTIME_init_manager = "tiny-init"
VIRTUAL-RUNTIME_keymaps = ""
# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in
diff --git a/meta-yocto/recipes-core/tiny-init/files/init b/meta-yocto/recipes-core/tiny-init/files/init
new file mode 100644
index 0000000..bf2817d
--- /dev/null
+++ b/meta-yocto/recipes-core/tiny-init/files/init
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Mount the Linux kernel virtual filesystems
+mount none -t proc /proc
+mount none -t sysfs /sys
+mkdir /dev/pts
+mount none -t devpts /dev/pts
+
+ifup lo
+
+# Allow for distro or local customizations
+if [ -f /etc/rc.local ] ; then
+ source /etc/rc.local
+fi
+
+# Become session leader and try to find a real tty (e.g. ttyS0)
+while true; do
+ setsid cttyhack sh
+ echo "Console sh exited with $?, respawning..."
+ sleep 1
+done
diff --git a/meta-yocto/recipes-core/tiny-init/files/rc.local.sample b/meta-yocto/recipes-core/tiny-init/files/rc.local.sample
new file mode 100644
index 0000000..d9e198a
--- /dev/null
+++ b/meta-yocto/recipes-core/tiny-init/files/rc.local.sample
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Start services and customize the boot process here.
+echo "Running /etc/rc.local..."
+
+# Use init scripts included with packages such as dropbear
+#/etc/init.d/dropbear start
+
+# Spawn a getty manually
+#setsid /sbin/getty 115200 ttyS2
+
+# Print a banner
+#echo "You are running a poky-tiny image brought to you by the Yocto Project."
+
+# Setup a debugging environment
+#mkdir /debugfs
+#mount none -t debugfs /debugfs
+
+# Load modules (note: linux-yocto-tiny does not have module support by default)
+#modprobe yourdriver
+
+# DO NOT run any long running tasks or loops as these will delay
+# the /init script and the console shell.
diff --git a/meta-yocto/recipes-core/tiny-init/tiny-init.bb b/meta-yocto/recipes-core/tiny-init/tiny-init.bb
new file mode 100644
index 0000000..1cf46ed
--- /dev/null
+++ b/meta-yocto/recipes-core/tiny-init/tiny-init.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Poky-tiny init"
+DESCRIPTION = "Basic init system for poky-tiny"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r0"
+
+SRC_URI = "file://init \
+ file://rc.local.sample \
+ "
+
+do_configure() {
+ :
+}
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0755 ${WORKDIR}/init ${D}
+ install -m 0755 ${WORKDIR}/rc.local.sample ${D}${sysconfdir}
+}
+
+FILES_${PN} = "/init ${sysconfdir}/rc.local.sample"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
@ 2012-06-14 5:21 ` Darren Hart
2012-06-14 7:05 ` Khem Raj
2012-06-14 9:41 ` Phil Blundell
2 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:21 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Yocto Project
Note that this is a part of a larger series. The other patches are
against meta-yocto, but the busybox change seemed more appropriate here
than in a bbappend in meta-yocto.
At some point poky-tiny may need to come into oe-core, until then...
On 06/13/2012 10:19 PM, Darren Hart wrote:
> When building very small systems, it can be useful to spawn
> a shell from a simple init script, rather than a full System V Init
> process. This requires the shell be the session leader and be able to
> open the controlling terminal if it is to have job control.
>
> Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for distros
> defining the "tiny" DISTRO_FEATURE.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: OE Core <openembedded-core@lists.openembedded.org>
> ---
> meta/recipes-core/busybox/busybox.inc | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 5b83d32..d07ba7e 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
> busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
> busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
> busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
> return "\n".join(cnf), "\n".join(rem)
>
> # X, Y = ${@features_to_uclibc_settings(d)}
>
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [OE-core] [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
@ 2012-06-14 5:21 ` Darren Hart
0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 5:21 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Yocto Project
Note that this is a part of a larger series. The other patches are
against meta-yocto, but the busybox change seemed more appropriate here
than in a bbappend in meta-yocto.
At some point poky-tiny may need to come into oe-core, until then...
On 06/13/2012 10:19 PM, Darren Hart wrote:
> When building very small systems, it can be useful to spawn
> a shell from a simple init script, rather than a full System V Init
> process. This requires the shell be the session leader and be able to
> open the controlling terminal if it is to have job control.
>
> Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for distros
> defining the "tiny" DISTRO_FEATURE.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: OE Core <openembedded-core@lists.openembedded.org>
> ---
> meta/recipes-core/busybox/busybox.inc | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 5b83d32..d07ba7e 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
> busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
> busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
> busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
> return "\n".join(cnf), "\n".join(rem)
>
> # X, Y = ${@features_to_uclibc_settings(d)}
>
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [OE-core] [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 5:21 ` [OE-core] " Darren Hart
(?)
@ 2012-06-14 6:58 ` Khem Raj
2012-06-14 21:11 ` Darren Hart
-1 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2012-06-14 6:58 UTC (permalink / raw)
To: yocto
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 6/13/2012 10:21 PM, Darren Hart wrote:
> At some point poky-tiny may need to come into oe-core, until
> then...
why do you think so. micro is also a distro with similar goals lives
outside of OE-Core infact any distros live outside oe-core
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk/Zi60ACgkQuwUzVZGdMxSg/gCfUHIMxUBVSOWrPP5geIykH1pJ
xpkAniMD6AZAnQfMA82Ri3EdjkDLkBlk
=Jyew
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
2012-06-14 5:21 ` [OE-core] " Darren Hart
@ 2012-06-14 7:05 ` Khem Raj
2012-06-15 22:22 ` Darren Hart
2012-06-14 9:41 ` Phil Blundell
2 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2012-06-14 7:05 UTC (permalink / raw)
To: openembedded-core
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 6/13/2012 10:19 PM, Darren Hart wrote:
> When building very small systems, it can be useful to spawn a shell
> from a simple init script, rather than a full System V Init
> process. This requires the shell be the session leader and be able
> to open the controlling terminal if it is to have job control.
>
> Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for
> distros defining the "tiny" DISTRO_FEATURE.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: OE Core
> <openembedded-core@lists.openembedded.org> ---
> meta/recipes-core/busybox/busybox.inc | 2 ++ 1 files changed, 2
> insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/busybox.inc
> b/meta/recipes-core/busybox/busybox.inc index 5b83d32..d07ba7e
> 100644 --- a/meta/recipes-core/busybox/busybox.inc +++
> b/meta/recipes-core/busybox/busybox.inc @@ -57,6 +57,8 @@ def
> features_to_busybox_settings(d): busybox_cfg('nls',
> distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
> busybox_cfg('ipv4', distro_features,
> 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem) busybox_cfg('ipv6',
> distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem) +
> busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem) +
> busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
> return "\n".join(cnf), "\n".join(rem)
>
> # X, Y = ${@features_to_uclibc_settings(d)}
Enabling cttyhack and setsid could be a good thing in general
(thinking of initramfs kind of images) so I would propose to enable it
by default
and not introduce another distro knob here. How much does busybox code
size grow which these two features turned on.?
otherwise second best thing is to keep it in poky-tiny distro layer
which wants to set the policy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk/ZjTsACgkQuwUzVZGdMxSXwACfX44Ffs5G4hhW9q9toubwxZYn
Ag4AnijTe1TbzrGZfHaHw+qZY/IQAzlA
=mTVi
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
2012-06-14 5:21 ` [OE-core] " Darren Hart
2012-06-14 7:05 ` Khem Raj
@ 2012-06-14 9:41 ` Phil Blundell
2012-06-14 13:55 ` [OE-core] " Darren Hart
2 siblings, 1 reply; 15+ messages in thread
From: Phil Blundell @ 2012-06-14 9:41 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Yocto Project, Darren Hart
On Wed, 2012-06-13 at 22:19 -0700, Darren Hart wrote:
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 5b83d32..d07ba7e 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
> busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
> busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
> busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
> return "\n".join(cnf), "\n".join(rem)
>
> # X, Y = ${@features_to_uclibc_settings(d)}
What exactly is the mission of the "tiny" DISTRO_FEATURE? It doesn't
seem very wholesome for it to be enabling a random grab-bag of bits in
busybox (or anywhere else).
If poky-tiny wants those features enabled then it can, and should, ship
its own configuration for busybox which turns them on. I think that
would be better than further proliferation of switches in oe-core.
p.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 9:41 ` Phil Blundell
@ 2012-06-14 13:55 ` Darren Hart
0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 13:55 UTC (permalink / raw)
To: Phil Blundell
Cc: Yocto Project, Patches and discussions about the oe-core layer
On 06/14/2012 02:41 AM, Phil Blundell wrote:
> On Wed, 2012-06-13 at 22:19 -0700, Darren Hart wrote:
>> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
>> index 5b83d32..d07ba7e 100644
>> --- a/meta/recipes-core/busybox/busybox.inc
>> +++ b/meta/recipes-core/busybox/busybox.inc
>> @@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
>> busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
>> busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
>> busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
>> + busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
>> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
>> return "\n".join(cnf), "\n".join(rem)
>>
>> # X, Y = ${@features_to_uclibc_settings(d)}
>
> What exactly is the mission of the "tiny" DISTRO_FEATURE? It doesn't
> seem very wholesome for it to be enabling a random grab-bag of bits in
> busybox (or anywhere else).
The idea is to avoid having to bbappend busybox and other recipes
basically. I can see how "tiny" is different than "ipv4" as it isn't
explicit it what it enables, making it a "grab-bag" as you put it.
I could come up with a term that describes systems without complex init
systems that need to be able to setup their own shells easily.
Another approach would be to just consider these two features and decide
if they shouldn't just be part of the oe-core busybox defconfig anyway.
I don't see why setsid shouldn't be. I can see arguments against
cttyhack (as it is a hack), but I wouldn't think either should be a huge
deal to just include. I thought the DISTRO_FEATURE was a reasonable
compromise between that and having to maintain a bbappend outside of
oe-core.
>
> If poky-tiny wants those features enabled then it can, and should, ship
> its own configuration for busybox which turns them on. I think that
> would be better than further proliferation of switches in oe-core.
>
How would you feel about just including these two features in the
defconfig then?
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [OE-core] [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
@ 2012-06-14 13:55 ` Darren Hart
0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 13:55 UTC (permalink / raw)
To: Phil Blundell
Cc: Yocto Project, Patches and discussions about the oe-core layer
On 06/14/2012 02:41 AM, Phil Blundell wrote:
> On Wed, 2012-06-13 at 22:19 -0700, Darren Hart wrote:
>> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
>> index 5b83d32..d07ba7e 100644
>> --- a/meta/recipes-core/busybox/busybox.inc
>> +++ b/meta/recipes-core/busybox/busybox.inc
>> @@ -57,6 +57,8 @@ def features_to_busybox_settings(d):
>> busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
>> busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
>> busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
>> + busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
>> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf, rem)
>> return "\n".join(cnf), "\n".join(rem)
>>
>> # X, Y = ${@features_to_uclibc_settings(d)}
>
> What exactly is the mission of the "tiny" DISTRO_FEATURE? It doesn't
> seem very wholesome for it to be enabling a random grab-bag of bits in
> busybox (or anywhere else).
The idea is to avoid having to bbappend busybox and other recipes
basically. I can see how "tiny" is different than "ipv4" as it isn't
explicit it what it enables, making it a "grab-bag" as you put it.
I could come up with a term that describes systems without complex init
systems that need to be able to setup their own shells easily.
Another approach would be to just consider these two features and decide
if they shouldn't just be part of the oe-core busybox defconfig anyway.
I don't see why setsid shouldn't be. I can see arguments against
cttyhack (as it is a hack), but I wouldn't think either should be a huge
deal to just include. I thought the DISTRO_FEATURE was a reasonable
compromise between that and having to maintain a bbappend outside of
oe-core.
>
> If poky-tiny wants those features enabled then it can, and should, ship
> its own configuration for busybox which turns them on. I think that
> would be better than further proliferation of switches in oe-core.
>
How would you feel about just including these two features in the
defconfig then?
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 13:55 ` [OE-core] " Darren Hart
(?)
@ 2012-06-14 14:26 ` Phil Blundell
-1 siblings, 0 replies; 15+ messages in thread
From: Phil Blundell @ 2012-06-14 14:26 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Yocto Project
On Thu, 2012-06-14 at 06:55 -0700, Darren Hart wrote:
> Another approach would be to just consider these two features and decide
> if they shouldn't just be part of the oe-core busybox defconfig anyway.
> I don't see why setsid shouldn't be. I can see arguments against
> cttyhack (as it is a hack), but I wouldn't think either should be a huge
> deal to just include. I thought the DISTRO_FEATURE was a reasonable
> compromise between that and having to maintain a bbappend outside of
> oe-core.
Well, you don't need to maintain a .bbappend as such: you can just
provide your own, completely custom config file for busybox. That's
what micro does, what shr does (I think), and what I would suggest that
most DISTROs with non-trivial configuration requirements should probably
do.
I think most folks do actually use a .bbappend to fiddle FILESPATH in
order to get the configuration file picked up, but I'm fairly sure you
could do this with a bit of suitable magic in your distro config file
and avoid the .bbappend altogether.
> How would you feel about just including these two features in the
> defconfig then?
Not massively enthusiastic, simply because the logical conclusion of
that approach is that we end up with basically everything in busybox
turned on. If we're going to go along that path then I think I would
prefer us to be up-front about it and just make the oe-core default
configuration for busybox be a "maximum features enabled" one.
p.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [OE-core] [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 6:58 ` Khem Raj
@ 2012-06-14 21:11 ` Darren Hart
0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-14 21:11 UTC (permalink / raw)
To: Khem Raj; +Cc: yocto
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/13/2012 11:58 PM, Khem Raj wrote:
> On 6/13/2012 10:21 PM, Darren Hart wrote:
>> At some point poky-tiny may need to come into oe-core, until
>> then...
>
> why do you think so. micro is also a distro with similar goals
> lives outside of OE-Core infact any distros live outside oe-core
Note I'm not arguing for it one way or the other. I could see people
wanting it to come in with linux-yocto-tiny already in oe-core. Or, it
might make more sense to move linux-yocto-tiny to meta-yocto and just
keep it all contained in meta-yocto. That's fine with me too.
- --
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJP2lNoAAoJEKbMaAwKp364GmwH/3wmP5TTnZ2oReLwaNFOkdCh
aKMr7EVm0ZOfb2j8vS2oRBg3C5AQ4aV7CR3w3OmXt+0tRlTF2P/M5XT2WgB90YUA
aeFM9znTs4DWSkUHw0Kr9O+kmb2WE6jXJUMxcmk9rId03XhykZBKKjVjUQXON8hQ
oL8u3s83IOL1fPLIUbJEg28LuOW25O0jQftZBeAqiX5tG8nC10m0HZFry0FqN/UG
MggLVSmUOEVioS1Z3rYHxValFqs/LFEtr3B+8sEgILFOM+kKE0LbJUbup2vS1eoh
YbhA2pzPsqLKswJAdkgv11QLvJ0fT9osrsBTUe7uIEPJHQG0YRawIFk8pS8BxZU=
=OZf4
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-14 7:05 ` Khem Raj
@ 2012-06-15 22:22 ` Darren Hart
2012-06-15 22:57 ` Darren Hart
0 siblings, 1 reply; 15+ messages in thread
From: Darren Hart @ 2012-06-15 22:22 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/14/2012 12:05 AM, Khem Raj wrote:
> On 6/13/2012 10:19 PM, Darren Hart wrote:
>> When building very small systems, it can be useful to spawn a
>> shell from a simple init script, rather than a full System V Init
>> process. This requires the shell be the session leader and be
>> able to open the controlling terminal if it is to have job
>> control.
>
>> Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for
>> distros defining the "tiny" DISTRO_FEATURE.
>
>> Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: OE Core
>> <openembedded-core@lists.openembedded.org> ---
>> meta/recipes-core/busybox/busybox.inc | 2 ++ 1 files changed,
>> 2 insertions(+), 0 deletions(-)
>
>> diff --git a/meta/recipes-core/busybox/busybox.inc
>> b/meta/recipes-core/busybox/busybox.inc index 5b83d32..d07ba7e
>> 100644 --- a/meta/recipes-core/busybox/busybox.inc +++
>> b/meta/recipes-core/busybox/busybox.inc @@ -57,6 +57,8 @@ def
>> features_to_busybox_settings(d): busybox_cfg('nls',
>> distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
>> busybox_cfg('ipv4', distro_features,
>> 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem) busybox_cfg('ipv6',
>> distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem) +
>> busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf, rem)
>> + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK', cnf,
>> rem) return "\n".join(cnf), "\n".join(rem)
>
>> # X, Y = ${@features_to_uclibc_settings(d)}
>
> Enabling cttyhack and setsid could be a good thing in general
> (thinking of initramfs kind of images) so I would propose to enable
> it by default and not introduce another distro knob here. How much
> does busybox code size grow which these two features turned on.?
So this struck me as strange, but I did it twice to make sure I didn't
mess something up:
BEFORE
- -rwxr-xr-x 1 dvhart dvhart 2799417 2012-06-15 15:06 busybox
- -rwxr-xr-x 1 dvhart dvhart 547872 2012-06-15 15:06 busybox_stripped
AFTER (w/ SETSID and CTTYHACK)
- -rwxr-xr-x 1 dvhart dvhart 2805195 2012-06-15 14:45 busybox
- -rwxr-xr-x 1 dvhart dvhart 547872 2012-06-15 15:05 busybox_stripped
DELTA
busybox: 5778
busybox_stripped: 0
The difference is <6k for the unstripped binary, and 0 bytes for the
stripped binary. It must have something to do with the way busybox
builds and enables features. The above was using my host strip
command. I also tried building the rootfs with and without these
features and comparing the cross-stripped binaries in the rootfs,
delta is also 0 bytes.
So the cost is "negligible" and there is a clear advantage to having
these two options enabled. I'll resend with a two line change to the
defconfig to enable them.
- --
Darren
>
> otherwise second best thing is to keep it in poky-tiny distro
> layer which wants to set the policy
>
> _______________________________________________ Openembedded-core
> mailing list Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
- --
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJP27WMAAoJEKbMaAwKp364Hf0IAKpHOMWy63ZPYwN+Ay7wXPf1
KaUe4fWGBIMNJqS5FGJyhxBnWMdXJceAKMP6Wo2nIa/kvjat//IME8v41xwAb+mD
5sjZpkcBE02CFq9rZmHfiTTPbYC7iS8a6Dz5n/fTLb79b189Jv3Rx/G3GCN4ioeC
xqwVU8zmdtkrHfU+UonR5G4HdNMCjOCFETLWcWW6DNTsj5PmazJV2cMIZTYJEr43
G/EyvO2fz/n+y53dsI04zwNEXuyr0pjurCK7dXt9oxlOnDvE276yS1b0Xihwm3cW
G/h0udSeQ3fcF91vCxdYMAlQNJyMqiCOCeSW5gOVe6NKs+kuxzRqYFSEfD0gtmY=
=aZeL
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE
2012-06-15 22:22 ` Darren Hart
@ 2012-06-15 22:57 ` Darren Hart
0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2012-06-15 22:57 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/15/2012 03:22 PM, Darren Hart wrote:
>
>
> On 06/14/2012 12:05 AM, Khem Raj wrote:
>> On 6/13/2012 10:19 PM, Darren Hart wrote:
>>> When building very small systems, it can be useful to spawn a
>>> shell from a simple init script, rather than a full System V
>>> Init process. This requires the shell be the session leader and
>>> be able to open the controlling terminal if it is to have job
>>> control.
>
>>> Enable CONFIG_CTTYHACK and CONFIG_SETSID to enable this for
>>> distros defining the "tiny" DISTRO_FEATURE.
>
>>> Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: OE Core
>>> <openembedded-core@lists.openembedded.org> ---
>>> meta/recipes-core/busybox/busybox.inc | 2 ++ 1 files
>>> changed, 2 insertions(+), 0 deletions(-)
>
>>> diff --git a/meta/recipes-core/busybox/busybox.inc
>>> b/meta/recipes-core/busybox/busybox.inc index 5b83d32..d07ba7e
>>> 100644 --- a/meta/recipes-core/busybox/busybox.inc +++
>>> b/meta/recipes-core/busybox/busybox.inc @@ -57,6 +57,8 @@ def
>>> features_to_busybox_settings(d): busybox_cfg('nls',
>>> distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
>>> busybox_cfg('ipv4', distro_features,
>>> 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem) busybox_cfg('ipv6',
>>> distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem) +
>>> busybox_cfg('tiny', distro_features, 'CONFIG_SETSID', cnf,
>>> rem) + busybox_cfg('tiny', distro_features, 'CONFIG_CTTYHACK',
>>> cnf, rem) return "\n".join(cnf), "\n".join(rem)
>
>>> # X, Y = ${@features_to_uclibc_settings(d)}
>
>> Enabling cttyhack and setsid could be a good thing in general
>> (thinking of initramfs kind of images) so I would propose to
>> enable it by default and not introduce another distro knob here.
>> How much does busybox code size grow which these two features
>> turned on.?
>
> So this struck me as strange, but I did it twice to make sure I
> didn't mess something up:
>
> BEFORE -rwxr-xr-x 1 dvhart dvhart 2799417 2012-06-15 15:06 busybox
> -rwxr-xr-x 1 dvhart dvhart 547872 2012-06-15 15:06
> busybox_stripped
>
> AFTER (w/ SETSID and CTTYHACK) -rwxr-xr-x 1 dvhart dvhart 2805195
> 2012-06-15 14:45 busybox -rwxr-xr-x 1 dvhart dvhart 547872
> 2012-06-15 15:05 busybox_stripped
>
> DELTA busybox: 5778 busybox_stripped: 0
>
> The difference is <6k for the unstripped binary, and 0 bytes for
> the stripped binary. It must have something to do with the way
> busybox builds and enables features. The above was using my host
> strip command. I also tried building the rootfs with and without
> these features and comparing the cross-stripped binaries in the
> rootfs, delta is also 0 bytes.
>
> So the cost is "negligible" and there is a clear advantage to
> having these two options enabled. I'll resend with a two line
> change to the defconfig to enable them.
Sorry, I hit the menuconfig/sstate bug. There is a 2560 byte
difference for including these two features. Seems reasonable to me. A
new patch has been sent to the list.
- --
Darren
>
> -- Darren
>
>
>> otherwise second best thing is to keep it in poky-tiny distro
>> layer which wants to set the policy
>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>>
>
>
> _______________________________________________ Openembedded-core
> mailing list Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
- --
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJP273OAAoJEKbMaAwKp364D7EH/2RsItQ6k5y610GbII1Emz/n
hX85K/T9f0Pooj9axNtM9E+W3X3AoRlDCRkhlKsZo8YqYnnTCcohYhVpoH0mrnN6
CtnW3e7usrAkoRjw/1COfRUuzGnxZRhE1BY7zW2+EKEYbFOeHFTw35erxOaTK8Cc
huemQLgmtfSYnMJjig8WEDETmlKy1dBHpRscRHUdJkkivKMJdv4M3ASZ9fAG21HB
fCXO6D6pRy2B60NJJ/7VKAuvB0o64ZOlK4rjuUPL+goGayQTwt85giB5Vk2K3zkT
n1ekvtBezgYg/3Av9B16kwoiKEWZzZ2qDvSkpCh4u6bzTcXeJAaWaaYUyhQGojU=
=Yn5h
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-06-15 23:09 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 5:19 [RFC PATCH 0/3] poky-tiny: Add tiny-init mechanism for poky-tiny distro Darren Hart
2012-06-14 5:19 ` [PATCH 1/3] poky-tiny: Define the "tiny" DISTRO_FEATURE Darren Hart
2012-06-14 5:19 ` [PATCH 2/3] busybox: Add setsid and cttyhack for tiny DISTRO_FEATURE Darren Hart
2012-06-14 5:21 ` Darren Hart
2012-06-14 5:21 ` [OE-core] " Darren Hart
2012-06-14 6:58 ` Khem Raj
2012-06-14 21:11 ` Darren Hart
2012-06-14 7:05 ` Khem Raj
2012-06-15 22:22 ` Darren Hart
2012-06-15 22:57 ` Darren Hart
2012-06-14 9:41 ` Phil Blundell
2012-06-14 13:55 ` Darren Hart
2012-06-14 13:55 ` [OE-core] " Darren Hart
2012-06-14 14:26 ` Phil Blundell
2012-06-14 5:19 ` [PATCH 3/3] tiny-init: Basic init mechanism for poky-tiny Darren Hart
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.