aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/busybox/busybox-config.inc
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-07-06 09:32:20 +0000
committerKhem Raj <raj.khem@gmail.com>2010-07-08 17:23:55 -0700
commitcd31df56e2451d3296607791706c542f94e23a14 (patch)
tree6fe154d179dcd5f9aeacc46a8e53a24897b504f6 /recipes/busybox/busybox-config.inc
parent8ea345630969e8bf6a44d0884213ec03cd053332 (diff)
downloadopenembedded-cd31df56e2451d3296607791706c542f94e23a14.tar.gz
busybox: configure according to {MACHINE, DISTRO}_FEATURES
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes/busybox/busybox-config.inc')
-rw-r--r--recipes/busybox/busybox-config.inc28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes/busybox/busybox-config.inc b/recipes/busybox/busybox-config.inc
new file mode 100644
index 0000000000..26ccec483a
--- /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