diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-06-09 15:04:03 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:08:32 +0100 |
commit | 7b95d5d70172bd1e70748c132d365441c28d54e1 (patch) | |
tree | bb708677f7d5491eddb3e3bbdcd83c2c20290978 /meta/conf/bitbake.conf | |
parent | 6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e (diff) | |
download | poky-7b95d5d70172bd1e70748c132d365441c28d54e1.tar.gz |
bitbake.conf: DISTRO_FEATURES as overrides
As discussed in "[Openembedded-architecture] Yocto Compatible 2.0 +
signature changes", changes in .bbappend must depend on some explicit
configuration change, typically selecting a distro feature.
For _append and _remove, adding an override that is set only when the
corresponding entry is in DISTRO_FEATURES achieves that:
In local.conf:
DISTRO_FEATURES_append = " my-distro-feature"
In layer.conf:
DISTRO_FEATURES_OVERRIDES += "my-distro-feature"
In a .bbappend:
do_install_append_df-my-distro-feature () {
...
}
The subset of DISTRO_FEATURES that are made available as overrides
must be configured explicitly because using them this way should
be a conscious decision.
(From OE-Core rev: 3b3ae91a22d6f685e804df4f32cdeebe1bd6bd88)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/bitbake.conf')
-rw-r--r-- | meta/conf/bitbake.conf | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index caae6a012b..bc438cca82 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -713,7 +713,7 @@ DISTRO_NAME ??= "OpenEmbedded" | |||
713 | # | 713 | # |
714 | # This works for functions as well, they are really just environment variables. | 714 | # This works for functions as well, they are really just environment variables. |
715 | # Default OVERRIDES to make compilation fail fast in case of build system misconfiguration. | 715 | # Default OVERRIDES to make compilation fail fast in case of build system misconfiguration. |
716 | OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable" | 716 | OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}${DISTROFEATURESOVERRIDES}:${CLASSOVERRIDE}:forcevariable" |
717 | OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES" | 717 | OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES" |
718 | CLASSOVERRIDE ?= "class-target" | 718 | CLASSOVERRIDE ?= "class-target" |
719 | DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}" | 719 | DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}" |
@@ -722,6 +722,21 @@ MACHINEOVERRIDES[vardepsexclude] = "MACHINE" | |||
722 | 722 | ||
723 | FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}" | 723 | FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}" |
724 | 724 | ||
725 | # Turns certain DISTRO_FEATURES into overrides of the same name | ||
726 | # or (optionally) some other name. Ensures that these special | ||
727 | # distro features remain set also for native and nativesdk | ||
728 | # recipes, so that these overrides can also be used there. | ||
729 | # | ||
730 | # Beware that this part of OVERRIDES changes during parsing, so usage | ||
731 | # of these overrides should be limited to .bb and .bbappend files, | ||
732 | # because then DISTRO_FEATURES is final. | ||
733 | DISTRO_FEATURES_OVERRIDES ??= "" | ||
734 | DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature> entries. \ | ||
735 | Each entry is added to OVERRIDES as df-<feature> if <feature> is in DISTRO_FEATURES." | ||
736 | DISTRO_FEATURES_FILTER_NATIVE_append = " ${DISTRO_FEATURES_OVERRIDES}" | ||
737 | DISTRO_FEATURES_FILTER_NATIVESDK_append = " ${DISTRO_FEATURES_OVERRIDES}" | ||
738 | DISTROFEATURESOVERRIDES = "${@ ''.join([':df-' + x for x in (set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) & set((d.getVar('DISTRO_FEATURES') or '').split()))]) }" | ||
739 | |||
725 | ################################################################## | 740 | ################################################################## |
726 | # Include the rest of the config files. | 741 | # Include the rest of the config files. |
727 | ################################################################## | 742 | ################################################################## |