Files
geminux/ARCHITECTURE.md
T

9.9 KiB

Architecture

Geminux pairs a custom-patched Linux 7.3.5 kernel with XLibre X11, a hardened suckless desktop, unified .Xresources + native wallpaper rendering, zero-poll C11 daemons, pure-Linux MTK flashing/packaging tooling, and signed local APK pinning.

Kernel and MediaTek MT6797X support

Vanilla Linux 7.3.5 builds from patches/kernel/ with CONFIG_XFRM_USER=y and IPsec modules (esp4, esp6, af_key, xfrm_interface) for 3GPP IMS:

Patch Summary
0001-ixoo-gemini-pda-mainline-7.3.5.patch Core MT6797X / Gemini PDA 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 domains
0003-arm64-dts-mediatek-geminux-gemini-pda.patch Device Tree pinmux, regulators, and peripheral bindings
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 CONSYS Wi-Fi/BT drivers and NVRAM/factory firmware loading
0006-mt6797-boot-cleanups.patch Early boot and console cleanups
0007-mt6797-wlan-peer-deauth-and-rekey.patch WLAN peer deauth recovery and GTK rekey stability
0008-gemini-resume-wake-and-spm-standby.patch S3 resume wakes, mt6797-spm-sleep standby, mtk-eint debounce clear, mtk-pmic-keys
0009-mt6797-wlan-drop-free-stability.patch CONSYS WLAN RX/TX buffer drop-free handling 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 Hall GPIO66 synchronous lid filtering, 1 ms Hall / 10 ms keypad debounce, touch inhibit
0012-gemini-lid-wake-and-fg-taper-fix.patch PM_POST_SUSPEND + raw-GPIO lid reconciliation and mt6351+bq25890 zero-current OCV/taper fuel gauge
0013-gemini-pmic-wake-and-spm-safety.patch Moves mt6397_irq_suspend/resume to LATE_SYSTEM_SLEEP_PM_OPS and adds SPM WAKE_PCM_WDT + 5000 ms cntp backstop
0014-gemini-deep-sleep-power-drainers.patch PMIC sleep modes (pmic_modes=1, 0.700 V VCORE clamp), MD1-active SPM mem suspend (allow_md1=1, CCIF0/CLDMA/MD1_WDT wakes, RF LDO low-IQ), Panfrost VGPU/LDO/MFGPLL suspend rail-off, and MD1 stage-0 clock/PLL gating
  • Graphics & Radios: mediatek-drm + SSD2092 DSI/touch, early simpledrm (DRM_SIMPLEDRM=y + rotated TER16x32 console), Mali-T880 panfrost, sii902x HDMI bridge, and mt6797_wlan_core/btmt6797 CONSYS.
  • Modem / eSIM / IMS: mt6797-ccci-cldma exposes /dev/ccci_*, /dev/ttyC0..3, and ccmni* via struct mt6797_ccci_header (mt6797_ccci.h). geminux-ccci-fs.c serves MD1 boot HS v2 / NVRAM / RPC; geminux-cellctl.c manages SIM/ST33 eUICC (lpac) & ccmni* PDNs; geminux-imsd.c implements VoLTE/VoWiFi (strongswan SWu), MILENAGE AKA, XFRM ipsec-3gpp, SIP, RP-DATA SMS, and 20 ms RTP.
  • Boot, LUKS2 FDE & Recovery: mkbootimg-osm0sis packs LK images (<= 16 MiB boot/recovery, <= 512 KiB DTB). Built-in BLK_DEV_DM=y, DM_CRYPT=y, and ARMv8 AES-CE (CRYPTO_AES_ARM64_CE_BLK=y) power LUKS2 unlock in src/initramfs/init (cryptsetup + /etc/gemini-us.kmap, DM_DISABLE_UDEV=1, e2fsck -p, resize2fs -f). src/initramfs/init-recovery provides a USB NCM shell (172.16.42.1/24) with LUKS2-aware helpers. See POWER-OPTIMIZATION.md for suspend and CPU/power architecture.

Graphics, window management, and stability

  • XLibre (25.x): Cross-compiled against pure Alpine Edge aarch64 sysroots (scripts/build-xlibre.sh). 10-geminux-gpu.conf uses AccelMethod "none", ShadowFB "true", TearFree "true", PageFlip "false", SWcursor "true", and Rotate "left" to avoid rotated DSI tearing while keeping Panfrost EGL/OpenGL 3D enabled. Zero Wayland compositors are installed.
  • dwm: 32-bit ARGB XEmbed systray (_NET_SYSTEM_TRAY_S0, reparent/input race fixes, restacked under fullscreen lockscreen); EWMH/ICCCM/NETWM (_NET_WORKAREA struts, _NET_WM_STATE_{FOCUSED,STICKY,ABOVE,HIDDEN}, WM_CHANGE_STATE, nofocuswin, Wine/DXVK focus recovery); in_xerror recursion & non-fatal RENDER error guards, bounded 200 ms getservertime(), async pointer/button grabs; Pango PANGO_ELLIPSIZE_END, FC_COLOR=FcFalse, and UTF-8 sanitization in drw.c; >= 78 px bar, Mod4 tap-latch, Fn+F, Mod4+Shift+r/SIGUSR1 .Xresources reload, and SIGHUP self-reexec.
  • dmenu & st & dunst: dmenu uses Pango/HarfBuzz 82 px rows, dmenu_xerror/RENDER guards, FC_COLOR=FcFalse, UTF-8 sanitization, and pairs with geminux-launcher. st adds HarfBuzz Fira Code ligatures (hb.c), wheel scrollback, FocusIn/FocusOut cursor sync + unfocused blink gating, and XA_RESOURCE_MANAGER + SIGUSR1 reloads. dunst v1.12.2 (src/dunst-notify/) runs pure-X11 without gdk-pixbuf.

Unified theming, wallpaper engine, and media

  • Unified Theming: Defaults to Anodized (192 DPI, baseFontSize: 32, Xcursor.size: 64). geminux-session merges new /etc/skel/.xthemes/*.xth files into ~/.xthemes/, seeds /etc/skel/.config/geminux/wallpaper.conf on first boot, and loads ~/.Xresources via xrdb -nocpp -load. geminux-xth.h powers geminux-themes interactive Editor & .xth Importer (~/.config/geminux/themes/). geminux-apply-theme syncs Dunst, GTK2/GTK3/GTK4/libadwaita (ADW_DISABLE_PORTAL=1 + dconf in 10-geminux-env.sh), xsettingsd, Qt5/Qt6 (qt6ct QT_QPA_PLATFORMTHEME=qt6ct:gtk3 + Kvantum), Tk/Ttk (gtkTtk 0.9 in src/gtkTtk/), live X11 clients, and wallpaper mattes (USE_THEME_BG=1).
  • Native X11 Wallpaper Engine: geminux-wallpaper.h + geminux-wallpaper-x11.h decode images in pure C via dlopen("libgdk_pixbuf-2.0.so.0") (geminux-gdk-pixbuf, EXIF orientation), Cairo PNG, libjpeg-turbo, libwebp, and magick/convert fallback; draw to a retained root Pixmap (_XROOTPMAP_ID, ESETROOT_PMAP_ID, RetainPermanent, XKillClient, XRandR/Xinerama multi-monitor); and bundle artwork/wallpapers/ into /usr/share/geminux/wallpapers/.
  • Webarchy & Media: webarchy.cpp (GTK3 + WebKit2GTK-4.1, software crash fallback), pure-C gdk-pixbuf 2.42.12 + GSettings schemas (scripts/build-webarchy.sh, scripts/compile-gsettings-schemas.sh), native mpv (mpv.conf), ffmpeg/gst-libav, and yt-dlp (quickjs).

Custom UI toolkit and zero-poll C11 daemons

  • libgemui.so (src/libgemui/): Double-buffered Cairo + Pango/HarfBuzz X11 toolkit with XA_RESOURCE_MANAGER + SIGUSR1 live reloads, lockscreen restacking, contrast guards, clipboard paste, and socket IPC.
  • 11 HiDPI apps (src/geminux-apps/): geminux-control, geminux-audio, geminux-datetime, geminux-net, geminux-dialer, geminux-callscreen, geminux-sms, geminux-contacts, geminux-camera, geminux-themes, and geminux-lock.
  • Zero-poll daemons (src/geminux-daemons/): geminux-powerd, geminux-statusd, geminux-touchd, geminux-leds, 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, and geminux-checkpw (detailed in POWER-OPTIMIZATION.md).

APK package policy

Target $ROOTFS installs only pure Alpine Edge (main, community, testing) plus 11 RSA-4096 signed @geminux APKs built by scripts/package-local-apks.sh: geminux-kernel-modules, geminux-xlibre, geminux-suckless, geminux-dunst, geminux-ui, geminux-bantam (build-bantam.sh), geminux-gsocket (build-gsocket.sh), geminux-gdk-pixbuf, geminux-webarchy, geminux-gtkttk (build-gtkttk.sh), and geminux-config (including bundled wallpapers, /etc/mpv/mpv.conf, geminux-sdcard udev/OpenRC units). /etc/apk/world pins all 11 with name@geminux=version and blocks disallowed Rust/Wayland overrides via scripts/rootfs-prune-packages.txt, enforced by scripts/check-rebuild.sh. /etc/apk/protected_paths.d/geminux.list shields configs across upgrades.

Flasher, offline provisioning, and release ZIP packager