diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-04 13:09:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-05 14:24:43 +0000 |
commit | 6ab56c54f316154d89f03ec0c6c2cb39d1736cff (patch) | |
tree | 952d5bde1c81457378d6d995051cd04674dbf489 /meta/recipes-core/busybox | |
parent | 82233cd647b1ecc256afb0c3378906cf8af46f8e (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 23 |
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" | |||
47 | inherit cml1 systemd update-rc.d ptest | 47 | inherit cml1 systemd update-rc.d ptest |
48 | 48 | ||
49 | # internal helper | 49 | # internal helper |
50 | def busybox_cfg(feature, features, tokens, cnf, rem): | 50 | def 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 |
60 | def features_to_busybox_settings(d): | 60 | def 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" | |||
295 | ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" | 294 | ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" |
296 | 295 | ||
297 | python () { | 296 | python () { |
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))) |