diff --git a/AGENTS.md b/AGENTS.md index f781bf1..b50565e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -57,7 +57,7 @@ All cross-compilation scripts run inside rootless Docker (`alpine:3.24` `armv7` - `./scripts/prune-rootfs-packages.sh world|purge` — removes Wayland-only, Rust-based, and retired packages from a target rootfs inside the build container. - `./scripts/build-bananarchy-daemons.sh` — cross-builds the three compiled ARM idle daemons (`bananarchy-lid`, `bananarchy-cover-idle`, `bananarchy-volume-keys`) from `src/bananarchy-daemons/`; `--check` validates the ARM ELF artifacts and overlay sync. No Python-based daemon runs in the idle system. - `./scripts/build-lk2nd-beatles.sh` — cross-builds all three beatles lk2nd images (normal, diagnostic and display; the display image is the flasher default) from the pinned upstream lk2nd commit plus `bootloader/lk2nd/nokia-beatles.patch` in rootless Docker (`--check` validates all three shipped images, `--only normal|diagnostic|display` builds one, `--force-panel-init` forces the panel replay, `--with-display` enables SPI display during boot). Offline validators: `scripts/check-lk2nd-beatles.py` and `scripts/test-lk2nd-beatles-port.py`. -- `./scripts/test-webarchy-renderer.py`, `./scripts/test-idle-blank-lock.py`, `./scripts/test-bluetooth-scan.py` and `./scripts/test-battery-charge-event.py` — host unit/integration tests for the Webarchy renderer profile, the idle-blank screenlock wiring, the Bluetooth discovery parser and the charger plug/unplug icon refresh (all also run by `check-rebuild.sh`). +- `./scripts/test-webarchy-renderer.py`, `./scripts/test-idle-blank-lock.py`, `./scripts/test-bluetooth-scan.py`, `./scripts/test-battery-charge-event.py` and `./scripts/test-gps-time-sync.py` — host unit/integration tests for the Webarchy renderer profile, the idle-blank screenlock wiring, the Bluetooth discovery parser, the charger plug/unplug icon refresh and the GPS-only time source (all also run by `check-rebuild.sh`). - `./scripts/check-rebuild.sh` — offline preflight for a clean clone (syntax, package list, plugin artifacts, overlay sync, SMS long-message rendering guard, ignored local agent config, Docker, version helper). - `./scripts/sync-prebuilt-overlay.sh [--check]` — mirrors `prebuilt/` artifacts into `overlay/rootfs/`; `--check` only reports drift. - `./scripts/bootstrap-flash-deps.sh` — installs `pyusb` and `pyserial` into the gitignored `.flash-deps/` directory for `flash-edl.py`. @@ -85,7 +85,7 @@ and the NetworkManager dispatcher hook, which call `chronyc refresh` / `burst` over chronyd's root-only Unix socket when a connection comes up; **Config -> Sync net time** (`src/sxmo-dmenu/dmenu.c` + `usr/bin/bananarchy-sync-net-time.sh`) forces the same burst manually and -notifies the user, and the helper's `sync` mode reports the result. Keep DNS +notifies the user, and the helper's `sync` mode reports the result. **Config -> Time source** (`network` default, `gps`) and **Config -> Sync GPS time** use `usr/bin/bananarchy-gps-time-sync.sh` to set the datetime solely from GNSS; in GPS mode chronyd is stopped and every NTP burst is skipped. All GPS queries resolve the GNSS-capable modem through `usr/bin/bananarchy-gps-modem.sh`, never `mmcli -m any` on dual-SIM targets. Keep DNS resolution outside the helper's `flock` so a long boot retry cannot swallow network-up events, and keep `var/lib/chrony` owned by the `chrony` user. Network state changes are event-driven through `etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh` + `usr/bin/bananarchy-network-event.sh`; keep `superctl disable sxmo_networkmonitor` in the session start hooks, and never reintroduce `superctl start sxmo_networkmonitor` or a long-lived `nmcli device monitor`. The status bar clock must be refreshed synchronously on unlock (`sxmo_hook_unlock.sh`), by dmenu's `update_t9_status_indicator()` before `XStoreName()`, and every minute by the `statusbar_clock` aligned job in the session start hooks; `sxmo_hook_statusbar.sh` forces a root-name refresh on `time` / `state_change`, and its `battery` and `refresh` actions republish the charge icon together with a fresh clock (`bananarchy-time-sync.sh` calls `refresh` after an NTP clock step). `postmarketos-zram-swap` uses `/usr/bin/zramstart`, not `/etc/conf.d/zram-init`: keep `deviceinfo_zram_swap_algo="lz4"` in every `devices/*/deviceinfo*` file. Keep `vm.compaction_proactiveness=0` in `etc/sysctl.d/99-bananarchy-power.conf` and `etc/local.d/10-power-save.start`; see `BATTERY-OPTIMIZATION-ANALYSIS.md` §17 and §18. Deep standby is `bananarchy-suspend.sh` / `bananarchy-deep-standby.sh` / `sxmo_autosuspend.sh` / `sxmo_suspend.sh`, gated by `/etc/bananarchy-no-deep-standby` (shipped present = disabled) and inert because `CONFIG_SUSPEND` is off. A full custom module tree rebuild is deliberately **not** planned: this firmware has no PSCI `SYSTEM_SUSPEND`, so `CONFIG_SUSPEND` would only give s2idle (`freeze`), not `mem` / DDR self-refresh, for <1 mA of saving (see `BATTERY-OPTIMIZATION-ANALYSIS.md` §14 and §17). Never force `sxmo.noidle`/`sxmo.nosuspend` from the session scripts and never reintroduce the infinite `sxmo_not_suspendable` wakelock. `/etc/bananarchy/` is root-only. - **Image residue**: `rebuild-image.sh` strips `/var/cache/apk`, all `apk.log*` files, and unused gettext locale trees before `mke2fs` and aborts the build if any apk cache/log remains; never add an `apk` call after that guard. diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e2444..2186cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ Release versions follow the `
` format (where `2026` is `a`, Work since `a1108` has focused on reliable 2720 Flip hardware support and a reproducible boot/flash path. Earlier incremental and superseded diagnostic entries are consolidated here. +### GPS reception and GPS-only system time + +- **GPS never produced a fix**: `bananarchy-gps`, `gps.so` and the new helpers all used `mmcli -m any`, which is ambiguous on the dual-SIM QMI stack of the 2720 Flip and can resolve to a modem without a Location interface. `/usr/bin/bananarchy-gps-modem.sh` now lists the modems, prefers the one advertising `gps-nmea`, enables the modem plus `3gpp`, `gps-nmea`, `gps-raw` and a 2 s refresh rate, and falls back to `any` only when nothing is enumerated. `gps.so`, the CLI (`status|nmea|watch|enable|disable|modem`) and the time helper share this resolver, so `nokia-argon` keeps its single-modem behaviour. +- **Config -> Time source and Config -> Sync GPS time**: `~/.config/sxmo/time_source` selects `network` (default) or `gps`. With GPS selected, `/usr/bin/bananarchy-gps-time-sync.sh` stops `chronyd`, `bananarchy-time-sync.sh` declines all boot/network-up/force NTP bursts, and the datetime is set solely from a valid GNSS UTC/RMC fix (`date -u -s`, `hwclock -w -u`, status bar refresh), including a boot-time sync. `bananarchy-sync-gps-time.sh` is the user-facing one-shot action with a notification. `scripts/test-gps-time-sync.py` verifies ISO and RMC parsing, chronyd/NTP isolation, source switching, the notification wrapper and CLI modem resolution with stubbed commands; `check-rebuild.sh` guards the rebuilt `gps.so` and `dmenu.so`. + ### Charger plug/unplug battery icon - **Charge icon stayed unchanged on VBUS transitions**: `85-bananarchy-battery.rules` treated every PM8916 event as a capacity change, but `sxmo_hook_battery.sh` caches `state:percentage` and the charger `online` / battery `status` sysfs attributes can still hold the old value while the uevent is delivered. The cache therefore swallowed exactly the plug/unplug event the user wanted to see. Charger events now run `/usr/bin/bananarchy-battery-charge-event.sh`, which forces an immediate `sxmo_hook_battery.sh force` republish (the forced path removes the icon file so `sxmo_status.sh` cannot skip an unchanged value), then re-reads sysfs after two seconds; `flock` coalesces the uevent burst. A generic `ENV{POWER_SUPPLY_ONLINE}` rule covers firmware revisions that publish VBUS on a separate USB/Mains supply. `scripts/test-battery-charge-event.py` validates the immediate + delayed refresh with a stubbed hook, and `check-rebuild.sh` guards the rules, helper and overlay installation. `nokia-argon` keeps the same capacity-change path. diff --git a/MANUAL.md b/MANUAL.md index ee853d3..f0755fb 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -611,7 +611,9 @@ The **Xlibre** display server (`modesetting_drv.so`) uses **Glamor + DRI3 + GLX bananarchy-gps nmea # print raw NMEA sentences from ModemManager / QMI PDS bananarchy-gps watch 2 # continuously poll GPS fix and satellite telemetry every 2s bananarchy-gps disable # stop standalone GNSS engine to save power + bananarchy-gps modem # show the resolved ModemManager modem and its location capabilities ``` + All CLI and `gps.so` queries go through `/usr/bin/bananarchy-gps-modem.sh`, which picks the modem advertising `gps-nmea` (with `--location-enable-3gpp`, `--location-enable-gps-nmea`, `--location-enable-gps-raw`, `--location-set-gps-refresh-rate=2` and `--enable`). Plain `mmcli -m any` is ambiguous on the dual-SIM 2720 Flip and used to leave every GPS query empty. ### 5.7 Network time synchronisation (`bananarchy-time-sync.sh`) @@ -625,6 +627,20 @@ bananarchy-time-sync.sh force # re-resolve the pool and burst immediately bananarchy-time-sync.sh sync # force and print a human-readable result ``` +### 5.8 GPS-only system time (`bananarchy-gps-time-sync.sh`) + +**Config -> Time source** toggles between `Network (NTP)` (the default) and `GPS only`. In GPS-only mode `chronyd` is stopped, `bananarchy-time-sync.sh` declines every boot/network-up/force NTP burst, and the system datetime is set **solely** from GNSS: `/usr/bin/bananarchy-gps-time-sync.sh` enables the modem's location sources, reads either ModemManager's `modem.location.gps.utc` or a valid `$GNRMC`/`$GPRMC` fix, steps the clock with `date -u -s`, writes the RTC with `hwclock -w -u`, and republishes the status bar clock. No DNS, NTP pool or network connection is used. The boot service calls `boot` in this mode, so a cold start with a 1970 RTC still recovers the date from GPS. + +**Config -> Sync GPS time** (`/usr/bin/bananarchy-sync-gps-time.sh`) runs the same one-shot sync immediately and shows the resulting UTC timestamp (or the failure reason) as a notification; it works in either time-source mode. From the shell: + +```bash +bananarchy-gps-time-sync.sh get # network | gps +bananarchy-gps-time-sync.sh source gps # select GNSS as the sole source +bananarchy-gps-time-sync.sh source network # restore NTP and chronyd +bananarchy-gps-time-sync.sh sync # one-shot GPS clock step +bananarchy-gps-time-sync.sh status # source, last fix, modem capabilities +``` + --- ## 6. Rebuilding the OS from a clean clone diff --git a/README.md b/README.md index a7a9ddd..1d43366 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs - **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, custom homepage support, and link focus that always scrolls the viewport to the focused link in both wrapped and unwrapped modes. - **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `