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 # Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support
19 MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}"
21 python __anonymous() {
22 for c in (d.getVar('CONTAINER_IMAGES') or "").split():
23 (mc, image) = c.split(':')
24 dependency = 'mc::' + mc + ':' + image + ':do_image_complete'
25 d.setVarFlag('do_rootfs', 'mcdepends', dependency)
27 # Assume there is a X-lxc-config package for guest-image-X
29 if config.startswith('guest-image-'):
30 config = config[len('guest-image-'):]
31 d.appendVar('LXC_CONTAINER_CONFIGS', 'lxc-config-' + config)
34 install_container_images() {
35 for c in ${CONTAINER_IMAGES}; do
38 name=${image#guest-image-}
39 rm -rf ${IMAGE_ROOTFS}/var/lib/machines/${name}
40 install -m 0755 -d ${IMAGE_ROOTFS}/var/lib/machines/${name}
41 src="${TOPDIR}/tmp-${config}/deploy/images/${MACHINE}/${image}-${MACHINE}${MACHINE_SUFFIX}.tar.bz2"
42 bbnote "Installing ${src}"
43 tar -C ${IMAGE_ROOTFS}/var/lib/machines/${name} -xf ${src}
48 # Force rebuild of rootfs on every build to work around mcdepends issue
51 # This is currently required as bitbake fails to trigger do_rootfs
52 # sometimes even when the guest image has in fact rebuilt. This is
53 # being investigated with upstream.
55 do_rootfs[nostamp] = "1"
57 ROOTFS_POSTPROCESS_COMMAND += "install_container_images; "
59 IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"