From 9adc057bb9d5f8587f0c0fb8df2fa2bc81599545 Mon Sep 17 00:00:00 2001 From: Budleigh Salterton Date: Sat, 16 Mar 2024 10:21:50 +0000 Subject: [PATCH] Add kiosk mode stage --- .../00-install-packages/00-debconf | 2 + .../00-install-packages/00-packages | 10 +++ stage99-z1-kiosk/01-setup-user/00-run.sh | 6 ++ stage99-z1-kiosk/02-setup-kiosk/00-run.sh | 13 ++++ .../02-setup-kiosk/files/init.html | 66 +++++++++++++++++++ stage99-z1-kiosk/02-setup-kiosk/files/kiosk | 7 ++ stage99-z1-kiosk/EXPORT_IMAGE | 4 ++ stage99-z1-kiosk/prerun.sh | 7 ++ 8 files changed, 115 insertions(+) create mode 100644 stage99-z1-kiosk/00-install-packages/00-debconf create mode 100644 stage99-z1-kiosk/00-install-packages/00-packages create mode 100755 stage99-z1-kiosk/01-setup-user/00-run.sh create mode 100755 stage99-z1-kiosk/02-setup-kiosk/00-run.sh create mode 100644 stage99-z1-kiosk/02-setup-kiosk/files/init.html create mode 100644 stage99-z1-kiosk/02-setup-kiosk/files/kiosk create mode 100644 stage99-z1-kiosk/EXPORT_IMAGE create mode 100755 stage99-z1-kiosk/prerun.sh diff --git a/stage99-z1-kiosk/00-install-packages/00-debconf b/stage99-z1-kiosk/00-install-packages/00-debconf new file mode 100644 index 0000000000..7dbd12eb28 --- /dev/null +++ b/stage99-z1-kiosk/00-install-packages/00-debconf @@ -0,0 +1,2 @@ +# Adobe Flash Player. Copyright 1996-2015. Adobe Systems Incorporated. All Rights Reserved. +rpi-chromium-mods rpi-chromium-mods/adobe note diff --git a/stage99-z1-kiosk/00-install-packages/00-packages b/stage99-z1-kiosk/00-install-packages/00-packages new file mode 100644 index 0000000000..068b329d82 --- /dev/null +++ b/stage99-z1-kiosk/00-install-packages/00-packages @@ -0,0 +1,10 @@ +xserver-xorg xinit x11-xserver-utils +chromium-browser matchbox-window-manager xautomation unclutter +fonts-noto-color-emoji +gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav +git +chromium-browser rpi-chromium-mods libwidevinecdm0 +gldriver-test +fonts-droid-fallback +fonts-liberation2 +vulkan-tools mesa-vulkan-drivers diff --git a/stage99-z1-kiosk/01-setup-user/00-run.sh b/stage99-z1-kiosk/01-setup-user/00-run.sh new file mode 100755 index 0000000000..792ed71371 --- /dev/null +++ b/stage99-z1-kiosk/01-setup-user/00-run.sh @@ -0,0 +1,6 @@ +#!/bin/bash -e + +on_chroot << EOF + SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_behaviour B2 + SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_overscan 1 +EOF diff --git a/stage99-z1-kiosk/02-setup-kiosk/00-run.sh b/stage99-z1-kiosk/02-setup-kiosk/00-run.sh new file mode 100755 index 0000000000..a1fb9e96d7 --- /dev/null +++ b/stage99-z1-kiosk/02-setup-kiosk/00-run.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e + +install -v -o 1000 -g 1000 -d -m 755 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/bin" +install -v -o 1000 -g 1000 -m 755 files/kiosk "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/bin" + +install -v -o 1000 -g 1000 -d -m 755 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/kiosk" +install -v -o 1000 -g 1000 -m 755 files/init.html "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/kiosk" + +echo 'xinit /home/pi/kiosk -- vt$(fgconsole)' >> /home/${FIRST_USER_NAME}/.bashrc + +on_chroot << EOF + chown ${FIRST_USER_NAME}:${FIRST_USER_NAME} /home/${FIRST_USER_NAME}/.bashrc +EOF diff --git a/stage99-z1-kiosk/02-setup-kiosk/files/init.html b/stage99-z1-kiosk/02-setup-kiosk/files/init.html new file mode 100644 index 0000000000..ea74244579 --- /dev/null +++ b/stage99-z1-kiosk/02-setup-kiosk/files/init.html @@ -0,0 +1,66 @@ + + + + + + + +
+ 191D4BD8-E624-4E50-AA91-EEF6B698E6D1 +
+
+
System initializing...
+ + diff --git a/stage99-z1-kiosk/02-setup-kiosk/files/kiosk b/stage99-z1-kiosk/02-setup-kiosk/files/kiosk new file mode 100644 index 0000000000..52aecfc920 --- /dev/null +++ b/stage99-z1-kiosk/02-setup-kiosk/files/kiosk @@ -0,0 +1,7 @@ +#!/bin/sh +xset -dpms # disable DPMS (Energy Star) features. +xset s off # disable screen saver +xset s noblank # don't blank the video device +matchbox-window-manager -use_titlebar no & +unclutter & # hide X mouse cursor unless mouse activated +chromium-browser --display=:0 --kiosk --incognito --window-position=0,0 file:///${HOME}/kiosk/init.html diff --git a/stage99-z1-kiosk/EXPORT_IMAGE b/stage99-z1-kiosk/EXPORT_IMAGE new file mode 100644 index 0000000000..7779f4d74c --- /dev/null +++ b/stage99-z1-kiosk/EXPORT_IMAGE @@ -0,0 +1,4 @@ +IMG_SUFFIX="-sth-kiosk" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/stage99-z1-kiosk/prerun.sh b/stage99-z1-kiosk/prerun.sh new file mode 100755 index 0000000000..6986417e74 --- /dev/null +++ b/stage99-z1-kiosk/prerun.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +echo "Copying previous" + +if [ ! -d "${ROOTFS_DIR}" ]; then + copy_previous +fi