Add support integration type of multi partition 86/28786/8
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Thu, 4 May 2023 03:11:20 +0000 (12:11 +0900)
committerNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Mon, 8 May 2023 23:13:10 +0000 (08:13 +0900)
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 <naoto.yamaguchi@aisin.co.jp>
meta-agl-ic-container/conf/multiconfig/agl-container-cluster.conf
meta-agl-ic-container/conf/multiconfig/agl-container-ivi.conf
meta-agl-ic-container/dynamic-layers/meta-rcar-gen3/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend [new file with mode: 0644]
meta-agl-ic-container/recipes-platform/images/agl-instrument-cluster-container-demo.bb [new file with mode: 0644]
meta-agl-ic-container/recipes-platform/images/agl-lxc-install-single-image.inc
meta-agl-ic-container/recipes-platform/images/agl-lxc-multi-partition-image.inc [new file with mode: 0644]
meta-agl-ic-container/recipes-platform/images/agl-lxc-multiconfig-build.inc [new file with mode: 0644]
meta-agl-ic-container/recipes-platform/images/guest-image-cluster-demo.bb
meta-agl-ic-container/recipes-platform/images/guest-image-ivi-demo.bb
meta-agl-ic-container/wic/agl-ic-container-noloader.wks [new file with mode: 0644]

index 29272c7..ab0078a 100644 (file)
@@ -10,7 +10,7 @@ TMPDIR = "${TOPDIR}/tmp-${BB_CURRENT_MC}"
 AGL_DEFAULT_IMAGE_FSTYPES = ""
 AGL_EXTRA_IMAGE_FSTYPES = ""
 
-IMAGE_FSTYPES:aglcontainerguest = "container"
+IMAGE_FSTYPES:aglcontainerguest = "container ext4"
 
 IMAGE_LINGUAS:append:aglcontainercluster = " en-us"
 
index 4553e7a..e969011 100644 (file)
@@ -10,7 +10,7 @@ TMPDIR = "${TOPDIR}/tmp-${BB_CURRENT_MC}"
 AGL_DEFAULT_IMAGE_FSTYPES:aglcontainerivi = ""
 AGL_EXTRA_IMAGE_FSTYPES:aglcontainerivi = ""
 
-IMAGE_FSTYPES:aglcontainerguest = "container"
+IMAGE_FSTYPES:aglcontainerguest = "container ext4"
 
 IMAGE_LINGUAS:append:aglcontainerivi = " en-us"
 
diff --git a/meta-agl-ic-container/dynamic-layers/meta-rcar-gen3/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend b/meta-agl-ic-container/dynamic-layers/meta-rcar-gen3/recipes-platform/images/agl-instrument-cluster-container-demo.bbappend
new file mode 100644 (file)
index 0000000..b037b19
--- /dev/null
@@ -0,0 +1 @@
+IMAGE_INSTALL:append:rcar-gen3 = " kernel-module-gles "
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 (file)
index 0000000..bade2e3
--- /dev/null
@@ -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 "
index de2ea5c..49b7bc8 100644 (file)
@@ -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 (file)
index 0000000..bd85e70
--- /dev/null
@@ -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 (file)
index 0000000..73ec163
--- /dev/null
@@ -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"
index 1476d7a..8cf1528 100644 (file)
@@ -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"
index 22a5911..fe5928b 100644 (file)
@@ -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"
diff --git a/meta-agl-ic-container/wic/agl-ic-container-noloader.wks b/meta-agl-ic-container/wic/agl-ic-container-noloader.wks
new file mode 100644 (file)
index 0000000..4af949a
--- /dev/null
@@ -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 --fstype=ext4 --label agl-qt-ivi --align 4096  --size 3072
+part --fstype=ext4 --label agl-flutter-ivi --align 4096  --size 3072
+part --fstype=ext4 --label agl-html5-ivi --align 4096  --size 3072