diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-04-05 02:09:58 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-04-05 02:09:58 +0000 |
| commit | 6ec07384e871727c87f3960389e713be78786725 (patch) | |
| tree | 0b86507e451f8be6e55107e5dabcfb6f6fd39c21 /conf | |
| parent | f829fbfda0f14365235d48dbe2055121fbc0718c (diff) | |
| download | meta-virtualization-6ec07384e871727c87f3960389e713be78786725.tar.gz | |
conf/distro: add build profile configuration fragments
Add includable configuration fragments that replace manual
DISTRO_FEATURES, CONTAINER_PROFILE, and related settings in
local.conf. Fragments are organized as a base + composable deltas:
- meta-virt-host.conf: base for all virtualization work
(virtualization, systemd, seccomp, vmsep, vcontainer, BBMULTICONFIG)
- container-host-{docker,podman,containerd,k3s,k3s-node}.conf:
container engine profiles setting CONTAINER_PROFILE and
profile-specific DISTRO_FEATURES
- xen-host.conf: Xen hypervisor support (xen, vxn distro features,
xen-image-minimal packages)
- meta-virt-dev.conf: QEMU development settings (IMAGE_FSTYPES,
QB_MEM, debug image features)
- container-registry.conf: local dev registry defaults
(insecure localhost:5000)
Profiles are pure deltas and do not auto-include the base to avoid
BitBake duplicate inclusion warnings. Users include meta-virt-host.conf
first, then add profile fragments. The BUILD_PROFILE variable enables
single-line profile switching.
Usage in local.conf:
require conf/distro/include/meta-virt-host.conf
BUILD_PROFILE ?= "podman"
require conf/distro/include/container-host-${BUILD_PROFILE}.conf
Tested with podman, docker, and xen builds.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'conf')
| -rw-r--r-- | conf/distro/include/container-host-containerd.conf | 14 | ||||
| -rw-r--r-- | conf/distro/include/container-host-docker.conf | 14 | ||||
| -rw-r--r-- | conf/distro/include/container-host-k3s-node.conf | 18 | ||||
| -rw-r--r-- | conf/distro/include/container-host-k3s.conf | 17 | ||||
| -rw-r--r-- | conf/distro/include/container-host-podman.conf | 17 | ||||
| -rw-r--r-- | conf/distro/include/container-registry.conf | 29 | ||||
| -rw-r--r-- | conf/distro/include/meta-virt-dev.conf | 28 | ||||
| -rw-r--r-- | conf/distro/include/meta-virt-host.conf | 20 | ||||
| -rw-r--r-- | conf/distro/include/xen-host.conf | 17 |
9 files changed, 174 insertions, 0 deletions
diff --git a/conf/distro/include/container-host-containerd.conf b/conf/distro/include/container-host-containerd.conf new file mode 100644 index 00000000..c4a68845 --- /dev/null +++ b/conf/distro/include/container-host-containerd.conf | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | # Container host configuration fragment: Containerd | ||
| 2 | # | ||
| 3 | # Include from local.conf to set up a containerd-based container host. | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/container-host-containerd.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake container-image-host | ||
| 10 | # | ||
| 11 | # Sets CONTAINER_PROFILE and the DISTRO_FEATURES required by | ||
| 12 | # container-image-host with the containerd engine stack. | ||
| 13 | |||
| 14 | CONTAINER_PROFILE = "containerd" | ||
diff --git a/conf/distro/include/container-host-docker.conf b/conf/distro/include/container-host-docker.conf new file mode 100644 index 00000000..5bf29359 --- /dev/null +++ b/conf/distro/include/container-host-docker.conf | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | # Container host configuration fragment: Docker | ||
| 2 | # | ||
| 3 | # Include from local.conf to set up a Docker-based container host. | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/container-host-docker.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake container-image-host | ||
| 10 | # | ||
| 11 | # Sets CONTAINER_PROFILE and the DISTRO_FEATURES required by | ||
| 12 | # container-image-host with the Docker engine stack. | ||
| 13 | |||
| 14 | CONTAINER_PROFILE = "docker" | ||
diff --git a/conf/distro/include/container-host-k3s-node.conf b/conf/distro/include/container-host-k3s-node.conf new file mode 100644 index 00000000..75580d71 --- /dev/null +++ b/conf/distro/include/container-host-k3s-node.conf | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | # Container host configuration fragment: K3s agent node | ||
| 2 | # | ||
| 3 | # Include from local.conf to set up a K3s agent (worker) node. | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/container-host-k3s-node.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake container-image-host | ||
| 10 | # | ||
| 11 | # Sets CONTAINER_PROFILE and the DISTRO_FEATURES required by | ||
| 12 | # container-image-host with K3s agent-only orchestration. The | ||
| 13 | # k3s-node profile bundles the k3s agent, embedded containerd, | ||
| 14 | # and CNI plugins. The node joins an existing k3s server cluster. | ||
| 15 | |||
| 16 | CONTAINER_PROFILE = "k3s-node" | ||
| 17 | |||
| 18 | DISTRO_FEATURES:append = " k3s" | ||
diff --git a/conf/distro/include/container-host-k3s.conf b/conf/distro/include/container-host-k3s.conf new file mode 100644 index 00000000..6e3733b1 --- /dev/null +++ b/conf/distro/include/container-host-k3s.conf | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Container host configuration fragment: K3s server | ||
| 2 | # | ||
| 3 | # Include from local.conf to set up a K3s server (control plane + agent). | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/container-host-k3s.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake container-image-host | ||
| 10 | # | ||
| 11 | # Sets CONTAINER_PROFILE and the DISTRO_FEATURES required by | ||
| 12 | # container-image-host with K3s orchestration. The k3s-host profile | ||
| 13 | # bundles the k3s server, embedded containerd, and CNI plugins. | ||
| 14 | |||
| 15 | CONTAINER_PROFILE = "k3s-host" | ||
| 16 | |||
| 17 | DISTRO_FEATURES:append = " k3s" | ||
diff --git a/conf/distro/include/container-host-podman.conf b/conf/distro/include/container-host-podman.conf new file mode 100644 index 00000000..7190e32b --- /dev/null +++ b/conf/distro/include/container-host-podman.conf | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Container host configuration fragment: Podman | ||
| 2 | # | ||
| 3 | # Include from local.conf to set up a Podman-based container host. | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/container-host-podman.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake container-image-host | ||
| 10 | # | ||
| 11 | # Sets CONTAINER_PROFILE and the DISTRO_FEATURES required by | ||
| 12 | # container-image-host with the Podman engine stack. | ||
| 13 | # Includes ipv6 which is required by the podman packagegroup. | ||
| 14 | |||
| 15 | CONTAINER_PROFILE = "podman" | ||
| 16 | |||
| 17 | DISTRO_FEATURES:append = " ipv6" | ||
diff --git a/conf/distro/include/container-registry.conf b/conf/distro/include/container-registry.conf new file mode 100644 index 00000000..357e7913 --- /dev/null +++ b/conf/distro/include/container-registry.conf | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Container registry configuration fragment | ||
| 2 | # | ||
| 3 | # Include from local.conf to enable a local development registry: | ||
| 4 | # | ||
| 5 | # require conf/distro/include/container-registry.conf | ||
| 6 | # | ||
| 7 | # Defaults to an insecure (HTTP) registry at localhost:5000 with | ||
| 8 | # namespace "yocto". Override any variable after the require line. | ||
| 9 | # | ||
| 10 | # This fragment enables the container-registry IMAGE_FEATURES, which | ||
| 11 | # installs registry configuration into the target rootfs (daemon.json | ||
| 12 | # for Docker, registries.conf.d/ for Podman/containerd). | ||
| 13 | # | ||
| 14 | # For a secure (TLS + authentication) registry, override these after | ||
| 15 | # the require: | ||
| 16 | # | ||
| 17 | # CONTAINER_REGISTRY_URL = "registry.example.com:5000" | ||
| 18 | # CONTAINER_REGISTRY_SECURE = "1" | ||
| 19 | # CONTAINER_REGISTRY_USERNAME = "myuser" | ||
| 20 | # # Optional: enable htpasswd authentication | ||
| 21 | # CONTAINER_REGISTRY_AUTH = "1" | ||
| 22 | # # Optional: custom namespace | ||
| 23 | # CONTAINER_REGISTRY_NAMESPACE = "myproject" | ||
| 24 | |||
| 25 | CONTAINER_REGISTRY_URL ?= "localhost:5000" | ||
| 26 | CONTAINER_REGISTRY_NAMESPACE ?= "yocto" | ||
| 27 | CONTAINER_REGISTRY_INSECURE ?= "1" | ||
| 28 | |||
| 29 | IMAGE_FEATURES:append = " container-registry" | ||
diff --git a/conf/distro/include/meta-virt-dev.conf b/conf/distro/include/meta-virt-dev.conf new file mode 100644 index 00000000..06dcbb95 --- /dev/null +++ b/conf/distro/include/meta-virt-dev.conf | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | # QEMU development and testing settings | ||
| 2 | # | ||
| 3 | # Include from local.conf when developing and testing with runqemu: | ||
| 4 | # | ||
| 5 | # require conf/distro/include/meta-virt-dev.conf | ||
| 6 | # | ||
| 7 | # This is separate from the build profiles (container-host-*, xen-host-*) | ||
| 8 | # and provides settings that only matter for QEMU-based development: | ||
| 9 | # image format, memory, debug features, etc. | ||
| 10 | # | ||
| 11 | # Typical local.conf for QEMU-based k3s development: | ||
| 12 | # | ||
| 13 | # require conf/distro/include/meta-virt-host.conf | ||
| 14 | # BUILD_PROFILE ?= "k3s" | ||
| 15 | # require conf/distro/include/container-host-${BUILD_PROFILE}.conf | ||
| 16 | # require conf/distro/include/meta-virt-dev.conf | ||
| 17 | # MACHINE = "qemux86-64" | ||
| 18 | |||
| 19 | # Use raw ext4 for runqemu boot/test cycles. | ||
| 20 | # Snapshot formats (qcow2) don't work well with repeated boots. | ||
| 21 | IMAGE_FSTYPES = "ext4" | ||
| 22 | |||
| 23 | # Xen QEMU settings: Dom0 memory cap and total VM memory | ||
| 24 | QB_XEN_CMDLINE_EXTRA ?= "dom0_mem=512M" | ||
| 25 | QB_MEM ?= "-m 1024" | ||
| 26 | |||
| 27 | # Debug-friendly image features | ||
| 28 | EXTRA_IMAGE_FEATURES ?= "allow-empty-password empty-root-password allow-root-login post-install-logging" | ||
diff --git a/conf/distro/include/meta-virt-host.conf b/conf/distro/include/meta-virt-host.conf new file mode 100644 index 00000000..99d5271e --- /dev/null +++ b/conf/distro/include/meta-virt-host.conf | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | # Base virtualization host configuration fragment | ||
| 2 | # | ||
| 3 | # Common DISTRO_FEATURES for any virtualization work: containers, Xen, | ||
| 4 | # k3s, or custom/mixed configurations. | ||
| 5 | # | ||
| 6 | # Use standalone for custom builds: | ||
| 7 | # | ||
| 8 | # require conf/distro/include/meta-virt-host.conf | ||
| 9 | # MACHINE = "qemux86-64" | ||
| 10 | # | ||
| 11 | # Or let a specific profile (container-host-*, xen-host-*) inherit it. | ||
| 12 | |||
| 13 | DISTRO_FEATURES:append = " virtualization systemd seccomp vmsep vcontainer" | ||
| 14 | |||
| 15 | # Container runtime provider — the unified runc recipe provides both | ||
| 16 | # runc-docker and runc-opencontainers via RPROVIDES | ||
| 17 | PREFERRED_PROVIDER_virtual/runc ?= "runc" | ||
| 18 | |||
| 19 | # Multiconfig for cross-arch vruntime builds (vdkr/vpdmn blobs) | ||
| 20 | BBMULTICONFIG ?= "vruntime-aarch64 vruntime-x86-64" | ||
diff --git a/conf/distro/include/xen-host.conf b/conf/distro/include/xen-host.conf new file mode 100644 index 00000000..0d21cc63 --- /dev/null +++ b/conf/distro/include/xen-host.conf | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Xen host configuration fragment | ||
| 2 | # | ||
| 3 | # Include from local.conf for Xen Dom0 development and testing. | ||
| 4 | # Requires meta-virt-host.conf to be included first: | ||
| 5 | # | ||
| 6 | # require conf/distro/include/meta-virt-host.conf | ||
| 7 | # require conf/distro/include/xen-host.conf | ||
| 8 | # MACHINE = "qemux86-64" | ||
| 9 | # bitbake xen-image-minimal | ||
| 10 | # | ||
| 11 | # Enables Xen hypervisor support, vxn (Docker CLI for Xen), and containerd | ||
| 12 | # for the OCI runtime path. | ||
| 13 | |||
| 14 | DISTRO_FEATURES:append = " xen vxn" | ||
| 15 | |||
| 16 | # Xen Dom0 image packages: vxn, containerd | ||
| 17 | IMAGE_INSTALL:append:pn-xen-image-minimal = " vxn containerd-opencontainers" | ||
