Patchwork [07/12] busybox: simplify handling of busybox-static

login
register
mail settings
Submitter Bernhard Reutner-Fischer
Date Jan. 3, 2011, 8:02 p.m.
Message ID <1294084926-3115-7-git-send-email-rep.dot.nop@gmail.com>
Download mbox | patch
Permalink /patch/164/
State Accepted
Headers show

Comments

Bernhard Reutner-Fischer - Jan. 3, 2011, 8:02 p.m.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 recipes/busybox/busybox-static_1.17.4.bb |    8 +-------
 recipes/busybox/busybox-static_1.18.1.bb |    6 ------
 recipes/busybox/busybox.inc              |   15 +++++++++++++--
 3 files changed, 14 insertions(+), 15 deletions(-)
Bernhard Reutner-Fischer - Jan. 11, 2011, 7:53 p.m.
Ping?

This is a first step into sanitizing busybox recipes, although it
doesn't really cleanup much ATM.

In the long run, i have already thought about virtualizing busybox into
coreutils/util-linux/init/whatnot and use packages and u-a (to handle
these opkg-packages natively via rootfs_opkg and pstaging w/ opkg-cl
-O). We now do a real install with the superset of {,-static} each and
use u-a to properly set the tools per provider. But anyway. The above
was a step. ACK?

On Mon, Jan 03, 2011 at 09:02:01PM +0100, Bernhard Reutner-Fischer wrote:
>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>---
> recipes/busybox/busybox-static_1.17.4.bb |    8 +-------
> recipes/busybox/busybox-static_1.18.1.bb |    6 ------
> recipes/busybox/busybox.inc              |   15 +++++++++++++--
> 3 files changed, 14 insertions(+), 15 deletions(-)
>
>diff --git a/recipes/busybox/busybox-static_1.17.4.bb b/recipes/busybox/busybox-static_1.17.4.bb
>index 325752a..252fd66 100644
>--- a/recipes/busybox/busybox-static_1.17.4.bb
>+++ b/recipes/busybox/busybox-static_1.17.4.bb
>@@ -1,11 +1,5 @@
> require busybox_${PV}.bb
>-PR = "${INC_PR}.0"
>+PR = "${INC_PR}.1"
> 
> FILESPATHPKG =. "busybox-${PV}:"
> S = "${WORKDIR}/busybox-${PV}"
>-
>-do_configure_append() {
>-	sed -i -e '/CONFIG_STATIC/d' .config
>-	echo "CONFIG_STATIC=y" >>.config
>-}
>-
>diff --git a/recipes/busybox/busybox-static_1.18.1.bb b/recipes/busybox/busybox-static_1.18.1.bb
>index 58aca93..eeb3040 100644
>--- a/recipes/busybox/busybox-static_1.18.1.bb
>+++ b/recipes/busybox/busybox-static_1.18.1.bb
>@@ -2,9 +2,3 @@ require busybox_${PV}.bb
> 
> FILESPATHPKG =. "busybox-${PV}:"
> S = "${WORKDIR}/busybox-${PV}"
>-
>-do_configure_append() {
>-	sed -i -e '/CONFIG_STATIC/d' .config
>-	echo "CONFIG_STATIC=y" >>.config
>-}
>-
>diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
>index a9d1e6e..eda5f95 100644
>--- a/recipes/busybox/busybox.inc
>+++ b/recipes/busybox/busybox.inc
>@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
> SECTION = "base"
> PRIORITY = "required"
> 
>-INC_PR = "r38"
>+INC_PR = "r39"
> 
> SRC_URI = "\
>   file://busybox-cron \
>@@ -97,9 +97,11 @@ python () {
>                  d)
> }
> 
>-do_configure () {
>+do_prepare_config () {
> 	sed -e 's#@DATADIR@#${datadir}#g' \
> 		< ${WORKDIR}/defconfig > ${S}/.config
>+	sed -i -e '/CONFIG_STATIC/d' .config
>+	echo "# CONFIG_STATIC is not set" >> .config
> 	for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
> 		${S}/.config
> 	sed -i -e '${configmangle}' ${S}/.config
>@@ -112,6 +114,15 @@ do_configure () {
> 	  {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
> 		  ${S}/.config.oe-tmp > ${S}/.config
> 	fi
>+}
>+
>+do_prepare_config_append_pn-busybox-static() {
>+	sed -i -e '/CONFIG_STATIC/d' .config
>+	echo "CONFIG_STATIC=y" >>.config
>+}
>+
>+do_configure () {
>+	do_prepare_config
> 	cml1_do_configure
> }
> 
>-- 
>1.7.2.3
>
Otavio Salvador - Jan. 12, 2011, 8:41 p.m.
On Tue, Jan 11, 2011 at 17:53, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> In the long run, i have already thought about virtualizing busybox into
> coreutils/util-linux/init/whatnot and use packages and u-a (to handle
> these opkg-packages natively via rootfs_opkg and pstaging w/ opkg-cl
> -O). We now do a real install with the superset of {,-static} each and
> use u-a to properly set the tools per provider. But anyway. The above
> was a step. ACK?

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

Regarding the busybox cleanup a nice way to enable/disable features
(and links) on it is an important thing to have. We have sort of it
for uclibc (and patches for eglibc has been sent).

Patch

diff --git a/recipes/busybox/busybox-static_1.17.4.bb b/recipes/busybox/busybox-static_1.17.4.bb
index 325752a..252fd66 100644
--- a/recipes/busybox/busybox-static_1.17.4.bb
+++ b/recipes/busybox/busybox-static_1.17.4.bb
@@ -1,11 +1,5 @@ 
 require busybox_${PV}.bb
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 FILESPATHPKG =. "busybox-${PV}:"
 S = "${WORKDIR}/busybox-${PV}"
-
-do_configure_append() {
-	sed -i -e '/CONFIG_STATIC/d' .config
-	echo "CONFIG_STATIC=y" >>.config
-}
-
diff --git a/recipes/busybox/busybox-static_1.18.1.bb b/recipes/busybox/busybox-static_1.18.1.bb
index 58aca93..eeb3040 100644
--- a/recipes/busybox/busybox-static_1.18.1.bb
+++ b/recipes/busybox/busybox-static_1.18.1.bb
@@ -2,9 +2,3 @@  require busybox_${PV}.bb
 
 FILESPATHPKG =. "busybox-${PV}:"
 S = "${WORKDIR}/busybox-${PV}"
-
-do_configure_append() {
-	sed -i -e '/CONFIG_STATIC/d' .config
-	echo "CONFIG_STATIC=y" >>.config
-}
-
diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index a9d1e6e..eda5f95 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,7 +11,7 @@  LICENSE = "GPLv2"
 SECTION = "base"
 PRIORITY = "required"
 
-INC_PR = "r38"
+INC_PR = "r39"
 
 SRC_URI = "\
   file://busybox-cron \
@@ -97,9 +97,11 @@  python () {
                  d)
 }
 
-do_configure () {
+do_prepare_config () {
 	sed -e 's#@DATADIR@#${datadir}#g' \
 		< ${WORKDIR}/defconfig > ${S}/.config
+	sed -i -e '/CONFIG_STATIC/d' .config
+	echo "# CONFIG_STATIC is not set" >> .config
 	for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
 		${S}/.config
 	sed -i -e '${configmangle}' ${S}/.config
@@ -112,6 +114,15 @@  do_configure () {
 	  {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
 		  ${S}/.config.oe-tmp > ${S}/.config
 	fi
+}
+
+do_prepare_config_append_pn-busybox-static() {
+	sed -i -e '/CONFIG_STATIC/d' .config
+	echo "CONFIG_STATIC=y" >>.config
+}
+
+do_configure () {
+	do_prepare_config
 	cml1_do_configure
 }