summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox.inc
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-04 13:09:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-05 14:24:43 +0000
commit6ab56c54f316154d89f03ec0c6c2cb39d1736cff (patch)
tree952d5bde1c81457378d6d995051cd04674dbf489 /meta/recipes-core/busybox/busybox.inc
parent82233cd647b1ecc256afb0c3378906cf8af46f8e (diff)
downloadpoky-6ab56c54f316154d89f03ec0c6c2cb39d1736cff.tar.gz
classes/recipes: More optimal DISTRO_FEATURES references
Using the contains function results in more optimal sstate checksums resulting in better cache reuse as we as more consistent code. (From OE-Core rev: 9c93526756e7cbbff027c88eb972f877bcb1f057) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox/busybox.inc')
-rw-r--r--meta/recipes-core/busybox/busybox.inc23
1 files changed, 11 insertions, 12 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index b3d0cd25de..0c84c1f115 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -47,11 +47,11 @@ RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
47inherit cml1 systemd update-rc.d ptest 47inherit cml1 systemd update-rc.d ptest
48 48
49# internal helper 49# internal helper
50def busybox_cfg(feature, features, tokens, cnf, rem): 50def busybox_cfg(feature, tokens, cnf, rem):
51 if type(tokens) == type(""): 51 if type(tokens) == type(""):
52 tokens = [tokens] 52 tokens = [tokens]
53 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens]) 53 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
54 if type(features) == type([]) and feature in features: 54 if feature:
55 cnf.extend([token + '=y' for token in tokens]) 55 cnf.extend([token + '=y' for token in tokens])
56 else: 56 else:
57 cnf.extend(['# ' + token + ' is not set' for token in tokens]) 57 cnf.extend(['# ' + token + ' is not set' for token in tokens])
@@ -59,15 +59,14 @@ def busybox_cfg(feature, features, tokens, cnf, rem):
59# Map distro features to config settings 59# Map distro features to config settings
60def features_to_busybox_settings(d): 60def features_to_busybox_settings(d):
61 cnf, rem = ([], []) 61 cnf, rem = ([], [])
62 distro_features = d.getVar('DISTRO_FEATURES', True).split() 62 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
63 busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IPV6', cnf, rem) 63 busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem)
64 busybox_cfg('largefile', distro_features, 'CONFIG_LFS', cnf, rem) 64 busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
65 busybox_cfg('largefile', distro_features, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem) 65 busybox_cfg(base_contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
66 busybox_cfg('nls', distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem) 66 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
67 busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem) 67 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
68 busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem) 68 busybox_cfg(base_contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
69 busybox_cfg('wifi', distro_features, 'CONFIG_RFKILL', cnf, rem) 69 busybox_cfg(base_contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem)
70 busybox_cfg('bluetooth', distro_features, 'CONFIG_RFKILL', cnf, rem)
71 return "\n".join(cnf), "\n".join(rem) 70 return "\n".join(cnf), "\n".join(rem)
72 71
73# X, Y = ${@features_to_uclibc_settings(d)} 72# X, Y = ${@features_to_uclibc_settings(d)}
@@ -295,7 +294,7 @@ ALTERNATIVE_${PN}-syslog += "syslog-conf"
295ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" 294ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
296 295
297python () { 296python () {
298 if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split(): 297 if base_contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
299 pn = d.getVar('PN', True) 298 pn = d.getVar('PN', True)
300 d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init') 299 d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
301 d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True))) 300 d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))