1 SUMMARY = "A minimal container host image"
3 require recipes-platform/images/agl-image-boot.inc
7 ${LXC_CONTAINER_CONFIGS} \
10 CONTAINER_IMAGES ??= ""
12 LXC_CONTAINER_CONFIGS ?= ""
16 NO_RECOMMENDATIONS = "1"
18 python __anonymous() {
19 for c in (d.getVar('CONTAINER_IMAGES') or "").split():
20 (mc, image) = c.split(':')
21 dependency = 'mc::' + mc + ':' + image + ':do_image_complete'
22 d.setVarFlag('do_rootfs', 'mcdepends', dependency)
24 # Assume there is a X-lxc-config package for guest-image-X
26 if config.startswith('guest-image-'):
27 config = config[len('guest-image-'):]
28 d.appendVar('LXC_CONTAINER_CONFIGS', 'lxc-config-' + config)
31 install_container_images() {
32 for c in ${CONTAINER_IMAGES}; do
35 name=${image#guest-image-}
36 rm -rf ${IMAGE_ROOTFS}/var/lib/machines/${name}
37 install -m 0755 -d ${IMAGE_ROOTFS}/var/lib/machines/${name}
38 src="${TOPDIR}/tmp-${config}/deploy/images/${MACHINE}/${image}-${MACHINE}.tar.bz2"
39 bbnote "Installing ${src}"
40 tar -C ${IMAGE_ROOTFS}/var/lib/machines/${name} -xf ${src}
45 # Force rebuild of rootfs on every build to work around mcdepends issue
48 # This is currently required as bitbake fails to trigger do_rootfs
49 # sometimes even when the guest image has in fact rebuilt. This is
50 # being investigated with upstream.
52 do_rootfs[nostamp] = "1"
54 ROOTFS_POSTPROCESS_COMMAND += "install_container_images; "
56 IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"