Skip to content

About

drumLinux — DRM Kiosk Distribution

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drumLinux — DRM Kiosk Distribution

A minimal Debian-based Linux that boots straight to the DRM (no X11) and presents a fullscreen, multi-tab, GPU terminal (kitty) on the weston kiosk shell. Built reproducibly in WSL2, runs in QEMU on Windows (WHPX CPU acceleration, virgl GPU, dsound audio) — and boots on real hardware thanks to a minimal common-driver kernel.

kernel 6.12.102-kiosk → initramfs → systemd
  → weston (DRM backend, kiosk shell) → kitty fullscreen (tabs, GPU)
  → virgl → host GPU      |      audio: virtio-snd → dsound

Demo

drumLinux kiosk booting in QEMU (kitty on weston)

Fullscreen kitty on the weston kiosk shell, booting in QEMU on Windows (virgl GPU, GPU-accelerated text). Trimmed screen recording: 12.6 s.

Default credentials

Username root (admin console)
Password kiosk
Username kiosk (runs the GUI, unprivileged)
Password kiosk

Change both with passwd — they are local-VM defaults. The GUI (weston + kitty) runs as the kiosk user via the seatd daemon, so the on-screen terminal is NOT a root shell.

Quick start (run the image)

One image, one launcher — the boot menu picks the mode:

powershell -ExecutionPolicy Bypass -File run\qemu-run.ps1
  • At boot, the menu shows: "drumLinux (kitty - GUI kiosk)" (default, boots after 30 s) or "drumLinux (kmsconsole - root shell, no GUI)".
  • GUI mode: the drumLinux banner shows, then kitty opens fullscreen.
  • Login (console tty1 or serial): root / kiosk
  • Tabs in kitty: Ctrl+Shift+T; quitting kitty relaunches it after ~2 s (kiosk-kitty-loop); systemctl stop kiosk-weston.service stops the GUI
  • Shut down cleanly: log in and type poweroff

QEMU shortcuts (SDL window)

  • Ctrl+Alt+f — toggle full screen (QEMU starts fullscreen; press this to window it)
  • Ctrl+Alt+g — release / re-grab the mouse pointer from the VM
  • Close the SDL window to quit QEMU (a hard close is fine — the next boot fsck's the image; poweroff in the guest is still the cleanest)

The image (out/drumlinux.img)

The only artifact: a persistent live image — single ext4 partition (the whole system on /), SYSLINUX in the MBR, no GRUB, no installer. Boot it directly from a USB stick or in QEMU:

# QEMU (or just run\qemu-run.ps1)
qemu-system-x86_64 -machine pc,accel=whpx -m 2G -drive file=out\drumlinux.img,format=raw -display sdl,gl=on -full-screen

# Write to USB (Linux)
dd if=drumlinux.img of=/dev/sdX bs=4M status=progress
# Windows: Rufus / balenaEtcher in DD mode

Because the root filesystem is writable, apt install persists — anything the user installs is still there on the next boot. Build it with build/make-distro-image.sh.

Boot menu (drumlinux.img)

At boot, SYSLINUX shows a menu — pick "drumLinux (kitty - GUI kiosk)" (default, boots after 30 s) or "drumLinux (kmsconsole - root shell, no GUI)". The kmsconsole choice adds kmsconsole to the kernel cmdline, which makes the weston service skip the GUI and leaves you on the plain console.

Login is root / kiosk on the console (tty1) and the serial console. The GUI kiosk itself starts automatically without any login — weston + kitty run as the unprivileged kiosk user (DRM/input via seatd).

Restart weston / kitty

systemctl stop kiosk-weston.service     # stop the GUI entirely
systemctl start kiosk-weston.service    # start (or restart) the GUI

kitty runs via kiosk-kitty-loop, a single path after weston's -- — weston re-joins the tail args through sh -c, so an inline sh -c 'while true; do kitty; done' wrapper loses its quoting and kitty never starts. Quitting kitty relaunches it after a 2 s pause; the compositor itself stays up.

Troubleshooting

Symptom What to do
kitty / weston doesn't start systemctl status kiosk-weston.service; cat /var/log/weston.log; journalctl -u kiosk-weston. If / is read-only (mount | grep ' / ' shows ro), that's the cause — next row.
Root fs read-only (ro) The image was hard-killed (QEMU window closed mid-run). Boot once more: the initramfs now fsck's the ext4 (e2fsprogs is in the image) and the rw boot flag remounts it writable. Stubborn case: run e2fsck -fy on the partition from WSL.
Black / blank QEMU window Use -display sdl,gl=on (the gtk path is broken on Windows). The kiosk kernel ships DRM_FBDEV_EMULATION — without it there is no /dev/fb0 and nothing reaches the window.
Qt demo shows a static rectangle Run kiosk-qt-demo --seconds 10 -platform eglfs and read stderr (serial): it prints GL ... | renderer ... and fps lines plus any shader compile/link errors. No fps output = the repaint loop isn't running.
kitty quits and stays gone It relaunches after ~2 s via kiosk-kitty-loop. If weston also exited: systemctl start kiosk-weston.service.
Serial input mangled / dropped chars The guest's 8250 RX overflows while weston+kitty render. Type slowly, or use the SDL window (Ctrl+Alt+g grabs the mouse).
QEMU window not fullscreen / odd size Use -full-screen (this QEMU build rejects display sdl,fullscreen=on); Ctrl+Alt+f toggles fullscreen at runtime.

Debugging

Techniques that proved useful while developing drumLinux:

1. The serial console is your eyes. Every QEMU run exposes a login on the serial console (-serial stdio in run\qemu-run.ps1 — the PowerShell window it launches from). Log in as root / kiosk and inspect the live system:

mount | grep ' / '                # root rw?  (ro = image was hard-killed)
systemctl status kiosk-weston.service
journalctl -u kiosk-weston --no-pager
cat /var/log/weston.log
ps -o user=,comm= -C weston       # who is weston running as? (expect: kiosk)

2. Automated serial capture. run\qemu-boot-test.ps1 boots the image and writes the whole serial stream to out\img-boot.log — hands-off, scriptable, great for CI-style checks.

3. Type slowly when driving the serial programmatically. While weston/kitty render, the guest's 8250 serial RX drops characters. Send one character at a time and wait for its echo before sending the next (that is what made reliable scripted login + commands possible).

4. Find regressions with git. "It worked before change X" → find the suspect commit, then read the exact diff:

git log --oneline -- configs/kiosk-weston.service   # history of one file
git show <commit> -- configs/kiosk-weston.service   # the exact change

This is how the kitty failure was traced to the sh -c 'while true; do kitty; done' wrapper added during the kms-console work.

5. Instrument the apps. The demos print their state to stderr, which lands on the serial console: kiosk-qt-demo prints GL ... | renderer ... + fps

  • shader compile/link errors. If something renders wrong, run it and read the stderr before guessing — the "static rectangle" turned out to be a rendering path issue, not missing code.

6. The kmsconsole boot-menu entry gives a plain root shell without the GUI — handy for console-only paths and kiosk-drm-demo.

7. Verify what actually landed in the image. After a rebuild, boot and check: wc -L /etc/issue (banner width), id kiosk (user/groups), dpkg -l | grep -E 'seatd|e2fsprogs' — confirm the intended config is real, not assumed.

Demos

Demo What it is How to run
kiosk-drm-demo Pure DRM/KMS (libdrm only, CPU-rendered animated gradient, page flips) kiosk-drm-demo 30 (console: kmsconsole entry, or after systemctl stop kiosk-weston) — ESC quits
kiosk-shader Fullscreen GLSL fragment shader player (Wayland client) In kitty: systemctl stop kiosk-weston && kiosk-shader /etc/kitty/sample-shader.glsl then systemctl start kiosk-weston
kiosk-qt-demo Qt Widgets + OpenGL (eglfs): shaded rotating cube, FPS From serial console: kiosk-qt-demo-run 30 (stops weston, restarts it after)
kiosk-qt-demo-wl Same Qt demo, but as a Wayland client (weston stays up) From serial console: kiosk-qt-demo-wl 30
kiosk-audio On-demand audio test (440 Hz sine via virtio-snd) kiosk-audio [freq] [sec]

Why some demos stop weston

DRM master is exclusive — only one client can own /dev/dri/card0. Direct-DRM apps (kiosk-drm-demo, kiosk-qt-demo on eglfs) must take the screen from weston. Wayland clients (kiosk-shader, kiosk-qt-demo-wl) render through weston and never stop it.

No root needed: every demo runs as the unprivileged kiosk user — DRM access via the video + render groups (virgl GL stays hardware-accelerated), Wayland via weston's session socket. The runner scripts (kiosk-qt-demo-run, kiosk-qt-demo-wl) handle this automatically; kiosk can stop/start the GUI and power off through a scoped sudoers rule — no root shell involved.

Features

  • Boot to a GPU terminal on raw DRM — no X anywhere
  • Hardware GL in the guest (virgl) — kitty text + shaders are GPU-accelerated
  • GLSL shader support via kiosk-shader; Qt via kiosk-qt-demo (+ Wayland)
  • Full apt package management in the running distro
  • Audio: virtio-snd → dsound (real hardware: Intel HDA)
  • Minimal real-hardware drivers built in: SATA/NVMe/USB, e1000e/r8169 LAN, iwlwifi/ath9k/mt76 WiFi, simpledrm (display on any GPU), EFI stub, firmware-linux-free; heavier firmware/drivers via apt
  • KMS console boot mode (kmsconsole on the kernel cmdline)
  • Reproducible: one script builds the whole distro from zero

Build from scratch (WSL2)

# From the project root (WSL resolves the Windows path automatically):
wsl -d Alpine -- sh build/from-scratch.sh

# Incremental rebuild of the image from the existing chroots
wsl -d Alpine -- sh build/make-drumlinux.sh [--force]

Artifacts land in out/ (Windows side): drumlinux.img (the bootable, persistent USB/QEMU image).

Default packages (slim)

Python 3 (+ venv/pip), Qt6 runtime (+ Wayland), mpv, git, chafa, caca-utils, NetworkManager + wpasupplicant (CLI wifi: wifi connect <ssid> [password]), opencode (standalone), free firmware. Everything else is one apt install away — the build prints the optional package list.

Scripts reference

Script Where it runs What it does
build/from-scratch.sh WSL Alpine Wipe everything + full rebuild (debootstrap → kernel → packages → demos → images)
build/make-drumlinux.sh WSL Alpine Incremental rebuild of out/ from existing chroots (--force re-installs packages)
build/build-kernel.sh build chroot Kernel 6.12.102-kiosk (minimal real-hw drivers) → bzImage
build/distro-bootstrap.sh WSL Alpine debootstrap the distro rootfs (/srv/debian-distro)
build/distro-packages.sh distro chroot Slim default package set (kiosk core, python, Qt6, mpv, wifi, opencode…)
build/make-image.sh WSL Alpine Kernel modules + bzImage + initramfs into the distro
build/distro-configure.sh WSL Alpine Configs, branding, root password, services, NetworkManager
build/demos.sh build chroot Compile all demos (kiosk-drm-demo, kiosk-shader, kiosk-qt-demo)
build/make-distro-image.sh WSL Alpine Assemble out/drumlinux.img (bootable persistent single-partition USB image)
build/make-config-deb.sh build chroot Build kiosk-config.deb
build/enter-chroot.sh WSL Alpine Re-mount + enter the build chroot for manual work
build/clean-wsl.sh WSL Alpine Detach leftover loop mounts after interrupted ops
run/qemu-run.ps1 Windows Boot drumlinux.img (menu: kitty GUI or kmsconsole)
run/qemu-boot-test.ps1 Windows Automated boot test of drumlinux.img (serial capture)

Each script documents its own prerequisites and outputs in its header.

Repo layout

app/       demo sources (kiosk-drm-demo, kiosk-shader, kiosk-qt-demo)
build/     build scripts (run in WSL2 Alpine)
configs/   distro configs (banner, weston.ini, kitty.conf, systemd units)
run/       Windows QEMU launchers (GUI + console mode)
out/       build artifacts (gitignored)
SPEC.md    system requirements & architecture (detailed spec)
TODO.md    task tracker

Notes

  • Root password is kiosk — local VM only
  • Set kmsconsole on the kernel cmdline to boot without the GUI
  • See SPEC.md for architecture, the driver list, and lessons learned

Credits

Built with the assistance of DeepSeek (deepseek-v4-flash).

About

drumLinux — DRM Kiosk Distribution

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages