From 55d5b9a017f110c829585a57fa55763b15b9dd8d Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Thu, 4 May 2023 12:11:20 +0900 Subject: Add support integration type of multi partition Existing AGL IC container integration was not supporting multi partition integration. This patch enable multi partition integration using wic. Bug-AGL: SPEC-4777 Change-Id: I8c926410177642953b3888751b774e71e924a074 Signed-off-by: Naoto Yamaguchi --- .../agl-instrument-cluster-container-demo.bb | 32 ++++++++++++++++++++++ .../images/agl-lxc-install-single-image.inc | 19 ++----------- .../images/agl-lxc-multi-partition-image.inc | 20 ++++++++++++++ .../images/agl-lxc-multiconfig-build.inc | 16 +++++++++++ .../images/guest-image-cluster-demo.bb | 5 ++++ .../images/guest-image-ivi-demo.bb | 7 ++++- 6 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 meta-agl-ic-container/recipes-platform/images/agl-instrument-cluster-container-demo.bb create mode 100644 meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc create mode 100644 meta-agl-ic-container/recipes-platform/images/agl-lxc-multiconfig-build.inc (limited to 'meta-agl-ic-container/recipes-platform/images') diff --git a/meta-agl-ic-container/recipes-platform/images/agl-instrument-cluster-container-demo.bb b/meta-agl-ic-container/recipes-platform/images/agl-instrument-cluster-container-demo.bb new file mode 100644 index 00000000..bade2e3f --- /dev/null +++ b/meta-agl-ic-container/recipes-platform/images/agl-instrument-cluster-container-demo.bb @@ -0,0 +1,32 @@ +SUMMARY = "AGL Instrument Cluster Cotainer Integration demo image" +LICENSE = "MIT" + +require lxc-host-image-minimal.bb +require recipes-platform/images/agl-lxc-multi-partition-image.inc + +CONTAINER_IMAGES ?= "agl-container-cluster:guest-image-cluster-demo \ + agl-container-ivi:guest-image-ivi-demo \ + " + +IMAGE_INSTALL += " \ + kernel-modules \ + alsa-utils \ + packagegroup-pipewire \ + pipewire-ic-ipc \ + wireplumber-config-agl \ +" + +# packages required for network bridge settings via lxc-net +IMAGE_INSTALL += " \ + lxc-networking \ + iptables-modules \ + dnsmasq \ + systemd-netif-config \ + kernel-module-xt-addrtype \ + kernel-module-xt-multiport \ +" + +# network manager to use +VIRTUAL-RUNTIME_net_manager = "systemd" + +WKS_FILES:prepend = "agl-ic-container-noloader.wks " diff --git a/meta-agl-ic-container/recipes-platform/images/agl-lxc-install-single-image.inc b/meta-agl-ic-container/recipes-platform/images/agl-lxc-install-single-image.inc index de2ea5ca..49b7bc8e 100644 --- a/meta-agl-ic-container/recipes-platform/images/agl-lxc-install-single-image.inc +++ b/meta-agl-ic-container/recipes-platform/images/agl-lxc-install-single-image.inc @@ -1,15 +1,10 @@ # Integration type support for install guest root filesystem into host image. +require recipes-platform/images/agl-lxc-multiconfig-build.inc + # Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}" -python __anonymous() { - for c in (d.getVar('CONTAINER_IMAGES') or "").split(): - (mc, image) = c.split(':') - dependency = 'mc::' + mc + ':' + image + ':do_image_complete' - d.appendVarFlag('do_rootfs', 'mcdepends', ' ' + dependency) -} - install_container_images() { for c in ${CONTAINER_IMAGES}; do config=${c%:*} @@ -23,14 +18,4 @@ install_container_images() { done } -# -# Force rebuild of rootfs on every build to work around mcdepends issue -# -# NOTE: -# This is currently required as bitbake fails to trigger do_rootfs -# sometimes even when the guest image has in fact rebuilt. This is -# being investigated with upstream. -# -do_rootfs[nostamp] = "1" - ROOTFS_POSTPROCESS_COMMAND += "install_container_images; " diff --git a/meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc b/meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc new file mode 100644 index 00000000..bd85e70e --- /dev/null +++ b/meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc @@ -0,0 +1,20 @@ +# Integration type support for multi partition with host and guest image. + +require recipes-platform/images/agl-lxc-multiconfig-build.inc + +# Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support +MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}" + +install_container_images() { + for c in ${CONTAINER_IMAGES}; do + config=${c%:*} + image=${c#*:} + name=${image#guest-image-} + rm -f "${DEPLOY_DIR_IMAGE}/${image}.ext4" + src="${TOPDIR}/tmp-${config}/deploy/images/${MACHINE}/${image}-${MACHINE}${MACHINE_SUFFIX}.ext4" + bbnote "Installing ${src}" + ln -s ${src} "${DEPLOY_DIR_IMAGE}/${image}.ext4" + done +} + +ROOTFS_POSTPROCESS_COMMAND += "install_container_images; " diff --git a/meta-agl-ic-container/recipes-platform/images/agl-lxc-multiconfig-build.inc b/meta-agl-ic-container/recipes-platform/images/agl-lxc-multiconfig-build.inc new file mode 100644 index 00000000..73ec163f --- /dev/null +++ b/meta-agl-ic-container/recipes-platform/images/agl-lxc-multiconfig-build.inc @@ -0,0 +1,16 @@ +python __anonymous() { + for c in (d.getVar('CONTAINER_IMAGES') or "").split(): + (mc, image) = c.split(':') + dependency = 'mc::' + mc + ':' + image + ':do_image_complete' + d.appendVarFlag('do_rootfs', 'mcdepends', ' ' + dependency) +} + +# +# Force rebuild of rootfs on every build to work around mcdepends issue +# +# NOTE: +# This is currently required as bitbake fails to trigger do_rootfs +# sometimes even when the guest image has in fact rebuilt. This is +# being investigated with upstream. +# +do_rootfs[nostamp] = "1" diff --git a/meta-agl-ic-container/recipes-platform/images/guest-image-cluster-demo.bb b/meta-agl-ic-container/recipes-platform/images/guest-image-cluster-demo.bb index 1476d7ab..8cf15287 100644 --- a/meta-agl-ic-container/recipes-platform/images/guest-image-cluster-demo.bb +++ b/meta-agl-ic-container/recipes-platform/images/guest-image-cluster-demo.bb @@ -10,3 +10,8 @@ IMAGE_INSTALL += " \ cluster-refgui \ pipewire-ic-ipc \ " + +IMAGE_OVERHEAD_FACTOR = "0" +EXTRA_IMAGECMD:append = " -L agl-cluster" +IMAGE_ROOTFS_EXTRA_SPACE = "0" +IMAGE_ROOTFS_SIZE = "1048576" diff --git a/meta-agl-ic-container/recipes-platform/images/guest-image-ivi-demo.bb b/meta-agl-ic-container/recipes-platform/images/guest-image-ivi-demo.bb index 22a59114..fe5928b7 100644 --- a/meta-agl-ic-container/recipes-platform/images/guest-image-ivi-demo.bb +++ b/meta-agl-ic-container/recipes-platform/images/guest-image-ivi-demo.bb @@ -27,4 +27,9 @@ IMAGE_INSTALL += " \ wireplumber \ packagegroup-pipewire-base \ wireplumber-policy-config-agl \ -" \ No newline at end of file +" + +IMAGE_OVERHEAD_FACTOR = "0" +EXTRA_IMAGECMD:append = " -L agl-momi-ivi" +IMAGE_ROOTFS_EXTRA_SPACE = "0" +IMAGE_ROOTFS_SIZE = "1048576" -- cgit 1.2.3-korg