# Geminux Geminux is an Alpine Linux (`aarch64`, musl, OpenRC) distribution tailored for the **Planet Computers Gemini PDA** (Wi-Fi + 4G, MediaTek MT6797X / Helio X27). It pairs a custom-patched Linux `7.3.5-geminux` kernel with XLibre X11, a touch-friendly suckless desktop, 11 HiDPI C11 applications (`libgemui`), MT6797 cellular/eSIM/IMS daemons, and a pure-Linux MediaTek flasher with optional LUKS2 full-disk encryption. ## Highlights - **Desktop & Theming**: Rotated `ShadowFB` + `TearFree` XLibre display with Panfrost EGL/OpenGL 3D acceleration, Pango/HarfBuzz `dwm` / `st` / `dmenu` (Fira Code ligatures and Nerd Fonts), `192 DPI` scaling (`2x`), **22** unified `.xth` themes defaulting to **Anodized**, an interactive **Theme Editor & Importer**, and a native X11 + Cairo **Wallpaper** manager. - **Cellular, Connectivity & Audio**: MT6797 MD1 cellular bring-up (`geminux-cellctl` + `lpac` ST33 eUICC eSIM), 3GPP VoLTE / VoWiFi / SMS-over-IMS (`geminux-imsd`), PipeWire audio + WirePlumber idle suspend, `Fn+F` hardware Airplane Mode, microSD `/media/sdcard` boot/hotplug automount (`geminux-sdcard` / `eudev`), and configurable DNS presets (`geminux-dnsctl`). - **Browser, Media & CLI Tools**: Ultrawide `GTK3`/`WebKit2GTK` **Webarchy** browser (`webarchy` with collapsible vertical tabs), native Alpine Edge `mpv` + `ffmpeg` + `gst-libav`, `yt-dlp` (`quickjs`), `python3`/`pip`, `tcl`/`tk` with dynamic `gtkTtk 0.9`, `gnupg`/`pass`, `dosfstools`, `bantam` CLI AI agent (`kilo-auto/free` default), `lynx`, and `gsocket`. - **Flashing & Security**: Pure-Linux `mtkclient` BROM/DA flasher preserving MediaTek protected partitions (`LBA 0..0x6FFFF`), offline desktop/`root` credential provisioning, and optional Argon2id + ARMv8 AES-CE **LUKS2** full-disk encryption (`--encrypt`) with Gemini matrix keyboard unlock in initramfs. ## Key design goals - **Upgradable Alpine Edge userspace**: Standard packages update normally via `apk update && apk upgrade`. - **Pinned hardware stack**: Kernel modules, XLibre, suckless desktop, `dunst`, custom UI, Webarchy, pure-C `gdk-pixbuf`, `gtkTtk`, `bantam`, `gsocket`, and system configs live in **11** local RSA-signed `@geminux` APK packages (`name@geminux=version`). - **Rust-free & Wayland-free policy**: Disallowed Rust/Wayland/upstream override packages are blocked via `!` pins in `/etc/apk/world` and verified by ELF scanning (`librsvg`, `rav1e`/`rav1e-libs`, and `libdovi` remain whitelisted for ecosystem compatibility and `ffmpeg`/`mpv`/`gst-libav`). - **Full eMMC layout**: Claims user-writable eMMC for Linux (`geminux-root`) without Android dual-boot partitioning, while write-protecting the MediaTek factory region (`LBA 0..0x6FFFF`). - **Optional full-disk encryption**: `--encrypt` wraps `geminux-rootfs` in LUKS2 `aes-xts-plain64` (hardware AES-CE, Argon2id) with early-boot `simpledrm` + Gemini US keyboard unlock and automatic first-boot ext4 expansion. - **End-to-end battery optimization**: Combines kernel tuning (`HZ_100`, `RCU_LAZY`, `SUSPEND`, LZ4 `zram`, `SCHEDUTIL`, `0013` PMIC wake IRQ & SPM safety) with zero-poll `epoll` daemons, A72 cluster gating, `st` unfocused blink gating, default-off cover LEDs, and lid-close deep sleep. ## Component stack | Subsystem | Implementation | Source / Script | | --- | --- | --- | | **Kernel & boot** | Linux `7.3.5-geminux` + 13 Gemini x27 patches (`0001`–`0013`): `SSD2092` DSI/touch, synchronous `gemini-lid`, `mt6351`+`bq25890` zero-current OCV & taper fuel gauge, CONSYS Wi-Fi/BT, CCCI/CLDMA + MD1, S3 resume + `0013` MT6397 `LATE_SYSTEM_SLEEP_PM_OPS` & SPM watchdog/timer safety, XFRM/ESP IPsec, `sii902x`, LUKS2 initramfs | [scripts/build-kernel.sh](scripts/build-kernel.sh) | | **Flasher & GPT** | Vendored GPLv3 `mtkclient` + MT6797 DA + GPT builder + offline credential & LUKS2 provisioning | [flash-mtk.sh](flash-mtk.sh), [flash-mtk.py](flash-mtk.py), [scripts/geminux_accounts.py](scripts/geminux_accounts.py), [scripts/geminux_luks.py](scripts/geminux_luks.py) | | **Display server** | XLibre Xorg 25.x (`modesetting` `ShadowFB` + `TearFree` rotated 2D scanout, Panfrost Glamor/EGL 3D, `fbdev`, `libinput`) | [scripts/build-xlibre.sh](scripts/build-xlibre.sh) | | **WM & terminal** | Patched `dwm` (Pango `PANGO_ELLIPSIZE_END` & `FC_COLOR=FcFalse`, 32-bit ARGB XEmbed systray, full EWMH/ICCCM/NETWM + Wine/DXVK focus recovery, `xerror`/`RENDER` fault guards, live `.Xresources` reload, `Mod4`, `Fn+F` Airplane Mode, `SIGHUP` self-reexec), `st` (HarfBuzz ligatures, live `XA_RESOURCE_MANAGER`/`SIGUSR1` reloads, focus cursor sync & blink gating), full-height touch `dmenu` (82 px rows, `RENDER` guards, UTF-8 sanitization) | [scripts/build-suckless.sh](scripts/build-suckless.sh) | | **Notifications** | Pure-X11 zero-`gdk-pixbuf` `dunst v1.12.2` + custom GDBus `notify-send` / `dunstify` (`geminux-sync-dunst-theme`) | [scripts/build-dunst.sh](scripts/build-dunst.sh) | | **Web & toolkits** | Webarchy C++20 `GTK3` + `WebKit2GTK-4.1` browser (right-side vertical tabs, live `.Xresources` theming), pure-C `gdk-pixbuf 2.42.12`, `tcl`/`tk` + `gtkTtk 0.9` theme engine, synchronized GTK2/3/4/`libadwaita`/Qt5/Qt6/Tk theming | [scripts/build-webarchy.sh](scripts/build-webarchy.sh), [scripts/build-gtkttk.sh](scripts/build-gtkttk.sh), [scripts/compile-gsettings-schemas.sh](scripts/compile-gsettings-schemas.sh) | | **UI, themes & daemons** | `libgemui.so`, 11 HiDPI apps including `geminux-themes` (22 `.xth` themes defaulting to **Anodized**, interactive Theme Editor & Importer, native X11 Wallpaper manager) + `geminux-apply-wallpaper`, zero-poll C11 daemons (`geminux-cellctl`, `geminux-imsd`, `geminux-powerd`, `geminux-statusd`, `geminux-touchd`, `geminux-dnsctl`, etc.) | [scripts/build-geminux-ui.sh](scripts/build-geminux-ui.sh) | | **Media & CLI tools** | Native Alpine Edge `mpv` (`/etc/mpv/mpv.conf` Panfrost EGL + PipeWire + IPC), `ffmpeg`/`ffprobe`, `gst-libav`, `mpg123`, `openmpt123`, `yt-dlp` (`quickjs`), `python3`/`pip3`, `tclsh`/`wish`, `gpg`, `pass`, `dosfstools`, `bantam`, `lynx`, `gsocket`, `.apexrc`, default `htoprc` | [scripts/build-bantam.sh](scripts/build-bantam.sh), [scripts/build-gsocket.sh](scripts/build-gsocket.sh), [overlay/rootfs/etc/mpv/mpv.conf](overlay/rootfs/etc/mpv/mpv.conf) | | **Local APK repository** | 11 signed `@geminux` `.apk` packages + `APKINDEX.tar.gz` | [scripts/package-local-apks.sh](scripts/package-local-apks.sh) | | **Full build & checks** | Full image assembly + automated offline verification suite | [rebuild-image.sh](rebuild-image.sh), [scripts/check-rebuild.sh](scripts/check-rebuild.sh) | ## Repository layout - [kernel/](kernel/) and [patches/kernel/](patches/kernel/) — kernel manifest, MT6797X configuration, and 13 Linux `7.3.5` patches - [src/](src/) — initramfs scripts, `st`, `dwm`, `dmenu`, `dunst-notify`, `bantam`, `webarchy`, `gtkTtk`, `libgemui`, `geminux-apps` (including `geminux-xth.h`, `geminux-wallpaper.h`, `geminux-wallpaper-x11.h`), and `geminux-daemons` - [overlay/rootfs/](overlay/rootfs/) — OpenRC services (`geminux-sdcard`, `geminux-hwinit`, etc.), ALSA UCM2, XKB layout, console keymap, Xorg drop-ins, **22** `.xth` themes (default: `Anodized`), `geminux-apply-theme`, `geminux-apply-wallpaper`, PipeWire/WirePlumber, udev rules (`95-geminux-sdcard.rules`), `/etc/mpv/mpv.conf`, and NetworkManager configs - [scripts/](scripts/) — cross-compilation builders, APK packager, rootfs bootstrapper, verification suite, and 9 host Python unit test suites - [prebuilt/](prebuilt/) — cross-compiled `aarch64` staging tree (`images/` holds built boot, recovery, and ext4 rootfs images) ## Verification status vs. on-device testing **Automated host verification** via [scripts/check-rebuild.sh](scripts/check-rebuild.sh) validates: - Cross-compiled binaries, kernel/DTB artifacts, and GPT repartitioning logic ([scripts/test-flash-mtk-gpt.py](scripts/test-flash-mtk-gpt.py)) - Offline credential/LUKS2 builders, XKB keymap compilation, and `.Xresources`-to-`dunstrc`/GTK/Qt/Tk theme syncing - MT6797 CCCI framing/handshake, 3GPP IMS/AKA/ESP/SIP/RTP protocol handling ([scripts/test-ims-protocol.py](scripts/test-ims-protocol.py)), and zero-poll power policy - Webarchy renderer profiles, WebKit GSettings schemas, `dosfstools` + `/media/sdcard` automount logic, ELF Rust scans, and `apk upgrade --simulate` **Verified on physical Gemini PDA (x27 Wi-Fi + 4G) hardware**: - USB BROM/DA flashing, offline credential provisioning, LUKS2 unlock, and first-boot ext4 resize - `SSD2092` FHD+ display, `geminux-touchd` multi-touch gestures, and tear-free rotated `ShadowFB` scanout - Lid-close and overnight S3 deep sleep/resume, CONSYS Wi-Fi/BT, MT6797 MD1 boot (`MD_STATE=READY`), ST33 eUICC/physical SIM slot switching, and `Fn+F` hardware Airplane Mode - Webarchy Panfrost rendering, PipeWire audio, Media Controller + 10-bit Bayer camera ISP, AW9120 back LEDs, Chrony NTP sync, and USB NCM networking > [!NOTE] > Carrier- and accessory-dependent tests (such as live VoLTE/VoWiFi calls/SMS on an active carrier SIM or external Slimport/HDMI monitors) are covered in the hardware checklist in [INSTALL.md](INSTALL.md). ## Quick start (host build and checks) ```sh ./rebuild-image.sh ./scripts/check-rebuild.sh ``` To rebuild all cross-compiled components from scratch and upgrade preinstalled Alpine Edge packages in `rootfs/` to the latest Edge release: ```sh ./rebuild-image.sh --rebuild-all --force-bootstrap ./scripts/check-rebuild.sh ``` Running `./rebuild-image.sh --force-bootstrap` alone refreshes preinstalled Alpine Edge packages inside `rootfs/` without recompiling toolchains. ## Documentation index - [INSTALL.md](INSTALL.md) — Host prerequisites, flashing workflow, backup, firmware extraction, LUKS2 encryption, and hardware validation checklist - [MANUAL.md](MANUAL.md) — Keyboard layout, DWM shortcuts, themes & Theme Editor, desktop wallpapers, applications, and Alpine Edge maintenance - [ARCHITECTURE.md](ARCHITECTURE.md) — Kernel patch queue, XLibre, suckless hardening, theming/wallpaper engine, `@geminux` APK pinning, and flasher internals - [POWER-OPTIMIZATION.md](POWER-OPTIMIZATION.md) — Deep sleep fixes, zero-poll daemons, CPU cluster gating, and on-device power auditing