Add IMS/VoLTE/VoWiFi stack and fix Dual-SIM cellular mobile data

- Add Qualcomm MCFG .mbn parser and profile store (bananarchy-imsctl), QMI_PDC/QMI_IMSDCM VoLTE daemon (bananarchy-imsd), and SWu IKEv2/EAP-AKA/ESP/SIP/AMR VoWiFi engine (bananarchy-vowifi) with disabled-by-default (auto) 4G-only activation and xmodem/xfiles/xcallscreen UI support.

- Add libmm-wds-bind.so QMI_SERVICE_WDS PRIMARY subscription binding (including serialized post-mux/data-port binding), msm-modem-uim-selection DSDS PS-domain handoff, cs-only dial pause/restore (10-bananarchy-dpm.sh), cold-boot mmcli -K recovery, and networks.so connection.autoconnect no race fix.

- Add offline test suites (test-ims-mbn.py, test-imsd-volte.py, test-vowifi-swu-ims.py, test-lte-mobile-data.py), update docs (CHANGELOG.md Unreleased, README.md, MANUAL.md, AGENTS.md), and pin rebuilt 4-target image SHA-256 hashes in scripts/check-rebuild.sh.
This commit is contained in:
Luxferre committed 2026-11-20 19:18:58 +02:00
1 parent 03bc80f267
commit c40ec932de
65 files changed
+11916 -129

No files matched your search

+26
View File
@@ -12,6 +12,32 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
---
## Unreleased
### Cellular PS attach, Dual-SIM QMI WDS subscription binding (`libmm-wds-bind.so`), and mobile data (`wwan0`) fixes across all targets
- **QMI `WDS` subscription binding (`src/bananarchy-daemons/mm-wds-bind.c`, `libmm-wds-bind.so`, `/etc/init.d/modemmanager`)**: added a lightweight C `LD_PRELOAD` library preloaded by `ModemManager` and `msm-modem-uim-selection` (`run_wds_qmicli`) that hooks `qmi_device_allocate_client_finish()`, `qmi_client_wds_bind_mux_data_port()`, and `qmi_client_wds_bind_data_port()` to serialize `QMI_SUBSCRIPTION_TYPE_PRIMARY` (`1`, overrideable via `BANANARCHY_WDS_SUBSCRIPTION`) binding on every `QMI_SERVICE_WDS` (`1`) client both at allocation and after `Bind Mux Data Port` (`0x00A2`) / `Bind Data Port` (`0x0089`), preventing sticky KaiOS `SECONDARY` EFS `DDS` state (`QMI_DSD 0x004F == 2`) from resetting or routing `WDS Start Network` or `3gpp` profile lookups to the unprovisioned secondary subscription.
- **DSDS PS-domain handoff, APN sync, autoconnect race fix, cold-boot MM recovery, and safe `cs-only` dial pause/restore (`msm-modem-uim-selection`, `10-bananarchy-dpm.sh`, `networks_plugin.cpp`)**: updated `ensure_dsds_nas_registration()` (`QrtrTransport` `NAS` + `DSD`) to lock `Secondary GW` (`sub=1`) to GSM/`cs-only`, promote `Primary GW` (`sub=0`) to `cs-ps` + `gsm,umts,lte` (unless `rat_parked`) and `PS attach`, and bind `QMI_DSD` to `PRIMARY` (`data_enabled=1`) without triggering `QMI_DSD 0x004E`; updated `sync_wds_apn()` to populate empty `Profile [1]` alongside `attach_pdn`/`def_prof` directly via `QMI_WDS` while skipping `ims`/`sos` and removing `mmcli --3gpp-set-initial-eps-bearer-settings` calls (which triggered asynchronous 3GPP detaches before dial); added ANSI-safe `mmcli -K` cold-boot `failed` (`sim-missing`) auto-recovery and `nmcli` `gsm:` readiness gating in `mobile-data-prep` alongside `22 s` waits + `spawn_enable_and_register` in `boot`; switched cellular GSM profiles in `networks.so` and `mobile-data-prep` to `connection.autoconnect no` and ran `nmcli connection modify` before `mobile-data-prep` (and cleared any in-flight `qrtr0` `connecting` state) so background autoconnect never collides with `nmcli --wait 30 connection up` (`QMI OutOfCall (15)`); added `mobile-data-prep` / `restore-dsds` (`dsds_paused_for_data`) pause/reactivation via `10-bananarchy-dpm.sh` and `networks.so` when carrier EFS still holds `sub=0` in `cs-only`; and added `pre-up.d/10-bananarchy-dpm.sh` so `wwan0` BAM-DMUX opens before NetworkManager dial.
- **Idle `QMI_IMSDCM` (`0x0302`) isolation & bearer separation (`bananarchy-imsd.c`, `bananarchy-ims-bearer.sh`)**: gated QRTR `QMI_IMSDCM` (`0x0302`) server registration behind active VoLTE (`ensure_imsdcm()` / `close_imsdcm()`) and emitted `IMS_QMI_FLAG_IND` on `PDP_ACTIVATE`/`PDP_DEACTIVATE` so `MPSS.JO.3.1` `IMSAgent` cannot stall `DDSState = Pending` (`CM 2007`) at idle, while keeping IMS bearers isolated to `wwan1`/`rmnet_data1` away from `wwan0`.
- **Offline regression suite (`scripts/test-lte-mobile-data.py`, `scripts/check-rebuild.sh`)**: added offline host tests covering Dual-SIM/Single-SIM `ensure-ps-domain` over mock QRTR (`NAS` + `DSD`), `rat_parked` preservation, `cs-only` Dual-SIM pause and dispatcher `restore-dsds`, `Profile [1/4/5]` APN sync + initial-bearer skip, host `gcc` + `ctypes` validation of `mm-wds-bind.c`, and `bananarchy-ims-bearer.sh` `wwan0` isolation, wired into `scripts/check-rebuild.sh`.
### IMS profile (`.mbn`) management, VoLTE, and VoWiFi (`bananarchy-imsctl`, `bananarchy-imsd`, `bananarchy-vowifi`) across all targets
- **Disabled-by-default (`auto`) IMS policy with 4G-only auto-activation (`/etc/bananarchy/ims.conf`, `bananarchy-imsd`, `bananarchy-ims-bearer.sh`, `40-bananarchy-ims.sh`)**: shipped `volte_mode=auto` and `vowifi_mode=auto` (`volte_backend=auto`, `vowifi_roaming=0`, `wfc_preference=cellular_preferred`), keeping IMS daemons, bearer allocation, and `bananarchy-vowifi` completely idle at 0% CPU when CS/3G/2G fallback is available (`LTE+UMTS`, `UMTS`, `GSM`, or no registration) and activating VoLTE / VoWiFi automatically only when the connected cellular network is strictly **4G-only** (`LTE` with no 2G/3G CS fallback or modem `4G Only` preference) or when explicitly enabled by the user.
- **Qualcomm MCFG `.mbn` ELF32 parser, profile store, and `QMI_PDC` loader (`src/bananarchy-daemons/ims_mbn.h`, `ims_qrtr.h`, `bananarchy-imsctl.c`, `bananarchy-imsd.c`)**: implemented pure-C Qualcomm MCFG `.mbn` ELF32 LE validation (enforcing `config_type == 1` software configs, parsing `MCFG_TRL` carrier/MCC-MNC/version trailers, scanning `NV 67218` / EFS IMS flags, and computing pure-C SHA-1 `ba_<16hex>` IDs without external tools), persistent storage under `/var/lib/bananarchy/ims/profiles/`, `QMI_PDC` chunked `.mbn` loading/activation over `AF_QIPCRTR` (deduplicated via `g_pdc_loaded_id` / `pdc_select_only`), `QMI_DSD` `"ims"` APN tagging, dedicated-socket `QMI_IMSDCM` (`0x0302`) bearer activate/deactivate server, `QMI_IMS`/`QMI_IMSA` baseband VoLTE control with userspace fallback (`userspace`), and full Duress Mode mutation/exposure guards (`kDuressModeFlagPath`).
- **VoWiFi (`SWu` IKEv2 + `EAP-AKA`/`EAP-AKA'` + UDP/4500 ESP + 3GPP SIP + `SMS-over-IP`) and AMR-WB/AMR-NB codec support (`src/dwm-plugins/bananarchy_vowifi.cpp`, `vowifi_ikev2.h`, `vowifi_aka.h`, `amr_rtp.h`, `sip_plugin.cpp`)**: added an event-driven C++20 `SWu`/`IMS` userland engine implementing RFC 7296 IKEv2 (`COOKIE`, OpenSSL 3 `BN_get_rfc3526_prime_2048()` DH Group 14 with Group 2 fallback, `CFG_REQUEST` `P_CSCF_IP4/6`), RFC 4187/5448 `EAP-AKA` / `EAP-AKA'` via locked `QMI_UIM` `ISIM`/`USIM` `OPEN_LOGICAL_CHANNEL` + `SEND_APDU` (plus offline Milenage support), RFC 3948 UDP/4500 ESP over `tun_ims`, 3GPP SIP `REGISTER` (`AKAv1-MD5` with `AUTS` resync & instant `REFRESH` triggers), `INVITE` / `183 Session Progress` / `PRACK` / `UPDATE` / RTP / DTMF / `BYE`, `SMS-over-IP` (`RP-DATA` GSM-7/UCS-2 logging cleanly without `[SIM n]` tags), anti-spam `block.tsv` filtering, runtime-`dlopen`ed `AMR-WB` (`16 kHz`) / `AMR-NB` (`8 kHz`) octet-aligned and bandwidth-efficient RFC 4867 codecs (shared with `xsip` / `sip.so`), and cellular-first `112`/`911` emergency call routing (`sxmo_modemdial.sh`, `sxmo_modemcall.sh`, `sxmo_modemsendsms.sh`).
- **NeoUI control, CallScreen, power policy, and offline verification (`modem_plugin.cpp`, `files_plugin.cpp`, `callscreen_plugin.cpp`, `bananarchy-power-policy.sh`, `scripts/test-{ims-mbn,imsd-volte,vowifi-swu-ims,standby-power-policy}.py`)**: expanded `xmodem` to 5 tabs (`1:SIM 2:Rad 3:IMS 4:AT 5:Log`) with interactive `.mbn` install/select/remove and ePDG modals, added `.mbn` inspect/install actions to `xfiles`, wired `[SIM n VoWiFi]` / `[SIM n VoLTE]` badges and 425 Hz ringback into `xcallscreen`, updated `sxmo_hook_statusbar.sh`, `sxmo_hook_modem.sh`, `bananarchy-cover-status.sh`, `bananarchy-power-policy.sh` (preventing GSM parking during active cellular-preferred VoLTE and preserving IPv6 RA when `VOWIFI_IPV6_EPDG=1`), and added offline mock-QRTR / mock-TUN / Milenage host test suites (`test-ims-mbn.py`, `test-imsd-volte.py`, `test-vowifi-swu-ims.py`, and case 6 in `test-standby-power-policy.py`) wired into `scripts/check-rebuild.sh`.
- **Rebuilt local image SHA-256 checksums (`--mkinitfs`, no release `.zip` archives built yet)**:
- `images/bananarchy-nokia-argon.img`: `22014270bb62ebc825afe5ef60fe8aefa65776eb9efc511b92e834a61b59fb0e`
- `images/bananarchy-nokia-beatles.img`: `dce127a00efcf1e19aeaa8b21e4f28b33cdd5dd0044dcea0051a2e880c021ef7`
- `images/boot-bananarchy-nokia-beatles.img`: `480d6988f57028006ce0227092de077dffe5d6a51dadeedb0ef1f16a9a35a3e0`
- `images/bananarchy-nokia-coconut.img`: `1d5f20a0f6677748c25eedd044b23bb168ddaee0e4ae71c47ceefc0b0878c86f`
- `images/boot-bananarchy-nokia-coconut.img`: `7f56459f258857ed0252d0cd81e8fe496e55af2cff48e3cf6defe39a341dfc4a`
- `images/bananarchy-nokia-sparkler.img`: `99d54d6bc001e97f41dc314bbf012ef266251a70b6663a82260f32b1ffeff9e5`
- `images/boot-bananarchy-nokia-sparkler.img`: `a57973505f56754be74fdea9536e656af82a93d3d3722dcb61b3c6b6e9f6782b`
---
## Build `a1120` — codename `cocojamboo` (2026-11-20)
This build expands public release coverage to all four hardware-verified targets — **Nokia 8110 4G (`nokia-argon`)**, **Nokia 2720 Flip (`nokia-beatles`)**, **Nokia 800 Tough (`nokia-coconut`)**, and **Nokia 8000 4G (`nokia-sparkler`)** — shipping 4-core SMP/`cpufreq`, calibrated 157 Hz speaker-LRA haptic audio, dual-LED torch/camera support, versionless `lk2nd` screens, 72-hour DSDS/Wi-Fi standby optimizations (`0012`), Bluetooth 5.x/6.x headset audio and Android SSP pairing/OBEX file transfer, the Quagr encrypted pager (`xquagr`) with 2720 Flip cover alerts, permissionless keypad timers, microSD detection fixes, and DNS resolution/VPN leak fixes.