pigo-config – System Provisioning and Hardware Configuration for PiGo OS

Why PiGo Needs a Dedicated Configuration Repository
A fresh Raspberry Pi OS Lite installation knows nothing about PiGo's custom carrier PCB. Out
of the box, the 320×240 SPI display stays dark, the onboard I2S sound chip has no software
volume mixer, the backlight PWM pin is uninitialized, the uinput kernel module
is not exposed to non-root users, and the system boots into a blinking TTY login prompt
instead of a game launcher.
Configuring all of those pieces by hand is tedious and impossible to reproduce reliably. pigo-config solves this by bundling every hardware overlay, boot parameter, systemd unit, Wayland rule, and system cleanup step into a single, versioned, idempotent provisioning repository.
Purpose: One Script for Both Image Builds and Live Updates
The key design goal of pigo-config is that it works identically in two very
different environments:
-
During Offline Image Generation (
pi-genchroot): Where no runningsystemdor user D-Bus session exists, so services and user lingering must be enabled via direct filesystem symlinks and/var/lib/systemd/linger/pigo. -
On a Live PiGo Handheld: Where
update.shpulls the latest changes from GitHub and re-runsinstall.shto apply new configurations, updatepigoguianduinput-pigo-mapper, and keep the console up to date.
How the Code Is Structured
The repository is intentionally flat and transparent — every file maps directly to a concrete subsystem on the Raspberry Pi:
1. Custom Hardware Overlays & Boot Config
-
ili9341-modern.dts: A Device Tree Source overlay targeting&spi0for the 320×240 ILI9341 display. It configures a 32 MHz SPI clock, mapsdc-gpiosto GPIO 6 andreset-gpiosto GPIO 5, and setsrotation = <270>for landscape handheld orientation. During installation,install.shcompiles it on the fly withdtcinto/boot/firmware/overlays/ili9341-modern.dtbo. -
config.txt: Enables I2C (dtparam=i2c_arm=on), SPI (dtparam=spi=on), DRM/KMS (dtoverlay=vc4-kms-v3d), the customili9341-moderndisplay overlay, and I2S audio (dtoverlay=hifiberry-dacanddtoverlay=i2s-mmap). It also tunes boot speed and memory withgpu_mem=32,arm_boost=1,disable_splash=1,boot_delay=0, andinitial_turbo=20. -
asound.conf: Configures ALSA with admixsoftware mixer and asoftvol(PCM) layer on top of the I2Sspeakerbonnethardware card, ensuring multiple audio streams can play together and software volume control works seamlessly in games and the launcher. -
99-uinput.rules: GrantsGROUP="input"withMODE="0660"on/dev/uinput, paired with/etc/modules-load.d/uinput.confso the virtual input subsystem is always ready foruinput-pigo-mapper.
2. Wayland Compositor & Systemd Boot Chain
Rather than booting into X11 or a login shell, pigo-config sets up a lean
four-unit boot pipeline:
-
lightdisplay.service: Runs early atsysinit.targetto enable hardware PWM on GPIO 13 (gpio -g pwm 13 1024via WiringPi), lighting up the screen immediately. -
sway.service: A user-level systemd service (backed byseatd.servicefor KMS/DRM access without a VT login) that starts the Sway Wayland compositor automatically for userpigo. -
sway.config: Disables XWayland, hides the status bar, locks the EDID-less SPI display to320x240, forces all game windows fullscreen, and pinsapp_id="pigogui"as a floating, sticky overlay so the Quick Menu and HUD bars always render cleanly on top of paused games:
mode 320x240
scale 1
transform normal
}
for_window [app_id=".*"] fullscreen enable
for_window [app_id="pigogui"] fullscreen disable
for_window [app_id="pigogui"] floating enable
for_window [app_id="pigogui"] sticky enable
-
pigogui.service: Waits until$XDG_RUNTIME_DIR/wayland-1appears, then launches/opt/pigo/pigogui/start.shwithRestart=on-failure.
3. Provisioning, Binaries & Image Slimming (install.sh)
install.sh orchestrates the entire setup: it installs core runtime libraries
(sway, seatd, libsdl2-2.0-0,
python3-libevdev, pipewire-pulse, network-manager,
mpg123, libcurl4, libopenal1, and audio codecs),
adds user pigo to video,input,audio,tty, clones or updates
pigogui and uinput-pigo-mapper into /opt/pigo/,
patches /boot/firmware/cmdline.txt for silent boot on tty3, and
fetches the prebuilt ARM64 LVGL micropython binary and WiringPi.
Finally, it aggressively trims the OS footprint: purging unused Wi-Fi/Bluetooth firmware for
non-Pi hardware, compilers (gcc, g++), debuggers, manpages, extra
locales (keeping only English and German), Python __pycache__ directories, and
capping the systemd journal to 20 MB while setting vm.swappiness=10.
Role in the PiGo Handheld Ecosystem
pigo-config is the system integration backbone of PiGo OS.
pi-gen-pigo invokes pigo-config/update.sh to transform a generic
Raspberry Pi OS Lite rootfs into PiGo OS, and every other component relies on the environment
it prepares: uinput-pigo-mapper depends on its udev rules and kernel module,
pigogui depends on its Sway/Wayland session and LVGL MicroPython binary, and
every game benefits from its silent, fast-booting, low-overhead Linux foundation.
