From 166ae7e592a67bde3bacbfdcb5e1d72b9decc067 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 1 Aug 2025 09:08:57 -0500 Subject: [PATCH] Add kioskbrowser --- .editorconfig | 9 +++++++++ Config.in | 1 + configs/kitchenos_defconfig | 4 ++++ external.mk | 1 + package/kioskbrowser/Config.in | 10 ++++++++++ package/kioskbrowser/kioskbrowser.mk | 15 +++++++++++++++ rootfs/etc/sway/kiosk.conf | 1 + rootfs/usr/lib/systemd/system/kiosk.service | 5 +---- .../kioskbrowser.service | 1 + rootfs/usr/lib/systemd/user/kioskbrowser.service | 9 +++++++++ rootfs/usr/lib/systemd/user/sway-session.target | 3 +++ rootfs/usr/lib/tmpfiles.d/kiosk.conf | 1 + 12 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 .editorconfig create mode 100644 package/kioskbrowser/Config.in create mode 100644 package/kioskbrowser/kioskbrowser.mk create mode 100644 rootfs/etc/sway/kiosk.conf create mode 120000 rootfs/usr/lib/systemd/user/graphical-session.target.wants/kioskbrowser.service create mode 100644 rootfs/usr/lib/systemd/user/kioskbrowser.service create mode 100644 rootfs/usr/lib/systemd/user/sway-session.target create mode 100644 rootfs/usr/lib/tmpfiles.d/kiosk.conf diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..add5496 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[Config.in] +indent_style = tab +indent_size = 4 + +[*.mk] +indent_style = tab +indent_size = 4 diff --git a/Config.in b/Config.in index e69de29..7c57313 100644 --- a/Config.in +++ b/Config.in @@ -0,0 +1 @@ +source "$BR2_EXTERNAL_kitchenos_PATH/package/kioskbrowser/Config.in" diff --git a/configs/kitchenos_defconfig b/configs/kitchenos_defconfig index d6103f8..e0daed9 100644 --- a/configs/kitchenos_defconfig +++ b/configs/kitchenos_defconfig @@ -6,6 +6,7 @@ BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches" BR2_DOWNLOAD_FORCE_CHECK_HASHES=y BR2_INIT_SYSTEMD=y +# BR2_INIT_SYSTEMD_POPULATE_TMPFILES is not set BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET="graphical.target" # BR2_TARGET_ENABLE_ROOT_LOGIN is not set BR2_SYSTEM_BIN_SH_BASH=y @@ -25,6 +26,7 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_PACKAGE_XZ=y BR2_PACKAGE_STRACE=y BR2_PACKAGE_SWAY=y +BR2_PACKAGE_LIBGLVND=y BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_LLVM=y BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LLVMPIPE=y @@ -49,6 +51,7 @@ BR2_PACKAGE_OPENSSH=y # BR2_PACKAGE_OPENSSH_CLIENT is not set BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_ACL=y BR2_PACKAGE_COREUTILS=y BR2_PACKAGE_PROCPS_NG=y BR2_PACKAGE_SEATD_BUILTIN=y @@ -63,3 +66,4 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_KMOD_XZ=y BR2_PACKAGE_HOST_MTOOLS=y +BR2_PACKAGE_KIOSKBROWSER=y diff --git a/external.mk b/external.mk index e69de29..aa45135 100644 --- a/external.mk +++ b/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_kitchenos_PATH)/package/*/*.mk)) diff --git a/package/kioskbrowser/Config.in b/package/kioskbrowser/Config.in new file mode 100644 index 0000000..4522694 --- /dev/null +++ b/package/kioskbrowser/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_KIOSKBROWSER + bool "kioskbrowser" + depends on BR2_PACKAGE_WEBKITGTK + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_RUSTC + help + Enable the kioskbrowser + +comment "kioskbrowser needs webkitgtk" + depends on !BR2_PACKAGE_WEBKITGTK diff --git a/package/kioskbrowser/kioskbrowser.mk b/package/kioskbrowser/kioskbrowser.mk new file mode 100644 index 0000000..ba73a9c --- /dev/null +++ b/package/kioskbrowser/kioskbrowser.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# kioskbrowser +# +################################################################################ + +KIOSKBROWSER_VERSION = fbd9ecedc7e357be91de486be85eff546b1d3511 +KIOSKBROWSER_SITE = https://git.pyrocufflink.net/dustin/kioskbrowser +KIOSKBROWSER_SITE_METHOD = git +KIOSKBROWSER_LICENSE = GPL-3.0+ + +KIOSKBROWSER_DEPENDENCIES = \ + webkitgtk + +$(eval $(cargo-package)) diff --git a/rootfs/etc/sway/kiosk.conf b/rootfs/etc/sway/kiosk.conf new file mode 100644 index 0000000..3d7e7ed --- /dev/null +++ b/rootfs/etc/sway/kiosk.conf @@ -0,0 +1 @@ +exec /usr/libexec/sway-systemd diff --git a/rootfs/usr/lib/systemd/system/kiosk.service b/rootfs/usr/lib/systemd/system/kiosk.service index 2d5b669..7a36407 100644 --- a/rootfs/usr/lib/systemd/system/kiosk.service +++ b/rootfs/usr/lib/systemd/system/kiosk.service @@ -4,12 +4,9 @@ Conflicts=getty@tty1.service [Service] Type=exec -ExecStart=/usr/bin/sway -RuntimeDirectory=%N -Environment=XDG_RUNTIME_DIR=%t/%N +ExecStart=/usr/bin/sway -c /etc/sway/%N.conf PAMName=%N User=%N -SupplementaryGroups=render tty StandardInput=tty-force StadnardOutput=inherit StandardError=journal diff --git a/rootfs/usr/lib/systemd/user/graphical-session.target.wants/kioskbrowser.service b/rootfs/usr/lib/systemd/user/graphical-session.target.wants/kioskbrowser.service new file mode 120000 index 0000000..214092d --- /dev/null +++ b/rootfs/usr/lib/systemd/user/graphical-session.target.wants/kioskbrowser.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/kioskbrowser.service \ No newline at end of file diff --git a/rootfs/usr/lib/systemd/user/kioskbrowser.service b/rootfs/usr/lib/systemd/user/kioskbrowser.service new file mode 100644 index 0000000..cfd8092 --- /dev/null +++ b/rootfs/usr/lib/systemd/user/kioskbrowser.service @@ -0,0 +1,9 @@ +[Unit] +Description=Kiosk browser + +[Service] +Type=exec +ExecStart=/usr/bin/kioskbrowser + +[Install] +WantedBy=graphical-session.target diff --git a/rootfs/usr/lib/systemd/user/sway-session.target b/rootfs/usr/lib/systemd/user/sway-session.target new file mode 100644 index 0000000..78511ca --- /dev/null +++ b/rootfs/usr/lib/systemd/user/sway-session.target @@ -0,0 +1,3 @@ +[Unit] +Description=Sway session +BindsTo=graphical-session.target diff --git a/rootfs/usr/lib/tmpfiles.d/kiosk.conf b/rootfs/usr/lib/tmpfiles.d/kiosk.conf new file mode 100644 index 0000000..e2c1549 --- /dev/null +++ b/rootfs/usr/lib/tmpfiles.d/kiosk.conf @@ -0,0 +1 @@ +d /home/kiosk 0700 kiosk kiosk - -