diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-11 23:34:27 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-11 23:34:27 +0000 |
| commit | 947678262ae85f214a306ff41d7352485c8d5a03 (patch) | |
| tree | 06e7e0a29528f3d73a901456252efc559ebebc4e | |
| parent | 09a89703b9fb4ce19bd4baabc57bec33c6a8d4a7 (diff) | |
| download | meta-virtualization-947678262ae85f214a306ff41d7352485c8d5a03.tar.gz | |
container-registry: make IMAGE_FEATURES conditional on distro features
Move the container-registry IMAGE_FEATURES[validitems] registration
from layer.conf into meta-virt-container-cfg.bbclass where it can be
gated on DISTRO_FEATURES. The validitems varflag is now only registered
when vcontainer or virtualization is in DISTRO_FEATURES.
layer.conf is parsed before distro features are known, so inline
Python cannot be used there. The bbclass is loaded via USER_CLASSES
(deferred parsing) and already handles container profile configuration.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | classes/meta-virt-container-cfg.bbclass | 3 | ||||
| -rw-r--r-- | conf/layer.conf | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/classes/meta-virt-container-cfg.bbclass b/classes/meta-virt-container-cfg.bbclass index 9a4b144e..f797a6aa 100644 --- a/classes/meta-virt-container-cfg.bbclass +++ b/classes/meta-virt-container-cfg.bbclass | |||
| @@ -8,3 +8,6 @@ | |||
| 8 | # match the other configs of the layer and in case the above statement isn't | 8 | # match the other configs of the layer and in case the above statement isn't |
| 9 | # always true in the future. | 9 | # always true in the future. |
| 10 | include ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${META_VIRT_CONTAINER_CONFIG_PATH}', '${META_VIRT_CONTAINER_CONFIG_PATH}', d)} | 10 | include ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${META_VIRT_CONTAINER_CONFIG_PATH}', '${META_VIRT_CONTAINER_CONFIG_PATH}', d)} |
| 11 | |||
| 12 | # Register custom IMAGE_FEATURES only when container features are enabled | ||
| 13 | IMAGE_FEATURES[validitems] += "${@bb.utils.contains_any('DISTRO_FEATURES', 'vcontainer virtualization', 'container-registry', '', d)}" | ||
diff --git a/conf/layer.conf b/conf/layer.conf index 6eadc87f..cbf95e6a 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
| @@ -50,12 +50,6 @@ CONTAINER_PROFILE ?= "default" | |||
| 50 | # virt profile can be: kvm, xen, runx | 50 | # virt profile can be: kvm, xen, runx |
| 51 | VIRTUALIZATION_PROFILE ?= "default" | 51 | VIRTUALIZATION_PROFILE ?= "default" |
| 52 | 52 | ||
| 53 | # Custom IMAGE_FEATURES for container images | ||
| 54 | # container-registry: Install registry config based on container engine | ||
| 55 | # Requires: CONTAINER_REGISTRY_URL (for OCI) or DOCKER_REGISTRY_INSECURE (for Docker) | ||
| 56 | # Usage: IMAGE_FEATURES:append = " container-registry" | ||
| 57 | IMAGE_FEATURES[validitems] += "container-registry" | ||
| 58 | |||
| 59 | # Sanity check for meta-virtualization layer. | 53 | # Sanity check for meta-virtualization layer. |
| 60 | # Setting SKIP_META_VIRT_SANITY_CHECK to "1" would skip the bbappend files check. | 54 | # Setting SKIP_META_VIRT_SANITY_CHECK to "1" would skip the bbappend files check. |
| 61 | INHERIT += "sanity-meta-virt" | 55 | INHERIT += "sanity-meta-virt" |
