17 KiB
Architecture
Geminux combines a custom-patched Linux 7.3.5 kernel, pure-Linux MTK flasher, XLibre graphics server, patched suckless X11 stack, and custom C11 applications and daemons, packaged cleanly into signed Alpine APK packages so standard userspace updates continue working indefinitely.
Kernel and MediaTek MT6797X support
- Kernel tree: Vanilla Linux
7.3.5patched via patches/kernel/ (0001-ixoo-gemini-pda-mainline-7.3.5.patch,0002-mt6797-ccci-cldma-and-md1-domain.patch,0003-arm64-dts-mediatek-geminux-gemini-pda.patch,0004-gemini-ssd2092-display-and-touch.patch,0005-mt6797-consys-wifi-factory-firmware.patch,0006-mt6797-boot-cleanups.patch,0007-mt6797-wlan-peer-deauth-and-rekey.patch,0008-gemini-resume-wake-and-spm-standby.patch,0009-mt6797-wlan-drop-free-stability.patch,0010-mt6797-ccci-md1-boot-hs-v2-and-rpc.patch,0011-gemini-lid-sync-filter-and-debounce.patchadding synchronous Hall GPIO66 lid-close keyboard/touch filtering,1 msHall EINT debounce,10 msmatrix keypad debounce, and touchscreen inhibit, and0012-gemini-lid-wake-and-fg-taper-fix.patchaddinggemini-lidPM_POST_SUSPEND/raw-GPIO recheck reconciliation to prevent stuckBL_CORE_SUSPENDED/ input inhibition alongsidemt6351-fuel-gauge+bq25890boot zero-current OCV calibration (POWER_SUPPLY_PROP_CALIBRATE/MT6351_RGS_CHRDET), consecutivewin_ua+reg_uaCV-taper validation,+1%conservative step caps, and180 mVboot-sagADC21tolerance), withCONFIG_XFRM_USER=yandesp4,esp6,af_key, andxfrm_interfacemodules enabled for 3GPP IMS IPsec. - Graphics & display: MediaTek DRM (
mediatek-drm), Solomon SystechSSD2092DSI FHD+ panel & touchscreen, early-bootsimpledrm(DRM_SIMPLEDRM=y+ rotatedTER16x32console), Mali-T880panfrostGPU driver, andsii902xSlimport/HDMI bridge. - Wi-Fi / Bluetooth CONSYS: Staged
mt6797_wlan_coreandbtmt6797drivers backed by NVRAM/factory firmware provisioning (geminux-wifi-nvramandfirmware-cache/mt6797/), hardened by0007and0009for peer deauth, GTK rekey, and drop-free RX/TX buffer handling. - Modem / Telephony / eSIM / IMS: Staged
mt6797-ccci-cldmadriver exposing/dev/ccci_md_ctl,/dev/ccci_fs,/dev/ccci_rpc,/dev/ttyC0..3, andccmni*network interfaces with the 16-bytestruct mt6797_ccci_headerUAPI (mt6797_ccci.h).geminux-ccci-daemon(geminux-ccci-fs.c) serves MD1 boot handshake v2, NVRAM/CCCI_FS file I/O, and RPC queries (MD_STATE=READY);geminux-cellctl(geminux-cellctl.c) handles physical SIM vs. ST33 eUICCAT+ESIMSslot switching,lpacAT-CSIM/CGLAAPDU bridging for eSIM provisioning, andccmni*LTE PDN bring-up;geminux-imsd(geminux-imsd.c) provides 3GPP VoLTE overccmni*and VoWiFiSWuIKEv2/IPsec viastrongswan, ISIM/USIM MILENAGE AKA, kernel XFRMipsec-3gppwith RFC 4303 userspace ESP fallback, SIPREGISTER/INVITE/BYE/MESSAGE, 3GPPRP-DATASMS, and 20 mstimerfdAMR-NB/AMR-WB/G.711/DTMF RTP bridged to PipeWire/ALSAVoiceCallUCM2. - Boot, LUKS2 FDE & recovery: Packed LK-compatible Android boot images (
images/boot-geminux.img,images/recovery-geminux.img) built withmkbootimg-osm0sis(16 MiBboot slot ceiling,512 KiBDTB ceiling). The kernel includes built-inBLK_DEV_DM=y,DM_CRYPT=y, and ARMv8 AES-CE (CRYPTO_AES_ARM64_CE_BLK=y), and the initramfs bundlescryptsetupplus a standalone binary Gemini US keymap (/etc/gemini-us.kmap). WithDM_DISABLE_UDEV=1, src/initramfs/init runs the off-mode charger guard, optionally unlocks LUKS2PARTLABEL=linuxinto/dev/mapper/geminux_root(whole-device dynamic segment), checks ext4 non-interactively (e2fsck -p </dev/null), and expands the root filesystem viaresize2fs -f </dev/nullon first boot. src/initramfs/init-recovery exposes a USB NCM/RNDIS gadget shell (172.16.42.1/24) with LUKS2-awareunlock-root,check-fs, andmount-root.
Graphics, window management, and theming
- XLibre (
25.x): Cross-compiled against pure Alpine Edgeaarch64sysroots withmodesetting_drv.so,fbdev_drv.so,libinput_drv.so, and Panfrost Glamor EGL (libglamoregl.so) (scripts/build-xlibre.sh). 10-geminux-gpu.conf configuresmodesettingwithAccelMethod "none",ShadowFB "true",TearFree "true",PageFlip "false",SWcursor "true", andRotate "left"to eliminate rotated DSI tearing and Glamor fence spin-wait CPU overhead while keeping Panfrost EGL/OpenGL 3D acceleration active for clients. Zero Wayland compositors (sway,weston,phosh,xwayland, etc.) are installed. - Patched suckless desktop:
stwith HarfBuzz font shaping (hb.c) supporting Fira Code programming ligatures, Nerd Font fallback, mouse/two-finger wheel scrollback, immediate cursor redraw onFocusIn/FocusOut+ unfocused cursor-blink timeout gating (paired withdwmFocusChangeMask/NotifyWhileGrabbedguards andlibgemuifocus restore across grabs), andSIGUSR1live.Xresourcesreload.dwmwith Pango/HarfBuzz multi-font bar (drw.c), EWMH/XEmbed system tray, touch-friendly>= 68pxstatus bar,Mod4 = Fn+Alt+ one-shotSuper_Ltap-latch,Fn+F(XF86XK_UWB/XF86XK_RFKill) hardware Airplane Mode binding,SIGHUPself-reexec, andSIGUSR1.Xresourcesreload.dmenuwith Pango/HarfBuzz, dynamic full-screen-height item rows (68pxtouch rows), and mouse/touch click selection, paired withgeminux-launcherpinning the 11 GUI apps alongsideWebarchy Browser,Bantam AI agent, andLynx Web Browserinst(and wrappingTerminal=true.desktopentries inst -e).
- Zero-Rust notifications:
dunst v1.12.2compiled withWAYLAND=0 DUNSTIFY=0and custom pure-C PNG (libpng+ Cairo) / JPEG (libjpeg-turbo) icon loader replacinggdk-pixbuf(src/dunst-notify/), paired with a lightweight GDBusnotify-send/dunstify. - Unified desktop, GTK2/3/4, Qt5/6 & Tk (
gtkTtk) theming: Switching.xthpalettes viageminux-themesorgeminux-apply-themeupdates~/.Xresources,dunstrc(geminux-sync-dunst-theme), and viageminux-sync-gtk-themegenerates a light- or dark-basedGeminux-<Theme>theme across GTK2 (gtk-2.0/gtkrc,~/.gtkrc-2.0), GTK3 (gtk-3.0/gtk.css,~/.config/gtk-3.0/{settings.ini,gtk.css}), GTK4/libadwaita(gtk-4.0/gtk.css,~/.config/gtk-4.0/{settings.ini,gtk.css}with@define-colorand:rootcustom variables plusdconf-backedgsettingscolor-scheme),xsettingsd(~/.config/xsettingsd/xsettingsd.conf), Qt6 (~/.config/qt6ct/{qt6ct.conf,colors/Geminux-<Theme>.conf}21-roleQPalette), and Kvantum (~/.config/Kvantum/Geminux/Geminux.kvconfig) before merging~/.Xresourcesviaxrdb. 10-geminux-env.sh setsADW_DISABLE_PORTAL=1(solibadwaitabinds directly todconf/gsettingscolor-schemeon portal-free X11 with live updates) andQT_QPA_PLATFORMTHEME=qt6ct:gtk3(routing Qt6 toqt6ct-styleand Qt5 dialogs tolibqgtk3.so, with Kvantum configs ready forQT_STYLE_OVERRIDE=kvantum), GTK2 writes DPI-scaledxthickness/ythicknessand style metrics (192 DPI/2x) alongside*TkTheme: gtkTtkto auto-load preinstalledgtkTtk 0.9in Tk/Ttk/Tkinter apps against~/.gtkrc-2.0(with DPI-scaled widget geometry, negative-pixel font heights matched totheme.baseFontSize, zero-poll X11RESOURCE_MANAGERPropertyNotifylive reloading across src/gtkTtk/, and pure-X11 XImage blitting avoidinggdk-pixbuf-xlib), alongsideSIGUSR1for livedwm,st,webarchy, andlibgemuiclients. Preinstalledtcl(tcl-lib+tcl-tls) andtkrun cleanly on the same stack. - Webarchy & pure-C
gdk-pixbuf: src/webarchy/webarchy.cpp provides a standalone C++20GTK3+WebKit2GTK-4.1multi-tab browser adapted for the2160x1080ultrawide display (1080x506logical @GDK_SCALE=2) with a collapsible flush-right vertical tab bar, DPI-scaledptCSS reloaded live from~/.XresourcesviaSIGUSR1(selecting the generatedGeminux-<Theme>GTK3 theme and dark/light preference dynamically), persistent SQLite cookies/bookmarks under~/.local/share/geminux/webarchyand~/.config/geminux/webarchy, single-instance FIFO URL forwarding, and automatic CPU renderer fallback on WebProcess crash. scripts/build-webarchy.sh also cross-compiles pure-C GNOMEgdk-pixbuf 2.42.12(-Dbuiltin_loaders=all, zerolibglycin/librsvg) sogtk+3.0andgst-plugins-goodinstall cleanly without Rust, and scripts/compile-gsettings-schemas.sh compiles/usr/share/glib-2.0/schemas/gschemas.compiledforWebKitNetworkProcess. - Native media &
yt-dlpstack: Native Alpine Edgempv(configured via overlay/rootfs/etc/mpv/mpv.conf for Panfrost X11 EGL, PipeWire/Pulse/ALSA, and/tmp/geminux-mpv.sockmedia-key IPC),ffmpeg/ffprobe, andgst-libav(for WebKit HTML5 media), paired withmpg123,openmpt123,python3/py3-pip, andyt-dlp-core+yt-dlp-ejs-rt-quickjs(quickjs, avoidingdeno/py3-cryptography).
Custom UI toolkit and zero-poll C11 daemons
libgemui.so(src/libgemui/): Double-buffered Cairo + Pango/HarfBuzz Xlib toolkit polling X11 events,SIGUSR1self-pipe for instant.Xresourcesreloads, dynamic timers,MSG_NOSIGNAL/drained Unix socket IPC (gemui_unix_cmd), and non-blocking extra FDs (such as V4L2 orinotify).- 11 landscape HiDPI applications (src/geminux-apps/):
geminux-control(including hardware Airplane Mode toggle),geminux-audio,geminux-datetime,geminux-net(5 tabs including Wi-Fi, Cellular/ST33 eSIM management, Airplane Mode banner, andDNSconfiguration),geminux-dialer,geminux-callscreen,geminux-sms,geminux-contacts,geminux-camera(MT6797 Media Controller pipeline + 10-bit Bayer demosaic/AWB software ISP),geminux-themes, andgeminux-lock. - Zero-poll C11 daemons (src/geminux-daemons/):
geminux-powerd—epollover/dev/input/event*(SW_LID,KEY_POWER,mtk-pmic-keysKEY_ESCwakeup, keyboard/touch/pointer activity), filteredKOBJECT_UEVENT(inputrescan lid-state reconciliation,power_supply,drm),/run/geminux/powerd.sock, andtimerfd; enforcesinhibit_ac_lid(blanks/locks without unloading CONSYS or invoking/sys/power/statewhile on USB/AC), tears down/reloadsmt6797_consysand offlines non-boot CPUs across batterymemsleep or zero-thrashlow_power_standbywhenMD1is powered (nofreeze/s2idlefallback), manages persisted hardware Airplane Mode (/var/lib/geminux/airplane-mode,/run/geminux/airplane-mode) by unloading CONSYS Wi-Fi/BT kernel modules and placing MD1 inAT+CFUN=4while leavingusb0up, drives two-stage screensaver idle dim/lock/suspend timed from the last active user input, and resolves the active desktop user dynamically from UID10000.geminux-statusd—epolloversignalfd(SIGUSR1),RTMGRP_LINK/RTMGRP_IPV4_IFADDR, filteredKOBJECT_UEVENT(power_supply,net),inotify, and minute-alignedtimerfd; displaysAIRPLANEwhen hardware Airplane Mode is active and deduplicates rootWM_NAMEupdates with zero child shell forks.geminux-touchd— XInput 2.2 multi-touch gesture daemon (2-finger tap/hold right-click, 3-finger middle-click, 2-finger scroll).geminux-leds— AW9120 back cover RGB controller drivingrgb:indicator-1..5(default off when idle/full;rgb:indicator-6amber while charging; persistent manual override;SIGPIPE-safe socket server at/run/geminux/leds.sock).geminux-ccci-daemon—epollover/dev/ccci_*, uevents, and/run/geminux/ccci.sock, serving MD1 boot HS v2,CCCI_FSNVRAM I/O, and RPC cleanly (idles if MD firmware is absent).geminux-cellctl&geminux-imsd— cellular/eSIM controller (AT+ESIMS,lpac,ccmni*) and event-driven IMS daemon (/run/geminux/imsd.sock).geminux-modem-ctl,geminux-bt-obex(GLibGMainLoop/GDBus),geminux-dnsctl,geminux-power-ctl,geminux-power-audit,geminux-tzctl,geminux-wifi-nvram, andgeminux-checkpw.
APK package pinning and package policy
To keep Alpine Edge aarch64 userspace freely updatable while locking all hardware-tuned components:
- Build-time host Docker containers use
postmarketos/v26.06solely forgcc-aarch64,binutils-aarch64, andmkbootimg-osm0sis. All$SYSROOTtrees and the target$ROOTFSuse only pure Alpine Edge (main,community,testing) plus the RSA-4096 signed local@geminuxrepository (/var/lib/geminux/apk-repo). - scripts/package-local-apks.sh builds eleven
.apkpackages viaapk mkpkgand indexes them intoAPKINDEX.tar.gzviaapk mkndx:geminux-kernel-modulesgeminux-xlibregeminux-sucklessgeminux-dunstgeminux-uigeminux-bantam(bantamminimalist C++20 CLI AI agent withkilo-auto/freedefault model, built via scripts/build-bantam.sh)geminux-gsocket(gs-netcat/gsocketNAT traversal toolkit built via scripts/build-gsocket.sh)geminux-gdk-pixbuf(pure-C zero-glycingdk-pixbuf 2.42.12built via scripts/build-webarchy.sh)geminux-webarchy(webarchy/xwebarchybrowser built via scripts/build-webarchy.sh)geminux-gtkttk(gtkTtk 0.9dynamic GTK2 theme engine for Tk/Ttk/Tkinter built via scripts/build-gtkttk.sh)geminux-config(includes/etc/mpv/mpv.conf,/etc/htoprc,/etc/skel/.config/htop/htoprc,/etc/skel/.lynx.cfg,/etc/skel/.apexrc,/etc/skel/.bashrcwithGPG_TTY,/etc/profile.d/10-geminux-env.shaddingsbinpaths fordosfstools, and/etc/init.d/geminux-sdcard+/etc/udev/rules.d/95-geminux-sdcard.rules+/usr/sbin/geminux-sdcard-mountfor boot/eudevhotplug automounting of/dev/mmcblk1p1or superfloppy/dev/mmcblk1into/media/sdcardwithUID 10000+plugdev0660/0775permissions acrossvfat,exfat, and POSIXext4/ext3/ext2)
/etc/apk/worldpins all eleven withname@geminux=versionand locks out Rust/Wayland/upstream overrides (withlibrsvg,rav1e/rav1e-libs, andlibdoviwhitelisted) via!constraints from scripts/rootfs-prune-packages.txt. Verified automatically by an ELF binary Rust scan,apk upgrade --simulate, and 9 host Python unit suites in scripts/check-rebuild.sh./etc/apk/protected_paths.d/geminux.listshields Geminux configuration directories across upgrades.
Pure-Linux flasher and eMMC layout
flash-mtk.py uses vendored GPLv3 mtkclient + single-chip MTK_DA_V5_MT6797.bin to communicate directly over USB BROM/DA without MediaTek's proprietary GUI. Protected partitions in LBA 0..0x6FFFF (preloader, nvram, proinfo, lk, tee1, md1img, etc.) are backed up and write-blocked by default (0x0E000000 protected boundary verified in scripts/test-flash-mtk-gpt.py).
On staged copies of geminux-rootfs.img (without mutating the build output), scripts/geminux_accounts.py performs pure-Python $6$ SHA-512 password hashing and offline debugfs/e2fsck /etc/{passwd,group,shadow} + /home/<username> provisioning, and scripts/geminux_luks.py optionally wraps the staged ext4 image in an encrypted LUKS2 container via unprivileged host cryptsetup reencrypt --encrypt --disable-locks.