README.md | ||
setup-signage.sh |
Alpine Linux Weston/Chromium Kiosk Setup
This script automates the setup of a minimal Alpine Linux system to function as a digital signage kiosk. It installs and configures Weston (a Wayland compositor), Chromium (web browser), and necessary supporting services to automatically display a specific webpage in fullscreen kiosk mode upon system boot.
Features
- Automated installation and configuration on a base Alpine Linux system.
- Uses the modern Wayland display protocol via the Weston compositor.
- Employs
elogind
for session and seat management. - Uses
greetd
withagreety
for lightweight, automatic user login. - Configurable target URL displayed in Chromium's kiosk mode.
- Includes basic Mesa graphics drivers and essential firmware.
- Checks for the problematic
nomodeset
kernel parameter.
How to Use
- Download/Save Script: Obtain the
setup_signage.sh
script and place it on your target Alpine machine (e.g., usingwget
,scp
, or copy-paste via SSH). - Configure:
- Edit the script using a text editor (like
nano
):nano setup_signage.sh
- Modify the following variables near the top of the script:
KIOSK_URL
: Set this to the full URL of the webpage you want to display (e.g.,"https://your-status-board.com"
).SIGNAGE_USER
: You can change the username if desired, but"signage"
is standard for this setup.
- Save the changes (
Ctrl+O
,Enter
in nano) and exit (Ctrl+X
).
- Edit the script using a text editor (like
- Make Executable:
chmod +x setup_signage.sh
- Run as Root:
./setup_signage.sh
- Review Output: Watch the script output for any errors. Pay attention to any warnings, especially regarding
nomodeset
. - Reboot: If the script completes successfully, reboot the system:
reboot
Upon rebooting, the system should automatically log in as the signage
user and launch Weston with Chromium displaying the configured KIOSK_URL
.
How It Works (Technical Details)
The script performs the following main steps:
- Checks for root privileges.
- Checks
/proc/cmdline
for thenomodeset
kernel parameter and issues a warning if found (as this prevents Weston's DRM backend from working). - Updates Alpine package repositories (
apk update
). - Runs
setup-wayland-base
to install and configureelogind
,eudev
, enable the community repository, and set up related services. - Installs core packages:
weston
,weston-backend-drm
,weston-shell-desktop
,chromium
,mesa-dri-gallium
,mesa-va-gallium
,dbus
, fonts,util-linux
(for dependencies),linux-firmware
,greetd
,greetd-agreety
. - Ensures the
dbus
service is enabled and started. - Creates the non-root user (
signage
by default) with/bin/sh
as the shell. - Creates Weston configuration (
~/.config/weston.ini
) settingidle-time=0
(no screen blanking) and specifying Chromium as the client, ensuring the--ozone-platform=wayland
flag is used. - Creates
greetd
configuration (/etc/greetd/config.toml
) to useagreety
on VT1, perform autologin for thesignage
user, and set the session command to/usr/bin/weston
. - Modifies
/etc/inittab
to start/usr/sbin/greetd
on tty1 instead of the default getty/login prompt. - Attempts to add
pam_elogind.so
to the PAM configuration (/etc/pam.d/greetd
or/etc/pam.d/system-auth
) to ensureelogind
handles session setup correctly (including$XDG_RUNTIME_DIR
).
IMPORTANT: nomodeset
Boot Parameter
Weston requires Kernel Mode Setting (KMS) graphics drivers to function with its primary (drm
) backend. The kernel parameter nomodeset
disables KMS drivers.
If the setup script warned you about nomodeset
being present, the graphical kiosk WILL NOT WORK.
You MUST remove nomodeset
from your kernel boot arguments. Edit your bootloader configuration file:
- Syslinux/Extlinux: Edit
/boot/extlinux.conf
. Find the line(s) starting withAPPEND
and delete the wordnomodeset
. - GRUB: Edit
/etc/default/grub
. Find the line(s) starting withGRUB_CMDLINE_LINUX_DEFAULT=
andGRUB_CMDLINE_LINUX=
and delete the wordnomodeset
from within the quotes. After saving, runupdate-grub
.
Reboot after modifying the bootloader configuration.
Troubleshooting
If the kiosk doesn't start correctly after rebooting:
- Switch TTY: Press
Alt+F2
(orF3
,F4
, etc.) to get to another virtual console login prompt. - Login as Root: Use the root username and password.
- Check Logs & Status:
- Greetd:
cat /var/log/messages | grep greetd
(Look for errors starting or running greetd) - Weston:
cat /home/signage/.local/share/weston/weston.log
(Look for DRM errors, GL errors, client launch errors) - XDG Runtime Dir:
ls -ld /run/user/$(id -u signage)
(Should exist, owned bysignage
, permissionsdrwx------
) - Services:
rc-service elogind status && rc-service dbus status
(Both should be started) - inittab:
grep ^tty1 /etc/inittab
(Should show/usr/sbin/greetd
) - Kernel Messages:
dmesg | tail -n 50
(Look for graphics/DRM driver errors, especially if you suspectnomodeset
issues) - Greetd Config:
cat /etc/greetd/config.toml
(Verify syntax, command path, user) - Weston Config:
cat /home/signage/.config/weston.ini
(Verify syntax, client path, Chromium flags)
- Greetd: