From 211ddbdf4143da9509c8c747485bc87b2ab49ba9 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Sun, 7 May 2023 08:22:51 +0900 Subject: Add CH57x keyboard based UI for container demo Container exchange user interface using CH57x keyboard. This UI based on mock container manager for AGL CES2023 demo. That is contributed by Hiroyuki Ishii Bug-AGL: SPEC-4766 Change-Id: I3654bb0fd22787c66af554db71fc3adb82440702 Signed-off-by: Naoto Yamaguchi --- .../recipes-demo/momikey/files/momikey.rules | 1 + .../recipes-demo/momikey/files/momikey.service | 10 ++++++ .../recipes-demo/momikey/files/momikey.sh | 27 +++++++++++++++ .../recipes-demo/momikey/momikey_0.1.bb | 39 ++++++++++++++++++++++ .../images/agl-lxc-multi-partition-image.inc | 9 ++++- 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules create mode 100644 meta-agl-ic-container/recipes-demo/momikey/files/momikey.service create mode 100644 meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh create mode 100644 meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules new file mode 100644 index 00000000..167a5cb1 --- /dev/null +++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ATTR{idVendor}=="1189", ATTR{idProduct}=="8890", RUN+="/bin/sh -c 'systemctl start momikey'" diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service new file mode 100644 index 00000000..e2e50efb --- /dev/null +++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service @@ -0,0 +1,10 @@ +[Unit] +Description=CH57x keyboard based UI for container demo +After=container-manager.service multi-user.target + +[Service] +Type=simple +ExecStart=/usr/bin/momikey.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh new file mode 100644 index 00000000..d0e0b0b6 --- /dev/null +++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +while sleep 1 ;do evtest /dev/input/by-id/usb-wch.cn_CH57x-event-kbd ;done | while read line; do + unset key target_container + [[ "$line" =~ \((KEY_.)\),\ value\ 1 ]] && key="${BASH_REMATCH[1]}" + case "$key" in + KEY_G) + cmcontrol --change-active-guest-name=agl-flutter-ivi-demo + cmcontrol --shutdown-guest-role=ivi + ;; + KEY_D) + cmcontrol --change-active-guest-name=agl-qt-ivi-demo + cmcontrol --shutdown-guest-role=ivi + ;; + KEY_A) + cmcontrol --change-active-guest-name=agl-momi-ivi-demo + cmcontrol --shutdown-guest-role=ivi + ;; + KEY_H) + cmcontrol --change-active-guest-name=agl-html5-ivi-demo + cmcontrol --shutdown-guest-role=ivi + ;; + KEY_C) + cmcontrol --force-reboot-guest-role=ivi + ;; + esac +done diff --git a/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb b/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb new file mode 100644 index 00000000..845ef46d --- /dev/null +++ b/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb @@ -0,0 +1,39 @@ +SUMMARY = "CH57x keyboard based UI for container demo" +DESCRIPTION = "Container exchange user interface using CH57x keyboard. \ + This UI based on mock container manager for AGL CES2023 demo." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI += " \ + file://momikey.sh \ + file://momikey.service \ + file://momikey.rules \ +" + +inherit systemd + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE:${PN} = "momikey.service" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" + +do_install:append () { + install -d ${D}/usr/bin + install -m 0755 ${WORKDIR}/momikey.sh ${D}/usr/bin/momikey.sh + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/momikey.service ${D}${systemd_system_unitdir} + + install -d ${D}${sysconfdir}/udev/rules.d + install -m 644 ${WORKDIR}/momikey.rules ${D}${sysconfdir}/udev/rules.d/ +} + +FILES:${PN} += " \ + /usr/bin/momikey.sh \ + ${systemd_system_unitdir} \ + ${sysconfdir}/udev/rules.d/ \ +" + +RDEPENDS:${PN} := " \ + bash \ + evtest \ +" 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 72ffb556..7d6fcf12 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 @@ -17,6 +17,13 @@ OUT_OF_TREE_CONTAINER_CONFIGS ??= " \ cm-config-agl-html5-ivi-demo \ " +CONTAINER_EXCHANGE_DEMO_UI ??= "momiweb momikey" + +CONTAINER_MULTI_DEMO ??= " \ + ${OUT_OF_TREE_CONTAINER_CONFIGS} \ + ${CONTAINER_EXCHANGE_DEMO_UI} \ +" + # Handle modification of IMAGE_LINK_NAME done by ULCB builds with Kingfisher support MACHINE_SUFFIX = "${@bb.utils.contains('AGL_FEATURES', 'kingfisher', '-kf', '', d)}" @@ -44,7 +51,7 @@ install_container_images() { 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} momiweb', d)} \ + ${@bb.utils.contains('OUT_OF_TREE_CONTAINER_IMAGE_DEPLOY_DIR', 'non', '', '${CONTAINER_MULTI_DEMO}', d)} \ " WKS_FILES:prepend = " \ -- cgit 1.2.3-korg