From 451321705864e1865b91722ee651b0a6b3b609bd Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Sat, 6 May 2023 12:18:41 +0900 Subject: Add support out of three image install to support agl demo ivi guests Existing AGL IC container integration build host and all guest using multi config. When we want to add support agl demo ivi guests, multiconfig based integration require to long build time by single build tree. This patch enable support out of tree image install to support. This method support prebuild ext4 image installation. This method realize to reduce build time for AGL IC developer. Bug-AGL: SPEC-4766 Change-Id: Id4ba092ce89c05bad3440e75845e6602bb0a50ab Signed-off-by: Naoto Yamaguchi --- .../agl-instrument-cluster-container-demo.bbappend | 6 ++-- .../agl-instrument-cluster-container-demo.bb | 2 -- .../images/agl-lxc-multi-partition-image.inc | 32 ++++++++++++++++++++++ .../wic/agl-ic-container-bootpart-uuid-demo.wks | 11 ++++++++ .../wic/agl-ic-container-noloader-demo.wks | 11 ++++++++ 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 meta-agl-ic-container/wic/agl-ic-container-bootpart-uuid-demo.wks create mode 100644 meta-agl-ic-container/wic/agl-ic-container-noloader-demo.wks diff --git a/meta-agl-ic-container/dynamic-layers/meta-raspberrypi/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend b/meta-agl-ic-container/dynamic-layers/meta-raspberrypi/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend index 68505c09..ef2f75d9 100644 --- a/meta-agl-ic-container/dynamic-layers/meta-raspberrypi/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend +++ b/meta-agl-ic-container/dynamic-layers/meta-raspberrypi/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend @@ -1,2 +1,4 @@ -WKS_FILES:remove = "agl-ic-container-noloader.wks" -WKS_FILES:prepend = "agl-ic-container-bootpart-uuid.wks " +WKS_FILES:remove = "agl-ic-container-noloader.wks agl-ic-container-noloader-demo.wks" +WKS_FILES:prepend = " \ + ${@bb.utils.contains('OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR', 'non', 'agl-ic-container-bootpart-uuid.wks ', 'agl-ic-container-bootpart-uuid-demo.wks ', d)} \ +" 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 index 41f2df96..b83fd5e7 100644 --- 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 @@ -31,5 +31,3 @@ IMAGE_INSTALL += " \ # 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-multi-partition-image.inc b/meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc index bd85e70e..6531e9b9 100644 --- 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 @@ -2,6 +2,21 @@ require recipes-platform/images/agl-lxc-multiconfig-build.inc +# Install out of tree build image support +OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR ??= "non" + +OUT_OF_TREE_CONTAINER_IMAGES ??= " \ + agl-ivi-demo-platform \ + agl-ivi-demo-platform-flutter \ + agl-ivi-demo-platform-html5 \ +" + +OUT_OF_TREE_CONTAINER_CONFIGS ??= " \ + cm-config-agl-qt-ivi-demo \ + cm-config-agl-flutter-ivi-demo \ + cm-config-agl-html5-ivi-demo \ +" + # Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}" @@ -15,6 +30,23 @@ install_container_images() { bbnote "Installing ${src}" ln -s ${src} "${DEPLOY_DIR_IMAGE}/${image}.ext4" done + + if ${@bb.utils.contains('OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR', 'non', 'false', 'true', d)}; then + for image in ${OUT_OF_TREE_CONTAINER_IMAGES}; do + rm -f "${DEPLOY_DIR_IMAGE}/${image}.ext4" + src="${OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR}/images/${MACHINE}/${image}-${MACHINE}${MACHINE_SUFFIX}.ext4" + bbnote "Installing ${src}" + ln -s ${src} "${DEPLOY_DIR_IMAGE}/${image}.ext4" + done + fi } ROOTFS_POSTPROCESS_COMMAND += "install_container_images; " + +IMAGE_INSTALL:append = " \ + ${@bb.utils.contains('OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR', 'non', '', '${OUT_OF_TREE_CONTAINER_CONFIGS}', d)} \ +" + +WKS_FILES:prepend = " \ + ${@bb.utils.contains('OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR', 'non', 'agl-ic-container-noloader.wks ', 'agl-ic-container-noloader-demo.wks ', d)} \ +" diff --git a/meta-agl-ic-container/wic/agl-ic-container-bootpart-uuid-demo.wks b/meta-agl-ic-container/wic/agl-ic-container-bootpart-uuid-demo.wks new file mode 100644 index 00000000..5a81288d --- /dev/null +++ b/meta-agl-ic-container/wic/agl-ic-container-bootpart-uuid-demo.wks @@ -0,0 +1,11 @@ +# short-description: Create SD card image with a boot partition +# long-description: Creates a partitioned SD card image. Boot files +# are located in the first vfat partition. + +part /boot --source bootimg-partition --fstype=vfat --label boot --use-uuid --active --align 4 --size 16 +part / --source rootfs --fstype=ext4 --label host --align 4096 --size 1024 +part --source rawcopy --sourceparams="file=guest-image-cluster-demo.ext4" +part --source rawcopy --sourceparams="file=guest-image-ivi-demo.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform-flutter.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform-html5.ext4" diff --git a/meta-agl-ic-container/wic/agl-ic-container-noloader-demo.wks b/meta-agl-ic-container/wic/agl-ic-container-noloader-demo.wks new file mode 100644 index 00000000..77d1e33d --- /dev/null +++ b/meta-agl-ic-container/wic/agl-ic-container-noloader-demo.wks @@ -0,0 +1,11 @@ +# short-description: Single partition rootfs with UUID and no bootloader +# long-description: Creates a partitioned image with a single partition in +# use and does not contain a bootloader. + +bootloader --ptable gpt +part / --source rootfs --fstype=ext4 --label host --align 4096 --size 1024 +part --source rawcopy --sourceparams="file=guest-image-cluster-demo.ext4" +part --source rawcopy --sourceparams="file=guest-image-ivi-demo.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform-flutter.ext4" +part --source rawcopy --sourceparams="file=agl-ivi-demo-platform-html5.ext4" -- cgit 1.2.3-korg