[OE-core] [PATCH 1/2] bitbake.conf: DISTRO_FEATURES as overrides

Peter Kjellerstedt peter.kjellerstedt at axis.com
Wed Jun 7 16:11:27 UTC 2017


> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org
> [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf Of
> Patrick Ohly
> Sent: den 7 juni 2017 17:32
> To: openembedded-core at lists.openembedded.org
> Subject: [OE-core] [PATCH 1/2] 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:
> 
>   DISTRO_FEATURES = " ... my-distro-feature ... "
> 
>   do_install_append_my-distro-feature () {
>        ...
>   }
> 
> Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
> ---
>  meta/conf/bitbake.conf | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 3ad905c..ca6501e 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -713,7 +713,7 @@ DISTRO_NAME ??= "OpenEmbedded"
>  #
>  # This works for  functions as well, they are really just environment
> variables.
>  # Default OVERRIDES to make compilation fail fast in case of build
> system misconfiguration.
> -OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-
> ${BUILD_OS}:pn-
> ${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevari
> able"
> +OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-
> ${BUILD_OS}:pn-
> ${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}${DISTROFEATURESOVERRIDES}:
> ${CLASSOVERRIDE}:forcevariable"
>  OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES"
>  CLASSOVERRIDE ?= "class-target"
>  DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}"
> @@ -722,6 +722,21 @@ MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
> 
>  FILESOVERRIDES =
> "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
> 
> +# Turns certain DISTRO_FEATURES into overrides of the same name
> +# or (optionally) some other name. Ensures that these special
> +# distro features remain set also for native and nativesdk
> +# recipes, so that these overrides can also be used there.
> +#
> +# Beware that this part of OVERRIDES changes during parsing, so usage
> +# of these overrides should be limited to .bb and .bbappend files,
> +# because then DISTRO_FEATURES is final.
> +DISTRO_FEATURES_OVERRIDES ??= ""
> +DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature>
> entries. \
> +Each entry is added to OVERRIDES with the <feature> name if <feature>
> is in DISTRO_FEATURES."
> +DISTRO_FEATURES_FILTER_NATIVE_append = " ${DISTRO_FEATURES_OVERRIDES}"
> +DISTRO_FEATURES_FILTER_NATIVESDK_append = "
> ${DISTRO_FEATURES_OVERRIDES}"
> +DISTROFEATURESOVERRIDES = "${@ ''.join([':' + x for x in
> (set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) &
> set((d.getVar('DISTRO_FEATURES') or '').split()))]) }"
> +
>  ##################################################################
>  # Include the rest of the config files.
>  ##################################################################
> --
> git-series 0.9.1

Rather than requiring that the wanted DISTRO_FEATURES that should be 
available as overrides are defined in DISTRO_FEATURES_OVERRIDES (which 
should not be confused with the similarly named DISTROFEATURESOVERRIDES 
variable that you also add...), why not add them all but with a prefix. 
I.e., similar to how package names are available as overrides prefixed 
with "pn-", how about all distro features are made available as 
overrides with a "df-" prefix?

//Peter




More information about the Openembedded-core mailing list