From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: philb@gnu.org
Cc: openembedded-devel@lists.openembedded.org
Subject: [PATCH 2/2] busybox: configure according to {MACHINE, DISTRO}_FEATURES
Date: Thu, 10 Jun 2010 21:46:48 +0200 [thread overview]
Message-ID: <1276199208-31929-2-git-send-email-rep.dot.nop@gmail.com> (raw)
In-Reply-To: <1276114963.4424.42.camel@lenovo.internal.reciva.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
recipes/busybox/busybox-config.inc | 28 +++++++++++++++++++++++++
recipes/busybox/busybox.inc | 39 +++++++++++++++++++++++++++++++++++-
2 files changed, 66 insertions(+), 1 deletions(-)
create mode 100644 recipes/busybox/busybox-config.inc
diff --git a/recipes/busybox/busybox-config.inc b/recipes/busybox/busybox-config.inc
new file mode 100644
index 0000000..26ccec4
--- /dev/null
+++ b/recipes/busybox/busybox-config.inc
@@ -0,0 +1,28 @@
+# internal helper
+def busybox_cfg(feature, features, tokens, cnf, rem):
+ if type(tokens) == type(""):
+ tokens = [tokens]
+ rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+ if type(features) == type([]) and feature in features:
+ cnf.extend([token + '=y' for token in tokens])
+ else:
+ cnf.extend(['# ' + token + ' is not set' for token in tokens])
+# Map distro and machine features to config settings
+def features_to_busybox_settings(d):
+ cnf, rem = ([], [])
+ distro_features = bb.data.getVar('DISTRO_FEATURES', d).split()
+ machine_features = bb.data.getVar('MACHINE_FEATURES', d).split()
+ busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IPV6', cnf, rem)
+ busybox_cfg('largefile', distro_features, 'CONFIG_LFS', cnf, rem)
+ 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)
+ return "\n".join(cnf), "\n".join(rem)
+# X, Y = ${@features_to_uclibc_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_busybox_conf(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return cnf
+def features_to_busybox_del(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return rem
diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index f554478..827e917 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
SECTION = "base"
PRIORITY = "required"
-INC_PR = "r29"
+INC_PR = "r30"
SRC_URI = "\
file://busybox-cron \
@@ -70,10 +70,47 @@ RDEPENDS_${PN}-udhcpd += "${PN}"
LD = "${CC} -nostdlib"
inherit cml1 update-rc.d
+require busybox-config.inc
+
+configmangle = '/CROSS_COMPILER_PREFIX/d; \
+ /CONFIG_EXTRA_CFLAGS/d; \
+ '
+OE_FEATURES := "${@features_to_busybox_conf(d)}"
+OE_DEL := "${@features_to_busybox_del(d)}"
+DO_IPv4 := ${@base_contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}
+DO_IPv6 := ${@base_contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}
+python () {
+ if "${OE_DEL}":
+ bb.data.setVar('configmangle_append', "${OE_DEL}" + "\n", d)
+ if "${OE_FEATURES}":
+ bb.data.setVar('configmangle_append',
+ "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+ ("\\n".join((bb.data.expand("${OE_FEATURES}", d).split("\n")))),
+ d)
+ bb.data.setVar('configmangle_append',
+ "/^### CROSS$/a\\\n%s\n" %
+ ("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
+ "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\""
+ ])
+ ),
+ d)
+}
do_configure () {
sed -e 's#@DATADIR@#${datadir}#g' \
< ${WORKDIR}/defconfig > ${S}/.config
+ for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
+ ${S}/.config
+ sed -i -e '${configmangle}' ${S}/.config
+ if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
+ # disable networking applets
+ mv ${S}/.config ${S}/.config.oe-tmp
+ awk 'BEGIN{net=0}
+ /^# Networking Utilities/{net=1}
+ /^#$/{if(net){net=net+1}}
+ {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
+ ${S}/.config.oe-tmp > ${S}/.config
+ fi
cml1_do_configure
}
--
1.7.1
next prev parent reply other threads:[~2010-06-10 19:51 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-21 15:31 [PATCH] uClibc: rename main include Bernhard Reutner-Fischer
2010-02-22 5:54 ` Khem Raj
2010-03-12 17:46 ` [RFC, PATCH 0/3] uClibc recipe touchup Bernhard Reutner-Fischer
2010-03-12 17:46 ` [PATCH 1/3] uClibc: rename include file of old releases Bernhard Reutner-Fischer
2010-03-12 17:46 ` [PATCH 2/3] sane-toolchain: add PREFERRED_UCLIBC_VERSION Bernhard Reutner-Fischer
2010-04-05 19:49 ` Roman I Khimov
2010-04-08 9:30 ` Stefan Schmidt
2010-06-09 17:11 ` Bernhard Reutner-Fischer
2010-03-12 17:46 ` [PATCH 3/3] uClibc: redo configuration Bernhard Reutner-Fischer
2010-04-05 20:22 ` Roman I Khimov
2010-06-09 17:10 ` [PATCH 0/3] uClibc configury touchup; RFC WRT feature/dep picking heuristics Bernhard Reutner-Fischer
2010-06-09 21:26 ` RFC " Bernhard Reutner-Fischer
2010-06-09 17:10 ` [PATCH 1/3] uClibc: redo configuration Bernhard Reutner-Fischer
2010-06-09 17:10 ` [PATCH 2/3] uclibc_git: keep PV at "git" Bernhard Reutner-Fischer
2010-06-09 17:10 ` [PATCH 3/3] busybox: picking IPv6 per default is not up to the package Bernhard Reutner-Fischer
2010-06-09 18:44 ` Phil Blundell
2010-06-09 18:52 ` Bernhard Reutner-Fischer
2010-06-09 19:18 ` Phil Blundell
2010-06-09 19:32 ` Bernhard Reutner-Fischer
2010-06-09 20:22 ` Phil Blundell
2010-06-10 19:46 ` [PATCH 1/2] uclibc: handle DISTRO_FEATURE="largefile" Bernhard Reutner-Fischer
2010-06-10 19:46 ` Bernhard Reutner-Fischer [this message]
2010-06-10 19:55 ` [PATCH 2/2] busybox: configure according to {MACHINE, DISTRO}_FEATURES Chris Larson
2010-06-10 20:22 ` Phil Blundell
2010-06-10 20:27 ` Chris Larson
2010-06-10 20:50 ` Bernhard Reutner-Fischer
2010-06-10 21:06 ` Phil Blundell
2010-06-10 21:20 ` Bernhard Reutner-Fischer
2010-06-11 12:59 ` Phil Blundell
2010-06-22 20:39 ` Bernhard Reutner-Fischer
2010-06-28 18:23 ` ping**2 [was: Re: [PATCH 2/2] busybox: configure according to {MACHINE, DISTRO}_FEATURES] Bernhard Reutner-Fischer
2010-06-10 22:56 ` [PATCH 2/2] busybox: configure according to {MACHINE, DISTRO}_FEATURES Khem Raj
2010-06-11 7:16 ` Bernhard Reutner-Fischer
2010-06-10 20:44 ` Bernhard Reutner-Fischer
2010-06-10 21:09 ` Phil Blundell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1276199208-31929-2-git-send-email-rep.dot.nop@gmail.com \
--to=rep.dot.nop@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
--cc=philb@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox