From: Kenta Date: Thu, 19 Dec 2024 10:07:30 +0000 (+0900) Subject: Unified HMI: Preconfigured Images X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=11770412cc0710807f93a2ba9cc8733441a7f2f9;p=AGL%2Fmeta-agl-demo.git Unified HMI: Preconfigured Images A new preconfigured demo image for Unified HMI has been added. By building and launching the images for both the sender and receiver, and executing a few commands, you can display the application across two displays. It supports three boards: qemu-x86-64, raspberrypi4, and agl-refhw. Bug-AGL: SPEC-5321 Change-Id: Idc4e6d4b7e36245a239148607f6fe08f3be28a25 Signed-off-by: Kenta --- diff --git a/meta-agl-uhmi-demo/README.md b/meta-agl-uhmi-demo/README.md new file mode 100644 index 000000000..04dd20030 --- /dev/null +++ b/meta-agl-uhmi-demo/README.md @@ -0,0 +1,53 @@ +# Unified HMI preconfigured demo images + +## Introduction +Unified HMI needs a litle complex environment setup, so here we provide a recipe that allow you to create a pre-configured images. + +## Unified HMI frameworks +For a detailed explanation of Unified HMI, please refer to the [AGL Documentation](https://docs.automotivelinux.org/en/master/#06_Component_Documentation/11_Unified_HMI/) + +## Demo environment +Demo images supports three boards: qemux-86-64, raspberrypi4, and agl-refhw. +Please prepare two boards, one is the sender and the other is the receiver, on any boards and build the respective images for each. + +* sender +``` +IP: 192.168.0.100 +HOSTNAME: agl-host0 +``` + +* receiver +``` +IP: 192.168.0.101 +HOSTNAME: agl-host1 +``` + +## How to build +Follow the [AGL documentation](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/01_Build_Process_Overview/) for the build process, and set up the "[Initializing Your Build Environment](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/04_Initializing_Your_Build_Environment/)" section as described below to enable the AGL feature 'agl-uhmi-demo'. + +For example: +``` +$ cd $AGL_TOP/master +$ source ./meta-agl/scripts/aglsetup.sh -m qemux86-64 -b qemux86-64 agl-devel agl-uhmi-demo +``` + +After adding the feature, execute the bitbake command: + +for sender +``` +$ bitbake agl-uhmi-demo-preconfigured-sender +``` + +for receiver +``` +$ bitbake agl-uhmi-demo-preconfigured-receiver +``` + +## How to use +After both the sender and receiver have successfully booted, you can execute the following commands on the sender to confirm that the application is displayed across two displays each connected to diferrent boards. + +on sender (IP:192.168.0.100, hostname:agl-host0): +``` +$ cat /var/local/uhmi-app/glmark2/app.json | ucl-distrib-com /etc/uhmi-framework/virtual-screen-def.json +$ cat /var/local/uhmi-app/glmark2/initial_vscreen.json | ula-distrib-com +``` \ No newline at end of file diff --git a/meta-agl-uhmi-demo/SECURITY.md b/meta-agl-uhmi-demo/SECURITY.md new file mode 100644 index 000000000..a3c80fdd3 --- /dev/null +++ b/meta-agl-uhmi-demo/SECURITY.md @@ -0,0 +1,19 @@ +How to Report a Potential Vulnerability? +======================================== + +If you would like to report a public issue (for example, one with a released +CVE number), please report it to security AT automotivelinux DOT org + +If you are dealing with a not-yet released or urgent issue, please send a +message to security AT automotivelinux DOT org, including as many details as +possible: the layer or software module affected, the recipe and its version, +and any example code, if available. + +Branches maintained with security fixes +--------------------------------------- + +See [https://wiki.automotivelinux.org/schedule this page] +for detailed info regarding the policies and maintenance of Stable branches. + +The [https://wiki.automotivelinux.org/agl-distro/release-notes Release page] +contains a list of all releases of Automotive Grade Linux. diff --git a/meta-agl-uhmi-demo/conf/layer.conf b/meta-agl-uhmi-demo/conf/layer.conf new file mode 100644 index 000000000..3d3466b11 --- /dev/null +++ b/meta-agl-uhmi-demo/conf/layer.conf @@ -0,0 +1,14 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH =. "${LAYERDIR}:" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "agl-uhmi-demo-layer" +BBFILE_PATTERN_agl-uhmi-demo-layer = "^${LAYERDIR}/" +BBFILE_PRIORITY_agl-uhmi-demo-layer = "70" + +LAYERSERIES_COMPAT_agl-uhmi-demo-layer = "scarthgap" + +LAYERDEPENDS_agl-uhmi-demo-layer = "agldemo" diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/customize-uhmi-ivi-wm.inc b/meta-agl-uhmi-demo/recipes-config/uhmi-config/customize-uhmi-ivi-wm.inc new file mode 100644 index 000000000..3bd00925f --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/customize-uhmi-ivi-wm.inc @@ -0,0 +1,5 @@ +customize_uhmi_ivi_wm() { + sed -i "s/XDG_RUNTIME_DIR=\/run\/user\/1001/XDG_RUNTIME_DIR=\/run\/user\/200/" ${IMAGE_ROOTFS}/${systemd_system_unitdir}/uhmi-ivi-wm.service + sed -i "s/WAYLAND_DISPLAY=wayland-0/WAYLAND_DISPLAY=wayland-1/" ${IMAGE_ROOTFS}/${systemd_system_unitdir}/uhmi-ivi-wm.service +} +ROOTFS_POSTPROCESS_COMMAND:append = " customize_uhmi_ivi_wm;" diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/app.json b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/app.json new file mode 100644 index 000000000..1dcce8aa2 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/app.json @@ -0,0 +1,49 @@ +{ + "format_v1": { + "command_type" : "remote_virtio_gpu", + "appli_name" : "glmark2", + "sender" : { + "launcher" : "agl-host0", + "command" : "/usr/bin/ucl-virtio-gpu-wl-send", + "frontend_params" : { + "scanout_x" : 0, + "scanout_y" : 0, + "scanout_w" : 1920, + "scanout_h" : 1080, + "server_port" : 33445 + }, + "appli" : "/usr/bin/glmark2-es2-wayland -s 1920x1080", + "env" : "LD_LIBRARY_PATH=/usr/lib/mesa-virtio" + }, + "receivers" : [ + { + "launcher" : "agl-host0", + "command" : "/usr/bin/ucl-virtio-gpu-wl-recv", + "backend_params" : { + "ivi_surface_id" : 101000, + "scanout_x" : 0, + "scanout_y" : 0, + "scanout_w" : 1920, + "scanout_h" : 1080, + "listen_port" : 33445, + "initial_screen_color" : "0x33333333" + }, + "env" : "XDG_RUNTIME_DIR=/run/user/200 WAYLAND_DISPLAY=wayland-1" + }, + { + "launcher" : "agl-host1", + "command" : "/usr/bin/ucl-virtio-gpu-wl-recv", + "backend_params" : { + "ivi_surface_id" : 101000, + "scanout_x" : 0, + "scanout_y" : 0, + "scanout_w" : 1920, + "scanout_h" : 1080, + "listen_port" : 33445, + "initial_screen_color" : "0x33333333" + }, + "env" : "XDG_RUNTIME_DIR=/run/user/200 WAYLAND_DISPLAY=wayland-1" + } + ] + } +} diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/initial_vscreen.json b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/initial_vscreen.json new file mode 100644 index 000000000..d6ac77713 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/initial_vscreen.json @@ -0,0 +1,20 @@ +{ + "command": "initial_vscreen", + "vlayer": [ + { + "VID": 1010000, + "coord": "global", + "virtual_w": 1920, "virtual_h": 1080, + "vsrc_x": 0, "vsrc_y": 0, "vsrc_w": 1920, "vsrc_h": 1080, + "vdst_x": 960, "vdst_y": 0, "vdst_w": 1920, "vdst_h": 1080, + "vsurface": [ + { + "VID": 101000, + "pixel_w": 1920, "pixel_h": 1080, + "psrc_x": 0, "psrc_y": 0, "psrc_w": 1920, "psrc_h": 1080, + "vdst_x": 0, "vdst_y": 0, "vdst_w": 1920, "vdst_h": 1080 + } + ] + } + ] +} diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-receiver.network b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-receiver.network new file mode 100644 index 000000000..8c5e841ca --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-receiver.network @@ -0,0 +1,5 @@ +[Match] +Name=eth* en* + +[Network] +Address=192.168.0.101/24 diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-sender.network b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-sender.network new file mode 100644 index 000000000..0557692a6 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/files/wired-sender.network @@ -0,0 +1,5 @@ +[Match] +Name=eth* en* + +[Network] +Address=192.168.0.100/24 diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/set-hostname.inc b/meta-agl-uhmi-demo/recipes-config/uhmi-config/set-hostname.inc new file mode 100644 index 000000000..9ff5339e1 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/set-hostname.inc @@ -0,0 +1,5 @@ +set_hostname() { + UHMI_HOSTNAME=${UHMI_HOSTNAME:-agl-host} + echo "${UHMI_HOSTNAME}" > ${IMAGE_ROOTFS}/${sysconfdir}/hostname +} +ROOTFS_POSTPROCESS_COMMAND:append = " set_hostname;" diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-receiver.bb b/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-receiver.bb new file mode 100644 index 000000000..662a73f72 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-receiver.bb @@ -0,0 +1,16 @@ +SUMMARY = "Setting files for UHMI receiver" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://wired-receiver.network \ +" + +do_install() { + install -d ${D}${sysconfdir}/systemd/network/ + install -m 644 ${WORKDIR}/wired-receiver.network ${D}${sysconfdir}/systemd/network/wired.network +} + +FILES:${PN} += " \ + ${sysconfdir}/systemd/network/* \ +" diff --git a/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-sender.bb b/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-sender.bb new file mode 100644 index 000000000..f756955ec --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-config/uhmi-config/uhmi-config-sender.bb @@ -0,0 +1,23 @@ +SUMMARY = "Setting files for UHMI sender" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://app.json \ + file://initial_vscreen.json \ + file://wired-sender.network \ +" + +do_install() { + install -d ${D}${sysconfdir}/systemd/network/ + install -m 644 ${WORKDIR}/wired-sender.network ${D}${sysconfdir}/systemd/network/wired.network + + install -d ${D}/var/local/uhmi-app/glmark2 + install -m 644 ${WORKDIR}/app.json ${D}/var/local/uhmi-app/glmark2/ + install -m 644 ${WORKDIR}/initial_vscreen.json ${D}/var/local/uhmi-app/glmark2/ +} + +FILES:${PN} += " \ + ${sysconfdir}/systemd/network/* \ + /var/local/uhmi-app/glmark2 \ +" diff --git a/meta-agl-uhmi-demo/recipes-graphics/wayland/files/weston_ivi-shell.ini b/meta-agl-uhmi-demo/recipes-graphics/wayland/files/weston_ivi-shell.ini new file mode 100644 index 000000000..5001d11eb --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-graphics/wayland/files/weston_ivi-shell.ini @@ -0,0 +1,50 @@ +[core] +shell=ivi-shell.so +modules=ivi-controller.so +require-input=false + +[output] +name=HDMI-A-1 +mode=1920x1080@60 + +[output] +name=HDMI-A-2 +mode=1920x1080@60 + +[output] +name=HDMI-A-3 +mode=1920x1080@60 + +[output] +name=DSI-1 +mode=1920x1080@60 + +[output] +name=DSI-2 +mode=1920x1080@60 + +[output] +name=DP-1 +mode=1920x1080@60 + +[output] +name=Virtual-1 +mode=1920x1080 + +[output] +name=Virtual-2 +mode=1920x1080 + +[output] +name=VGA-1 +mode=1920x1080 + +[output] +name=VGA-2 +mode=1920x1080 + +[ivi-shell] +ivi-input-module=ivi-input-controller.so +#ivi-client-name=/usr/bin/simple-weston-client +bkgnd-surface-id=1000000 +bkgnd-color=0xFF000000 diff --git a/meta-agl-uhmi-demo/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-uhmi-demo/recipes-graphics/wayland/weston-init.bbappend new file mode 100644 index 000000000..1cc6091c2 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-graphics/wayland/weston-init.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +WESTON_INIT_IVI_SHELL ?= "weston_ivi-shell.ini" + +SRC_URI:append = " \ + file://${WESTON_INIT_IVI_SHELL} \ +" + +do_install:append () { + install -d ${D}/${sysconfdir}/xdg/weston + install -m 644 ${WORKDIR}/${WESTON_INIT_IVI_SHELL} ${D}/${sysconfdir}/xdg/weston/ + ln -nfs ${sysconfdir}/xdg/weston/${WESTON_INIT_IVI_SHELL} ${D}/${sysconfdir}/xdg/weston/weston.ini +} diff --git a/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-receiver.bb b/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-receiver.bb new file mode 100644 index 000000000..71587ec39 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-receiver.bb @@ -0,0 +1,19 @@ +SUMMARY = "AGL Unified HMI demo preconfigured weston receiver image" +LICENSE = "MIT" + +DEPENDS = "uhmi-ivi-wm" + +require recipes-platform/images/agl-image-weston.bb + +IMAGE_FEATURES += "ssh-server-openssh" + +# Add packages for Unified HMI demo platform here +IMAGE_INSTALL += " \ + packagegroup-rvgpu \ + packagegroup-ddfw \ + uhmi-config-receiver \ +" + +UHMI_HOSTNAME ?= "agl-host1" +require recipes-config/uhmi-config/set-hostname.inc +require recipes-config/uhmi-config/customize-uhmi-ivi-wm.inc diff --git a/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-sender.bb b/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-sender.bb new file mode 100644 index 000000000..0942f1889 --- /dev/null +++ b/meta-agl-uhmi-demo/recipes-platform/images/agl-uhmi-demo-preconfigured-sender.bb @@ -0,0 +1,20 @@ +SUMMARY = "AGL Unified HMI demo preconfigured weston sender image" +LICENSE = "MIT" + +DEPENDS = "uhmi-ivi-wm" + +require recipes-platform/images/agl-image-weston.bb + +IMAGE_FEATURES += "ssh-server-openssh" + +# Add packages for Unified HMI demo platform here +IMAGE_INSTALL += " \ + packagegroup-rvgpu \ + packagegroup-ddfw \ + uhmi-config-sender \ + glmark2 \ +" + +UHMI_HOSTNAME ?= "agl-host0" +require recipes-config/uhmi-config/set-hostname.inc +require recipes-config/uhmi-config/customize-uhmi-ivi-wm.inc diff --git a/templates/feature/agl-uhmi-demo/50_bblayers.conf.inc b/templates/feature/agl-uhmi-demo/50_bblayers.conf.inc new file mode 100644 index 000000000..9dec54876 --- /dev/null +++ b/templates/feature/agl-uhmi-demo/50_bblayers.conf.inc @@ -0,0 +1,3 @@ +BBLAYERS =+ " \ + ${METADIR}/meta-agl-demo/meta-agl-uhmi-demo \ +" diff --git a/templates/feature/agl-uhmi-demo/50_local.conf.inc b/templates/feature/agl-uhmi-demo/50_local.conf.inc new file mode 100644 index 000000000..8ae7b749a --- /dev/null +++ b/templates/feature/agl-uhmi-demo/50_local.conf.inc @@ -0,0 +1 @@ +AGL_EXTRA_IMAGE_FSTYPES = "ext4" diff --git a/templates/feature/agl-uhmi-demo/included.dep b/templates/feature/agl-uhmi-demo/included.dep new file mode 100644 index 000000000..9d33e122b --- /dev/null +++ b/templates/feature/agl-uhmi-demo/included.dep @@ -0,0 +1,2 @@ +agl-demo +agl-uhmi