Files
bananarchy/README.md
T

167 lines
19 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bananarchy Linux
![Bananarchy Banner](artwork/banner-800x240.png)
**Bananarchy** is a keypad-first Linux distribution hardforked from postmarketOS (`v26.06` / Alpine `edge` `armv7`), built for **Qualcomm MSM8905 (Snapdragon 205)** and **Qualcomm MSM8909 (Snapdragon 210)** smart feature phones with **240x320 QVGA non-touch displays** and **physical 12-key T9 keypads**.
- **Current public release**: `a1031` (codename `myers`) — see the [changelog](./CHANGELOG.md) for release notes.
- **Device builds (`a1031` — codename `myers`)**:
- **Nokia 8110 4G (`nokia-argon`)**: https://bananarchy.top/builds/bananarchy-nokia-argon-a1031.zip
- **Project philosophy**: read [The Bananarchy Manifesto](./MANIFESTO.md) for the background and goals behind the distribution.
- **User and flashing guide**: see the [user manual](./MANUAL.md) for installation, keypad navigation, and hardware details.
- **UI and networking SDK reference**: see the [NeoUI and NeoNet SDK guide](./SDK.md) for building native C, C++, and Yabasic `240x320` GUI and networked applications.
---
## Key features
### System and hardware support
- **Mainline Linux 6.12 kernel**: custom patches and out-of-tree drivers for Qualcomm **Adreno 304 (`FD304`, 96 KB GMEM)** 3D GPU acceleration (`drm/msm` + `qcom-iommu`), Qualcomm QDSP6/Q6Voice audio routing, Dual-SIM modem control, the rear 2MP GalaxyCore `GC2395` / `GC2385` / `GC2365` camera (`/dev/video0`), the `SY7807` flashlight LED (`white:torch`), physical keypad/slider events, and clean PM8909 poweroff.
- **Alpine Linux Edge base**: full access to the Alpine package ecosystem with `< 95 MB` idle RAM usage on 512 MB devices and full local root access out of the box.
- **Pure X11 graphical stack with GPU acceleration**: cross-compiled **Xlibre** (`X11Libre/xserver`) display server offloading 2D/3D screen rendering to the **Adreno 304 GPU** via **Glamor, DRI3, GLX, and Mesa Freedreno (`FD304`, OpenGL 3.1 / OpenGL ES 3.0)** over `panel-mipi-dbi` KMSRO, paired with a customized **Sxmo (`sxmo-de-dwm`)** window manager (`240x320` vertical stack layout, Conky desktop clock and system status widget, `< 2 ms` slider/key wake latency, and zero Wayland overhead).
### Keypad-first user experience and native DWM plugins
Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs a suite of 22 preloaded C/C++ plugins inside DWM that sleep at 0% CPU and open in `< 2 ms`:
- **System and context menus (`dmenu`)**: instant full-screen 10-line vertical menus with live T9 filtering, built-in submenus, and hardware toggles.
- **Passcode-based fullscreen phone locker (`xlocker`)**: zero-bypass `240x320` fullscreen numeric passcode lock screen verified against the current user's system shadow password (`/usr/bin/bananarchy-verify-passcode`), blocking all desktop, menu, drawer, terminal, and power actions while locked and automatically handing off the display only during incoming calls.
- **Global controls drawer (`xdrawer`) and `*` + `#` screenshot combo**: press **both softkeys together** from anywhere to adjust linear (`1%`–`100%`) speaker, earpiece, and ringtone volume, audio output routing (`Speaker`, `Earpiece`, `Headphones` with automatic 3.5mm jack plug/unplug routing), ringer mode (`Ring+Vib` / `Vibrate` / `Silent` / `DND`), 3-level vibration intensity (`Light` / `Medium` / `Strong`), flashlight, sound and microphone mute, screen brightness, and keypad backlight; press **`*` and `#` together** from anywhere to capture a `240x320` PNG screenshot (`scrot` via `bananarchy-screenshot`) to `~/Pictures/screenshot-YYYYMMDD-HHMMSS.png`.
- **Phone dialer (`xdialer`), call log (`xcalllog`), and call screen (`xcallscreen`)**: press any digit on the home screen to start dialing with live T9 contact matching, run interactive carrier USSD codes (`*100#`, etc.), or type `*#06#` to inspect both IMEIs. When two SIM cards are active in Dual-SIM Dual Standby (DSDS), placing a call or running a USSD code prompts to choose between `SIM 1` and `SIM 2`. Incoming and active calls on either SIM (as well as incoming/active VoIP calls from `xsip` and `xtox`) open a dedicated call screen with an active `[SIM 1]`/`[SIM 2]`/`[SIP]`/`[TOX]` badge, earpiece/speaker switching, microphone mute, DTMF keypad, and one-key normalized WAV call recording (`~/Recordings/rec_HHMMSS_<caller>.wav`). The call log includes a 5-tab view (`All`, `Miss`, `In`, `Out`, `Spam`) with integrated anti-spam number blocking (`~/.config/sxmo/block.tsv`) that automatically hangs up blocked callers and logs them to the `Spam` tab without triggering missed-call notifications.
- **Contacts (`xcontacts`) and SMS manager (`xsms`)**: full phonebook editor with direct Qualcomm QMI SIM card contact import and export across SIM 1 and SIM 2, paired with a threaded SMS conversation view, multi-tap message composer with outgoing `SIM 1` / `SIM 2` selection when two SIMs are active, and built-in anti-spam blocklist / spam folder (`~/.local/share/sxmo/block`) with one-key thread blocking and restoration.
- **Modem and Dual-SIM manager (`xmodem`)**: 4-tab cellular control center (`SIMs`, `Radio`, `AT`, `Log`) supporting Dual-SIM Dual Standby (DSDS) with simultaneous network registration on both SIM slots, instant default SIM switching (`Set as Default SIM (Calls/SMS)`), full Primary/Secondary GW (`4G/Data`) slot swapping (`Make Primary GW (4G/Data Swap)`), SIM PIN unlock and PUK unblock wizards, 2G/3G/4G radio mode selection, interactive USSD sessions, and a live AT command console.
- **Networks and Bluetooth manager (`xnetworks`)**: 3-tab connectivity manager for Wi-Fi networks, WPA2 password entry, Wi-Fi hotspot, USB tethering, 4G/LTE mobile data (`wwan0`) and APN editing, and Bluetooth pairing.
- **File manager (`xfiles`) with microSD automount (`sxmo_sdcard.sh`), music and tracker player (`xmusic`), and camera (`xcamera`)**: keypad directory browser with automatic microSD card (`/dev/mmcblk1`) detection and `/media/sdcard` mounting/unmounting, built-in text viewer, integrated GUI multi-tap text editor (`Edit in Text Editor`, available as an action on any file), image viewer, and dedicated monophonic ringtone viewer (`RingtoneView` for Nokia RTTTL `.nrt`/`.rtttl`/`.rtx`, Ericsson eMelody `.emy`, and IrDA iMelody `.imy` with graphical piano-roll pitch contour, note sequence viewer, live audio preview, and one-key assignment as call ringtone or notification/SMS sound — plus one-click actions to launch `.jar`/`.jad` MIDlets in the **ReMEdy (`remedy`)** J2ME emulator, launch `.gb`/`.gbc` ROMs in the Game Boy emulator, run `.yab` scripts in Yabasic inside the terminal, play audio, preview images, set any image as wallpaper, or install any audio, tracker, or monophonic melody file as call ringtone or notification/SMS sound), a 3-tab music and chiptune tracker module player (`WAV`, `MP3`, `OGG`, `FLAC`, `Opus`, `MOD`, `XM`, `IT`, `S3M`, `NRT`, `RTTTL`, `RTX`, `EMY`, `IMY`, and more), and a live V4L2 camera viewfinder with digital zoom, flash/torch control, self-timer, and photo gallery.
- **Native NeoUI communication and internet suite (`xsip`, `xemail`, `xirc`, `xtox`, `xkopher`)**:
- **SIP VoIP client (`xsip` / `sip.so`)**: RFC 3261 SIP softphone (`Dialer`, `Accounts`, `History`) with Digest MD5 authentication, standby `REGISTER` keepalive, incoming `INVITE` ringing and call handling integrated with `xcallscreen`, bidirectional G.711 (`PCMU`/`PCMA` 8 kHz) RTP audio, and RFC 2833 DTMF.
- **Email client (`xemail` / `xmail` / `email.so`)**: multi-account `IMAP4rev1`, `POP3`, and `SMTP` client (`Inbox`, `Compose`, `Accounts`) supporting implicit TLS, `STARTTLS`, and plain TCP, SASL `PLAIN`/`LOGIN`, MIME RFC 2047/Base64/Quoted-Printable decoding, offline inbox cache, full-screen message reader, and composer.
- **IRCv3 client (`xirc` / `irc.so`)**: multi-server IRC client (`Buffers`, `Chat`, `Servers`) with OpenSSL TLS, IRCv3 capability negotiation (`CAP LS 302`: `sasl`, `server-time`, `message-tags`, `multi-prefix`, `away-notify`, `account-notify`, `chghost`, `cap-notify`), `SASL PLAIN` authentication, slash commands, and resident background mode with highlight vibration alerts.
- **Tox / Trifa P2P messenger and audio call client (`xtox` / `tox.so`)**: encrypted P2P messenger (`Friends`, `Chat`, `My Tox ID`) built on `c-toxcore` (`libtoxcore.so.2`) with DHT + TCP relay bootstrap, friend requests, persistent message history, and `ToxAV` 48 kHz Opus voice calls integrated with `xcallscreen`.
- **Kopher SmallWeb browser (`xkopher` / `kopher` / `xsmallweb` / `smallweb.so`)**: multi-protocol SmallWeb client for **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring WAP-style default keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git), user-adjustable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, and custom homepage support.
- **GPS reception test utility (`bananarchy-gps`) and OpenStreetMap navigator (`xgps` / `xmaps` / `xnav` / `gps.so`)**: CLI GNSS/GPS diagnostic tool (`bananarchy-gps status|enable|disable|nmea|watch`) and 3-tab NeoUI GPS navigator (`1:GPS Status`, `2:OSM Map`, `3:Nav/Search`) with live NMEA/QMI PDS satellite and 3GPP cell telemetry, interactive `240x212` OpenStreetMap slippy-map tile viewer with offline PNG tile cache (`~/.cache/sxmo/osm_tiles/`), Nominatim place search, saved waypoints, and OSRM turn-by-turn route geometry and step navigation.
- **Themes (`xthemes`), wallpapers (`xwallpapers`), and ringtones (`xringtones`)**: installable `.Xresources` color and font themes (`~/.xthemes/*.xth`, 20 preinstalled schemes) with live zero-restart reload across the entire UI and terminal, alongside dedicated managers for desktop wallpapers and 3-tab call ringtones & notification/SMS alerts (`1:Ringtone`, `2:Notif/SMS`, `3:Settings`, supporting standard audio, tracker modules, and Nokia RTTTL `.nrt`/`.rtttl`/`.rtx`, Ericsson eMelody `.emy`, and IrDA iMelody `.imy` monophonic ringtones via `/usr/bin/bananarchy-melody`, wired into `sxmo_notifs.sh` and `sxmo_hook_notification.sh`) with 3-level vibration control.
### Input, terminal, and developer tools
- **6-mode `fcitx5-t9` keypad input**: press `#` to cycle between `abc`, `Abc`, `ABC`, `Sym` (all 32 ASCII punctuation symbols), `Ctl` (`Ctrl` sequences, arrows, `PageUp`/`PageDown`, `F1`–`F12`), and `123` numeric modes with a fixed bottom candidate bar.
- **First-class Linux terminal (`st`)**: patched with HarfBuzz OpenType ligatures (`Fira Code` as the default system and terminal font), XIM T9 input, and live theme reloading.
- **On-device development, scripting, 3D demos, and gaming**: preinstalled `gcc`/`g++`, `make`, `git`, GNU `coreutils`, GNU `bc`/`dc`, `mandoc`, `nano`, `ed`, `sqlite3`, `lua` (`5.5` and `5.4`), `yabasic` (with full `yabasic-doc` manual and HTML documentation), `perl`, `tcl`, the [Janet](https://janet-lang.org/) language and `jpm`, the [Bantam](https://bantam.luxferre.top/) coding agent, `frotz` (interactive fiction), OpenGL / OpenGL ES hardware diagnostics and demos (`glxinfo`, `eglinfo`, `glxgears`, `glteapot`, `es2gears_x11`), standalone X11 keypad games (`Snake` and `Tetris`), a full-featured Gambatte-based Game Boy / Game Boy Color emulator (`gambatte` / `gbemu`) with readjustable keypad controls (`B=8`, `Turbo B=5`, `A=9`, `Turbo A=6`, `D-pad`, `Start=2`, `Select=3`, `Palette=*`), 10 color palettes, save states, and file manager `.gb`/`.gbc` integration, and **ReMEdy (`remedy` / `j2me`)**, a native `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator with Adreno 304 hardware-accelerated JSR-184 M3G 3D graphics, NeoUI-themed high-level LCDUI widgets, socket/HTTP networking (`Connector`), `RecordStore` (RMS) persistence, MMAPI audio, readjustable keypad controls, and `.jar`/`.jad` file manager integration.
- **NeoUI `240x320` UI SDK (`libneoui.so` + `/usr/include/neoui.h` + `neoui.yab`) and NeoNet (`neonet.yab`)**: unified C-compatible FFI and C++20 UI SDK wrapping Xlib, Xft, Pango, `libjpeg`/`libpng`, `.Xresources` / `~/.xthemes/*.xth` live theme resolution, offscreen `Pixmap` double buffering, standardized OS shell widgets (headers, tabs, softkey bars, list/toggle/slider rows, input boxes, progress bars, scrollbars, modals, popup menus, and toasts), keypad/softkey chord handling, and multi-tap text entry—usable from C, C++, or Yabasic (`~/Projects/neoui.yab` and `~/Projects/neoui_demo.yab`), paired with **NeoNet (`~/Projects/neonet.yab` and `~/Projects/neonet_demo.yab`)** for `libcurl`-based HTTP/HTTPS requests with custom headers and TCP/TLS/UDP socket exchange in Yabasic. See [SDK.md](./SDK.md) for full documentation.
---
## Supported MSM8909 and MSM8905 devices
| Device | Codename | SoC | CPU / RAM | Display and panel firmware | Device tree (`.dtb`) |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **Nokia 8110 4G** | `nokia-argon` | Qualcomm MSM8905 (SD205) | 2x Cortex-A7 @ 1.1 GHz, 512 MB | 2.4" 240x320 SPI (`nokia,argon-gc9305-v2-panel.bin`) | `qcom-msm8905-nokia-argon.dtb` |
| **Nokia 2720 Flip** | `nokia-beatles` | Qualcomm MSM8905 (SD205) | 2x Cortex-A7 @ 1.1 GHz, 512 MB | 2.8" 240x320 SPI (`nokia,beatles-gc9305-panel.bin`) | `qcom-msm8905-nokia-beatles.dtb` |
| **Nokia 800 Tough** | `nokia-tough` (`nokia-coconut`) | Qualcomm MSM8905 (SD205) | 2x Cortex-A7 @ 1.1 GHz, 512 MB | 2.4" 240x320 SPI (`nokia,coconut-gc9305-panel.bin`) | `qcom-msm8905-nokia-coconut.dtb` |
| **Nokia 8000 4G** | `nokia-sparkler` | Qualcomm MSM8909 (SD210) | 4x Cortex-A7 @ 1.1 GHz, 512 MB | 2.8" 240x320 SPI (`nokia,sparkler-gc9307-hlt-28-panel.bin`) | `qcom-msm8909-nokia-sparkler.dtb` |
| **Nokia 6300 4G** *(sibling)* | `nokia-leo` | Qualcomm MSM8909 (SD210) | 4x Cortex-A7 @ 1.1 GHz, 512 MB | 2.4" 240x320 SPI (`nokia,leo-gc9305-hlt-24-panel.bin`) | `qcom-msm8909-nokia-leo.dtb` |
---
## Repository structure
```text
bananarchy/
├── README.md # Project overview, repository layout, and build workflow
├── CHANGELOG.md # Public release build history
├── MANIFESTO.md # The Bananarchy Manifesto
├── MANUAL.md # Complete flashing, keypad, plugin, T9, camera, and modem manual
├── SDK.md # NeoUI 240x320 UI SDK reference for C, C++, and Yabasic
├── flash-edl.sh # Automated USB EDL flasher wrapper (sudo + ModemManager handling)
├── flash-edl.py # Multi-device Qualcomm Sahara/Firehose EDL flasher
├── rebuild-image.sh # Builds boot.img and partitioned MBR .img
├── chroot-shell.sh # Rootless Docker armv7 package and rootfs customization shell
├── artwork/ # Bananarchy master icon, generated icons, wallpapers, and splashes
├── bootloader/ # lk2nd secondary bootloader and Sahara/Firehose programmer (8110.mbn)
├── devices/ # Device definitions, DTBs, and MIPI-DBI panel init sequences
├── patches/ # Upstream kernel, EDL, Sxmo, Xlibre, and fcitx5-t9 patch sets
├── src/
│ ├── neoui/ # NeoUI 240x320 UI SDK (libneoui.so + /usr/include/neoui.h, C FFI & C++20)
│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, softkey bar, and plugin API)
│ ├── dwm-plugins/ # DWM plugins (locker, dialer, calllog, callscreen, contacts, sms, files,
│ │ # camera, themes, modem, networks, ringtones, wallpapers, music, sip,
│ │ # email, irc, tox, smallweb, gps), net_tls.h, theme.h, and runner
│ ├── xdrawer/ # XDrawer global phone controls DWM plugin (xdrawer.so / xdrawer)
│ ├── sxmo-dmenu/ # Resident DWM menu plugin (dmenu.so) and client (dmenu / xdmenu)
│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligatures and XIM
│ ├── xf86-input-libinput/ # Xlibre xf86-input-libinput DDX driver
│ ├── xf86-video-fbdev/ # Xlibre xf86-video-fbdev fallback DDX driver
│ ├── fcitx5-t9/ # 6-mode fcitx5-t9 keypad input method
│ ├── games/ # Standalone keypad X11 games, Gambatte GB/GBC, and ReMEdy J2ME (snake, tetris, gambatte, remedy)
│ ├── leds-msm8905-torch/ # Kernel driver for SY7807 torch LED, WCD codec init, and PON shutdown
│ └── msm8905-cam/ # Kernel V4L2 driver for GC2395/GC2385/GC2365 2MP rear camera (/dev/video0)
├── overlay/rootfs/ # System configuration overlay applied over the target rootfs
├── prebuilt/ # Pre-compiled armv7 binaries and kernel modules
└── scripts/ # Cross-compilation, artwork generation, version, and overlay scripts
```
---
## Build and customization workflow
### 1. Regenerate artwork assets
Whenever `artwork/icon-large.png` is updated, regenerate all icons, `240x320` wallpapers, and animated boot splashes:
```bash
./scripts/generate-artwork.py
```
### 2. Recompile core components (optional — prebuilts included)
All components are pre-compiled in `prebuilt/` and `overlay/rootfs/`, and can be rebuilt from source at any time using rootless Docker (`alpine:3.24`):
```bash
# Rebuild cross-compiled Xlibre (X11Libre/xserver) + Glamor/GLX + libinput/fbdev DDX drivers
./scripts/build-xlibre.sh
# Rebuild patched sxmo-st, sxmo-dmenu, sxmo-dwm, and all 21 C++ DWM plugins
./scripts/build-sxmo-x11.sh
# Rebuild standalone X11 games and emulators (snake, tetris, gambatte, remedy)
./scripts/build-games.sh
# Rebuild multi-mode fcitx5-t9 input engine
./scripts/build-fcitx5-t9.sh
# Fetch latest master from https://code.luxferre.top/luxferre/bantam-cpp and cross-compile Bantam AI agent
./scripts/build-bantam.sh
# Rebuild Linux 6.12.1-msm8916 Adreno 304 DRM/MSM GPU module, QDSP6/Q6Voice audio modules, torch LED module, camera module, and DTBs
./scripts/build-kernel-audio.sh
```
### 3. Customize rootfs packages or configs
```bash
./chroot-shell.sh
# Inside the container shell:
# pkg-add <pkg>
# pkg-del <pkg>
# pkg-search <pattern>
```
### 4. Build flashable device images
```bash
# Build for Nokia 8110 4G (default)
./rebuild-image.sh nokia-argon
# Or build for Nokia 2720 Flip, Nokia 800 Tough, or Nokia 8000 4G:
./rebuild-image.sh nokia-beatles --mkinitfs
./rebuild-image.sh nokia-tough --mkinitfs
./rebuild-image.sh nokia-sparkler --mkinitfs
```
Output images are written to `images/`:
- `images/bananarchy-<device>.img`: partitioned MBR image with `pmOS_boot` + `pmOS_root` for EDL `userdata`, `fastboot flash userdata`, or a microSD card.
---
## Flashing via USB EDL (`05c6:9008`)
```bash
sudo ./flash-edl.sh nokia-argon
```
See [MANUAL.md](MANUAL.md) for complete EDL, Fastboot, and microSD installation instructions, keypad navigation shortcuts, and the multi-mode T9 reference.
## Credits
All Bananarchy-specific components were initially created by Luxferre and released into the public domain with no warranties.
Alpine Linux, postmarketOS/Nura, and other third-party components are guided by their respective licensing terms.