summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
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
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')
-rw-r--r--meta/recipes-core/busybox/busybox.inc23
-rw-r--r--meta/recipes-core/dbus/dbus.inc3
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc12
-rw-r--r--meta/recipes-core/systemd/systemd_208.bb3
4 files changed, 17 insertions, 24 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)))
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index 6612184e22..5b99034bf4 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -27,8 +27,7 @@ INITSCRIPT_NAME = "dbus-1"
27INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." 27INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
28 28
29python __anonymous() { 29python __anonymous() {
30 features = d.getVar("DISTRO_FEATURES", True).split() 30 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
31 if "sysvinit" not in features:
32 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") 31 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
33} 32}
34 33
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
index 5d9623d2c6..4262b1d6e5 100644
--- a/meta/recipes-core/dropbear/dropbear.inc
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -62,14 +62,10 @@ do_install() {
62 -e 's,/usr/bin,${bindir},g' \ 62 -e 's,/usr/bin,${bindir},g' \
63 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear 63 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear
64 chmod 755 ${D}${sysconfdir}/init.d/dropbear 64 chmod 755 ${D}${sysconfdir}/init.d/dropbear
65 for i in ${DISTRO_FEATURES}; 65 if [ "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
66 do 66 install -d ${D}${sysconfdir}/pam.d
67 if [ ${i} = "pam" ]; then 67 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
68 install -d ${D}${sysconfdir}/pam.d 68 fi
69 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
70 fi
71 done
72
73} 69}
74 70
75inherit update-alternatives 71inherit update-alternatives
diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
index 66e6beec8a..c1f8d773fb 100644
--- a/meta/recipes-core/systemd/systemd_208.bb
+++ b/meta/recipes-core/systemd/systemd_208.bb
@@ -271,8 +271,7 @@ INITSCRIPT_NAME_udev = "systemd-udevd"
271INITSCRIPT_PARAMS_udev = "start 03 S ." 271INITSCRIPT_PARAMS_udev = "start 03 S ."
272 272
273python __anonymous() { 273python __anonymous() {
274 features = d.getVar("DISTRO_FEATURES", True).split() 274 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
275 if "sysvinit" not in features:
276 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") 275 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
277} 276}
278 277