Kiosk terminal image builder for Raspberry Pi
This project builds an image for a Raspberry Pi that boots directly into a browser with a predefined web page. It is a soft fork of https://git.fsmpi.rwth-aachen.de/thomas/ci-vm-image (which was designed for CI VM images on amd64).
The system runs from RAM, almost all changes at runtime are ephemeral. The device can safely be unplugged without shutting down with no real risk of data loss. As the boot partition is mounted read-write in order to regularly update the software clock, there is still a minor chance, but in practice it is very unlikely to corrupt the file system.
On boot, the kiosk
user is automatically logged in and launches Firefox in
kiosk mode with /boot/CONFIG/kiosk.html
(see below). Terminal switching is
possible, both root
and kiosk
passwords are empty. When Firefox quits, it
will automatically be relaunched, unless /tmp/noautologin
exists.
:::warning Bug: Firefox will not show (only blank screen) until the first user input, such as mouse movement or a key press. :::
Building
Requirements: Podman and a native arm64 host or a correctly configured and container-compatible qemu-binfmt setup.
% make # for arm64, RPi 3 and later
% make ARCH=arm # for armv7, RPi 2
RPi 1 (armv6/armhf) is currently untested and unsupported, but could work. One
would need to pass --variant
to the podman
invocation or use a single-arch
image such as docker.io/arm32v6/alpine
.
The results (boot.tar
, root.img
) are placed in the arm64
or arm
directory.
SELinux
On SELinux-enabled systems (such as Fedora), the container may not have access
to the directories. Either move the whole building directory to an
appropriately labelled place, or customise the scripts to place the in-container
directories elsewhere, or set the type context label of the build directory to
container_file_t
(e. g., chcon -R -t container_file_t .
). You may
need to install container-selinux
manually on Fedora.
Flashing
- Partition an SD card with the typical RPi layout:
- a small-ish (~200MiB should be enough, cf. size of
boot.tar
) partition at the beginning of MBR type0x0c
for the boot file system, - and a partition of at least 2GiB and type
0x83
for the root file system.
- a small-ish (~200MiB should be enough, cf. size of
- Create a FAT32 file system (e. g.,
mkfs.vfat /dev/mmcblk0p1
) on the first partition. - Mount the first partition and extract
boot.tar
to its root. You can ignore the error that theboot
symlink cannot be created. - Copy
root.img
to the second partition (e. g., `pv -pterbaY root.img/dev/mmcblk0p2`)
Configuration
All configurables are stored in the CONFIG
directory of the boot partition,
i. e., /boot/CONFIG/
in the running system.
swclock
- Software clock. On boot, system time is set to the time stamp of this file. Every hour, the time stamp of this file is updated. During normal operation, time should be updated via NTP.
interfaces
- Configuration for ifupdown-ng.
hostname
- System host name.
kiosk.html
- Opened on boot, would typically contain a redirect to a web site.
wpa_supplicant.conf
- Additional WLAN configuration, required for WPA-EAP (PSK is possible via
interfaces
alone).