meta-agl-kvm-demo: update for YP scarthgap and clean up 02/30102/2
authorScott Murray <scott.murray@konsulko.com>
Mon, 8 Jul 2024 17:09:57 +0000 (13:09 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 9 Jul 2024 09:35:44 +0000 (09:35 +0000)
Note that while these changes do get the KVM demo images building
and bootable, some further investigation is required into getting
the guest displays rendering to the outputs.

Changes:
- Move some of the feature template and multiconfig files that were
  accidentally left in meta-agl-demo to meta-agl-kvm-demo.
- Rework how MACHINE is defined for the guest multiconfig to make it
  a bit more obvious how other machines could be supported.  Sadly,
  experimentaion has shown that trying to do a generic
  virtio-${TUNE_ARCH} or similar scheme does not work with BitBake's
  parser, so document that a bit.
- Update agl-qemu-runner.sh for change to IMAGE_NAME_SUFFIX default
  value, and qemu now warning about using "-vga" with the "virt"
  machine which does not support it.
- Add new "agl-virtio-guest" feature to AGL_FEATURES in guest to get
  virtio kernel configuration.

Bug-AGL: SPEC-5201

Change-Id: I194a5c49adf6242cd91d205e19a8eecde698ad7e
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/30102
Tested-by: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
ci-image-build: Jenkins Job builder account

conf/include/agl-kvm.inc [deleted file]
meta-agl-kvm-demo/conf/include/agl-kvm.inc [new file with mode: 0644]
meta-agl-kvm-demo/conf/include/mc-conf-agl-kvm-guest.inc [moved from conf/include/mc-conf-agl-kvm-guest.inc with 100% similarity]
meta-agl-kvm-demo/conf/include/mc-conf-default.inc [moved from conf/include/mc-conf-default.inc with 100% similarity]
meta-agl-kvm-demo/conf/multiconfig/agl-kvm-guest.conf [moved from conf/multiconfig/agl-kvm-guest.conf with 81% similarity]
meta-agl-kvm-demo/recipes-extended/agl-qemu-runner/files/agl-qemu-runner.sh
meta-agl-kvm-demo/recipes-platform/images/agl-kvm-demo.bb
templates/feature/agl-kvm/50_local.conf.inc

diff --git a/conf/include/agl-kvm.inc b/conf/include/agl-kvm.inc
deleted file mode 100644 (file)
index fadb345..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-DISTRO_FEATURES:append = " virtualization"
-
-BBMULTICONFIG = "agl-kvm-guest"
-
-AGL_FEATURES:append = " agl-kvm"
-
-# Override remote display network configuration to use KVM demo's
-# network configuration
-REMOTING_OUTPUT_HOST = "172.16.10.3"
-
-# Override cluster dashboard VIS server host for KVM demo's network
-# configuration
-CLUSTER_DEMO_VSS_HOSTNAME = "172.16.10.1"
-
-include mc-conf-${BB_CURRENT_MC}.inc
diff --git a/meta-agl-kvm-demo/conf/include/agl-kvm.inc b/meta-agl-kvm-demo/conf/include/agl-kvm.inc
new file mode 100644 (file)
index 0000000..894a457
--- /dev/null
@@ -0,0 +1,34 @@
+DISTRO_FEATURES:append = " virtualization"
+
+#
+# Attempt to make guest machine derived from host machine, as opposed to
+# hard-coding it in the multiconfig conf file.  Unfortunately, using any
+# of the expanded overrides or e.g. TUNE_ARCH from the host MACHINE seems
+# not feasible here with respect to BitBake conf file parse ordering, so
+# a generic mapping to e.g. virtio-${TUNE_ARCH} is sadly not currently
+# workable.
+#
+
+# Define a default, for now use one that will cause an immediate error.
+AGL_GUEST_MACHINE = "INVALID"
+
+# Set for demo target machine
+AGL_GUEST_MACHINE:h3ulcb = "virtio-aarch64"
+
+# Force variable value to be live before multiconfigs are parsed to make
+# BitBake parser happy
+AGL_GUEST_MACHINE := "${AGL_GUEST_MACHINE}"
+
+BBMULTICONFIG = "agl-kvm-guest"
+
+AGL_FEATURES:append = " agl-kvm"
+
+# Override remote display network configuration to use KVM demo's
+# network configuration
+REMOTING_OUTPUT_HOST = "172.16.10.3"
+
+# Override cluster dashboard VIS server host for KVM demo's network
+# configuration
+CLUSTER_DEMO_VSS_HOSTNAME = "172.16.10.1"
+
+include mc-conf-${BB_CURRENT_MC}.inc
similarity index 81%
rename from conf/multiconfig/agl-kvm-guest.conf
rename to meta-agl-kvm-demo/conf/multiconfig/agl-kvm-guest.conf
index 478bc5f..b17740c 100644 (file)
@@ -1,6 +1,6 @@
 TMPDIR = "${TOPDIR}/tmp-${BB_CURRENT_MC}"
 
-MACHINE = "virtio-aarch64"
+MACHINE = "${AGL_GUEST_MACHINE}"
 
 # Avoid parse errors caused by linux-renesas, and all the other
 # random bbappends in meta-rcar-gen3.
@@ -8,6 +8,8 @@ BBMASK += "meta-rcar-gen3/ meta-rcar-gen3-adas/ meta-agl-refhw-gen3/"
 
 DISTRO_FEATURES:append = " kvm virtualization"
 
+AGL_FEATURES:append = " agl-virtio-guest"
+
 # Use our own wks file
 WKS_FILE = "directdisk.wks.in"
 
@@ -15,8 +17,7 @@ WKS_FILE = "directdisk.wks.in"
 AGL_DEFAULT_IMAGE_FSTYPES = "ext4"
 AGL_EXTRA_IMAGE_FSTYPES = ""
 
-# Need to run QEMU with virtio-gpu device
-#PACKAGECONFIG:append:pn-qemu-system-native = " virglrenderer glx gtk+"
+# Need to run QEMU with virtio-gpu device, and we do not need gtk support
 PACKAGECONFIG:append:pn-qemu-system-target = " virglrenderer glx"
 
 # Until aglsetup.sh potentially changes to split features per multiconfig,
index f0136b6..dd82053 100755 (executable)
@@ -20,7 +20,7 @@ if [ -z "$QEMU_IMAGE_ARCH" ]; then
     QEMU_IMAGE_ARCH="virtio-${arch}"
 fi
 
-disk="/var/lib/machines/${image}/${image}-${QEMU_IMAGE_ARCH}.ext4"
+disk="/var/lib/machines/${image}/${image}-${QEMU_IMAGE_ARCH}.rootfs.ext4"
 if [ ! -f "$disk" ]; then
     echo "No disk image for $image"
     exit 1
@@ -65,7 +65,7 @@ qemu-system-${arch} \
        ${QEMU_INPUT_OPT} \
        -global virtio-mmio.force-legacy=false \
        -device virtio-gpu-gl-device \
-       -display sdl,gl=on -vga std \
+       -display sdl,gl=on \
        ${QEMU_AUDIO_OPT} \
        ${QEMU_CAN_OPT} \
        ${QEMU_EXTRA_OPT} \
index 33f2b92..b9ae413 100644 (file)
@@ -30,7 +30,7 @@ IMAGE_INSTALL += " \
 #IMAGE_LINGUAS = " "
 #NO_RECOMMENDATIONS = "1"
 
-GUEST_MACHINE ?= "virtio-${TUNE_ARCH}"
+GUEST_MACHINE ?= "${AGL_GUEST_MACHINE}"
 
 GUEST_VM1_IMAGE ?= "agl-ivi-demo-flutter-guest"
 GUEST_VM2_IMAGE ?= "agl-cluster-demo-flutter-guest"
@@ -56,7 +56,7 @@ install_guest_images() {
         name=${image}
         rm -rf  ${IMAGE_ROOTFS}/var/lib/machines/${name}
         install -m 0755 -d ${IMAGE_ROOTFS}/var/lib/machines/${name}
-        src="${TOPDIR}/tmp-${config}/deploy/images/${GUEST_MACHINE}/${image}-${GUEST_MACHINE}.ext4"
+        src="${TOPDIR}/tmp-${config}/deploy/images/${GUEST_MACHINE}/${image}-${GUEST_MACHINE}${IMAGE_NAME_SUFFIX}.ext4"
         bbnote "Installing ${src}"
         install -m 0600 ${src} ${IMAGE_ROOTFS}/var/lib/machines/${name}/
        # Placeholder until booting from kernel in VM image is worked out
index 2798116..64bbdbd 100644 (file)
@@ -1,2 +1,2 @@
-#see meta-agl-demo/conf/include/agl-kvm.inc
-require conf/include/agl-kvm.inc
+# see meta-agl-demo/meta-agl-kvm-demo/conf/include/agl-kvm.inc
+require meta-agl-kvm-demo/conf/include/agl-kvm.inc