summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-06-15 14:12:26 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-06-15 14:12:26 +0000
commitc595d3c9b714a1d15fe8e5dc1038f9372d68dbdb (patch)
treed4d0847734d9609548c841f4d0938e64335ec7fe
parent3d242c4c38a2b7d056b3c4e2af1c43b0d02d02ec (diff)
downloadmeta-virtualization-c595d3c9b714a1d15fe8e5dc1038f9372d68dbdb.tar.gz
lxc: pull in networking and templates via RRECOMMENDS
The lxc recipe ships three sub-packages: ${PN}, ${PN}-networking, and ${PN}-templates. ${PN} contains the lxc-* command-line binaries. ${PN}-networking owns lxc-net.service, /etc/default/lxc-net, the dnsmasq drop-in for the lxcbr0 bridge, and the firewall plumbing. ${PN}-templates owns /usr/share/lxc/templates, the per-distro container-creation scripts that lxc-create invokes via --template. Installing only the main ${PN} package leaves a non-functional LXC. There's no lxcbr0 bridge, so any container whose config references it (every download-template default config does) fails to start with network.c: netdev_configure_server_veth: Failed to attach "vethXXX" to bridge "lxcbr0", bridge interface doesn't exist and there are no template scripts, so lxc-create --template <foo> has nothing to invoke. The user-facing toolchain is effectively broken unless the integrator knows to add the sub-packages by hand. Pull both sub-packages in through RRECOMMENDS so any image that installs lxc gets a functional LXC by default, regardless of whether the install path is packagegroup-lxc, IMAGE_INSTALL:append, or CORE_IMAGE_EXTRA_INSTALL. Integrators who don't want them (custom networking, hand-written templates) can drop either or both through BAD_RECOMMENDATIONS. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/lxc/lxc_git.bb11
1 files changed, 11 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_git.bb b/recipes-containers/lxc/lxc_git.bb
index ec26f2c8..d6544073 100644
--- a/recipes-containers/lxc/lxc_git.bb
+++ b/recipes-containers/lxc/lxc_git.bb
@@ -32,6 +32,17 @@ RDEPENDS:${PN} = " \
32 32
33RDEPENDS:${PN}:append:libc-glibc = " glibc-utils" 33RDEPENDS:${PN}:append:libc-glibc = " glibc-utils"
34 34
35# Soft-pull the layer's own sub-packages so a default `lxc` install lands a
36# functional LXC. Without networking, lxc-net.service is missing and lxcbr0
37# never comes up, so any container whose config references lxcbr0 (the
38# download template's default) fails to start with:
39# network.c: netdev_configure_server_veth: Failed to attach "vethXXX" to
40# bridge "lxcbr0", bridge interface doesn't exist
41# Without templates, lxc-create --template <foo> has no template scripts
42# to invoke. Users who genuinely don't want either can drop them with
43# BAD_RECOMMENDATIONS.
44RRECOMMENDS:${PN} += "${PN}-networking ${PN}-templates"
45
35RDEPENDS:${PN}-ptest += "file make gmp nettle gnutls bash libgcc" 46RDEPENDS:${PN}-ptest += "file make gmp nettle gnutls bash libgcc"
36 47
37RDEPENDS:${PN}-networking += "iptables" 48RDEPENDS:${PN}-networking += "iptables"