agl-demo-control-panel: add recipe and image 47/29347/3
authorScott Murray <scott.murray@konsulko.com>
Mon, 30 Oct 2023 22:21:44 +0000 (18:21 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 6 Nov 2023 11:53:01 +0000 (11:53 +0000)
Add recipe to build the agl-demo-control-panel application, and a
corresponding new image recipe, agl-ivi-demo-control-panel, that
yields an image that runs the control panel fullscreen on boot.

Bug-AGL: SPEC-4952

Change-Id: I17d762230e48ab47de3f6214a2a9dc1f59f3a8ea
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/29347
Reviewed-by: Hiroyuki Ishii <ishii.hiroyuki002@jp.panasonic.com>
Reviewed-by: Lisandro Perez Meyer <lpmeyer@ics.com>
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account

recipes-demo/agl-demo-control-panel/agl-demo-control-panel_git.bb [new file with mode: 0644]
recipes-demo/agl-demo-control-panel/files/agl-demo-control-panel.service [new file with mode: 0644]
recipes-platform/images/agl-ivi-demo-control-panel.bb [new file with mode: 0644]

diff --git a/recipes-demo/agl-demo-control-panel/agl-demo-control-panel_git.bb b/recipes-demo/agl-demo-control-panel/agl-demo-control-panel_git.bb
new file mode 100644 (file)
index 0000000..f12ca5c
--- /dev/null
@@ -0,0 +1,59 @@
+SUMMARY     = "AGL demo control panel"
+LICENSE     = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=685e0faaaec2c2334cf8159ca6bd2975"
+
+PV = "1.0+git${SRCPV}"
+
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-demo-control-panel;protocol=https;branch=${AGL_BRANCH} \
+           file://agl-demo-control-panel.service \
+"
+SRCREV = "edfd96499fdbcf869c5182f2cfa89703cfb0dfd0"
+
+S = "${WORKDIR}/git"
+
+inherit systemd allarch
+
+require recipes-config/agl-users/agl-users.inc
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+    # There's no provision for a Pythonic install into /usr/lib, so dump
+    # into a directory /usr/libexec.
+    install -d ${D}${libexecdir}/${BPN}
+    cp -drv ${S}/* ${D}${libexecdir}/${BPN}
+
+    # Remove stray shell script from Docker container build support to
+    # avoid QA complaints
+    rm -rf ${D}${libexecdir}/${BPN}/docker
+
+    install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
+    
+    # Install conf file
+    install -d ${D}/home/agl-driver/.local/share/agl-demo-control-panel
+    sed 's/=user-session/=AGL-databroker/' ${S}/extras/config.ini > \
+        ${D}/home/agl-driver/.local/share/agl-demo-control-panel/config.ini
+    chown -R agl-driver:agl-driver ${D}/home/agl-driver
+}
+
+# For now generate resource wrapper on first boot, as it looks non-trivial
+# to get python3-pyqt5-native working to run pyrcc5 during build.
+pkg_postinst_ontarget:${PN} () {
+    /usr/bin/pyrcc5 -o ${libexecdir}/${BPN}/res_rc.py ${libexecdir}/${BPN}/assets/res.qrc
+    true
+}
+
+FILES:${PN} += "/home/agl-driver"
+
+RDEPENDS:${PN} += " \
+    python3 \
+    python3-modules \
+    python3-packaging \
+    python3-qtwidgets \
+    python3-can \
+    agl-users \
+    weston \
+"
diff --git a/recipes-demo/agl-demo-control-panel/files/agl-demo-control-panel.service b/recipes-demo/agl-demo-control-panel/files/agl-demo-control-panel.service
new file mode 100644 (file)
index 0000000..5780bdf
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Requires=weston.service
+After=weston.service
+Before=graphical.target
+
+[Service]
+Type=simple
+User=agl-driver
+Group=agl-driver
+Environment=XDG_RUNTIME_DIR=/run/user/1001/
+Environment=WAYLAND_DISPLAY=wayland-1
+ExecStart=/usr/bin/python3 /usr/libexec/agl-demo-control-panel/main.py
+Restart=on-failure
+
+[Install]
+WantedBy=graphical.target
diff --git a/recipes-platform/images/agl-ivi-demo-control-panel.bb b/recipes-platform/images/agl-ivi-demo-control-panel.bb
new file mode 100644 (file)
index 0000000..21785ca
--- /dev/null
@@ -0,0 +1,27 @@
+require recipes-platform/images/agl-image-weston.bb
+
+SUMMARY = "AGL demo control panel image"
+
+IMAGE_FEATURES += "splash package-management ssh-server-openssh"
+
+# NOTE: The client key and certificate in kuksa-certificates-agl-client
+#       seem required by kuksa-client at the moment even though client
+#       certification has been deprecated upstream, this needs further
+#       investigation so it can be dropped from the image.
+#   
+IMAGE_KUKSA_PACKAGES = " \
+    kuksa-client \
+    kuksa-certificates-agl-ca \
+    kuksa-certificates-agl-client \
+"
+
+IMAGE_INSTALL += "\
+    packagegroup-agl-networking \
+    weston-ini-conf-landscape \
+    weston-agl-driver-conf \
+    ${IMAGE_KUKSA_PACKAGES} \
+    agl-demo-control-panel \
+    qtwayland \
+    qtwayland-plugins \
+    qtwayland-qmlplugins \
+"