All of lore.kernel.org
 help / color / mirror / Atom feed
* Is there a recipe for building and using busybox with libbusybox out there ?
@ 2010-07-07  9:45 Hauser, Wolfgang (external)
  2010-07-07  9:52 ` Roman I Khimov
  2010-07-07 10:26 ` Phil Blundell
  0 siblings, 2 replies; 16+ messages in thread
From: Hauser, Wolfgang (external) @ 2010-07-07  9:45 UTC (permalink / raw)
  To: openembedded-devel

Hello,

I want to use busybox with the applet binaries linked against libbusybox
in our system.
We need a wide range of applets at the same time, so I suppose it will
save overall needed memory space.

Also I want to prevent the system from updating alternatives while the
first boot. We have to provide a read only root file system.

So my question, is somebody working on a recipe for using buysbox this
way ?

Regards
Wolfgang Hauser



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07  9:45 Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
@ 2010-07-07  9:52 ` Roman I Khimov
  2010-07-07 10:38   ` [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup Roman I Khimov
  2010-07-07 12:09   ` Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
  2010-07-07 10:26 ` Phil Blundell
  1 sibling, 2 replies; 16+ messages in thread
From: Roman I Khimov @ 2010-07-07  9:52 UTC (permalink / raw)
  To: openembedded-devel

В сообщении от Среда 07 июля 2010 13:45:25 автор Hauser, Wolfgang (external) 
написал:
> So my question, is somebody working on a recipe for using buysbox this
> way ?

Using it this way locally, will try to prepare a patch for oe.dev today.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07  9:45 Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
  2010-07-07  9:52 ` Roman I Khimov
@ 2010-07-07 10:26 ` Phil Blundell
  2010-07-07 10:48   ` Koen Kooi
  2010-07-07 11:34   ` Hauser, Wolfgang (external)
  1 sibling, 2 replies; 16+ messages in thread
From: Phil Blundell @ 2010-07-07 10:26 UTC (permalink / raw)
  To: openembedded-devel

On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
> I want to use busybox with the applet binaries linked against libbusybox
> in our system.
> We need a wide range of applets at the same time, so I suppose it will
> save overall needed memory space.

What's the advantage of this?  I would have thought it would give you a
larger memory footprint rather than a smaller one.  I guess I must be
missing something.

> Also I want to prevent the system from updating alternatives while the
> first boot. We have to provide a read only root file system.

Yeah, this is a long-standing piece of OE suckage.  We should fix the
alternative selection to work at image construction time.

p.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-07  9:52 ` Roman I Khimov
@ 2010-07-07 10:38   ` Roman I Khimov
  2010-07-12  5:32     ` Roman I Khimov
  2010-07-12 18:34     ` Khem Raj
  2010-07-07 12:09   ` Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
  1 sibling, 2 replies; 16+ messages in thread
From: Roman I Khimov @ 2010-07-07 10:38 UTC (permalink / raw)
  To: openembedded-devel

Where each applet is installed as a tiny binary linked against shared
libbusybox.

Signed-off-by: Roman I Khimov <khimov@altell.ru>
---
 recipes/busybox/busybox.inc |   74 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index a5346bd..31e6cdc 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r30"
+INC_PR = "r31"
 
 SRC_URI = "\
   file://busybox-cron \
@@ -98,15 +98,35 @@ do_install () {
 
 	install -d ${D}${sysconfdir}/init.d
 
-	# Install /bin/busybox, and the /bin/sh link so the postinst script
-	# can run. Let update-alternatives handle the rest.
-	install -d ${D}${base_bindir}
-	if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then
-		install -m 4755 ${S}/busybox ${D}${base_bindir}
+	if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${WORKDIR}/defconfig; then
+		# Install /bin/busybox, and the /bin/sh link so the postinst script
+		# can run. Let update-alternatives handle the rest.
+		install -d ${D}${base_bindir}
+		if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then
+			install -m 4755 ${S}/busybox ${D}${base_bindir}
+		else
+			install -m 0755 ${S}/busybox ${D}${base_bindir}
+		fi
+		ln -sf busybox ${D}${base_bindir}/sh
 	else
-		install -m 0755 ${S}/busybox ${D}${base_bindir}
+		install -d ${D}${base_bindir} ${D}${base_sbindir}
+		install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
+		cat busybox.links | while read FILE; do
+			NAME=`basename "$FILE"`
+			install -m 0755 "0_lib/$NAME" "${D}$FILE.${PN}"
+		done
+		# add suid bit where needed
+		for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
+			find ${D} -name $i.${PN} -exec chmod a+s {} \;
+		done
+		install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
+		ln -sf sh.${PN} ${D}${base_bindir}/sh
+		ln -sf ln.${PN} ${D}${base_bindir}/ln
+		ln -sf test.${PN} ${D}${bindir}/test
+		if [ -f ${D}/linuxrc.${PN} ]; then
+			mv ${D}/linuxrc.${PN} ${D}/linuxrc
+		fi
 	fi
-	ln -sf busybox ${D}${base_bindir}/sh
 
 	if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
 		install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN}
@@ -144,12 +164,42 @@ pkg_postinst_${PN} () {
 	# so the update-alternatives script will get the utilities it needs
 	# (update-alternatives have no problem replacing links later anyway)
 	test -n 2> /dev/null || alias test='busybox test'
-	if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
+	ln --help >/dev/null 2>&1 || alias ln='busybox ln'
+	if test "x$D" = "x"; then
+		while read link; do
+			if test ! -h "$link"; then
+				if test -f "$link.busybox"; then
+					to="$link.busybox"
+				else
+					case "$link" in
+						/*/*/*) to="../../bin/busybox";;
+						/bin/*) to="busybox";;
+						/*/*) to="../bin/busybox";;
+						/*) to="/bin/busybox";;
+					esac
+				fi
+				ln -s $to $link
+			fi
+		done </etc/busybox.links
+	fi
 
 	# This adds the links, remember that this has to work when building an image too, hence the $D
-    set +e
-	while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 50; done <$D/etc/busybox.links
-    set -e
+	set +e
+	while read link; do
+		if test -f "$D$link.${PN}"; then
+			to="$link.${PN}"
+		else
+			case "$link" in
+				/*/*/*) to="../../bin/busybox";;
+				/bin/*) to="busybox";;
+				/*/*) to="../bin/busybox";;
+				/*) to="/bin/busybox";;
+			esac
+		fi
+		bn=`basename $link`
+		update-alternatives --install $link $bn $to 50
+	done <$D/etc/busybox.links
+	set -e
 }
 
 pkg_postinst_${PN}-mountall () {
-- 
1.5.6.5




^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 10:26 ` Phil Blundell
@ 2010-07-07 10:48   ` Koen Kooi
  2010-07-07 12:01     ` Hauser, Wolfgang (external)
  2010-07-07 11:34   ` Hauser, Wolfgang (external)
  1 sibling, 1 reply; 16+ messages in thread
From: Koen Kooi @ 2010-07-07 10:48 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07-07-10 12:26, Phil Blundell wrote:
> On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
>> I want to use busybox with the applet binaries linked against libbusybox
>> in our system.
>> We need a wide range of applets at the same time, so I suppose it will
>> save overall needed memory space.
> 
> What's the advantage of this?  I would have thought it would give you a
> larger memory footprint rather than a smaller one.  I guess I must be
> missing something.
> 
>> Also I want to prevent the system from updating alternatives while the
>> first boot. We have to provide a read only root file system.
> 
> Yeah, this is a long-standing piece of OE suckage.  We should fix the
> alternative selection to work at image construction time.

OE already does that. But what it does after that is flag everything as
'unpacked' to have opkg rerun all postinsts at boot *again*. If OE
didn't run u-a at image time we wouldn't be able to use sysvinit for
example.
If you only care about u-a, just add a post process command to remove
the S98configure from the rootfs and opkg won't run.

In the long run a way to control this behaviour and optionally hook into
qemu or even targets over network to run them at image time. Having to
run a first boot, remove ssl keys and repackage everything is getting a
bit tedious.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMNFuPMkyGM64RGpERAmr3AKCNIYUK/AlJZyxB8CSNKGwTC34mywCeNUH4
yfJydmbOupXEw5hAvomV3sk=
=t0HL
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 10:26 ` Phil Blundell
  2010-07-07 10:48   ` Koen Kooi
@ 2010-07-07 11:34   ` Hauser, Wolfgang (external)
  2010-07-07 11:58     ` Phil Blundell
  1 sibling, 1 reply; 16+ messages in thread
From: Hauser, Wolfgang (external) @ 2010-07-07 11:34 UTC (permalink / raw)
  To: openembedded-devel

Hello, what memory footprint do you mean, the image or the ram ?

If I have to run several busybox applets at a time, e.g. sh, inetd, ftpd, telnetd, syslogd ... it would probably be better to load the shared library once and share it by the applets.

May be I am wrong, but the shared library overhead isn't that big at runtime. Especially if several applets are running at the same time.

Wolfgang Hauser

-----Ursprüngliche Nachricht-----
Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Phil Blundell
Gesendet: Mittwoch, 7. Juli 2010 12:26
An: openembedded-devel@lists.openembedded.org
Betreff: Re: [oe] Is there a recipe for building and using busybox with libbusybox out there ?

On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
> I want to use busybox with the applet binaries linked against libbusybox
> in our system.
> We need a wide range of applets at the same time, so I suppose it will
> save overall needed memory space.

What's the advantage of this?  I would have thought it would give you a
larger memory footprint rather than a smaller one.  I guess I must be
missing something.

> Also I want to prevent the system from updating alternatives while the
> first boot. We have to provide a read only root file system.

Yeah, this is a long-standing piece of OE suckage.  We should fix the
alternative selection to work at image construction time.

p.



_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 11:34   ` Hauser, Wolfgang (external)
@ 2010-07-07 11:58     ` Phil Blundell
  0 siblings, 0 replies; 16+ messages in thread
From: Phil Blundell @ 2010-07-07 11:58 UTC (permalink / raw)
  To: openembedded-devel

Both, really.

If you have several applets running at the same time then they
will/should already share the busybox executable.  I would have expected
making it into a library to increase the memory footprint (as well as
the startup time and image size) since you will now have a bunch of
extra relocs to fix up.

p.

On Wed, 2010-07-07 at 13:34 +0200, Hauser, Wolfgang (external) wrote:
> Hello, what memory footprint do you mean, the image or the ram ?
> 
> If I have to run several busybox applets at a time, e.g. sh, inetd, ftpd, telnetd, syslogd ... it would probably be better to load the shared library once and share it by the applets.
> 
> May be I am wrong, but the shared library overhead isn't that big at runtime. Especially if several applets are running at the same time.
> 
> Wolfgang Hauser
> 
> -----Ursprüngliche Nachricht-----
> Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Phil Blundell
> Gesendet: Mittwoch, 7. Juli 2010 12:26
> An: openembedded-devel@lists.openembedded.org
> Betreff: Re: [oe] Is there a recipe for building and using busybox with libbusybox out there ?
> 
> On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
> > I want to use busybox with the applet binaries linked against libbusybox
> > in our system.
> > We need a wide range of applets at the same time, so I suppose it will
> > save overall needed memory space.
> 
> What's the advantage of this?  I would have thought it would give you a
> larger memory footprint rather than a smaller one.  I guess I must be
> missing something.
> 
> > Also I want to prevent the system from updating alternatives while the
> > first boot. We have to provide a read only root file system.
> 
> Yeah, this is a long-standing piece of OE suckage.  We should fix the
> alternative selection to work at image construction time.
> 
> p.
> 
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 10:48   ` Koen Kooi
@ 2010-07-07 12:01     ` Hauser, Wolfgang (external)
  2010-07-07 12:20       ` Koen Kooi
  0 siblings, 1 reply; 16+ messages in thread
From: Hauser, Wolfgang (external) @ 2010-07-07 12:01 UTC (permalink / raw)
  To: openembedded-devel

As I am a little new in OE, where you suggest to add a post process command to remove
the S98configure ?

In the image recipe ? In the busybox recipe ?

Append to which command ?

Regards 
Wolfgang Hauser
  
-----Ursprüngliche Nachricht-----
Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Koen Kooi
Gesendet: Mittwoch, 7. Juli 2010 12:49
An: openembedded-devel@lists.openembedded.org
Betreff: Re: [oe] Is there a recipe for building and using busybox with libbusybox out there ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07-07-10 12:26, Phil Blundell wrote:
> On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
>> I want to use busybox with the applet binaries linked against libbusybox
>> in our system.
>> We need a wide range of applets at the same time, so I suppose it will
>> save overall needed memory space.
> 
> What's the advantage of this?  I would have thought it would give you a
> larger memory footprint rather than a smaller one.  I guess I must be
> missing something.
> 
>> Also I want to prevent the system from updating alternatives while the
>> first boot. We have to provide a read only root file system.
> 
> Yeah, this is a long-standing piece of OE suckage.  We should fix the
> alternative selection to work at image construction time.

OE already does that. But what it does after that is flag everything as
'unpacked' to have opkg rerun all postinsts at boot *again*. If OE
didn't run u-a at image time we wouldn't be able to use sysvinit for
example.
If you only care about u-a, just add a post process command to remove
the S98configure from the rootfs and opkg won't run.

In the long run a way to control this behaviour and optionally hook into
qemu or even targets over network to run them at image time. Having to
run a first boot, remove ssl keys and repackage everything is getting a
bit tedious.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMNFuPMkyGM64RGpERAmr3AKCNIYUK/AlJZyxB8CSNKGwTC34mywCeNUH4
yfJydmbOupXEw5hAvomV3sk=
=t0HL
-----END PGP SIGNATURE-----


_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07  9:52 ` Roman I Khimov
  2010-07-07 10:38   ` [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup Roman I Khimov
@ 2010-07-07 12:09   ` Hauser, Wolfgang (external)
  2010-07-07 12:21     ` Roman I Khimov
  1 sibling, 1 reply; 16+ messages in thread
From: Hauser, Wolfgang (external) @ 2010-07-07 12:09 UTC (permalink / raw)
  To: openembedded-devel

Hello Roman I Khimov,

what are your needs to use busybox linked to libbusybox.

What are the advantages/disadvantages in your opinion ?

Regards
Wolfgang Hauser

-----Ursprüngliche Nachricht-----
Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Roman I Khimov
Gesendet: Mittwoch, 7. Juli 2010 11:52
An: openembedded-devel@lists.openembedded.org
Betreff: Re: [oe] Is there a recipe for building and using busybox withlibbusybox out there ?

В сообщении от Среда 07 июля 2010 13:45:25 автор Hauser, Wolfgang (external) 
написал:
> So my question, is somebody working on a recipe for using buysbox this
> way ?

Using it this way locally, will try to prepare a patch for oe.dev today.
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 12:01     ` Hauser, Wolfgang (external)
@ 2010-07-07 12:20       ` Koen Kooi
  0 siblings, 0 replies; 16+ messages in thread
From: Koen Kooi @ 2010-07-07 12:20 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07-07-10 14:01, Hauser, Wolfgang (external) wrote:
> As I am a little new in OE, where you suggest to add a post process command to remove
> the S98configure ?
> 
> In the image recipe ? In the busybox recipe ?

in the image recipe using something like:

ROOTFS_POSTPROCESS_COMMAND += " ; rm file"

regards,

Koen

> 
> Append to which command ?
> 
> Regards 
> Wolfgang Hauser
>   
> -----Ursprüngliche Nachricht-----
> Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Koen Kooi
> Gesendet: Mittwoch, 7. Juli 2010 12:49
> An: openembedded-devel@lists.openembedded.org
> Betreff: Re: [oe] Is there a recipe for building and using busybox with libbusybox out there ?
> 
> On 07-07-10 12:26, Phil Blundell wrote:
>> On Wed, 2010-07-07 at 11:45 +0200, Hauser, Wolfgang (external) wrote:
>>> I want to use busybox with the applet binaries linked against libbusybox
>>> in our system.
>>> We need a wide range of applets at the same time, so I suppose it will
>>> save overall needed memory space.
> 
>> What's the advantage of this?  I would have thought it would give you a
>> larger memory footprint rather than a smaller one.  I guess I must be
>> missing something.
> 
>>> Also I want to prevent the system from updating alternatives while the
>>> first boot. We have to provide a read only root file system.
> 
>> Yeah, this is a long-standing piece of OE suckage.  We should fix the
>> alternative selection to work at image construction time.
> 
> OE already does that. But what it does after that is flag everything as
> 'unpacked' to have opkg rerun all postinsts at boot *again*. If OE
> didn't run u-a at image time we wouldn't be able to use sysvinit for
> example.
> If you only care about u-a, just add a post process command to remove
> the S98configure from the rootfs and opkg won't run.
> 
> In the long run a way to control this behaviour and optionally hook into
> qemu or even targets over network to run them at image time. Having to
> run a first boot, remove ssl keys and repackage everything is getting a
> bit tedious.
> 
> regards,
> 
> Koen

_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMNHEeMkyGM64RGpERAlb/AJ94spQyrbNfaJRTFlrNT0UG4h9lfgCfWDcZ
/NBxZJl6VUWy+XT34c75Mp8=
=V5gc
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Is there a recipe for building and using busybox with libbusybox out there ?
  2010-07-07 12:09   ` Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
@ 2010-07-07 12:21     ` Roman I Khimov
  0 siblings, 0 replies; 16+ messages in thread
From: Roman I Khimov @ 2010-07-07 12:21 UTC (permalink / raw)
  To: openembedded-devel

В сообщении от Среда 07 июля 2010 16:09:49 автор Hauser, Wolfgang (external) 
написал:
> what are your needs to use busybox linked to libbusybox.

We need properly set up mandatory access control system, symlinks are evil for 
that.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-07 10:38   ` [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup Roman I Khimov
@ 2010-07-12  5:32     ` Roman I Khimov
  2010-07-12  7:41       ` Hauser, Wolfgang (external)
  2010-07-12 18:34     ` Khem Raj
  1 sibling, 1 reply; 16+ messages in thread
From: Roman I Khimov @ 2010-07-12  5:32 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: Text/Plain, Size: 539 bytes --]

В сообщении от Среда 07 июля 2010 14:38:54 автор Roman I Khimov написал:
> Where each applet is installed as a tiny binary linked against shared
> libbusybox.
> 
> Signed-off-by: Roman I Khimov <khimov@altell.ru>
> ---
>  recipes/busybox/busybox.inc |   74
>  ++++++++++++++++++++++++++++++++++++------- 1 files changed, 62
>  insertions(+), 12 deletions(-)
> 

OK for .dev?

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-12  5:32     ` Roman I Khimov
@ 2010-07-12  7:41       ` Hauser, Wolfgang (external)
  0 siblings, 0 replies; 16+ messages in thread
From: Hauser, Wolfgang (external) @ 2010-07-12  7:41 UTC (permalink / raw)
  To: openembedded-devel

For me the patch works. 

Wolfgang Hauser

-----Ursprüngliche Nachricht-----
Von: openembedded-devel-bounces@lists.openembedded.org [mailto:openembedded-devel-bounces@lists.openembedded.org] Im Auftrag von Roman I Khimov
Gesendet: Montag, 12. Juli 2010 07:33
An: openembedded-devel@lists.openembedded.org
Betreff: Re: [oe] [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup

В сообщении от Среда 07 июля 2010 14:38:54 автор Roman I Khimov написал:
> Where each applet is installed as a tiny binary linked against shared
> libbusybox.
> 
> Signed-off-by: Roman I Khimov <khimov@altell.ru>
> ---
>  recipes/busybox/busybox.inc |   74
>  ++++++++++++++++++++++++++++++++++++------- 1 files changed, 62
>  insertions(+), 12 deletions(-)
> 

OK for .dev?

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-07 10:38   ` [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup Roman I Khimov
  2010-07-12  5:32     ` Roman I Khimov
@ 2010-07-12 18:34     ` Khem Raj
  2010-07-12 19:21       ` Roman I Khimov
  1 sibling, 1 reply; 16+ messages in thread
From: Khem Raj @ 2010-07-12 18:34 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Jul 7, 2010 at 3:38 AM, Roman I Khimov <khimov@altell.ru> wrote:
> Where each applet is installed as a tiny binary linked against shared
> libbusybox.

may be it should be a DISTRO_FEATURE in OE

>
> Signed-off-by: Roman I Khimov <khimov@altell.ru>
> ---
>  recipes/busybox/busybox.inc |   74 ++++++++++++++++++++++++++++++++++++-------
>  1 files changed, 62 insertions(+), 12 deletions(-)
>
> diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
> index a5346bd..31e6cdc 100644
> --- a/recipes/busybox/busybox.inc
> +++ b/recipes/busybox/busybox.inc
> @@ -11,7 +11,7 @@ LICENSE = "GPLv2"
>  SECTION = "base"
>  PRIORITY = "required"
>
> -INC_PR = "r30"
> +INC_PR = "r31"
>
>  SRC_URI = "\
>   file://busybox-cron \
> @@ -98,15 +98,35 @@ do_install () {
>
>        install -d ${D}${sysconfdir}/init.d
>
> -       # Install /bin/busybox, and the /bin/sh link so the postinst script
> -       # can run. Let update-alternatives handle the rest.
> -       install -d ${D}${base_bindir}
> -       if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then
> -               install -m 4755 ${S}/busybox ${D}${base_bindir}
> +       if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${WORKDIR}/defconfig; then
> +               # Install /bin/busybox, and the /bin/sh link so the postinst script
> +               # can run. Let update-alternatives handle the rest.
> +               install -d ${D}${base_bindir}
> +               if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then
> +                       install -m 4755 ${S}/busybox ${D}${base_bindir}
> +               else
> +                       install -m 0755 ${S}/busybox ${D}${base_bindir}
> +               fi
> +               ln -sf busybox ${D}${base_bindir}/sh
>        else
> -               install -m 0755 ${S}/busybox ${D}${base_bindir}
> +               install -d ${D}${base_bindir} ${D}${base_sbindir}
> +               install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
> +               cat busybox.links | while read FILE; do
> +                       NAME=`basename "$FILE"`
> +                       install -m 0755 "0_lib/$NAME" "${D}$FILE.${PN}"
> +               done
> +               # add suid bit where needed
> +               for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
> +                       find ${D} -name $i.${PN} -exec chmod a+s {} \;
> +               done
> +               install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
> +               ln -sf sh.${PN} ${D}${base_bindir}/sh
> +               ln -sf ln.${PN} ${D}${base_bindir}/ln
> +               ln -sf test.${PN} ${D}${bindir}/test
> +               if [ -f ${D}/linuxrc.${PN} ]; then
> +                       mv ${D}/linuxrc.${PN} ${D}/linuxrc
> +               fi
>        fi
> -       ln -sf busybox ${D}${base_bindir}/sh
>
>        if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
>                install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN}
> @@ -144,12 +164,42 @@ pkg_postinst_${PN} () {
>        # so the update-alternatives script will get the utilities it needs
>        # (update-alternatives have no problem replacing links later anyway)
>        test -n 2> /dev/null || alias test='busybox test'
> -       if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
> +       ln --help >/dev/null 2>&1 || alias ln='busybox ln'
> +       if test "x$D" = "x"; then
> +               while read link; do
> +                       if test ! -h "$link"; then
> +                               if test -f "$link.busybox"; then
> +                                       to="$link.busybox"
> +                               else
> +                                       case "$link" in
> +                                               /*/*/*) to="../../bin/busybox";;
> +                                               /bin/*) to="busybox";;
> +                                               /*/*) to="../bin/busybox";;
> +                                               /*) to="/bin/busybox";;
> +                                       esac
> +                               fi
> +                               ln -s $to $link
> +                       fi
> +               done </etc/busybox.links
> +       fi
>
>        # This adds the links, remember that this has to work when building an image too, hence the $D
> -    set +e
> -       while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 50; done <$D/etc/busybox.links
> -    set -e
> +       set +e
> +       while read link; do
> +               if test -f "$D$link.${PN}"; then
> +                       to="$link.${PN}"
> +               else
> +                       case "$link" in
> +                               /*/*/*) to="../../bin/busybox";;
> +                               /bin/*) to="busybox";;
> +                               /*/*) to="../bin/busybox";;
> +                               /*) to="/bin/busybox";;
> +                       esac
> +               fi
> +               bn=`basename $link`
> +               update-alternatives --install $link $bn $to 50
> +       done <$D/etc/busybox.links
> +       set -e
>  }
>
>  pkg_postinst_${PN}-mountall () {
> --
> 1.5.6.5
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-12 18:34     ` Khem Raj
@ 2010-07-12 19:21       ` Roman I Khimov
  2010-07-12 19:41         ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: Roman I Khimov @ 2010-07-12 19:21 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: Text/Plain, Size: 1127 bytes --]

В сообщении от Понедельник 12 июля 2010 22:34:48 автор Khem Raj написал:
> On Wed, Jul 7, 2010 at 3:38 AM, Roman I Khimov <khimov@altell.ru> wrote:
> > Where each applet is installed as a tiny binary linked against shared
> > libbusybox.
> 
> may be it should be a DISTRO_FEATURE in OE

Well, I don't think so. First, it doesn't change anything functional, only the 
way busybox is linked/installed/packaged and second is that it only affects 
one package, so if distro wants that, I think it should maintain its own 
defconfig (at least four distros do that already and IMO busybox is the 
package you want to tune for your specific needs). Or the distro itself may 
choose not to use busybox at all so such FEATURE would make no sense in that 
case.

I view FEATUREs as a way to make distro-global configuration, ipv6 is probably 
one of the best examples as it potentially affects many packages. 
FEATURE_INDIVIDUAL is completely busybox-specific.

-- 
 http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup
  2010-07-12 19:21       ` Roman I Khimov
@ 2010-07-12 19:41         ` Khem Raj
  0 siblings, 0 replies; 16+ messages in thread
From: Khem Raj @ 2010-07-12 19:41 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Jul 12, 2010 at 12:21 PM, Roman I Khimov <roman@khimov.ru> wrote:
> В сообщении от Понедельник 12 июля 2010 22:34:48 автор Khem Raj написал:
>> On Wed, Jul 7, 2010 at 3:38 AM, Roman I Khimov <khimov@altell.ru> wrote:
>> > Where each applet is installed as a tiny binary linked against shared
>> > libbusybox.
>>
>> may be it should be a DISTRO_FEATURE in OE
>
> Well, I don't think so. First, it doesn't change anything functional, only the
> way busybox is linked/installed/packaged and second is that it only affects
> one package, so if distro wants that, I think it should maintain its own
> defconfig (at least four distros do that already

ok in that case, it seems ok. This makes it a distro feature.

 and IMO busybox is the
> package you want to tune for your specific needs). Or the distro itself may
> choose not to use busybox at all so such FEATURE would make no sense in that
> case.
>
> I view FEATUREs as a way to make distro-global configuration, ipv6 is probably
> one of the best examples as it potentially affects many packages.
> FEATURE_INDIVIDUAL is completely busybox-specific.

if a distro does not support shared libraries then this feature is a problem.
but then if we tune it in busybox config then even that can be taken care of
so seems fine.

>
> --
>  http://roman.khimov.ru
> mailto: roman@khimov.ru
> gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-07-12 19:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07  9:45 Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
2010-07-07  9:52 ` Roman I Khimov
2010-07-07 10:38   ` [PATCH] busybox: add suport for FEATURE_INDIVIDUAL setup Roman I Khimov
2010-07-12  5:32     ` Roman I Khimov
2010-07-12  7:41       ` Hauser, Wolfgang (external)
2010-07-12 18:34     ` Khem Raj
2010-07-12 19:21       ` Roman I Khimov
2010-07-12 19:41         ` Khem Raj
2010-07-07 12:09   ` Is there a recipe for building and using busybox with libbusybox out there ? Hauser, Wolfgang (external)
2010-07-07 12:21     ` Roman I Khimov
2010-07-07 10:26 ` Phil Blundell
2010-07-07 10:48   ` Koen Kooi
2010-07-07 12:01     ` Hauser, Wolfgang (external)
2010-07-07 12:20       ` Koen Kooi
2010-07-07 11:34   ` Hauser, Wolfgang (external)
2010-07-07 11:58     ` Phil Blundell

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.