1 SUMMARY = "A minimal container host image"
3 require recipes-platform/images/agl-image-boot.inc
8 ${LXC_CONTAINER_CONFIGS} \
12 CONTAINER_IMAGES ??= ""
14 LXC_CONTAINER_CONFIGS ?= ""
18 NO_RECOMMENDATIONS = "1"
20 # Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support
21 MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}"
23 python __anonymous() {
24 for c in (d.getVar('CONTAINER_IMAGES') or "").split():
25 (mc, image) = c.split(':')
26 dependency = 'mc::' + mc + ':' + image + ':do_image_complete'
27 d.appendVarFlag('do_rootfs', 'mcdepends', ' ' + dependency)
29 # Assume there is a X-lxc-config package for guest-image-X
31 if config.startswith('guest-image-'):
32 config = config[len('guest-image-'):]
33 d.appendVar('LXC_CONTAINER_CONFIGS', ' ' + 'lxc-config-' + config)
36 install_container_images() {
37 for c in ${CONTAINER_IMAGES}; do
40 name=${image#guest-image-}
41 rm -rf ${IMAGE_ROOTFS}/var/lib/machines/${name}
42 install -m 0755 -d ${IMAGE_ROOTFS}/var/lib/machines/${name}
43 src="${TOPDIR}/tmp-${config}/deploy/images/${MACHINE}/${image}-${MACHINE}${MACHINE_SUFFIX}.tar.bz2"
44 bbnote "Installing ${src}"
45 tar -C ${IMAGE_ROOTFS}/var/lib/machines/${name} -xf ${src}
50 # Force rebuild of rootfs on every build to work around mcdepends issue
53 # This is currently required as bitbake fails to trigger do_rootfs
54 # sometimes even when the guest image has in fact rebuilt. This is
55 # being investigated with upstream.
57 do_rootfs[nostamp] = "1"
59 ROOTFS_POSTPROCESS_COMMAND += "install_container_images; "
61 IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"