16 KiB
Architecture
Geminux combines a custom-patched Linux 7.3.5 kernel, pure-Linux MTK flasher, XLibre graphics server, patched suckless desktop, unified .Xresources + wallpaper engine, and zero-poll C11 daemons packaged as signed Alpine APKs so standard Alpine Edge updates continue working cleanly.
Kernel and MediaTek MT6797X support
Vanilla Linux 7.3.5 is built from patches/kernel/ with built-in IPsec (CONFIG_XFRM_USER=y, esp4, esp6, af_key, xfrm_interface) for 3GPP IMS alongside Gemini PDA hardware support:
| Patch | Purpose |
|---|---|
0001-ixoo-gemini-pda-mainline-7.3.5.patch |
Core MT6797X / Gemini PDA mainline 7.3.5 platform, DRM, keypad, PMIC, and fuel-gauge base |
0002-mt6797-ccci-cldma-and-md1-domain.patch |
Staged mt6797-ccci-cldma baseband transport and MD1 power-domain support |
0003-arm64-dts-mediatek-geminux-gemini-pda.patch |
Geminux Device Tree bindings, pinmux, regulators, and peripheral wiring |
0004-gemini-ssd2092-display-and-touch.patch |
Solomon Systech SSD2092 DSI FHD+ panel and multi-touch controller fixes |
0005-mt6797-consys-wifi-factory-firmware.patch |
MT6797 CONSYS Wi-Fi/BT driver and factory firmware/NVRAM loading |
0006-mt6797-boot-cleanups.patch |
Early boot and console noise cleanups |
0007-mt6797-wlan-peer-deauth-and-rekey.patch |
WLAN station deauth recovery and GTK rekey stability |
0008-gemini-resume-wake-and-spm-standby.patch |
S3 resume wake handling, mt6797-spm-sleep standby, mtk-eint debounce clear, and mtk-pmic-keys wakeups |
0009-mt6797-wlan-drop-free-stability.patch |
CONSYS WLAN RX/TX buffer drop-free stability under load |
0010-mt6797-ccci-md1-boot-hs-v2-and-rpc.patch |
MD1 boot handshake v2 and CCCI RPC stabilization |
0011-gemini-lid-sync-filter-and-debounce.patch |
Synchronous Hall GPIO66 lid-close keystroke/touch filtering, 1 ms Hall EINT & 10 ms keypad debounce, and touch inhibit |
0012-gemini-lid-wake-and-fg-taper-fix.patch |
gemini-lid PM_POST_SUSPEND + raw-GPIO reconciliation (BL_CORE_SUSPENDED/input lockout fix) and mt6351 + bq25890 zero-current OCV calibration, CV-taper checks, +1% cap, and 180 mV ADC21 sag tolerance |
0013-gemini-pmic-wake-and-spm-safety.patch |
Moves mt6397_irq_suspend/mt6397_irq_resume from PM_SUSPEND_PREPARE into LATE_SYSTEM_SLEEP_PM_OPS so child enable_irq_wake() settings arm cleanly before deep sleep; hardens mt6797-spm-sleep s.sleep with WAKE_PCM_WDT, pcm_wdt, im_wait (1000 us), and a 5000 ms cntp physical timer backstop (100 ms on s.sodi) |
Hardware subsystems
- Graphics & display: MediaTek DRM (
mediatek-drm),SSD2092DSI FHD+ panel/touch, early-bootsimpledrm(DRM_SIMPLEDRM=y+ rotatedTER16x32console), Mali-T880panfrostGPU, andsii902xSlimport/HDMI bridge. - Wi-Fi / Bluetooth CONSYS: Staged
mt6797_wlan_coreandbtmt6797drivers backed by NVRAM/factory firmware provisioning (geminux-wifi-nvramandfirmware-cache/mt6797/), hardened by0007and0009. - Modem / Telephony / eSIM / IMS:
mt6797-ccci-cldmaexposes/dev/ccci_md_ctl,/dev/ccci_fs,/dev/ccci_rpc,/dev/ttyC0..3, andccmni*via the 16-bytestruct mt6797_ccci_headerUAPI (prebuilt/kernel/include/linux/mt6797_ccci.h):- geminux-ccci-fs.c (
geminux-ccci-daemon): MD1 boot HS v2, NVRAM/CCCI_FS I/O, and RPC (MD_STATE=READY). - geminux-cellctl.c (
geminux-cellctl): physical SIM vs. ST33 eUICCAT+ESIMSswitching,lpacAT-CSIM/CGLAAPDU bridging, andccmni*LTE PDN bring-up. - geminux-imsd.c (
geminux-imsd): 3GPP VoLTE (ccmni*) & VoWiFi (SWuIKEv2/IPsec viastrongswan), MILENAGE AKA, kernel XFRMipsec-3gpp(with RFC 4303 userspace ESP fallback), SIP signaling,RP-DATASMS, and 20 mstimerfdAMR-NB/AMR-WB/G.711/DTMF RTP bridged to PipeWire/ALSAVoiceCall.
- geminux-ccci-fs.c (
- Boot, LUKS2 FDE & recovery: LK-compatible images (
images/boot-geminux.img,images/recovery-geminux.img) built withmkbootimg-osm0sis(16 MiBboot ceiling,512 KiBDTB ceiling). Built-inBLK_DEV_DM=y,DM_CRYPT=y, and ARMv8 AES-CE (CRYPTO_AES_ARM64_CE_BLK=y) power initramfs unlock (cryptsetup+/etc/gemini-us.kmap,DM_DISABLE_UDEV=1). src/initramfs/init runs the off-mode charger guard, optionally unlocksPARTLABEL=linux->/dev/mapper/geminux_root, checks ext4 (e2fsck -p </dev/null), and expands the filesystem on first boot (resize2fs -f </dev/null). src/initramfs/init-recovery provides a USB NCM/RNDIS shell (172.16.42.1/24) with LUKS2-awareunlock-root,check-fs, andmount-root.
Graphics, window management, and stability
XLibre (25.x)
Cross-compiled against pure Alpine Edge aarch64 sysroots with modesetting_drv.so, fbdev_drv.so, libinput_drv.so, and Panfrost Glamor EGL (libglamoregl.so) via scripts/build-xlibre.sh. 10-geminux-gpu.conf sets AccelMethod "none", ShadowFB "true", TearFree "true", PageFlip "false", SWcursor "true", and Rotate "left" to prevent rotated DSI tearing and Glamor fence spin-wait overhead while keeping Panfrost EGL/OpenGL 3D active for applications. Zero Wayland compositors are installed.
Patched suckless desktop
dwm:- Systray & stacking: 32-bit ARGB XEmbed systray (
_NET_SYSTEM_TRAY_S0), XEmbed reparent/input race protection, and automatic restacking below fullscreen lockscreen windows. - EWMH / ICCCM / NETWM:
_NET_WORKAREAdock struts,_NET_WM_STATE_{FOCUSED,STICKY,ABOVE,HIDDEN}, desktop/PID atoms,WM_CHANGE_STATE,nofocuswinfallback, and Wine/DXVK focus recovery. - X11 / Pango hardening:
in_xerrorrecursion guard with rate-limited non-fatalRENDERerror ignoring, bounded200 msgetservertime()polling, async grab safety (AsyncBoth/GrabModeAsync), and PangoPANGO_ELLIPSIZE_END+FC_COLOR=FcFalse+ UTF-8 sanitization indrw.c(avoiding XRenderBadLengthfaults on color emoji glyphs). - Gemini UX:
>= 78 pxtouch top bar,Mod4 = Fn+Alt+ one-shotSuper_Ltap-latch,Fn+FAirplane Mode binding,Mod4 + Shift + r&SIGUSR1.Xresourcesreload, andSIGHUPself-reexec.
- Systray & stacking: 32-bit ARGB XEmbed systray (
dmenu: Pango/HarfBuzz rendering with82 pxtouch rows,dmenu_xerrorrecursion & non-fatalRENDERguards,FC_COLOR=FcFalse+ UTF-8 sanitization, and direct mouse/touch selection. Pairs withgeminux-launcherpinning the 11 GUI apps alongsideWallpaper,Webarchy Browser,Bantam AI agent, andLynx Web Browserinst(wrappingTerminal=true.desktopentries inst -e).st: HarfBuzz Fira Code ligatures (hb.c), Nerd Font fallback, mouse/two-finger wheel scrollback, immediate cursor redraw onFocusIn/FocusOut+ unfocused blink gating, and live theme reloading via both directXA_RESOURCE_MANAGERPropertyNotifyandSIGUSR1.- Notifications: Pure-X11 zero-
gdk-pixbufdunst v1.12.2(WAYLAND=0 DUNSTIFY=0) with custom pure-C PNG/JPEG icon loader (src/dunst-notify/) and lightweight GDBusnotify-send/dunstify.
Unified theming and native X11 wallpaper engine
Geminux defaults to the Anodized theme (192 DPI, baseFontSize: 32, Xcursor.size: 64) across /etc/skel/.Xresources and all compiled-in and script fallbacks. On login, geminux-session non-destructively copies newly added /etc/skel/.xthemes/*.xth themes into ~/.xthemes/ and loads ~/.Xresources cleanly via xrdb -nocpp -load.
Theme editor, importer & toolkit synchronization
- Editor & Importer: geminux-xth.h provides shared
.xthparsing/serialization forgeminux-themes(Edit,Duplicate,New,Reset/Delete, live WCAG contrast ratio againstbgMain, andImport .xthstored under~/.config/geminux/themes/). - Synced targets:
geminux-apply-theme(.xth->~/.Xresources+xrdb -nocpp -load) synchronizes:- Dunst:
~/.config/dunst/dunstrcviageminux-sync-dunst-theme - GTK2 / GTK3 /
xsettingsd:Geminux-<Theme>light/dark styling in~/.gtkrc-2.0,~/.config/gtk-3.0/{settings.ini,gtk.css}, and~/.config/xsettingsd/xsettingsd.conf(SIGHUPreload) - GTK4 &
libadwaita:~/.config/gtk-4.0/{settings.ini,gtk.css}+dconfcolor-scheme(ADW_DISABLE_PORTAL=1in 10-geminux-env.sh) - Qt5 / Qt6:
qt6ct21-roleQPalette(QT_QPA_PLATFORMTHEME=qt6ct:gtk3) and Kvantum (QT_STYLE_OVERRIDE=kvantum) - Tcl/Tk (
gtkTtk 0.9):*TkTheme: gtkTtk+ DPI-scaled widget geometry against~/.gtkrc-2.0with pure-X11 XImage blitting and zero-pollXA_RESOURCE_MANAGERlive reload (src/gtkTtk/) - X11 clients: Instant redraw via
XA_RESOURCE_MANAGERPropertyNotifyandSIGUSR1(dwm,st,webarchy,libgemui)
- Dunst:
Native X11 + Cairo wallpaper engine
- Core engine: geminux-wallpaper.h (pure-C11 config & placement geometry) + geminux-wallpaper-x11.h (X11/Cairo renderer) integrated into
geminux-themesand exposed to CLI viageminux-apply-wallpaper. - Image decoders: Decodes via runtime
dlopen("libgdk_pixbuf-2.0.so.0")(EXIF auto-orientation + PNG/JPEG/GIF/BMP/ICO/XPM/XBM/TGA/PNM powered bygeminux-gdk-pixbuf), Cairo PNG,libjpeg-turbo,libwebp, and optionalmagick/convertfallback. - Root Pixmap protocol: Renders onto an X11 root
Pixmapusing a dedicatedDisplayconnection withXSetCloseDownMode(..., RetainPermanent), publishing_XROOTPMAP_IDandESETROOT_PMAP_IDand cleaning up previous clients viaXKillClient. Supports multi-monitor geometry via XRandR and Xinerama. - Persistence & hooks: Saves state to
~/.config/geminux/wallpaper.confand restores automatically on login (geminux-session), on theme changes whenUSE_THEME_BG=1(geminux-apply-theme), and after external HDMIxrandrlayout switches (geminux-net).
Webarchy, pure-C gdk-pixbuf & media stack
- Webarchy: src/webarchy/webarchy.cpp is a C++20
GTK3+WebKit2GTK-4.1browser tuned for2160x1080(1080x506logical @GDK_SCALE=2) with a collapsible right-side vertical tab bar,SIGUSR1.Xresourcesreloading, SQLite cookies/bookmarks, single-instance FIFO forwarding, and WebProcess crash software fallback. - Pure-C
gdk-pixbuf& schemas: scripts/build-webarchy.sh cross-compiles pure-C GNOMEgdk-pixbuf 2.42.12(-Dbuiltin_loaders=all, zerolibglycin/librsvg), and scripts/compile-gsettings-schemas.sh builds/usr/share/glib-2.0/schemas/gschemas.compiled. - Media &
yt-dlp: Native Alpine Edgempv(overlay/rootfs/etc/mpv/mpv.conf — Panfrost X11 EGL, PipeWire/Pulse/ALSA,/tmp/geminux-mpv.sockIPC),ffmpeg/ffprobe,gst-libav,mpg123,openmpt123,python3/py3-pip, andyt-dlp(quickjs, avoidingdeno/py3-cryptography).
Custom UI toolkit and zero-poll C11 daemons
libgemui.so(src/libgemui/): Double-buffered Cairo + Pango/HarfBuzz Xlib toolkit with directXA_RESOURCE_MANAGERPropertyNotifyandSIGUSR1.Xresourceslive reloads, fullscreen lockscreen visibility restacking, button contrast guards, X11 clipboard paste, dynamic timers,MSG_NOSIGNALsocket IPC (gemui_unix_cmd), and non-blocking extra FDs.- 11 landscape HiDPI apps (src/geminux-apps/):
geminux-control,geminux-audio,geminux-datetime,geminux-net(Wi-Fi, Cellular/ST33 eSIM, Bluetooth, HDMI,DNStab, Airplane Mode),geminux-dialer,geminux-callscreen,geminux-sms,geminux-contacts,geminux-camera,geminux-themes(Themes, Theme Editor,.xthImporter & Wallpaper), andgeminux-lock. - Zero-poll C11 daemons (src/geminux-daemons/):
geminux-powerd:epollover/dev/input/event*(SW_LID,KEY_POWER,mtk-pmic-keysKEY_ESC), filteredKOBJECT_UEVENT(input,power_supply,drm),/run/geminux/powerd.sock, andtimerfd:- Enforces
inhibit_ac_lid(locks/blanks without unloading CONSYS or calling/sys/power/statewhile on USB/AC). - Tears down
mt6797_consysand parkscpu1..9offline before batterymemsuspend or zero-thrashlow_power_standbywhenMD1is active (neverfreeze/s2idle). - Polls post-resume input/lid events (
90 ms) even when the lid is open so only aclosed -> openlid transition, realEV_KEY/EV_REL/EV_ABSactivity, or USB/AC attach counts as a wake; internal timer wakes during open-lid idle lock re-suspend cleanly (quiet_timer_resleep) without reloading CONSYS or waking the backlight. - Persists hardware Airplane Mode (
/var/lib/geminux/airplane-mode) and resolves UID10000dynamically.
- Enforces
geminux-statusd:epolloversignalfd(SIGUSR1),RTMGRP_LINK/RTMGRP_IPV4_IFADDR, filteredKOBJECT_UEVENT(power_supply,net),inotify, and minute-alignedtimerfd; showsAIRPLANEstatus and deduplicatesWM_NAMEupdates with zero shell forks.geminux-touchd: XInput 2.2 multi-touch gesture recognizer.geminux-leds: AW9120 back cover RGB controller (/run/geminux/leds.sock, off when idle/100%, amberrgb:indicator-6while charging, persistent manual override).geminux-ccci-daemon,geminux-cellctl,geminux-imsd,geminux-modem-ctl,geminux-bt-obex,geminux-dnsctl,geminux-power-ctl,geminux-power-audit,geminux-tzctl,geminux-wifi-nvram,geminux-checkpw: Event-driven platform daemons and control helpers.
APK package pinning and package policy
- Pure Edge rootfs: Host Docker containers use
postmarketos/v26.06only forgcc-aarch64,binutils-aarch64, andmkbootimg-osm0sis. Both$SYSROOTand target$ROOTFScome strictly from Alpine Edge (main,community,testing) plus the RSA-4096 signed local@geminuxrepo (/var/lib/geminux/apk-repo). - Eleven signed local packages: scripts/package-local-apks.sh builds and indexes:
geminux-kernel-modulesgeminux-xlibregeminux-sucklessgeminux-dunstgeminux-uigeminux-bantam(scripts/build-bantam.sh)geminux-gsocket(scripts/build-gsocket.sh)geminux-gdk-pixbuf(scripts/build-webarchy.sh)geminux-webarchy(scripts/build-webarchy.sh)geminux-gtkttk(scripts/build-gtkttk.sh)geminux-config(/etc/mpv/mpv.conf,/etc/htoprc,~/.lynx.cfg,~/.apexrc,~/.bashrcwithGPG_TTY,/etc/profile.d/10-geminux-env.sh,/etc/init.d/geminux-sdcard+95-geminux-sdcard.rules+/usr/sbin/geminux-sdcard-mount)
- World pins & exclusions:
/etc/apk/worldexact-pins all 11 withname@geminux=versionand blocks Rust/Wayland/override packages via!constraints from scripts/rootfs-prune-packages.txt (librsvg,rav1e/rav1e-libs,libdoviwhitelisted). Enforced by ELF Rust scans,apk upgrade --simulate, and 9 host Python test suites in scripts/check-rebuild.sh. - Config protection:
/etc/apk/protected_paths.d/geminux.listshields Geminux config directories acrossapk upgrade.
Pure-Linux flasher and eMMC layout
flash-mtk.py embeds vendored GPLv3 mtkclient + MTK_DA_V5_MT6797.bin to communicate directly over USB BROM/DA. Protected partitions in LBA 0..0x6FFFF (preloader, nvram, proinfo, lk, tee1, md1img, etc.) are backed up and write-blocked by default (0x0E000000 boundary verified in scripts/test-flash-mtk-gpt.py).
On staged copies of geminux-rootfs.img (without modifying images/geminux-rootfs.img), scripts/geminux_accounts.py handles offline $6$ SHA-512 /etc/{passwd,group,shadow} and /home/<username> provisioning via debugfs/e2fsck, and scripts/geminux_luks.py optionally wraps the staged ext4 image in LUKS2 via unprivileged host cryptsetup reencrypt --encrypt --disable-locks.