diff options
author | Scott Murray <scott.murray@konsulko.com> | 2023-01-18 20:47:11 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2023-01-19 15:34:12 -0500 |
commit | 94ee287730b16820003aece648e790923a9a5b79 (patch) | |
tree | 0e096c5f23cb8320a95a28e5617845c1d6e4e5fa | |
parent | 5109016c566a4a46e4a85f2c7b9dfcd6b8540233 (diff) |
Run agl-compositor in system scope for QEMU+KVM demo image
To allow usefully depending on the native-shell-client "homescreen"
application from the systemd units running QEMU, tweak things to
drop the use of agl-session from the agl-kvm-demo-platform host
image. The motivation for this is to have the VM guest start up
ordering work as expected, avoiding unnecessary delays from race
failures on boot.
Changes:
- Rework agl-kvm template to use conf/include/agl-kvm.inc include
file to match other featurs and simplify development.
- Add include files for the host ("default" in BitBake) and guest
(so agl-kvm-guest) multiconfigs to allow disabling the agl-demo
feature in the host build, which disables agl-session.
- Update native-shell-client systemd unit to run at system scope
and depend upon agl-compositor directly.
- Update agl-qemu-runner systemd template unit to depend directly
on native-shell-client.
Note that a consequence of these changes is that building images
other than agl-kvm-demo-platform when the "agl-kvm" feature is used
will likely not yield the desired results. Future work will
investigate avoiding this problem, or forcing explicit compatibility
errors to avoid user confusion.
Bug-AGL: SPEC-4618
Change-Id: I7f2f2ad9a453b5d99bed4cfc33d99eb3002bcceb
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
9 files changed, 38 insertions, 15 deletions
diff --git a/conf/include/agl-kvm.inc b/conf/include/agl-kvm.inc new file mode 100644 index 000000000..12d8ae191 --- /dev/null +++ b/conf/include/agl-kvm.inc @@ -0,0 +1,15 @@ +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 +TRANSMITTER_OUTPUT_HOST = "172.16.10.3" + +# Override cluster dashboard VIS server host for KVM demo's network +# configuration +CLUSTER_DEMO_VISS_HOSTNAME = "172.16.10.2" + +include mc-conf-${BB_CURRENT_MC}.inc diff --git a/conf/include/mc-conf-agl-kvm-guest.inc b/conf/include/mc-conf-agl-kvm-guest.inc new file mode 100644 index 000000000..6777b2c68 --- /dev/null +++ b/conf/include/mc-conf-agl-kvm-guest.inc @@ -0,0 +1,3 @@ +# Override the default virtio-can configuration, as we do not have +# a backend to be able to use it. +CANBUS_NETWORK_CONFIG:virtio-all = "canbus-can.network" diff --git a/conf/include/mc-conf-default.inc b/conf/include/mc-conf-default.inc new file mode 100644 index 000000000..c60c999b3 --- /dev/null +++ b/conf/include/mc-conf-default.inc @@ -0,0 +1,3 @@ +# We don't want the app framework bits (specifically the user session) in +# the KVM host image. +AGL_FEATURES:remove = "agl-app-fw" diff --git a/recipes-demo/native-shell-client/files/native-shell-client.service b/recipes-demo/native-shell-client/files/native-shell-client.service index 4d77513a9..d7a2fe684 100644 --- a/recipes-demo/native-shell-client/files/native-shell-client.service +++ b/recipes-demo/native-shell-client/files/native-shell-client.service @@ -1,11 +1,12 @@ [Unit] -Requires=agl-compositor.service -After=agl-compositor.service +Requires=weston.service +After=weston.service [Service] Type=simple +Environment=XDG_RUNTIME_DIR=/run/user/200 ExecStart=/usr/bin/native-shell-client Restart=on-failure [Install] -WantedBy=agl-session.target +WantedBy=multi-user.target diff --git a/recipes-demo/native-shell-client/native-shell-client_agldemo.inc b/recipes-demo/native-shell-client/native-shell-client_agldemo.inc index 5e2538ee3..4c1dc1012 100644 --- a/recipes-demo/native-shell-client/native-shell-client_agldemo.inc +++ b/recipes-demo/native-shell-client/native-shell-client_agldemo.inc @@ -2,12 +2,12 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI += "file://native-shell-client.service" +inherit systemd + +SYSTEMD_SERVICE:${PN} = "${BPN}.service" + do_install:append() { - install -d ${D}${systemd_user_unitdir}/agl-session.target.wants - install -m0644 ${WORKDIR}/native-shell-client.service ${D}${systemd_user_unitdir}/native-shell-client.service - ln -s ../native-shell-client.service ${D}${systemd_user_unitdir}/agl-session.target.wants/native-shell-client.service + install -D -m 0644 ${WORKDIR}/native-shell-client.service ${D}${systemd_system_unitdir}/native-shell-client.service } -FILES:${PN} += " ${systemd_user_unitdir}" - RCONFLICTS:${PN} = "homescreen" diff --git a/recipes-extended/agl-qemu-runner/files/agl-qemu-runner.sh b/recipes-extended/agl-qemu-runner/files/agl-qemu-runner.sh index ab3a02c91..d050bdbfb 100755 --- a/recipes-extended/agl-qemu-runner/files/agl-qemu-runner.sh +++ b/recipes-extended/agl-qemu-runner/files/agl-qemu-runner.sh @@ -37,7 +37,7 @@ if [ -n "$QEMU_TASKSET_CPUS" ]; then fi export SDL_VIDEODRIVER=wayland -export XDG_RUNTIME_DIR=/run/user/1001 +export XDG_RUNTIME_DIR=/run/user/200 # The following may be needed if the socket is not wayland-0, as SDL # seems to lack detection logic for that case. #export WAYLAND_DISPLAY=wayland-1 diff --git a/recipes-extended/agl-qemu-runner/files/agl-qemu-runner@.service b/recipes-extended/agl-qemu-runner/files/agl-qemu-runner@.service index a9e9f3346..95b1fe086 100644 --- a/recipes-extended/agl-qemu-runner/files/agl-qemu-runner@.service +++ b/recipes-extended/agl-qemu-runner/files/agl-qemu-runner@.service @@ -1,6 +1,6 @@ [Unit] -Requires=agl-session@agl-driver.service -After=agl-session@agl-driver.service +Requires=native-shell-client.service +After=native-shell-client.service [Service] Type=simple diff --git a/templates/feature/agl-kvm/50_local.conf.inc b/templates/feature/agl-kvm/50_local.conf.inc index dc586eaa6..2798116a2 100644 --- a/templates/feature/agl-kvm/50_local.conf.inc +++ b/templates/feature/agl-kvm/50_local.conf.inc @@ -1,4 +1,2 @@ -DISTRO_FEATURES:append = " virtualization" - -BBMULTICONFIG = "agl-kvm-guest" - +#see meta-agl-demo/conf/include/agl-kvm.inc +require conf/include/agl-kvm.inc diff --git a/templates/feature/agl-kvm/README_feature_agl-kvm.md b/templates/feature/agl-kvm/README_feature_agl-kvm.md index 83c0a0c26..46ab15514 100644 --- a/templates/feature/agl-kvm/README_feature_agl-kvm.md +++ b/templates/feature/agl-kvm/README_feature_agl-kvm.md @@ -12,3 +12,6 @@ authors: Scott Murray <scott.murray@konsulko.com> The following features are pulled: * agl-demo + +Note that enabling this feature results in a configuration where building images +other than agl-kvm-demo-platform will likely not give the desired results. |