Enable psplash in guest container using drm-lease 93/28693/2
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Sun, 23 Apr 2023 11:31:49 +0000 (20:31 +0900)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 9 May 2023 15:29:36 +0000 (15:29 +0000)
The upstream version of psplash is supporting fb based splash screen.
On the other hand, drm lease infrastructure is not support fb.
This patch enable drm-lease support at psplash.

This work contributed by Hiroyuki Ishii at CES2023 demo development.

Bug-AGL: SPEC-4766

Change-Id: I2c58b0db489b1573ef3b7f7396203550c1fb89d6
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
recipes-core/psplash/agl-container-guest/psplash.env [new file with mode: 0644]
recipes-core/psplash/psplash-portrait-config.bbappend [new file with mode: 0644]
recipes-core/psplash/psplash-portrait-config_agl-container-guest-demo.inc [new file with mode: 0644]
recipes-core/psplash/psplash_agl-container-guest-demo.inc [new file with mode: 0644]
recipes-core/psplash/psplash_git.bbappend

diff --git a/recipes-core/psplash/agl-container-guest/psplash.env b/recipes-core/psplash/agl-container-guest/psplash.env
new file mode 100644 (file)
index 0000000..ed5f262
--- /dev/null
@@ -0,0 +1,4 @@
+XDG_RUNTIME_DIR=/run/user/0
+DLM_RUNTIME_PATH=/var/display/drm-lease-manager
+DRM_LEASE_DEVICE=lease
+WAYLAND_DISPLAY=wayland-1
diff --git a/recipes-core/psplash/psplash-portrait-config.bbappend b/recipes-core/psplash/psplash-portrait-config.bbappend
new file mode 100644 (file)
index 0000000..62914b5
--- /dev/null
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', 'psplash-portrait-config_agl-container-guest-demo.inc', '', d)}
diff --git a/recipes-core/psplash/psplash-portrait-config_agl-container-guest-demo.inc b/recipes-core/psplash/psplash-portrait-config_agl-container-guest-demo.inc
new file mode 100644 (file)
index 0000000..73edc67
--- /dev/null
@@ -0,0 +1,15 @@
+do_install[depends] = "psplash:do_populate_sysroot"
+
+do_install() {
+    # Install override
+    psplash_service="${STAGING_DIR_TARGET}/${systemd_system_unitdir}/psplash-start.service"
+    if [ ! -f "$psplash_service" ]; then
+        echo "ERROR: psplash service unit file not found: $psplash_service" >&2
+        exit 1
+    fi
+    install -d ${D}${systemd_system_unitdir}/psplash-start.service.d
+    psplash_portrait_conf="${D}${systemd_system_unitdir}/psplash-start.service.d/psplash-portrait.conf"
+    echo "[Service]" > "$psplash_portrait_conf"
+    echo "ExecStart=" >> "$psplash_portrait_conf"
+    sed -ne 's!^\(ExecStart=/usr/bin/psplash.*\)!\1 --angle 90!p' "$psplash_service" >> "$psplash_portrait_conf"
+}
diff --git a/recipes-core/psplash/psplash_agl-container-guest-demo.inc b/recipes-core/psplash/psplash_agl-container-guest-demo.inc
new file mode 100644 (file)
index 0000000..9c7fb37
--- /dev/null
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/agl-container-guest:"
+SRC_URI:append = " file://psplash.env"
+
+PACKAGECONFIG:append = " drm drm-lease"
+
+PSPLASH_DRM_LEASE_ARGS = "--drm-lease lease"
+
+do_install:append () {
+       sed -i -e '/^\[Service\]/a EnvironmentFile=/etc/default/psplash' ${D}${systemd_system_unitdir}/psplash-start.service
+    install -Dm644 ${WORKDIR}/psplash.env ${D}${sysconfdir}/default/psplash
+}
index 931b27c..d7d75d2 100644 (file)
@@ -1 +1,2 @@
 require ${@bb.utils.contains('AGL_FEATURES', 'agldemo', 'psplash_agldemo.inc', '', d)}
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', 'psplash_agl-container-guest-demo.inc', '', d)}