Files
Abdurrahman Kaan DikeçandClaude Opus 5.5 0608d94660 USB network "multi" (NCM + RNDIS in one configuration) and net-name eth
multi: RNDIS first (interface 0, MS OS compatible ID RNDIS), NCM next, then the
ACM console and adb, all in the single configuration Windows needs for its
composite parent. bcdDevice 0x0305 (0x0306 with adb). init names the netdevs
rndis0 and usb0, serves its early lease on a bridge of the two that goes before
switch_root; both are br-lan ports on Ubuntu and OpenWrt. usb-net-applied says
multi only when both functions were made; a kernel without f_rndis makes NCM.

net-name eth: every function's host_addr in the vendor block of LK's
androidboot.wifimac (globally administered, as stock Android's Wi-Fi address
is), so a Linux computer names the link eth0 instead of usb0; dev_addr stays.

Selectable everywhere the modes are: mu300-usb net multi / net-name, mu300-api
usb.net (mode multi, name), the Cockpit page, LuCI's Device page (device-usb,
mu300dash net_name), with translations. FINDINGS 242.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-11-01 23:41:52 +03:00

1.1 MiB
Raw Permalink Blame History

Findings: running Linux on the ZTE F50 / MU300 (Unisoc T760)

Everything below was verified on a ZTE F50 (hardware MU300, firmware MU300_ZYV1.0.0B09, Android 13, stock kernel 5.4.254-android12-9-g9c6342244991) during September 2026. Each item lists the symptom, the root cause and the fix, so it can be reused for other UMS9620 devices (for example the ZTE U30 Air).

Update 2026-10-07: the sections from 31 on were measured in October 2026, on mainline kernels as well as 5.4, and on more boards (a second F50, the U30 Air: §33, §34). This is a lab notebook, newest last: a later section can correct an earlier one. Where that happened, the earlier text is kept and an Update note under it points to what replaced it. The table below gives each section's state.

Contents

§ Title Status
1 Slot b one-shot trial (never touch boot_a) partly superseded by §17, §33a and PR #30 (Linux on either slot)
2 Boot ramdisk must be LZ4 legacy current
3 Logs without a serial console current
4 USB gadget dependency chain current (module count: see note)
5 The ~290 s power cut (PM co-processor watchdog) current
6 Load average of about 12 is not CPU usage current (5.4); for 6.18 see §31e, §31g
7 Matching source current
8 Build notes current
9 Unused space after userdata current
9b There is no second home for the rootfs current
10 Mounting gotchas current
11 systemd 259 works on 5.4 current
12 USB Ethernet must be up before the host activates ECM current (NCM is now the default function)
13 Userland needing newer syscalls current (Ubuntu 26.04 offered again, mainline only)
13b One reader at a time on the modem's AT tty current
13b-2 The modem stops answering on Linux superseded: not reproduced since (§13f-1, §31, §35)
13f The data call completes and still nothing arrives current (fixed)
13f-1 How it looked while it was open superseded by §13f
13g The same dead downlink, a different cause current; open: why the watchdog missed it
13h Ubuntu never started the delegate at all current (fixed)
13e The mailbox stops sending after one slow delivery current (fixed)
13c Reading this tty needs read -t current
13d Memory shared with the modem must not be mapped write-back current
14 Wi-Fi bring-up current (MAC and warning: superseded by §34, §31g)
14b Wi-Fi station mode: decided at boot, and one way only partly superseded by §31n (interface recreation)
14c The Wi-Fi driver can panic the kernel while it is still starting current (fixed)
15 Radio, registration and the data bearer current
16 Rootfs details found while testing data current
26b The tunnel needs sing-box's gvisor stack on this kernel current
26c SMS needs PDU mode current
26e The Xray engine current (engines now the vpn extra, PR #31)
17 Linux as default without losing the Android fallback current (updated in place; PR #39)
18 Services and drivers Android runs that the minimal port lacked current
19 systemd ordering pitfall current
20 Diagnosing early power cuts current
20b Telling a userspace reboot from a power cut current
21 One LAN for USB and Wi-Fi current (subnet per device: §33b)
22 Regulatory database current
23 Only one AP; 5 GHz AP needs the DS Parameter Set element current
26 Modem resets and mobile data recovery current (address check added: §31c)
26d USSD, and the AT lock current
27 Where the missing ~550 MiB of RAM goes current
28 Mali-G57 GPU (OpenCL) without Android current
29 OpenWrt 25.12 next to Ubuntu current (third system: §35)
30 Installer notes current
24 (removed) -
24b (removed) -
24c (removed) -
24d (removed) -
25 SC2355 Bluetooth on BlueZ current
31 Ubuntu on 6.18, and what it takes current (kernel now 6.18.56)
31a Wi-Fi RX: sync_for_device stopped invalidating current
31b The modem units' ordering cycle current
31c A context that comes back with a new address current
31d Evidence of a failed boot current
31e sipa-set-rps: a thread that never started current
31f The delegate on OpenWrt: -EINPROGRESS taken for a failure current
31g Three warnings on every boot, three vendor bugs current
31h Power-off, and the command line's crutches current
31i A Wi-Fi card that is late at boot panicked the board current
31j SD host under mainline partly superseded by §31l (mmc numbering)
31k The Linux filesystem on the SD card current; the hang is open in §31m
31l The card slot took mmc0 current
31m Hard hangs in the first seconds under 6.18 open
31n Wi-Fi powered off and on at the same time: an Oops in the RX interrupt current (fixed, PR #41); remaining races open
31o KVM, and the module set a router needs current
31p BTF and eBPF for dae, and the tracing that broke boots current; the writer at ~11.5 s is open
32 Old kernels, an idle IPA, and an update that ended in Android current
32a The offset in init, replaced by every boot image update current
32b The Magisk installer on a device partly superseded by PR #40 (passwords in update mode)
33 The same board with a battery partly superseded by §33d, §33f
33a misc and boot_b were looked up before the eMMC existed current
33b Two devices on one computer current (identity extended in §33j)
33c Mainline on the U30 Air: the USB PHY waited for a Type-C driver partly superseded by §33d (battery)
33d The U30 Air's battery under mainline current; open: charger-type detection to be retested
33e USB host on the U30 Air partly superseded by §33d (charger driver)
33f The U30 Air's LEDs current
33g The U30 Air's NFC tag current
33h A trial guard that outlived its experiment, again current
33i A reboot "with the hotspot off" that never brought it back current
33j Two devices restored from one backup current
33k Vendor driver fixes from the U30 Air test, measured current
34 LEDs, and the defects from a second board's test current
35 kanoqwq's fixes, measured current (panel languages: PR #48)
36 Power profiles: idle radios, the charging boot, the charge guard current; power table and device questions open (PR #62)
37 System suspend current (fixes on branch suspend-drivers); power not measured
39 The SMS pool: durable before the SIM lets go, long messages that never complete, forwarding current
40 The boot chain of the Linux slot: what is loaded per slot, and what the installers copy current; not yet run on a device whose slots differ
38 Three defects from users' reports, 2026-10-07 current
38a A read past the end of the eMMC never returns current (fixed)
38b RNDIS: the port kept the bridge's address current (fixed)
38c fw4 on 5.4: the boot ruleset without the LAN, and a reload that always fails current (fixed at boot; a reload by hand still needs the flowtable deleted first)
40 One stuck AT command wedged the control panel; a second per AT command on OpenWrt current (fixed)
41 The vendor daemons' own account current
41a OpenWrt with shadow-useradd: the modem's nodes the vendor account's, the daemons uid 1000 (issue #314) current (fixed)
42 No access point on a DFS channel (user report, 2026-10-11) current
43 adb over USB to Linux: adbd in the gadget, and what FunctionFS does to the rest of it current; the default (off) and who is let in (keys only): superseded by §70
44 Network namespaces on 5.4: the vendor's fragment sysctl, torn down by the wrong namespace (#103) current (fixed)
45 rmmod sprd_wlan_combo panicked in __run_timers (issue #146) current (fixed)
46 SMS sends failed with IMS "Busy Everywhere" until the SMSC was written back; the panel lost slow sends (#176) current (fixed)
47 A system the Magisk zip added beside another had a password nobody saw (#167) current (fixed)
48 The stock virtual thermal zone on mainline (mu300_thermal), and thermal-guard's handoff to the kernel current (F50-B, 7.2.10); U30 Air and 6.18 on a board untested
49 The SIM's own number in the panel: CNUM, else the IMS identity, on full rounds only current (U30 Air, Vodafone TR: CNUM answers)
50 Three guards for the installers: the boot image read back from the medium, bounded SD-card stages, no re-run in the same boot current; the timeout path not yet seen on a device
51 SMS delivered directly (+CMT), acknowledged only once the pool has it; the SIM path stays as the fallback current
52 The lock reset deleted the saved locks whether or not the modem took them: a verified reset current (fixed)
53 A carrier name shown as hex: UCS2 from a modem whose character set is not UCS2 (#174) current (fixed; unit tests and a user's report, not measured on our boards)
54 A webhook body of the user's own for SMS forwarding: values escaped for the type, never evaluated (#171) current (unit tests; not sent from a device to a real service)
55 Imported Android files nobody but root could read: the CP was never loaded (#127, #135, #170) current (fixed; what differed between #170's boots is not known)
56 The VPN page showed a refused config without its reason; the engines' own defects are in the VPN module's FINDINGS 26i-26m current (fixed; measured on the U30 Air)
57 A 64 GB unit whose partition table has userdata filling the disk, and no way to make room from Windows (#32) current (fixed; the erase of Android's data superseded by §112; unit tests against a table built from #9's figures, not measured on a device)
58 A service's own error in an HTTP 200 answer to the SMS webhook: a KEY=VALUE check of the answer; a button that clears the delivery log (#171) current (unit tests; measured on the U30 Air against a fake webhook, not against the real services)
60 /run takes files from every user: the daemons' directories there are checked, and a squatted name is put out of the way current (fixed for mu300-atd, F50-B on 5.4 and 7.2.10); /run itself is still 1777
63 A reused SMS reference number mixed long messages, or kept them from ever being joined; a part delivered again current (fixed; unit tests only, not measured on a device)
64 An update dropped the panel's saved locks (/etc/unisoc-modem) current (fixed; unit tests only, not reproduced on a device)
65 An APN with a user name and a password (AT+CGPCO), and what else kanoqwq's APN page does current (unit tests only; never sent to a modem)
66 The OpenWrt image build tries a package download again current (unit tests only; no image built with it)
70 adb to Linux on by default and open to every computer: the owner's decision, the exposure, and the state that decides it current (unit tests; nothing of it measured on a device: the checklist is in the section)
71 A graphical installer that drives the text installers: an answers mode, a progress stream, a window; a beta question; where a Python with a usable Tk is found current (run against an F50 from a Mac on 2026-10-15: check, backup, installs and uninstalls from the text installer and from the window; the U30 Air, a locked bootloader, Linux and Windows hosts not measured; Windows only by CI)
72 The web installer: adb over WebUSB, how the release files reach the device, WebUSB per platform, and what a closed tab leaves current; run end to end on an F50 from Chrome on macOS on 2026-10-13 (docs/web-installer.md), the real release mirror from Node on 2026-10-15; Windows, a Linux host, the U30 Air, KernelSU/APatch and a download over a carrier's network not measured
74 The U30 Air's second SIM: what two units showed, and the selector built on it (PR #73/#166, #194) current (the maintainer's U30 Air on 7.2.10 and the contributor's on 7.2.9); two working cards, kernel 5.4 and an F50 not run
80 WPA3 on the U30 Air's access point: the SC2355 firmware does SAE itself (PR #74, Snrat) disabled 2026-10-17 (§175): the PMK record cannot be told from one a client sends; history below
81 An update that brought another mu300-update ended with "another mu300-update is running": the lock was held by the first half's own keep-alive current (fixed; found on the F50 updating v2026.10.23 to v2026.10.24)
82 adb on by default, and no OpenWrt had it after a boot: the service gave up 13 s after power-on, before FunctionFS could be had current (fixed; measured on the F50, openwrt-luci, 7.2.10)
83 An update dropped the jobs of OpenWrt's System > Scheduled Tasks (/etc/crontabs) current (fixed; a user's report of the symptom, unit tests only)
85 An update keeps everything the user made: the image's manifest tells its files from the user's, one carry block for mu300-update, the installers and the Magisk zip, and never less protected than the user left it current (unit tests, real release images in containers, and the device protocol on a U30 Air, openwrt-luci, and an F50, Ubuntu, 2026-10-16, with two unpublished signed releases of the branch: everything carried; two defects fixed; the Android path not run)
86 Updating from the panel: System > Update, an update from a file (a release's Magisk zip), and release signatures (SHA256SUMS.sig) current (unit tests, a page test under Node, the commands in the image's container; the device protocol run on a U30 Air on openwrt-luci, 2026-10-15; F50 and Ubuntu not run)
90 The data watchdog took a modem that did not answer for a lost bearer, and redialled a working connection (after kanoqwq's 3cbf37fc) current (fixed; measured on the U30 Air, openwrt-luci v2026.10.27, 6.18.56, 2026-10-15; the OpenWrt watchdog's messages now reach the log)
91 The relay monitor read SIM1's bearer in a dual-SIM boot on SIM2, believed any +CGCONTRDP, and dropped the hint after a burst (after kanoqwq's 3cbf37fc) current (fixed; SIM1 measured on the U30 Air, openwrt-luci v2026.10.27, relay mode, 2026-10-15; the SIM2 choice only under the device's shell, no dual-SIM boot)
92 Three Wi-Fi TX log lines written once per frame; the AP multicast "endian fix" not taken (after kanoqwq's 3cbf37fc) current (mainline module only; measured on the F50 with 7.2.10 and the U30 Air with 6.18.56, 2026-10-15; the multicast question not measured)
93 sdhci-sprd started ADMA transfers with relaxed MMIO: the descriptors were not ordered before the command (after kanoqwq's 0438ab01) current (mainline kernels; eMMC soak on the F50 with 7.2.10 and the U30 Air with 6.18.56, 2026-10-15: clean, HS400ES, throughput unchanged; the SD slot not tested, no card)
95 The ZTE V50 (MU3351), experimental: how it is told apart, and what kano measured on his (f6b0668d, 0438ab01) experimental; nothing of it measured by this project (no V50 here): unit tests, the device trees of an F50 and a U30 Air, both mainline kernels built
100 mu300-next-boot: the default boot written before misc was, and a re-arm that could undo a switch (kanoqwq 1f8f03fb) current (fixed; measured on the F50, Ubuntu 24.04, and the U30 Air, openwrt-luci, both v2026.10.27, 2026-10-15)
101 The Magisk switch built its misc block under a fixed name in the adb shell user's directory current (fixed; measured on the F50, Android with Magisk, 2026-10-15; the U30 Air's sysfs name read from Linux)
102 Mobile data TX: a full IPA FIFO pushed another Ethernet header at every retry; IRQ flags in a static (kanoqwq 149c9d2a) current (fixed; run on the F50 with 7.2.10 and the U30 Air with 6.18.56, 2026-10-15: the busy path is every IPA resume; no difference visible on the device)
103 Wi-Fi TX on the SC2355 (mainline): a freed skb used on, AP IPv6 multicast refused in bursts, a full EDMA ring counted as failure (kanoqwq 149c9d2a) current (fixed; measured on the F50 with 7.2.10 and the U30 Air with 6.18.56, 2026-10-15: the multicast refusals gone, the full ring backpressure; one Wi-Fi client only)
104 The U30 Air's live SIM switch turned mobile data back on that the user had switched off (kanoqwq 2d3b6f3f) current (fixed; unit tests only, not run on a device)
105 The U30 Air's battery capacity kept at a power-off, and the fuel gauge's user area always written (kanoqwq 2af101f8) current (patch 0018; the callback device-tested on the U30 Air, 2026-10-17; the always-written part superseded by 181: stock writes with regmap_update_bits())
106 Wi-Fi (SC2355): a command the driver never sent returned success, and get_station handed on stack bytes (kanoqwq 0e19fe32) current (fixed in the mainline module and as a 5.4 patch; both built; not run on a device)
110 The web installer as a device manager: one checked entry point on the device (mu300-api), the page over it current (unit and Node tests against the real mu300-api; the device protocol run with the page's modules over WebUSB on a U30 Air, openwrt-luci, and an F50, Ubuntu, both v2026.10.27, 2026-10-16: six defects fixed; rows 6, 9, 16 and the Android restart not run)
111 One zip, two ways in: Magisk on the device, or unpacked on a computer as the computer's installer (kano's two-entry package, f6b0668d); adb not bundled current (unit and integration tests, the release's real zips built both ways and compared; no install from an unpacked zip on a device)
112 Making room by a reset, and the installation that resumes afterwards: kano's transaction, Android's recovery formats the encrypted userdata, the checks of the resumed run (f6b0668d, 0e19fe32) experimental; unit tests and tests against fakes (a fake eMMC); not run on a device, here or by kano
120 Data roaming: a switch of our own in the dial and its watchdog (no switch of the modem's is known), the network's word for roaming, and a test hook current (unit tests; checklist items 1-5 run on a U30 Air, openwrt-luci, and an F50, Ubuntu, both v2026.10.27, 2026-10-15, through the test hook; no SIM that really roams)
125 Release names: the day of the release and its number (vYYYY.MM.DD.N), newer than every three-field tag; one comparer per language against one table; what the updaters and installers up to v2026.10.27 do with them current (unit tests in sh, Python, JavaScript and PowerShell; the old clients read from their code, not run)
126 An update's password: kept by every installer, and checked on the device against the installed system's own hash, by the project's own static checker and never by a program of that system, when the user asks (the computer's installers ask; the Magisk zip takes the answer only from a mu300-install.conf inside the zip); the v2026.10.16.1 zip that reset an OpenWrt root of ubuntu to none current (unit tests; the zip on an F50, OpenWrt 6.18, 2026-10-16: kept unchecked, kept checked, refused, a new one; install.sh from the unpacked zip: refused, kept checked; install.ps1 and the window against the fake adb)
131 An update writes only what changed: the new image's binaries that the installed system has byte for byte become second names of its files (never text, never etc, var or the user's places), the room counted before anything is written by every installer and by mu300-update, nothing left behind by a run that fails or is cut off, and the computer installer's switch module of the release current (unit tests; the zip, mu300-update apply with rollback, and the computer installer on an F50, plain OpenWrt with Docker in its 804 MiB region, 2026-10-16; Ubuntu 24.04 by mu300-update with rollback on an F50, 2026-10-17)
132 Every OpenWrt release from v2026.10.13 to v2026.10.16.1 shipped its web server's TLS key (one per image, the same on every device): the build removes the pair, the release audit refuses it, 92-mu300-uhttpd-key removes a shipped key (32 fingerprints) at the first boot of each image current (unit tests; fingerprints of every published OpenWrt tarball; on the U30 Air by hand and at boot)
136 A carrier name the catalog has in another case (CHINA BROADNET) stayed English: looked up without case and spacing, then by its PLMN (#231) current (unit tests; a user's report, not measured on our boards)
137 The SMS webhook's custom body: the placeholder was Feishu's body, which WeCom refuses behind an HTTP 200; body presets for WeCom/DingTalk and Feishu/Lark that also fill in the answer check (#259) current (unit tests; not sent to a real service)
138 mu300-atd died at its first open of a SIPC tty that was not ready (a failed exec redirection ends dash and ash): it waits for the channel now, holding the command fifo (#226) current (unit tests under dash, bash and busybox ash; not on a device)
139 thermal-guard trusted the vendor 5.4 kernel to throttle by its release; a 5.4 whose sprd_cpu_cooling bound no zone overheated and reset (#229): every kernel is asked for a bound zone now current (unit tests; the 5.4 thermal sysfs on our boards not read yet: device checklist in the PR)
150 USB-C power delivery on the U30 Air: kano's UMP9620 port controller under TCPM, reviewed and rewritten (patches 0019/0020), off unless mu300-usb pd on; the charger refuses its boost against an outside supply experimental (built for 6.18.56/57 and 7.2.10/11, unit tests; on the U30 Air with a computer only: device + sink, off by default changes nothing)
151 The U30 Air's battery LED shows the battery as ZTE's firmware (white from 60 %, blue from 10 %, red below; breathing on the PMIC's curve while charging; no timeout on outside power, nor for the low-battery red), read at every tick of mu300-buttons current (unit tests; ZTE's behaviour from the stock firmware and its guide; not yet watched on a device)
152 The U30 Air's Wi-Fi LED: white on 5 GHz, blue on 2.4 GHz, as ZTE's firmware and its guide (it was the other way round); stock's network light shows the SIM in use, not 4G/5G (not changed) current (read from the stock firmware and ZTE's guide; not yet looked at on a device)
154 The U30 Air's network LED shows the SIM in use, as ZTE's firmware and its guide: white the nano-SIM (slot 0), blue the eSIM (slot 1), red no service, the target's colour blinking during a live switch; no longer 4G/5G current (read from the stock firmware and ZTE's guide; unit tests; not yet looked at on a device)
155 The settings as one file and back: `mu300-backup export import
156 The release smoke test, tools/smoke.py: identity first (SSH host key fingerprint, hostname, device, system, adb serial), the state before and after an update by each path (online, mirror, --from, the Magisk zip), the VPN's files compared by hash on the device current (unit tests with fakes; not yet run against a device)
160 The eMMC at a cold boot: a failed HS400ES (error -84, issue #226) no longer leaves the board without mmcblk0; the core drops the failed timing and the next attempt takes HS200, then HS/DDR52, then HS; a test hook sdhci_sprd.fail_hs400es current (unit tests; both mainline kernels built; not run on a device)
161 Mainline kernel sources: unpacked only after two OpenPGP signatures check out (kernel.org's autosigner over sha256sums.asc, the releaser over the tar) against keyrings pinned in upstream/keys/, fail closed current (unit tests with throwaway keys; 6.18.56 and 7.2.10 from kernel.org and seven kinds of tampering checked in the build image, 2026-10-16)
163 Linux 6.18.57 and 7.2.11 with every module the boards can use (all-modules.py, with a device-tree check), KVM in VHE mode with a guest, Docker's check-config and dockur/windows-arm; rare protocols, filesystems and line disciplines not loaded on demand, refused by module (mu300-modprobe-guard, three reviews of #256) current (built here; F50-B Ubuntu and the U30 Air openwrt-luci, both kernels each, the guard on both, 2026-10-16; dockur stops at its own RAM check: the boards have 1.4 GB; reboot soak of the mobile downlink, 2026-10-17: 6.18.57 20/20 boots on F50-C and the U30 Air, 6.18.56 12/12 on F50-C)
166 Mainline's soc-thmzone did not hold a full CPU load (38 to 98 C in three minutes): step_wise followed the sensors' noise. mu300_thermal gives it a trend over a second; thermal-guard caps on top of a kernel that does not hold the SoC from 92 C; the toolkit's stress test stops itself at 95 C current (host tests of the trend and a plant model; F50-C, OpenWrt, 6.18.56, 10-minute runs; 7.2.10 built, not run)
170 "Failed to send request: Operation not permitted" behind the VPN's kill switch: uclient's connect error, the tunnel down; the failure now names the kill switch, one try instead of four; vpn-dae refused before the download on a kernel that cannot run it current (reproduced in an OpenWrt 25.12 container with sing-box and the kill switch, 2026-10-17)
175 The U30 Air's firmware SAE offload disabled in every layer: the driver drops the PMK record and refuses the vendor command, no hostapd import, the wifi-scripts refuse SAE, a hotspot left on SAE becomes WPA2-PSK with the same password (or off, never open) with a notice current (unit tests; the driver built for 5.4 (objects), 6.18 and 7.2; on the U30 Air (OpenWrt, 6.18.57): refusal, migration, notice, the panel's save; no F50 yet)
180 Wi-Fi access point: get_station answered any address with the interface's own counters and the station side's signal; now only this AP's stations, with nothing filled in (the firmware has no per-client figures), -ENOENT otherwise; get_channel link 0 only (kanoqwq f59a296) current (mainline module and 5.4 patch built; unit tests; U30 Air 6.18.57 with a client, F50-B 7.2.11, 2026-10-17)
181 The U30 Air's fuel gauge against the stock module: the user area's writes are regmap_update_bits() with a wait after the release (stock save_last_cap at 0x4ba4), no migration guess for a valid saved value, the charger's Full is 100 % with the battery current within fullbatt-current (kanoqwq f59a296 reviewed: his 4.2 V condition would refuse a real Full) current (built for 6.18.57 and 7.2.11; unit tests; U30 Air 6.18.57, 2026-10-17: Full at 4.147 V gave 100 %, kept across a reboot)
188 (removed) -
195 Wi-Fi PCIe RX (kanoqwq 2d3f7438, cf4dcd61): the RX push interrupt never handed up a completed descriptor (inverted dscr_ring_empty(), mainline and 5.4); an RX refill refused by the full EDMA pending ring can resume on the bus completion instead of after 20 ms - 1 s (module parameter refill_bus_resume, off by default until measured); the 5.4 driver gets mainline's station-event bounds and channel-less mgmt_tx built (6.18.57, 7.2.11, 5.4 objects), unit tests run the real functions; not yet on a device
196 The U30 Air's charging boot: the stock modem_control never loads the CP after LK's charger boot (issue #253); a checked copy in RAM loads the CP alone (opt-in until run on a device); a charger boot can be a normal one (POWER_ON_CHARGER); unplugged, it powers off; a held power key starts it (from kanoqwq 85d72fa9) current; offline (loader disassembled, copy checksummed); not run on a device
197 The U30 Air's battery while awake: the fuel gauge's low-voltage and 1 % interrupts armed (patch 0023), and a low-battery poweroff in every state by the stock rules (from kanoqwq 99e1316a) current; built for 6.18.57 and 7.2.11, unit-tested; not run on a device
198 Network locks: "Automatic without 2G (152)" next to Automatic (134), from kanoqwq's auto work mode (cf4dcd61, c1293746); a lock like the others, replayed at boot offline tests; not yet on a device
199 Network LED: the V50 lights the lamp of the SIM in use as ZTE's firmware (slot 0 NET2, slot 1 NET1; it was NET1 always); F50/V50 show 5G for a 5G SA registration too (AT+C5GREG?), kanoqwq c1293746/f0ed60ff unit tests; not yet on a device
200 CPU cores online/offline (saved, CPU0 never) and CPU0's low latency (its idle states off, as ZTE's U30 Air; off by default), kanoqwq c1293746/2d3f7438 unit tests; not yet on a device
201 CPU voltage offset: the U30 Air's and the V50's SML builds are known (payload the F50's byte for byte; kanoqwq's U30 Air device test, c1293746, f6b0668d) unit tests; not yet on our U30 Air
202 A SIM's radio switched off in its settings: AT+SFUN=5 (the vendor RIL's stack off, CFUN reads 0 or 2) instead of AT+CFUN=4, back on through the ordinary AT+SFUN=4; an earlier release's flight mode still recognised (kanoqwq cf4dcd61) unit tests; kanoqwq's V50 device test; not yet on our boards
203 OpenWrt hotspot: U-APSD off on every access point, new and kept configurations (kanoqwq 2d3f7438); his U30 Air's beacon still announced it, so a configuration policy only unit tests; not yet on our boards
204 The ZTE V50's SIM cards (#332): ZTE's four board variants, a third built-in card behind SIM2 and the external card behind SIM1, switched by board GPIOs; chosen per boot, the switch set before the modem's CP starts (kanoqwq's f0ed60ff, b4c051c8) offline only (no V50 here): unit tests, the driver built for 6.18.57 and 7.2.11; on a V50 by the #332 reporter
205 The U30 Air's USB 3 link in device mode follows the plug orientation (#54): SuperSpeed only in the orientation the PHY/redriver latched at power-on; mu300-usb pd on (0020) gives CC and the roles but does not flip the lanes, and a replug does not bring SuperSpeed back (7.2.11) measured on a U30 Air, 7.2.11; no fix here. #341 on the same unit: orientation A at 10 Gbps, B not seen at all (worse than the USB 2 fallback); the PTN38003A does not answer at i2c 0x30 there
206 Linux 7.3 as a fourth kernel: every patch applies unchanged (none upstream, none dropped); PROC_SYSCTL folded into SYSCTL (config-ignored.txt, checked only where the kernel lacks the symbol), the cfg80211 cookie handed in by value, dma_capable() with DMA attributes; the checksum list from www.kernel.org (the CDN lagged) current (F50-B Ubuntu: all checks, the boot fallback; the one hang in a reboot loop was the board's plug pulled by accident, not 7.3; the U30 Air openwrt-luci with the VPN and its kill switch, 2026-10-19; sprd_wlan_combo for 6.18.57 and 7.2.11 byte for byte v2026.10.19.3's; released in v2026.10.22.1, F50-B 10/10 boots on 7.3 in a reboot soak)
213 A kernel oops on a restart of mu300-adbd: f_ncm and f_rndis free os_desc_table at unbind and keep the pointer, and a bind without MS OS descriptors (adbd's without_adb wrote os_desc/use 0) leaves it for the next unbind to free again - a kmalloc-16 double free that came back as kstrdup() oopsing in the UDC store; patch 0027 clears the pointer (6.18.57, 7.2.11 and 7.3 all have the bug), mu300-adbd keeps the descriptors on for every kernel current (F50 Ubuntu, 2026-10-24: unpatched 7.3 with the release's mu300-adbd went down within 11 restarts of it once, and oopsed at restart 118 a second time - "Unable to handle kernel paging request" at an address made of string bytes; 6.18.58 with 0027 and the same mu300-adbd 200 restarts clean; unpatched 7.3 with the new mu300-adbd 150 restarts clean. A U30 Air on OpenWrt 6.18.58 dropped off the air during the same loop)
218 CPU0's cluster power-down: USB, IPA and the Wi-Fi's PCIe were not wake sources of LP_AP_INTC (TF-A's IRQ_EN table); ums9620_lpintc adds every SPI the kernel enabled current (U30 Air OpenWrt 6.18.57: USB pings 9.5 ms avg / 42 ms max instead of 15.7 / 69; F50 Ubuntu 6.18.58: 1.2 / 1.5 ms instead of 30.6 / 150; builds for 7.2.12; suspend path not run)
242 USB network "multi": RNDIS and NCM in one configuration (bcdDevice 0x0305, 0x0306 with adb), both netdevs in br-lan; and "net-name eth", a computer's side MAC in the Wi-Fi address' vendor block, which Linux names eth0 as with Android current (F50-B Ubuntu, 7.3 and 5.4, macOS host; no Windows or Linux host)

Hardware and firmware facts

Item Value
SoC Unisoc T760 (UMS9620, "qogirn6pro"), board ums9620_2h10_feimao
RAM 2 GiB (about 1.4 GiB visible to Linux, the rest is reserved for modem/TEE)
Storage eMMC, about 58.25 GiB (122159104 sectors)
PMIC UMP9620 (+ UMP9621), charger IC bq2560x/sgm41513, fuel gauge sc27xx-fgu
Wi-Fi/BT SC2355 "Marlin3" on PCIe, firmware MARLIN3_20A_RLS2_W24.45.4
USB DWC3 (25100000.dwc3) + MUSB (musb-hdrc.1.auto), Type-C on the PMIC
Bootloader Unisoc LK ("sprdlk"), Trusty TEE, A/B slots
Boot images boot and vendor_boot are Android header v4, page 4096, LZ4 legacy ramdisks

Update 2026-10-07: the charger entry is the device tree's, not the F50's hardware: nothing answers at the charger's address 0x6b on the F50 (§33d). The U30 Air has the chip, an SGM41511 (a bq25601), §33d.

Boot chain and safe testing

1. Slot b one-shot trial (never touch boot_a)

  • Linux is written to boot_b only, and the 32-byte AOSP bootloader_control block at offset 0x800 of misc is set so that slot b has the highest priority.

  • Unisoc LK treats tries_remaining == 1 && successful_boot == 0 as an already failed boot (ANDROID: slot 1 booted fail, rolling back spl and reboot into normal). A one-shot trial therefore needs tries_remaining = 2: LK decrements it to 1 and boots slot b; if that boot fails, the next boot rolls back to slot a.

  • Linux init writes the original slot-a block back to misc as one of its first steps, so any later reboot returns to Android.

    Update 2026-10-07: three later changes. In default-Linux mode init does not restore slot a (§17). The restore runs after the vendor modules, once the eMMC exists, about 10 s in (§33a). And since PR #30 Linux can be on slot a, with Android on b (after an OTA, the Magisk installer does this). init takes the booted slot from LK and restores the other one (linux_slot_detect in boot/init). "boot_b" in this file means the Linux slot's boot partition.

  • The uboot_log partition contains LK's ring log. It is the best source for "which slot was chosen" and "why did it reset" (rst_mode, charge first poweron reset, watchdog flags).

2. Boot ramdisk must be LZ4 legacy

  • Symptom: RAMDISK: lz4 image found at block 0, RAMDISK: incomplete write (-28 != 8388608), then VFS: Unable to mount root fs on unknown-block(1,0).
  • Cause: vendor_boot's ramdisk is LZ4 legacy; a gzip boot ramdisk appended to it is not unpacked as an initramfs by this 5.4 kernel, which then falls back to the legacy /dev/ram0 image path.
  • Fix: compress the boot ramdisk with lz4 -l. Also add a dev/console node to the cpio.

3. Logs without a serial console

  • The stock cmdline has loglevel=1, so nothing reaches console-ramoops.
  • pstore only survives a warm reset. Most failures on this device end in a power cut, so init also persists its stage list and dmesg into unused space inside boot_b at 48 MiB (8 MiB); it is read back from Android.
  • A USB CDC-ACM function (acm.GS0) next to ECM gives a login console on the host (/dev/cu.usbmodem* on macOS) that works even when networking does not.

Hardware bring-up with the vendor modules

4. USB gadget dependency chain

The UDC only appears when the whole chain probes, in this order: extcon-usb-gpio (the PHY node references extcon-gpio) → PHYs → sc27xx_adc → sprd_battery_info → sprd-charger-manager → sc27xx_fuel_gauge → bq2560x-charger (provides the otg-vbus regulator used as vbus-supply by DWC3 and MUSB) → dwc3-sprd / musb_sprd.

  • sc27xx_adc must be loaded before the fuel gauge. The vendor sc27xx-fgu driver returns a hard error (not -EPROBE_DEFER) when its IIO channel is missing and is never probed again.

  • The exact working order of the 86 modules is in boot/module-order.txt.

    Update 2026-10-07: the list now has 85 entries. sipa-dele.ko left it and is loaded after the modem (§13f).

5. The ~290 s power cut (PM co-processor watchdog)

  • Symptom: Linux runs normally, then the device loses power about 290 s after boot. LK shows charge first poweron reset, not a watchdog reset.
  • Cause: the PM co-processor (CM4, pm_sys) runs its own watchdog. sprd_pmic_wdt disarms it by sending watchdog rstoff over an SIPC sbuf channel, but that channel only becomes ready after Android's modem_control reloads pm_sys (and the modem) through Trusty (kernelbootcp TA).
  • Fix: run Android's own /vendor/bin/modem_control in a chroot with Android's bionic linker and libraries. Requirements that were each discovered by failure:
    1. Copy /dev/__properties__ from a running Android so property reads work.
    2. Create /dev/block/by-name links and apply Android's node ownership (ueventd.rc plus chown/chmod from vendor init*.rc), because modem_control drops to uid system (1000). (On a distribution it starts as the account mu300vnd instead and the nodes are that account's: 41.)
    3. Bind-mount a copy of /proc/cmdline with androidboot.slot_suffix=_a so it loads the _a modem images (LK passes _b when booting the trial slot).
    4. Exec the binary directly. sprd_modem_loader rejects every ioctl/write unless current->comm is exactly modem_control (drivers/unisoc_platform/modem_loader); running it as linker64 /vendor/bin/modem_control makes the task name linker64.
    5. Provide a sink for liblog (tools/logdw, listens on /dev/socket/logdw), otherwise the daemon's logs vanish.
  • Result: kbc_verify_all_avb2() ret = 0, SEC_KBC_START_CP() ret = 0, sprd-pmic-wdt: sbuf ready for pmic wdt init!, Modem Alive, and no more power cut.

6. Load average of about 12 is not CPU usage

Vendor kernel threads (sprd-rotation/N, sipa-*, slog) wait in D state; Linux counts them in the load average. top shows about 98 % idle.

Custom kernel

7. Matching source

  • The ZTE U30 Air kernel (github.com/Enceka/android_kernel_zte_ums9620_mifi_u30air, "downloaded from ZTE opensource") is exactly 5.4.254, covers 137 of the 150 F50 vendor modules and all but one derived config symbol of the F50 stock config.
  • Missing from that tree: camera/display/GPU/touch modules (not used on this device) and the Wi-Fi driver sprd_wlan_combo, which is taken from the realme C51/C53 AndroidT kernel_modules drop.
  • An older Unisoc 5.4.147 tree lacks the whole qogirn6pro USB stack and is not usable.

8. Build notes

  • Full LTO needs more than 8 GiB in the linker step; ThinLTO keeps CFI and links fine.
  • Stock config + kernel/mu300-linux.fragment adds devtmpfs, fhandle, autofs, SysV IPC, namespaces, nftables, btrfs/xfs/squashfs, NFS/CIFS, USB serial/modem/audio host drivers, crypto user API, CDC-ACM gadget, and removes STATIC_USERMODEHELPER and forced module signatures.
  • All vendor modules must be rebuilt from the same tree (symbol CRCs change).

Root filesystem on free eMMC space

9. Unused space after userdata

  • userdata is 20 GiB and ends at sector 54218752; the GPT's last usable LBA is 122155007 and the backup GPT is at the very end. About 32.4 GiB between them belongs to no partition and read back as zeros.
  • The rootfs is an ext4 filesystem (mu300root) at byte offset 27762098176 (sector 54222848), 32.39 GiB, accessed through a loop device with an offset. The GPT, userdata and all Android partitions are unchanged.
  • userdata uses metadata encryption (dm-default-key, inlinecrypt), so it cannot be shrunk or shared.

9b. There is no second home for the rootfs

Asked for often, because a smaller eMMC variant leaves less free space behind userdata. Measured on the device:

  • An image file inside userdata cannot work. Metadata encryption covers the whole partition, not just file contents: mmcblk0p75 reads as ciphertext from Linux - 4079 of the first 4096 bytes are non-zero, no ext4 magic at 0x438 (2d81), no f2fs magic at 0x400 (58931da1). The same dd on our own region returns 53ef and the label mu300root, so this is the partition and not the reader. The key lives in keymaster and metadata and Android unwraps it at boot, so a file created from Android is unreadable from Linux whatever we do to it.

  • blackbox (500 MiB) and fulldumpdb (2 GiB) are not spare. They look unused, but sampling shows fulldumpdb non-zero in 16 of 16 samples (it starts with a note record) and blackbox in 1 of 16: the firmware writes crash dumps there.

  • So the gap after userdata is all there is. The installer no longer demands 4 GiB of it: the installed systems measure ~320 MiB (OpenWrt) and ~580 MiB (Ubuntu) and an update keeps the previous one as <os>.old, so it asks for 800 MiB, 1.6 GiB or 2.4 GiB depending on the choice, and prints the eMMC size and the end of the last partition, which identifies the variant when it still does not fit.

  • On the 32 GB variant the space can be made, by shrinking userdata - EXPERIMENTAL. Reported in issue #2 on a unit whose eMMC is 29.12 GiB (61079552 sectors) with partitions ending at sector 40095744 and userdata filling the rest, so --check computed a negative free size and refused. Shrinking userdata's GPT entry left 10 GiB behind it and the installer then ran unmodified.

    • Why only userdata: it is the last partition, so its end moves and nothing else does. Every other partition keeps its offset and the AVB descriptors and the boot chain stay valid. That is the entire safety argument, and it does not transfer to any other partition on these devices.
    • install.sh (and install.ps1, #57) offers it when there is no room, asks how many GiB to give Linux and keeps at least 4 GiB for Android and 800 MiB for Linux, and requires ERASE to be typed. uninstall.sh offers to grow it back, off by default because on the 64 GB variant that would hand the factory gap to Android. tools/resize-last-partition.py does the edit: it validates both GPT copies and every CRC first, refuses if the named partition is not the last one, and re-reads what it produced before handing it over. The backup GPT is written before the primary, so a power cut between the two leaves the old table and a device that still boots.
    • It rewrites the partition table and erases everything in Android. Take a full backup first (tools/backup-device.sh), and treat the path as experimental: it has been done by hand on one device.
    • (2026-10-15) Android's data is no longer cleared by the installer: Android's own recovery is asked to reset it, and the installation resumes after the reset (§112).

10. Mounting gotchas

  • busybox mount -o loop,offset= only creates a loop for regular files; for a block device the options go to ext4 and fail with EINVAL. Use losetup -o and verify /sys/block/loopN/loop/offset.
  • Android's losetup -f can return a loop index whose node does not exist yet; allocate, wait for the node and refuse to attach the same offset twice (two loops mounting one ext4 corrupted it once).
  • Toybox od on 64 MiB is extremely slow; never interrupt a safety check, an interrupted pipeline "passed" once.

Ubuntu on kernel 5.4

The root filesystem moved from Ubuntu 26.04 to 24.04 LTS: 26.04's userland starts to depend on syscalls newer than 5.4 (below), 24.04 is supported until 2029 and runs on 5.4 without workarounds.

Update 2026-10-07: Ubuntu 26.04 is offered again, as a beta, and only with a mainline kernel (6.18 or 7.2). install.sh refuses it with 5.4 for the openat2 reason in §13. Releases ship mu300-ubuntu-26.04-rootfs.tar.gz next to 24.04 (v2026.10.11).

11. systemd 259 works on 5.4

5.4 is systemd's minimum baseline; the system boots to running with the old-kernel taint.

12. USB Ethernet must be up before the host activates ECM

  • Symptom: macOS shows the "MU300 Linux USB Ethernet" interface as inactive forever, no DHCP, although on the device usb0 is UP with carrier.
  • Cause: usb0 was only brought up by a systemd unit a few seconds after the UDC was bound. f_ecm reports the link in its first CONNECT notification and macOS' AppleUserECM does not pick up a later "connected" notification.
  • Fix: ifconfig usb0 up immediately after binding the UDC in the initramfs.

Update 2026-10-07: the gadget now offers NCM by default, with ECM only as a fallback. Windows 10 2004+ and 11 bind their inbox driver to NCM, and Windows has no ECM driver. RNDIS is available on request (§35, K6). See setup_usb_gadget in boot/init. The same applies to §3's "next to ECM". The rule above, bring the link up before the host looks, still holds.

13. Userland needing newer syscalls

  • Ubuntu 26.04's GNU tar (1.35+dfsg-4ubuntu0.4) fails with Cannot stat: Function not implemented for every path, creating and extracting: it resolves paths with openat2 (Linux 5.6) and has no fallback. 24.04's tar does not use openat2.
  • ssh.service is socket-activated (24.04 and 26.04); enable ssh.socket, not only ssh.service.
  • Extracting an archive that contains a lib/ directory over Ubuntu replaces the /lib -> usr/lib symlink with a directory (systemd then disappears). Always ship files under usr/lib/....
  • docker export leaves /etc/hostname empty.

13b. One reader at a time on the modem's AT tty, and reopen it after a modem restart

/dev/stty_nr* are SIPC channels, not real serial ports, and the data goes to one reader. While a process holds the channel, a second one that opens the device reads nothing - it is not broken, it is simply not the owner.

Both of the things this section has claimed over time are true, of different situations, and telling the two apart is the whole problem:

  • A descriptor that was open across a modem restart (AT+SFUN=4, or a CP crash) refers to a channel that no longer exists, so it reads nothing - and because it still occupies the device, every other opener is shut out too, which is what made it look permanent. Closing it and opening the device again fixes that case immediately. Measured: with the daemon holding a stale descriptor, all six channels are silent; with the daemon stopped, all six answer OK at once.
  • Closing the descriptor while the modem is running does the opposite: the channel never answers again. Measured on 5.4, with AT+CGACT? answering normally minutes earlier: mu300-atd was killed and started again - one close, one open, nothing else - and from then on /dev/stty_nr1 accepted writes and returned nothing, for the remaining forty minutes of that boot. Everything tried against it failed: opening it raw with no daemon at all, opening nr0-nr5 together, draining nr0, and /etc/init.d/mu300-vendor restart - modem_control re-attaches without reloading the modem (the kernel logs modem_control has get lock 0, and no boot follows). Only a reboot brings it back. The modem is fine throughout: nr0 keeps delivering +SIND and +ECIND, and debugfs modem still reports run_state: 1.

A reopen is therefore the only cure for one case and the cause of the other, so the daemon needs evidence before it decides, and nr0 is that evidence: the modem's unsolicited output never stops while it is running, so a nr0 that is still producing lines means the modem is alive and this descriptor is fine - whatever else is wrong, closing it can only make things worse.

Three rules follow, and mu300-atd implements all three:

  • Exactly one owner. The daemon holds the tty and serves one command at a time through a pair of fifos in /run/mu300-at; mu300-at "AT+CSQ" asks it, and mobile-data uses it automatically when it is running. Nothing else may open the device - including stty -F, which is an open and a close of its own.
  • Drain nr0. It is read continuously into a capped log under /run/mu300-at/urc/, the way Android's RIL holds all six channels open. It is not a cure for a silent channel - that was tried - but registration and PDP changes are announced there and nowhere else, and stty_nr0.log is what the reopen rule below is built on. nr2-nr5 are left alone by default (MU300_AT_URC_CHANNELS takes them): a drainer owns its channel as completely as the daemon owns nr1, and measured, those four say nothing at all.
  • Reopen only when the modem is really gone. Five unanswered commands, at most one reopen every five minutes, and only when stty_nr0.log has been quiet for 240 s as well. The earlier rule - reopen after two or three unanswered commands - traded a working modem for a dead one on any device busy enough to miss a few replies.

"Exactly one owner" has to be enforced, not assumed. On the mainline kernel the modem kept going quiet a few minutes after every boot, and it was neither the channel nor the modem: a second mu300-atd had been started (procd respawning it, a service started twice). Two daemons read the same /dev/stty_nr1 and each gets part of every reply, and the newcomer removes and recreates the command fifo under the one already running, so every command returns empty. What follows looks exactly like a lost network - the watchdog sees no context, takes the interface down, netifd tears wan down and rebuilds it for ever - while the modem is untouched: stopping every daemon and starting a single one answered +CSQ: 43,24 with +CGACT:1,1 still active. mu300-atd now takes /run/mu300-at/lock before it opens the tty or creates the fifo; a second instance waits there instead of exiting, so a spare is always ready to take over if the owner is killed.

The lock alone was not enough, because mobile-data could still walk past it. Its at() asks the daemon when /run/mu300-at/cmd exists and opens /dev/stty_nr1 itself when it does not - and "no fifo" is not the same as "no daemon". Remove /run/mu300-at under a running mu300-atd (a stale lock cleaned up by hand, a tmpfiles sweep) and the daemon keeps its descriptor while the fifo is gone, so every mobile-data call takes the direct path and becomes a second reader on a channel that hands each line to exactly one of them. Found on the device: mu300-at reporting "the daemon is not reading commands" while /proc/*/fd showed mu300-atd and mobile-data watch both holding /dev/stty_nr1. mobile-data now checks /run/mu300-at/lock/pid before it opens anything: a live mu300-atd behind that pid means "refuse and say so", and otherwise it takes the same lock for the length of the command. tty_setup obeys the same check, since stty -F is an open and a close.

Also make sure only one bring-up runs at a time: mobile-data up from the service and from the watchdog used to run concurrently, and the two of them take the channel lock away from each other for every single AT command, so neither finishes. mobile-data now holds /run/mu300-mobile-data-up.lock while it works, down() leaves the context alone while a bring-up owns the channel, and only one watchdog runs.

Verified on 5.4 after these changes: a full down/up cycle followed by AT queries, and 12 queries over two minutes with the watchdog polling at the same time - all answered, no reopen needed.

A lock for this has to avoid one trap: ash and dash run an EXIT trap when a subshell exits, and the daemon runs a subshell per command (reply=$(collect ...)). A trap 'rm -rf $LOCK' EXIT therefore deleted the lock a second after taking it, and the next daemon walked straight in - the very failure the lock was meant to stop, now happening every few seconds. Clean up on INT/TERM only, and only when the pid in the lock is still ours.

13b-2. The modem stops answering on Linux - and it is not the mainline port (open)

Measured on both kernels and on stock Android, in that order, and the answer is not what it looked like. The modem stops talking to the AP partway through every Linux boot and never comes back without a reboot:

System First AT reply Then sipa_eth0
mainline 6.18.52 67 s silent 22 s later address, rx=0
vendor 5.4.254 60 s silent 17 s later address, rx=0
stock Android 13 - keeps working address, rx=104

So this is not a regression in the mainline port: the vendor kernel the device shipped with fails the same way on the same day, and Android on the same hardware, SIM and carrier passes traffic. What is missing is on our side of userspace, and it is missing on both kernels. Android runs a full modem stack (RIL, phoneserver/atcmdsrv, slogmodem, the IMS bridge); we run modem_control, cp_diskserver and refnotify and nothing else - and refnotify cannot even open /dev/stime_ch (ENODEV, the time-sync channel), on both kernels. The 5.4 module list also loads sipa_usb, sprd_pamu3 and sfp_core, none of which the mainline build has, though 5.4 shows rx=0 with them, so they are not sufficient by themselves.

The rest of this section is what was measured while the failure was still thought to be mainline's. Typical run: +CSQ: 44,26 at 67 s, nothing at 89 s. What dies is the CP's side of SIPC - the outbox (CP -> AP) mailbox interrupt stops counting, the modem's own log stops at the same moment, and after the mailbox fix (13e) the AP's messages still go out and are simply never answered. Restarting the vendor daemons does not recover it; modem_control reloading the modem does not either.

The timing is not fixed: measured deaths 24 s to 60 s after the first successful command (53 s, 87 s, 90 s, 91 s, 109 s of uptime), and not a fixed number of commands either - ten in a fast loop, four at one command every ten seconds.

Ruled out by measurement, so that nobody spends another evening on them:

  • Our own boot recorder. It did write 8 MiB to the eMMC every five seconds and that is worth fixing on its own (fixed since: early-recorder writes only what it has, not the whole 8 MiB window), but with it disabled the channel still died.
  • A cached alias of the modem's shared memory. The vendor device tree marks these reservations without no-map (only rebootescrow has it), so the 5.4 kernel maps them exactly the same way.
  • The modem power manager. sprd_mpm_init_resource_ops() is never called in the 5.4 tree either, so the NULL request/release callbacks are normal for this SoC.
  • The data attach. With wan disabled and no AT+CGDATA at all, the channel dies just the same.
  • Two daemons on the channel (real bug, fixed in 13b) and the modem log ring filling (real, 257 KB were sitting unread, drained now) - neither stops the failure.
  • A full software mailbox queue (real bug, fixed in 13e) - the AP can send again, and the modem still goes quiet.

Also ruled out by the same differential: our own services. With mu300-atd and mobile-data killed and a single shell holding the tty, the channel still went silent (132 s instead of ~90 s).

The next step is therefore not a kernel one: find what the CP expects from the AP that Android provides and we do not - the time-sync channel refnotify cannot open is the most concrete lead, followed by running more of the vendor modem userspace in the chroot the way modem_control already is.

Update 2026-10-07: this failure has not been seen since. The modem now answers for whole boots on both kernels: SMS and data on 6.18 (§31), and on 20 soft reboots of two devices the RIL handshake and registration worked on every boot, with a single AT+SFUN=4 in the whole run (§35). Which change ended it was not established. The likeliest is §13f-1's AT+CGDATA timeout: a late CONNECT was read as the answer to the next command. The delegate's load order (§13f) also changed in this period. Treat this section as history.

13f. The data call completes and still nothing arrives - fixed: the delegate has to come after the modem

Fixed. The downlink works: DNS resolves through the carrier's own resolvers and a TCP handshake to 1.1.1.1:443 completes, with rx_packets and the IPA receive interrupt climbing for the first time. What it took was loading sipa-dele.ko after the modem is up instead of with the rest of the modem stack. The measurements that led there are kept below, because most of them are about what the wrong answers look like.

Before and after, on the same device and SIM, one boot apart:

before after
sipa_eth0 rx_packets 0, always climbs with every request
irq 64 sprd,multi-sipa-0 0 67 and rising
SIPA_RM_RES_PROD_CP released, ref 0 granted, ref 1
nic: rc / nrt 0 / 1 4 / 0
channel 5-120 no trace of it send open msg at 50.9 s, receive open msg and success at 60.8 s
sipa_dele conversation silent type=5 flag=1 -> CONS_WWAN_DL 0->2 -> type=6 flag=1, cycling

The modem answers the channel open the moment it is up - smsg_ch_open(dst, chan, -1) waits, and 60.8 s is exactly when modem_control has the CP talking. So the old early load did not fail because the call was made too early in itself; it failed because the CP was reset underneath it afterwards, which is the path where smsg_recv errors out and conn_thread exits for good.

Two things that are not this bug, and cost time looking like it:

  • A stopped VPN leaves its policy routing behind. /etc/init.d/mu300-vpn stop removes neither the sbtun rules (prefs 9000-9010, table 2022) nor sing-box itself, so every packet still goes into a tunnel with nothing at the other end and every test reads Operation not permitted. That is an EPERM from routing, not from the modem, and it made a working data path look dead.

    Update 2026-10-07: mu300-vpn off now removes rules that a dead engine left behind (routing_cleanup, prefs 9000-9010 and table 2022), and every exit of the Xray engine takes its routes down (§26e). A service stop still leaves the kill switch up on purpose. Only ENABLE=0 or mu300-vpn off removes it. Since PR #31 the engines are not in the images at all, see §26e.

  • A resolv.conf left behind by Docker. Images built before the build fix carry the container's nameserver 192.168.65.7 as a regular file rather than the symlink to /tmp/resolv.conf, so every name lookup fails while addresses work fine.

What is left is not ours: with the tunnel down, DNS and 1.1.1.1:443 are reachable over the bearer and other destinations time out, which is the carrier restricting where this SIM may go.

13f-1. How it looked while it was open

Measured step by step on 5.4 with the release userspace, so none of it is a mainline or a script regression:

  • AT+CFUN? is 0 at boot - the radio is off until mobile-data turns it on. Any experiment that stubs mobile-data out is testing a device with no radio, which is why "the AT channel survives when nothing attaches" proved less than it looked.
  • With the radio on, the bring-up is textbook: +CEREG: 2,1 (registered), AT+CGACT=1,1 returns ^ORIG: 1,2 OK, AT+CGACT? reports +CGACT:1,1, AT+CGCONTRDP=1 hands back an address, a netmask and both DNS servers, and AT+CGDATA="M-ETHER",1 answers ^ORIG: 1,2 and then CONNECT.
  • Configure sipa_eth0 with exactly that address and route, and rx_packets stays at 0. Not one downlink packet, on either kernel, while stock Android on the same device, SIM and carrier shows rx=104.
  • cid 11 is the IMS context (ims.MNC002.MCC286.GPRS), not a second internet bearer, and no other sipa_ethN receives anything either.

AT+CGDATA needs a long timeout. It answers ^ORIG first and CONNECT ten to twenty seconds later. The eight-second budget mobile-data used meant the reply landed after we had given up, so the next command read that instead of its own answer - which is most of what "the AT channel dies after the attach" really was. Raised to 45 s.

What is left is the IPA receive path itself. Two differences from Android are recorded but neither is proven: its RIL defines the context as AT+CGDCONT=<cid>,"IP",<apn>,"",0,0,0,0,1 (IPv4 only, with the vendor's extra parameters) where we ask for IPV4V6; and its SIPA_RM_RES_CONS_WWAN_DL is granted while ours is never requested - though in sipa_nic.c that consumer belongs to PCIe-source nics, and this modem is on-chip.

The Android reference, taken on the same device with data working (sipa_eth0 rx=419 tx=1440), so that the Linux dump has something to be compared against rather than reasoned about. Mount debugfs first - Android does not (mount -t debugfs debugfs /sys/kernel/debug):

suspend_stage = 0x0 rc = 80 sc = 79 pf = 1          # and 0x3f / 80 / 80 / 0 a second later: it sleeps when idle
mode_state = 0x0 is_bypass = 0x1
open = 0 src_mask = 0x7070 netid = 0 fcs = 0 rm_flow_ctrl = 0 rr = 0 rw = 1 release_in_progress = 1 nrt = 0 rip = 0
DEVICE: sipa_eth0, src_id 6, netid 0, state UP      # rx_errors = 81, tx_errors = 81
SIPA_RM_RES_PROD_IPA      ref_count = 1 state = 2 (granted)
SIPA_RM_RES_PROD_CP       ref_count = 1 state = 2 (granted)
SIPA_RM_RES_CONS_WWAN_UL  ref_count = 1 state = 2 (granted)
SIPA_RM_RES_CONS_WWAN_DL  ref_count = 0 state = 0 (released)   # never granted, even with data flowing
sipa_dummy0: all 419 packets on CPU0, last_irq_trigger set, last_read_empty 0

The configuration is identical to ours. Same interface name, same src_id 6, same netid 0, same src_mask 0x7070, same is_bypass = 0x1. So the netid/src_id mapping is not the problem, bypass mode is not the problem, and CONS_WWAN_DL being released is not the problem either - Android passes downlink with it released. What differs is only the history: rc = 80 against our rc = 0, nrt = 0 against our nrt = 1. Ours has never been woken, because nothing has ever transmitted through it in the boot that was dumped. The comparison that matters has therefore still not been made: the Linux dump has to be taken while packets are actually being pushed at sipa_eth0, and then read field by field against the block above.

The downlink is the modem's decision, and it asks first. This is the part the Android log settles, and it reframes everything above. With data flowing, dmesg on Android is a conversation on SIPC channel 120 (SMSG_CH_COMM_SIPA, dst 5 = SIPC_ID_PSCP), repeating every few seconds:

sipa_dele: smsg_recv, smsg_cnt=295, dst=5, chan=120, type=5, flag=0x1   <- the modem asks
sipa_dele: prod_id:4, on_cmd, flag = 1
sipa_dele: sipa_dele get pd success ret = 0
sipa_rm:   SIPA_RM_RES_CONS_WWAN_DL state changed 0->2                  <- the AP grants
sipa_dele: smsg_send, dst=5 chan=120 type=6 flag=1                      <- and acks
...three seconds later...
sipa_dele: smsg_recv, ... type=5, flag=0x2                              <- the modem lets it go
sipa_rm:   SIPA_RM_RES_CONS_WWAN_DL state changed 2->0

So CONS_WWAN_DL is not released on a working system, as a single sample suggested - it cycles, granted for as long as the modem has something to deliver. And nothing arrives until the AP answers that request. A sipa_dele that is not holding up its end is therefore a complete explanation of our symptom: the modem is never given permission, so it never sends, so sipa_receiver_notify_cb is never called and rx_packets stays at zero while everything else looks correct.

Checking it costs one command, because both halves of the exchange are pr_info:

dmesg | grep -E 'sipa_dele|sipa_rm'

Nothing at all is the interesting answer. Two ways that happens, both visible:

  • sipa_delegator failed to open dst 5 channel 120 - smsg_ch_open refused.
  • No message of any kind, including that one. conn_thread calls smsg_ch_open(dst, chan, -1), and the -1 waits for ever by design ("the channel open may hang, we call it in the thread context"). If the modem side never opens channel 120, the kthread simply sits there and says nothing.

Worth knowing while reading the probe: dts parsing failed and get resource failed for remote-base! are not the failure. sipa_dele_plat_drv_probe logs them and carries on, and Android prints them too.

The delegate gets exactly one attempt, and ours has been taking it too early (not yet confirmed on the device, but it follows from the source and from our boot order). conn_thread's first act is smsg_ch_open(dst, chan, -1), and with the modem not up that ends one of two ways: it waits for ever for an OPEN that never comes, or smsg_recv returns an error, smsg_ch_open frees the channel, and the thread logs sipa_delegator failed to open dst 5 channel 120 and returns. The reopen handling further down (case SMSG_TYPE_OPEN: smsg_open_ack(...)) only ever runs after that first open succeeds, so a modem restart is survivable and a modem that was never there is not. There is no second chance either: sipa_dele is [permanent] in /proc/modules, so it cannot be removed and inserted again.

Our order made that likely. The initramfs loaded sipa-dele.ko with the rest of the modem stack at about twenty seconds, while modem_control does not have the CP talking until about sixty - measured on this device, sprd-sbuf: channel 5-* and sbuf ready for pmic wdt init both land at 60.8 s. Android loads it the other way round. sipa-dele-start now waits for one of those two lines before inserting the module, and boot/module-order.txt and upstream/module-order.txt no longer carry it. Nothing regresses if the theory is wrong: sipa_core creates every consumer resource itself, and the delegator only adds PROD_CP and the CONS_WWAN_UL -> PROD_CP edge, so sipa_eth0 still opens exactly as before.

Note that this needs a rebuilt boot image to take effect - an image that still loads the delegate early leaves nothing for sipa-dele-start to do, by design.

Do not test this with ping. On this network ICMP does not come back even over a link that works: on stock Android, with data flowing, ping -I sipa_eth0 8.8.8.8 reports 100 % loss, and that form binds to the device, so it is the cellular path rather than a VPN swallowing the echo. A TCP connect on the same interface completes and rx_packets climbs. The signal to read is that counter, not whether a connect succeeded - the connect may be carried by a VPN, and on Android it was (ip route get 1.1.1.1 goes to tun0), but the VPN's own packets still leave and arrive over sipa_eth0, which is the only WAN this device has. mu300-ipa-dump does it this way; several earlier "nothing arrives" measurements here were ping-based and proved less than they looked.

Two smaller differences from the same reference, both cheap to copy and neither yet tested:

  • Android keeps IPv6 switched off on that interface (/proc/sys/net/ipv6/conf/sipa_eth0/disable_ipv6 is 1); ours carries a link-local address. This fits its RIL defining the context as "IP" rather than our "IPV4V6".
  • Its rx_errors and tx_errors are equal and non-zero (81 each) on a link that works, so those counters are not by themselves a sign of trouble.

Read the IPA state before theorising - /sys/kernel/debug/sipa/ answers most of it, and two of its fields are easy to misread:

  • nic: suspend_stage, rc (resumes), sc (suspends), is_bypass, then one line per allocated nic. A fresh boot that has sent nothing shows suspend_stage = 0x3f rc = 0 and that is correct, not a fault: the driver sets suspend_stage = SIPA_SUSPEND_MASK in probe (sipa_core.c) and the hardware is woken lazily, by the first transmit, through sipa_nic_rm_res_request(). Likewise open = 0 on a nic line means NIC_OPEN, since that enum starts at 0 (sipa_priv.h) - an open nic, not a closed one. Any conclusion drawn from these two has to come from a dump taken while traffic is being pushed at sipa_eth0.
  • rm_res prints the whole producer/consumer graph with its states, fifo_cfg the seventeen common FIFOs, flow_ctrl the per-FIFO enter/exit counts, and sipa_eth/sipa_eth0/stats the driver's own packet counters - which are the ones to trust, since a route pointing at the interface is not the same as packets reaching it.

The downlink stopped again, and every counter read exactly like 13f's "before" column: rx_packets 0 since boot, SIPA_RM_RES_PROD_CP released with ref 0, suspend_stage = 0x3f, nic's nrt = 1. That invites the 13f diagnosis a second time. It was wrong. AT+CGACT? answered:

+CGACT:1,0
+CGACT:11,1

The internet context was gone while the IMS context stayed up, and sipa_eth0 still carried the address from the previous call - so ip addr and every check built on it kept passing. mobile-data up brought cid 1 back, the interface took a new address, and rx_packets moved on the first DNS query. Nothing about the IPA, the delegate or the kernel was involved.

An idle link reads as a broken one. SIPA runtime-suspends a few seconds after the last packet. Suspended, suspend_stage is 0x3f (SIPA_SUSPEND_MASK, the value sipa_probe starts from), every resource is Released and alloc_skb_cnt is 0, because the receive buffers are posted on resume and handed back on suspend. That is the normal idle state, not a fault: docs/reference/android-ipa-state.txt section 15 shows Android cycling through it every few seconds. In sipa/nic, rc and sc count resumes and suspends - awake is rc == sc + 1, and rc == sc only means nothing has been sent lately. None of these counters mean anything unless traffic is actually leaving while you read them. Drive the link first, then look.

Two things make "traffic is leaving" much harder to establish than it sounds, and both produced false positives here before the real cause turned up:

  • sing-box's tun answers ICMP itself. Its ip rule set sends locally generated packets into table 2022 as well (pref 9001 lookup 2022 suppress_prefixlength 0, and the tunnel routes are 0.0.0.0/1 and 128.0.0.0/2, which a prefix-length-0 suppression does not catch), so binding the source with ping -I <cellular address> does not escape it either. Every ping then succeeds in well under a millisecond while sipa_eth0's tx_packets never moves. A sub-millisecond reply from a public address is the tell. Stop sing-box before believing any ping, and check tx_packets alongside it.
  • The kill-switch turns the next attempt into a different lie. With sing-box stopped but the firewall up, the same ping returns sendto: Operation not permitted - an EPERM from table inet mu300_vpn, which reads like the modem refusing traffic. Both have to be down, or the test has to be a hole punched in accept_to_wan and taken straight back out.

The carrier answers DNS but drops ICMP to 8.8.8.8, so a failed ping is not evidence either way on this SIM. Resolve a name against the address AT+CGCONTRDP hands back and watch rx_packets; that is the cheap test that does not lie.

A cosmetic write could take the data call down with it. mobile-data's up() ends by putting the blue LED on. The PMIC rejected that write once (echo: write error: Invalid argument), and under set -euo pipefail the && list failing ended the function one line before it reported success - after the context was already up. So the call was live and the caller saw a failure. The LED writes go through a led() helper now that cannot fail. Worth remembering for any other cosmetic side effect in a path that matters.

Still open: mobile-data watch was running and its check does look at AT+CGACT?, so it should have caught the dropped context and reconnected. It did not, and this round did not establish why.

13h. Ubuntu never started the delegate at all

The fix in 13f moved sipa-dele.ko out of the module list into extra-modules, which starts sipa-dele-start when it finds $M/sipa-dele.ko with M=/lib/modules/$(uname -r). OpenWrt keeps its modules flat in that directory; the Ubuntu image keeps them under extra/. The test was false on Ubuntu, nothing was started and nothing was logged (not even the log file the redirection would have created), and every Ubuntu image since then came up with an address on sipa_eth0, a finished mobile-data and no downlink. What made it look like working on the test unit was a VPN still pointed at an HTTP proxy on the computer at the other end of the USB cable: wget succeeded with sipa_eth0 at rx 0 and tx 0. Both scripts now look in both places. Measured on Ubuntu afterwards: the delegate loads at boot, rx_packets climbs, and the Xray tunnel reaches its server over the bearer.

13e. The mailbox stops sending after one slow delivery (mainline)

On the mainline kernel the modem went quiet about ninety seconds into every boot - +CSQ: 44,26 at 67 s, nothing at 89 s - and stayed quiet until a reboot. It was neither the modem nor the channel: writing an AT command left the mailbox registers untouched (/dev/mbox: INBOX msg_low identical before and after), so the AP was not sending anything at all. mbox-deliver-th was asleep in sprd_mbox_deliver_thread, and the inbox interrupt had fired zero times since boot.

sprd_mbox_send_data() queues a message in a software fifo when phy_ops->send() fails, and only the inbox interrupt - raised when a delivery completes or a channel blocks - wakes the thread that drains it. But check_mbox_chan_state() also fails with -ETIMEDOUT when the remote core is merely slow to take the previous message, and that raises no interrupt at all. One such timeout leaves the fifo non-empty for ever, and from then on every message takes the "fifo is not empty, queue it" path: the AP never speaks to the modem again.

The fix is in the driver, not in the timeout: queueing now wakes the deliver thread itself, and the thread retries what is still queued (1 ms apart) instead of waiting for an interrupt that may never come.

13c. Reading this tty needs read -t, and only bash or busybox ash have it

Two ways of timing out a read do not work here, and both fail silently:

  • dash has no read -t. It is /bin/sh on Ubuntu and Debian, so a #!/bin/sh script using read -t fails on every read with "Illegal option", spins through its timeout and returns an empty reply. The symptom is a daemon that answers nothing while burning exactly one timeout of CPU per command (measured: 17.9 s for three 6 s commands).
  • The termios timer is ignored. stty min 0 time 5 changes nothing: the driver blocks in sbuf_read until the modem says something, possibly for ever. Visible as wchan = sbuf_read with zero CPU time.

read -t in bash and in busybox ash uses poll(), which this driver does implement, so both work. mu300-atd and mu300-at re-exec themselves under bash (or busybox ash) when the shell running them has no -t.

Apply stty to the already-open descriptor (stty raw -echo <&3), never stty -F /dev/stty_nr1: the -F form is an extra open and close of the device, which takes the channel away from whoever owns it (13b).

130. Docker in the images: Ubuntu's packages, OpenWrt ready to install, the data beside the systems

Status: current (Ubuntu 24.04 on F50-B, kernel 7.2.10; plain OpenWrt on F50-C, kernels 6.18.56 and 5.4, in a region of 804 MiB; test releases v2026.10.16.97 and .98 built from the branch with v2026.10.16.1's kernels, never published).

What is in which image.

system Docker image installed (4 KiB blocks) tarball Magisk zip (k7.2)
Ubuntu 24.04 installed: docker.io 29.1.3, containerd 2.2.1, runc 1.3.4, docker-compose-v2 2.40.3 345 -> 608 MiB 95 -> 175 MiB 122 -> 206 MB
Ubuntu 26.04 installed: docker.io 29.1.3, containerd 2.2.2, runc 1.4.0, docker-compose-v2 2.40.3 384 -> 649 MiB 107 -> 188 MiB 134 -> 220 MB
OpenWrt ready: settings and firewall zone; apk add dockerd docker docker-compose (29.6.1, compose 5.1.4) 58 MiB (251 with Docker in it) 21 MiB (86) 45 MB (113)
OpenWrt with the panel ready, as OpenWrt; luci-app-dockerman adds LuCI > Docker 61 MiB (254 with Docker) 23 MiB (87) 46 MB (114)

Ubuntu's own packages, not docker-ce: they come from the archive the image already uses, apt updates them with everything else, and they are the versions Ubuntu supports (Docker 29 in both releases). containerd's stress tool, its command line (ctr) and the docker trust plugin are left out with dpkg path-exclude (55 MB that docker and docker compose do not use; upgrades do not bring them back). OpenWrt: the 25.12 feed's packages (containerd-stress and ctr removed in the image build when MU300_DOCKER=1).

Why OpenWrt has it ready and not installed. With Docker in the image, plain OpenWrt's system on F50-C was 472 MiB (with the device's vendor files, 205 MiB) of the region's 775. The first install fits; the next update by zip does not: it unpacks the new system beside the old one before it carries the user's files over, and the zip of the same release stopped at tar: No space left on device (nothing was changed, as the installer says; it left openwrt.new, 300 MB, on the disk until the next run cleans it, and the disk was 98% full meanwhile). Without Docker the system is 263 MiB and the update fits. Docker installed with apk is a package of the device, which an update does not copy (it is installed again at the first boot), but on 800 MiB its 190 MB in the old system still leave too little room for the new one: the README says to remove the packages before such an update and add them after it (the data stays). MU300_DOCKER=1 builds an OpenWrt image with Docker in it (and luci-app-dockerman on the panel system); one such image ran Docker on 6.18 on F50-C.

The same arithmetic for Ubuntu: 608 + 205 MiB per system, twice during a zip update, is about 1.63 GiB, more than the 1.6 GiB region the installers allow for Ubuntu. Ubuntu keeps Docker installed (it is the system people install Docker on, and usually on far more room: F50-B has 32 GB); its minimum with room for an update should become 2.0 GiB (install.sh's NEED_UBUNTU, install.ps1, the Magisk installer's figures), or the update should link the new image's files that are byte for byte the old image's instead of unpacking them again. Neither is in this change.

Started when used, not at boot. Ubuntu: docker.socket is enabled, docker.service and containerd.service are not; the first docker command started both in 1.8 s. dockerd and containerd took 115 + 50 MB RSS after a compose run (F50-B, 7.2), 85 + 44 MB on OpenWrt 6.18, 63 + 31 MB on 5.4: memory a dongle without containers keeps. systemd-networkd-wait-online.service is disabled in the image, so docker.service's Wants=network-online.target does not wait. OpenWrt: the image build removes the enable link apk makes; an apk add on the device enables it (the package's post-install), which the README says.

The data lives beside the systems. data-root is /mnt/mu300-disk/docker/<system> (ubuntu, openwrt, openwrt-luci): on the Linux partition next to ubuntu/, openwrt/ and extra/, outside the directory a system boots from. An update unpacks the new system and carries the user's files of the old one into it (FINDINGS 85); /var/lib/docker inside the system would be carried too - copied in full when the old version is kept for a rollback (mu300-update apply), and its overlay2 layers are what fills a device. Outside, the carry never sees it: nothing is copied, nothing is left behind in <os>.old, and a rollback finds the same images and containers. Measured on F50-C: v2026.10.16.1 -> .97 (Docker in the image; images loaded, a compose project with restart: unless-stopped) -> .98 (Docker not in the image) -> apk add: the images and the compose container were there and running, on 5.4 after 6.18; on F50-B .1 -> .98 by mu300-update apply --from the zip, then the rollback. A system without /mnt/mu300-disk (one at the root of the partition, from before the systems had directories) keeps the data inside itself and has it carried as before; mu300-carry keeps extended attributes and device nodes, so overlay2's whiteouts and opaque directories survive that too. The classic overlay2 store ("features": {"containerd-snapshotter": false}): on a fresh install Docker 29 uses containerd's image store, which keeps every image twice (the compressed blobs and the unpacked snapshots) and in containerd's own root.

The firewall: Docker's nftables backend. "firewall-backend": "nftables" (Docker 29, experimental): Docker writes its own tables (ip docker-bridges, and ip6 docker-bridges on Ubuntu) and no iptables rules. With iptables Docker sets the iptables FORWARD policy to DROP when it turns forwarding on, which would stop the hotspot's forwarding on Ubuntu, and its rules need xt_addrtype, which the 5.4 kernel does not have (below). On Ubuntu mu300_filter's forward policy is accept, so nothing else is needed; "ip-forward": false keeps Docker from refusing to start while the system forwards nothing (mobile-data and wifi-client turn forwarding on). On OpenWrt fw4's forward chain rejects what no zone lets through, and an accept in Docker's table does not end the packet's way through fw4's chain. So /etc/uci-defaults/95-mu300-docker adds, once (the marker /etc/mu300/docker-zone), the zone docker: devices docker0, br-+ and !br-lan and subnet 172.16.0.0/12, which fw4 matches together (iifname "br-*" iifname != "br-lan" ip saddr 172.16.0.0/12), with Docker's default-address-pools set to that range in /etc/docker/daemon.json; input and forward REJECT (below); forwardings docker -> wan and lan -> docker, none from wan. Measured: containers on the default bridge and on a compose network reach the internet (masqueraded by Docker), a LAN client (a network namespace on br-lan, and the Mac over USB) reaches a published port and still reaches the internet, and a container does not reach a LAN client by itself. The package's init script reads /etc/docker/daemon.json (alt_config_file), so an apk add on the device keeps these settings (its own /etc/config/dockerd is written as .apk-new). The zone has the names of the package's uciadd (network docker, bridge device docker0), made in advance: when uciadd had to add them at the first boot with dockerd enabled, its network reload took docker0 from the dockerd that had just made it (adding interface ... to bridge docker0 failed: Device does not exist, F50-C, 5.4); with them in place it changes nothing (network and firewall unchanged across that boot, and Docker working, measured).

Containers are kept off the device itself (security review of this change). The first version of the zone had input and forward ACCEPT: any container - often a third party's image - could open the router's own services (dropbear, uhttpd/LuCI, ubus over rpcd, dnsmasq), so a compromised container was a way into the device. Now the zone has input REJECT and forward REJECT (output ACCEPT), and no docker -> lan forwarding. Containers need nothing from the router: on the default bridge Docker gives them the host's upstream resolvers (8.8.8.8 when the host has only 127.0.0.1), on a user network its own resolver at 127.0.0.11 asks from the host's side, through loopback; DHCP is Docker's IPAM. Two containers on one network talk over their bridge, which is switched and never reaches the firewall (Docker 29 did not load br_netfilter, measured on 7.2; 13-mu300-docker.conf keeps bridge filtering off where it is loaded), and Docker's own nftables chains drop what goes from one Docker network to another whatever fw4 says (measured on Ubuntu, whose forward policy is accept: a container on another network timed out against the compose service, one on its network got the page) - forward REJECT adds the same refusal in fw4. Measured with fw4's own ruleset (fw4 print of the image's config, loaded with nft in a network namespace setup like the device's: br-lan, docker0, a compose bridge, sipa_eth0): from a container the router's ports 22, 80 and 53 on its Docker and LAN addresses were refused, as were a container of another Docker network and a LAN client; a LAN client reached a container's port and the router's SSH. This review came before any release had the zone, so no device has the old one (and the marker would keep a changed one as it is). Ubuntu: Docker's nftables backend opens nothing of the host (no iptables rules, no FORWARD policy) and docker run -p publishes on every address, but what comes from the cellular side for a published port is DNATed and then dropped in mu300_filter's forward chain (iifname "sipa_eth*" counter drop after established), and from a Wi-Fi uplink by wifi-client's table in the same way; docker-proxy's own listeners (IPv6, hairpin) are behind the input chain's drop for those interfaces. firewall.nft now drops what comes from docker0 and the br-* bridges other than br-lan to the device itself (after established): measured on F50-B, a container got no answer from the device's SSH on 172.17.0.1 and on its LAN address 192.168.79.1 (drop counters rising), resolved names, and a LAN client still had SSH and the published port. On Ubuntu a container can open connections to LAN clients, as on any Docker host (the forward policy is accept).

The feed's kmods for Docker add /etc/modules.d entries (br_netfilter, the legacy iptables tables, btrfs, raid6) that ubox would load at every boot of a mainline kernel that has them as modules; the image build removes the ones Docker's packages add, and /etc/sysctl.d/13-mu300-docker.conf turns bridge firewalling off again after the package's 12-br-netfilter-ip.conf turned it on (with br_netfilter loaded, every frame between hotspot and USB clients would go through fw4; that happens after an apk add on the device).

Kernels (moby's check-config.sh). Every "generally necessary" option is there in the three kernels (namespaces, cgroups v2 with cpu, cpuset, io, memory and pids, veth, bridge, overlayfs, nf_tables with NAT, masquerade, fib and ct, seccomp, keys). What is missing matters for the iptables backend, which the images do not use, or is optional:

  • 5.4 (kernel/linux.config): NETFILTER_XT_MATCH_ADDRTYPE (Docker's iptables rules need it: dockerd with the iptables backend cannot start on 5.4), BRIDGE_NETFILTER, IP6_NF_NAT, IP6_NF_TARGET_MASQUERADE, NETFILTER_XT_MATCH_IPVS; optional CGROUP_HUGETLB, NET_CLS_CGROUP, CFS_BANDWIDTH (docker run --cpus), IP_VS* (swarm), IP_SCTP. Not changed here.
  • 6.18 and 7.2 (the v2026.10.16.1 builds of upstream/mu300-mainline.config): the legacy iptables tables (IP_NF_FILTER, IP_NF_NAT, IP_NF_MANGLE, IP_NF_RAW, IP_NF_TARGET_MASQUERADE, IP_NF_TARGET_REDIRECT and the IPv6 ones; the images' iptables is iptables-nft, which does not use them) and NETFILTER_XT_NAT (iptables-nft's DNAT and SNAT: docker run -p with the iptables backend); optional CGROUP_PERF, IP_SCTP, CRYPTO_GHASH (encrypted overlay networks, 7.2).
  • None of them: AppArmor or SELinux (Docker runs without a profile).

Found on the way: every OpenWrt device had the same TLS key. The uhttpd package makes its key pair when apk installs it in the image build, and the published images carried /etc/uhttpd.key (v2026.10.16.1's plain OpenWrt: sha256 ad78a3f7..., the same on F50-C as in the release tarball): LuCI over HTTPS used one private key on every device, and anyone who downloads the release has it. The image build removes the pair now (uhttpd makes its own at the first start, as it does whenever the pair is missing: F50-C got one), and the audit of make-release.sh refuses an image with etc/uhttpd.key. An update to such an image takes the old key away with the old image (the image's file, not the user's); a key the device made itself is the user's and is kept (the way back to v2026.10.16.1 kept F50-C's). (Main has the same fix as its own section, 132.)

Again after the delta updates, 2026-10-17 (test builds of this branch with the other open PRs; F50-B Ubuntu 24.04 7.2.11, F50-C plain OpenWrt 6.18.57 in its 804 MiB region):

  • Ubuntu: Docker 29.1.3, ubuntu in the docker group, docker.service inactive until the first command (socket), data-root /mnt/mu300-disk/docker/ubuntu (kept through the next update), an image loaded offline, a container on docker0 and one on a user network: neither reaches the device's SSH (172.17.0.1, 192.168.79.1); compose publishes a port that the Mac reached over the LAN.
  • OpenWrt, ready (the default): /etc/docker/daemon.json, /etc/config/dockerd and the docker zone (input and forward REJECT) are in place; apk add dockerd docker docker-compose (+234 MiB) started with data-root /mnt/mu300-disk/docker/openwrt, overlay2, 29.6.1; a container reached the internet over mobile data and neither the router's SSH nor its web server; compose published a port the Mac fetched over USB. apk del took it out again (its modules.d entries too), and with it the package removed the zone and the docker interface (its ucidel) but left the two forwardings: a later apk add makes the package's own zone, not this one (the uci-defaults script ran once at the first boot). Noted, not changed.
  • Docker in the OpenWrt image, now that updates write only what changed? Measured, and still no: a MU300_DOCKER=1 image (90 MB tarball) as an update of F50-C's OpenWrt (392 MiB installed, 345 MiB free with the download staged elsewhere) needs 422 MB with the rollback copy and 390 MB with --no-rollback, as mu300-update counts it - it refuses before changing anything. The images keep Docker ready, not installed.

133. The CPU voltage offset (EXPERIMENTAL): one value per boot, from the initramfs, taken back after a crash

Status: built, not yet device-tested. Both mainline kernels (6.18.57 and 7.2.11, the trees of PR #256) build with it, and the unit tests pass (tests/test_cpu_voltage.py); no board has run it yet (the test plan is in the PR). It can permanently damage a device: every front end says so in English, Turkish and Chinese and wants the word EXPERIMENTAL typed before it saves anything but zero. Based on kano's work (github.com/kanoqwq/mu300-linux, clean-tf-7.2 @ 3386928: the firmware analysis, the flag encoding and the read-only cpufreq attributes), deferred in the review of his fork (docs/superpowers/reviews/2026-10-11-kano-clean-tf-7.2.md) and taken now on the owner's decision, with the in-kernel limits and the boot guard that review asked for.

How the firmware takes an offset (kano's analysis). Linux never sets a CPU voltage on this SoC: the SML/ATF firmware runs DVFS, and the kernel asks through SIP calls. The one call that takes an offset is DVFS_INIT (0x8200060b), once per boot: byte 0 of its flag word is the vendor's androidboot.dvfs_set, bytes 1-3 are domains 0-2 (CPUs 0-3, 4-6, 7), bit 7 the sign (lower) and bits 0-6 whole millivolts. The firmware moves the CPU and the SRAM voltage tables by ceil(mV * 1000 / 3125) steps of its 3.125 mV selector. kano verified +3125 uV and back to 0 on one F50 (all 31 OPPs up exactly 3125 uV, vddcpu1/vddcpu2 read 753125 uV); nothing negative was ever run.

Why DVFS waits for the initramfs, and why the driver stays built in. The offset can only be given to DVFS_INIT, and a second DVFS_INIT is not an option: whether the firmware then adds the offset again (tables moved in place) is not known, and finding out on a device means risking exactly the damage this guards against. So the value has to be known before DVFS starts, and the user's setting lives on the Linux disk, which only the initramfs can read (the command line is built into the kernel: CMDLINE_FORCE). kano made the driver =m and loaded it from a userspace script (S08 on OpenWrt), which delays every boot's DVFS until then and needs EXPORT_SYMBOL_GPL(topology_set_freq_scale) patched into mainline. Ours keeps CONFIG_ARM_SPRD_CPUFREQ_V2=y and no mainline patch: the driver probes as before (cluster setup, SIP handles, the DCDC limit) and then holds only DVFS_INIT and the cpufreq registration until /sys/module/sprd_cpufreq_v2_driver/parameters/voltage_offset_uv is written. boot/init writes it right after the Linux disk is mounted (and after the boot-tries backstop): 0,0,0 for the stock call, which is every boot without the setting. Nothing written within 45 s (SPRD_VOLT_WAIT_S; longer than init's longest card wait, 8 + 30 s), and the driver starts DVFS at the stock voltages by itself; the rescue path (no Linux disk) writes 0,0,0 at once.

  • The gap. DVFS (and with it the cpufreq cooling devices) now starts at the root mount rather than at the driver's probe. On mainline the root is mounted at 5.0-5.2 s (§31l, F50 #1, 6.18.55, card) - after the initramfs' vendor modules, its partition lookup and the USB gadget. The driver probes at device_initcall, about a second in, so the CPUs stay at the bootloader's clocks for an estimated 4 s more than before, in every boot, offset or not. The stock Android and our 5.4 kernel already load sprd-cpufreq-v2.ko from the initramfs (module 20 of boot/module-order.txt), so the vendor's own gap is of this kind; nothing that needs cpufreq loads earlier on mainline (upstream/module-order.txt has no cpufreq user; wcn_bsp's frequency QoS and mu300_thermal load after switch_root). Not measured yet: the device test reads the DVFS waits for voltage_offset_uv and register cpufreq driver success timestamps, and compares with a 6.18.57 kernel without this change.
  • Kernel and init travel together. upstream/make-bundle.sh puts boot/init into the kernel's generic ramdisk, and every way a mainline kernel is installed writes that ramdisk with it; an older initramfs with this kernel would only cost the 45 s wait, never an offset.

The limits, in the kernel (sprd-cpufreq-v2-voltage.h, pure functions the tests compile on the host):

  • -25000 to +12500 uV, a whole number of 3125 uV steps (8 down, 4 up; kano allowed -50..+25 mV). 3125 uV is the firmware's selector step and the UMP9620 CPU DCDCs' own (ump9620-regulator.c: 3125 uV, 0..1596875 uV). Undervolt is what is worth having on a router (less heat, less power); 25 mV is about 4 % of the ~650 mV middle of the table and inside what vendors keep as margin, and a smaller range is easier to widen later than to find too wide. The encoding is floor(mV), and the firmware's ceil gives back exactly the steps asked for: the tests check every step of the range and of the 7-bit field.
  • All three or none. The three values are parsed (exactly three decimal integers, at most 6 digits) and checked before anything is encoded, and DVFS_INIT applies the three in one call: a domain is never left half set. A value is refused with -ERANGE, -EINVAL, -EOPNOTSUPP or -EBUSY, and the initramfs then writes 0,0,0.
  • A raise never past the DCDC maximum. A positive value needs the lowest regulator-max-microvolt of the PMIC's DCDC_CPU1 and DCDC_CPU2 nodes in the device tree (voltage_limits's dcdc_max); without one, a raise is refused. With one, every OPP the firmware reports after DVFS_INIT is compared with it, and the first one above it ends the frequency table: the firmware's index is the table's, so only the top can go, and cpufreq never asks for that step. Which DCDC feeds which domain is not known (two rails for three domains), so the lower maximum counts for all. The firmware writes the PMIC itself, so Linux cannot check a voltage before it is set - only make sure no frequency that would need it is ever requested.
  • Only the stock call when in doubt. Zero is the vendor's flag word exactly. A non-zero value is refused when the vendor's androidboot.dvfs_set already uses the upper bytes (meaning unknown), on anything that is not sprd,ums9620, when DVFS is off for debugging (magic 0x5A), and once DVFS runs (-EBUSY: one value per boot).
  • Who can set it. Never the command line: the parameter refuses any write before SYSTEM_RUNNING, which is when the command line is parsed (a built-in driver's parameters can be given there). A write needs CAP_SYS_ADMIN, and the sysfs file is 0644 root. The driver cannot be unbound (suppress_bind_attrs) and refuses a second probe.

The boot guard, in the initramfs (boot/init, cpu-voltage; tested against a fake driver and disk). It never stops a boot: anything unclear is 0,0,0. Files in .mu300 of the Linux disk: cpu-voltage (the request, written by mu300-cpu voltage set), cpu-voltage-trial, cpu-voltage-good, cpu-voltage-armed, cpu-voltage-rejected.

  • A new value runs once, as its trial boot (trial written before it is applied). It is good once that boot has been up 10 minutes (mu300-cpu voltage mark-good: a systemd timer, an OpenWrt procd instance) and runs from then on. A trial boot that ends before its good mark, cleanly or not, gets no second one.
  • Every boot with an offset writes armed and syncs it before the kernel gets the value; only a clean shutdown or reboot removes it (mu300-cpu voltage shutdown: a systemd unit's ExecStop that acts only while the system is stopping - systemctl stop is not a shutdown -, and on OpenWrt the K10 link's shutdown action, never stop). A boot that finds armed - a crash, a panic (panic=5, the lockup panics), a watchdog reset, reboot -f, a power cut - drops the offset: 0,0,0, the request cleared, the reason in rejected for the panels. The power cut is counted too: it cannot be told from a hang, and the price is setting the value again (mu300-cpu voltage keep-good on, off by default, keeps a good value whose boot was up its 10 minutes: FINDINGS 240).
  • A value the initramfs cannot check is never written: not three whole steps in range (the same check as the CLI, kept identical by a test), or a SoC firmware not known: both sml_a and sml_b of the eMMC must have the SHA-256 of the F50 build kano read (ff4782690fd805ff54fe34853ef8ee5c7e51c3259e20077c55373b50a4b259c2). The U30 Air's SML is not on the list until a device test reads it; any other firmware gets only the stock voltages.
  • A value the kernel refuses (a raise without a DCDC maximum) falls back to 0,0,0 in the same boot, and the request is cleared.
  • The boot-tries backstop still applies: N boots that never reach mu300-boot-ok go to Android, and the boot after a crash already runs at the stock voltages.

The front ends. mu300-cpu voltage status|set A,B,C --confirm EXPERIMENTAL|off|stress [MIN] [--background]|warning (root only for anything that writes; opt/mu300/lib/cpu-voltage-warning.txt holds the warning in the three languages); LuCI System > CPU (mu300dash cpu_voltage_get, read ACL, and cpu_voltage_set, write ACL; the shape checked there and again in unisoc-modem/cpu, the limits in mu300-cpu and the kernel); the Ubuntu panel's Power page (Cockpit, administrative access, an argument array); mu300-toolkit Performance > 4. Each shows the warning first, saves nothing but zero without the word, and offers the 10-minute CPU stress test (mu300-toolkit's) for the trial boot. "Back to the stock voltages" needs no word. Nothing changes before the next reboot.

kano's code, reviewed (3386928: the driver hunk, cpu-voltage-platform, mu300-cpu-driver, the plugin's cpu-voltage.uc):

  • Taken: the flag encoding (floor mV, sign bit), the one-shot guard and suppress_bind_attrs, the read-only cpufreq attributes (scaling_voltage_table, scaling_voltage_offset, scaling_voltage_domain; the table read returns -EIO on a failed pair instead of the raw SIP error, and a policy without driver data gives -ENODEV), the SML hash and the armed-marker idea.
  • Changed: =y instead of =m (no topology_set_freq_scale export, no userspace-timed DVFS); the value from the initramfs, with the trial/good/armed rules instead of "armed at load, cleared at shutdown" alone (which never asks whether a value has ever completed a boot); -25..+12.5 mV instead of -50..+25; the vendor's upper flag bytes kept for the stock call (kano cleared them in every boot, which changes the stock call wherever LK sets them) and a non-zero value refused when they are set; a raise only under the DCDC maximum; a 0444 module_param_array became a root-only write-once parameter that the command line cannot set; the SML partitions looked up on the eMMC only, the way init finds misc (kano's took /dev/disk/by-partlabel first, which a card can also provide).
  • Not taken: the S08 module loader, the TF/standalone layout, cpu-voltage.uc's per-cluster presets (-3.125 and -6.25 mV buttons: ours has no presets, every value is typed).

Not known, and what the device test has to show. Whether DVFS_INIT with a negative value behaves as the analysis says (kano never ran one); the voltages the firmware then reports (PAIR_GET) against the regulators' readback; the SRAM rail (moved with the CPU rail, not visible from Linux); the U30 Air's SML; the gap above.

F50-C, 2026-10-16/17: device plan steps 1-8 and 10 (OpenWrt v2026.10.16.1, with this PR's driver and init on 6.18.57). SML: both copies are ff478269..., the known build (the same as F50-B's). dcdc_max is 1596875 uV.

  • Offset 0. The driver reports applied, 0,0,0, stage=cpu-voltage 0,0,0 and DVFS_INIT flag 0x00000000. All three tables match 6.18.56's OPP lines exactly. Thermal zones, cooling maps, the Wi-Fi AP, mobile data and USB all come up. Three reboots gave the same result.
  • The DVFS start delay, measured. register cpufreq driver success comes at 2.03 s on 6.18.56. With this PR it comes at 5.28-5.56 s with 0,0,0 and at 6.38-6.61 s with an offset (DVFS_INIT runs at 4.9-5.3 s). So DVFS starts 3.3-4.6 s later in every boot.
  • What the boot paid for it, and the fix (F50-B, Ubuntu 24.04, 7.2.11, 2026-10-17). The init waited for applied after writing 0,0,0 too. With poll logging in the ramdisk: written at 4.99 s, queued at 5.00 and 5.22, applied only at 6.34 - the registration itself ends at 5.37, and the 200 ms poll after it took a second (forks stall while the new perf domains rebuild the scheduler domains). systemd's kernel phase went from 5.3 s (the released 7.2.11) to 6.7 s, on two boots. Now the stock call is handed over and not waited for (cpuv_stock): only an offset is waited for, so that a DVFS_INIT that fails with it is still taken back in the same boot. After the change: written at 4.98 s, switch_root at 5.03 s, kernel phase 5.19 s (userspace 34.7 s, as before); the registration finishes at 6.35 s while systemd starts. DVFS itself still starts some 3 s later than on the probe, with the CPUs at the bootloader's clocks until then; that is the price of an offset the firmware takes only once.
  • Offsets applied:
    • -3125,0,0 (flag 0x00008300), -3125,-3125,-3125 (0x83838300) and -6250,-6250,0 (0x00868600). In each case, the offset domains' tables are exactly 3125 or 6250 uV lower and the other domains' tables are unchanged. The vddcpu1/vddcpu2 readback follows the live OPP, so it is a spot value (for example 746875 and 743750 uV).
    • Each value passed a 10-minute mu300-cpu voltage stress with no oops. Each got its good mark at 10 minutes, and the next clean reboot applied it again and re-armed it.
    • No instability up to this round's limit (-6250 uV). Nothing beyond it was tried.
    • +3125,0,0 (flag 0x00000300) raised every OPP by 3125 uV, and no OPP was cut.
  • Taken back:
    • A sysrq panic with -6250,-6250,0 good gave unclean-end.
    • A watchdog reset during the +3125,0,0 trial (procd stopped feeding: ubus call system watchdog '{"stop":true}') gave unclean-end. After that reset the board was off USB for about 17 minutes and came up in Android.
    • A clean reboot 33 s into a trial gave no-good-mark.
    • /etc/init.d/mu300-cpu-voltage stop keeps armed, and reboot removes it.
    • off followed by a reboot gives step 1's tables again.
    • No USB power cut was tested: F50-C's Mac port has no port power switching.
  • The CLI on a kernel without the offset. On 6.18.56 the CLI reports unsupported and refuses set. It printed "can't open .../voltage_limits" to stderr; that is fixed in this PR, with a test.
  • Mainline thermal (not the offset, but it decides how the stress test has to be run):
    • Mainline's soc-thmzone does not hold this load. It has passive trips at 70 and 85 C, all three cpufreq maps are bound, and thermal-guard is "watching only".
    • At stock voltages, the toolkit's CPU stress (8 awk loops) took the SoC from 44 to 102.6 C in under 3 minutes. Twice it went on to thermal-guard's 105 C power-off.
    • The first trial of -3125,0,0 ended that way. It was a clean shutdown, so the reason recorded is no-good-mark, not a crash.
    • For the stress runs above, scaling_max_freq was capped one step at 96 C, which kept the SoC under 97 C.
    • The 5.4 kernel held a yes load at 80-91 C.
  • The eMMC after hot shutdowns. After each of those hot shutdowns or reboots, the next boot found no eMMC (root-offset not-found, losetup: /dev/mmcblk0: No such file) and took the 300 s rescue reboot. This happened 5 times in this run.
  • Not run here: the panels (plain OpenWrt has neither LuCI nor Cockpit) and the U30 Air's firmware check.

F50-B, Ubuntu 24.04, 7.2.11, 2026-10-17 (test kernels with this branch and the other open kernel PRs). SML known, dcdc_max 1596875 uV. Offset 0 with the stock call handed over (above): applied, 0,0,0, flag 0x00000000, then mu300-cpu voltage set -3125,0,0 --confirm EXPERIMENTAL (without the word: refused) and a reboot: flag 0x00008300, policy0's table exactly 3125 uV lower (650000 -> 646875 ... 834375 -> 831250), policy4 unchanged, trial and armed on the disk, the good-mark timer armed for 10 minutes; off and a clean reboot: 0,0,0, armed gone. 6.18.57 on the same board: 0,0,0 handed over at 4.90 s, switch_root at 5.01 s. The LuCI CPU page (luci-app-mu300's files copied onto F50-C's plain OpenWrt, release kernel): the section with the warning and "Not available with this kernel".

138. A SIPC tty that is not ready yet: mu300-atd waits for it instead of dying at the first open (#226)

Issue #226 (F50, OpenWrt, 6.18, v2026.10.23): after a cold boot the panel said "AT backend no response", and the log had mu300-atd: line 116: can't create /dev/stty_nr2: No such device (nr1, nr2, nr6, nr7) and then nothing from the daemon. The nodes exist before the channels work: an open gives ENODEV until the modem has started its sbuf (§74 measured the same for the U30 Air's second group, whose owners wait for sbuf_5_006, state: 1,). The init scripts wait only for the node ([ -c ], wait_and_exec), so the daemon opened too early.

  • Why it was gone and not "cannot open". open_tty did exec 3<>"$DEV" || return 1. A failed redirection on exec, a special built-in, ends a non-interactive POSIX shell: dash and busybox ash exit on the spot (busybox ash in alpine:3 and dash on macOS, 2026-10-16: the line after it never ran; bash outside POSIX mode returns). The || return 1 and the "cannot open" line were dead code, and so was the failure branch of the reopen in the loop. procd's respawn 3600 10 0 (no limit) and systemd's Restart=always start it again 10 s later, so on a modem that does come up late the daemon would come back; on #226's unit it never could, because the modem itself never started: the reporter found that the eMMC failed (mmc_select_hs400es failed, error -84, no mmcblk0), so there was no modem image to load. That part is not this daemon's (see the issue).
  • Now. command exec 3<>"$DEV" (through command a redirection error is an ordinary failure), and the first open is tried again every 2 s for up to MU300_AT_OPEN_WAIT seconds (240), with one line when the wait starts (... is not ready (the modem has not started its AT channels)), one when it ends (ready after N s) or gives up (did not become ready in 240 s: the modem has not started, exit 1: the supervisor starts it again, one line per round instead of one every 10 s). The command fifo exists during the wait, so mu300-at queues at the daemon and never takes its direct path to the tty (a second reader on the channel once it works). A reopen in the loop that fails ends the daemon as it always did in effect (the client gets an empty answer first), and its fresh start waits for the channel.
  • Not changed. No wait on /dev/sipc_sbuf for slot 0: 5.4's seqfile is not known to read the same line (§74), and a wait that never ends is a boot without WAN. Whether a failed open does anything to the channel is not measured; the releases before this one opened every 10 s under procd and the modem answered once it was up (#170).

Tests: tests/test_device_scripts.py Atd: a tty that cannot be opened (a link to /dev/tty in a process without a controlling terminal) is waited for, then turned into a pty: the daemon takes it and answers; one that never opens ends the wait after MU300_AT_OPEN_WAIT with exit 1 and leaves no fifo or owner; under dash and bash here, busybox ash in CI. The waiting test fails on the daemon before this change (it is gone after the first open).

13d. Memory shared with the modem must not be mapped write-back (mainline)

The modem and the AP share regions that are reserved inside System RAM (no no-map in the device tree), and the modem does not snoop the AP's caches. The vendor 5.4 driver maps them with vm_map_ram(pages, count, -1, pgprot_noncached(PAGE_KERNEL)). Newer kernels removed the prot argument from vm_map_ram(), and a port that reaches for memremap(..., MEMREMAP_WC | MEMREMAP_WB) instead gets write-back, because write-combine is never available for a linear-mapped region.

The modem then starts, asks for its NV data and never finishes: the NV server reads one good packet and logs fail SIZE on the next, writes three chunks, stalls, and modem_control gives up with wait modem alive timeout (g_modem_state = 8). ioremap_wc() cannot fix it either - the kernel refuses ioremap for System RAM addresses (WARNING at arch/arm64/mm/ioremap.c:27) and the code silently falls back to the cached mapping.

vmap(pages, count, VM_MAP, prot) still takes a pgprot, so building the page array and mapping non-cached, the way the vendor driver did, brings the modem up: fail SIZE goes to 0 and "Modem Alive" arrives.

Wi-Fi (SC2355 / Marlin3)

14. Bring-up

  • Modules: pcie-sprd-misc, pcie-sprd, wcn_bsp, sprd_wlan_combo.

  • Firmware and board config come from Android's /odm/firmware: wcnmodem.bin, gnssmodem.bin, wifi_board_config.ini, wifi_board_config_ab.ini. Place them in /usr/lib/firmware.

  • The realme wlan_combo driver falls back to wifi_board_config_hulk.ini for unknown projects; the firmware then asserts with CMD_DOWNLOAD_INI / LOAD_INI_DATA_FAILED and the chip stays in "card dump" state, so wlan0 cannot be brought up (RTNETLINK answers: No such device). kernel/patches/wlan_combo-default-board-config.patch fixes it.

  • rmmod wcn_bsp crashes the kernel; reboot instead of reloading the Wi-Fi stack.

  • The driver logs API version not match for a few command IDs (the realme driver is slightly older than the ZTE firmware) and a WARNING in sc2355_free_cmd_buf (spin_unlock_bh in IRQ context).

    Update 2026-10-07: the warning was a real lock bug and is fixed on both kernels (kernel/patches/wlan_combo-tx-complock-irqsave.patch, §31g).

  • Verified after the fix: the driver parses wifi_board_config.ini, wlan0 comes up, iw dev wlan0 scan lists nearby networks and hostapd (nl80211, WPA2) reaches AP-ENABLED. The MAC address is randomized on each load.

    Update 2026-10-07: not any more. The 5.4 driver reads LK's androidboot.wifimac, as the mainline port does (kernel/patches/wlan_combo-bootargs-mac.patch, §34).

  • A crash right after installing a module can leave a 0-byte .ko on ext4; run sync after installing files.

Mobile data without Android RIL

14b. Wi-Fi station mode: decided at boot, and one way only

The SC2355 can be an access point or a client of somebody else's network, but the switch only goes one way:

  • The driver creates wlan0 in station mode. hostapd turns it into an access point, and after that nothing turns it back. iw dev wlan0 set type managed is refused with Invalid argument even with the interface down and out of the bridge, although iw phy phy0 info lists managed among the supported modes.

  • Deleting and recreating the interface breaks the radio until the next reboot: the driver powers the WCN chip down and up through an SDIO path (WCN BASEstart_marlin SDIO card dump), which is not how Marlin3 is attached on this board, and the result is sprd-wlan: failed to power on WCN! on every later open. A second interface does not help either - with the first one still present the firmware answers scans with sc2355_scan_timeout.

    Update 2026-10-07: this was measured on 5.4, recreating a station after the AP. It is not a general rule. Under 6.18, OpenWrt's netifd deletes the driver's station wlan0 and adds an AP interface on every boot (iface 'wlan0' deleted, then type 3 added, §31n), and the AP comes up. What went wrong in §31n was a race with the probe's power-off, not the recreation itself.

So the mode belongs to the boot: mu300-wifi-client.service runs before mu300-hotspot.service, joins the saved network while wlan0 is still a station, and holds /run/mu300-wifi-client.active, which the hotspot unit refuses to start on (ConditionPathExists=!). Going back to the hotspot needs no reboot, because that is the direction hostapd can do by itself.

WPA3/SAE does not work: wpa_supplicant negotiates SAE correctly but every association is rejected with status_code=1, so Wi-Fi 7 / WPA3-only networks (a "MLO" SSID, for instance) cannot be joined. The driver says so itself: iw phy lists connect but no authenticate command (the SME is in the firmware), and wpa_supplicant 2.10 (built with SAE: get_capability auth_alg has it) leaves SAE out of wpa_cli get_capability key_mgmt. wifi-client asks that, and refuses a network whose every access point is SAE-only as soon as the supplicant's scan shows it. WPA2 works; measured on the device: 18 networks scanned, joined, DHCP address, and the Wi-Fi default route (metric 50) taking precedence over mobile data (metric 100).

14c. The Wi-Fi driver can panic the kernel while it is still starting (mainline)

Two boots in a row died at about 29 s with Unable to handle kernel paging request at 00000000000030b0, pc : sc2355_pcie_tx_cmd_pop_list+0x2c [sprd_wlan_combo], reached from dw_handle_msi_irq - "Fatal exception in interrupt", so the kernel stops and LK falls back to Android on the next boot. The captured trace is in /sys/fs/pstore/dmesg-ramoops-*, which Android can read after the failed boot.

The chip reports finished commands with an MSI, and the bus callbacks are registered around tx_init() and tx_deinit() - which allocates hif->tx_mgmt and sets it back to NULL. An interrupt inside that window walks &tx_mgmt->tx_list_cmd.cmd_to_free, which is offset 0x30b0 from NULL. Both PCIe pop callbacks now return the buffers to the bus and leave when there is no tx context yet.

15. Radio, registration and the data bearer

  • AT channels: /dev/stty_nr0 carries unsolicited results (URCs); /dev/stty_nr1 is a clean command channel.
  • After modem_control boots the modem the radio is off (+CFUN: 0). Android's RIL (libimpl-ril.so) uses the Unisoc commands AT+SFUN=2 (SIM on) and AT+SFUN=4 (protocol stack on); afterwards +CFUN: 1 and the modem registers (+CEREG: 2,1,...,13 = E-UTRA-NR dual connectivity, i.e. 5G NSA).
  • The network activates the default EPS bearer (CID 1, IPv4v6) by itself. AT+CGCONTRDP=1 returns the address as a.b.c.d.m.m.m.m plus DNS servers. AT+CGDATA="M-ETHER",1 answers CONNECT and binds the bearer to sipa_eth0 (sipa_eth<cid-1>, raw IP, NOARP). Assign the address as /32 and route default dev sipa_eth0.
  • Measured on a Turkcell 5G NSA SIM: about 9.3 MB/s download and 1.3 MB/s upload. rootfs/.../mobile-data implements up/down/status/sim-reset and NAT (nftables masquerade + MSS clamping) so USB/Wi-Fi clients can share the link.
  • AT responses can arrive after a short read timeout and then show up as answers to the next command. Drain the channel before sending and read until the final result code (OK, ERROR, +CME ERROR, CONNECT).
  • Hot-swapping the SIM leaves it busy (+CME ERROR: 14) and registration stays at emergency-only (+CEREG: 2,8); reboot after changing the SIM.
  • A SIM without an active data plan still registers and gets an address; TCP handshakes may even succeed, but no data flows. Check the plan before debugging the data path.

16. Rootfs details found while testing data

  • docker export leaves an empty /etc/resolv.conf: resolvectl query works but glibc programs cannot resolve names. Link it to ../run/systemd/resolve/stub-resolv.conf.
  • busybox/toybox tar drop xattrs, so ping loses cap_net_raw; mu300-fixups.service restores it.
  • Android's uid system (1000) is also Ubuntu's first user, so modem device nodes showed up as owned by ubuntu - writable by it, the modem's calibration among them. Fixed in 41: they are the vendor account's (mu300vnd) now.

26b. The tunnel needs sing-box's gvisor stack on this kernel

2026-10-09: the VPN moved to its own repository. mu300-vpn, its drivers and engines are the module of dikeckaan/mu300-linux-vpn now, installed as the vpn extra (mu300-extra install vpn); the images carry none of it. These findings (26b, 26e, 26f) stay here as they were written, and are continued in that repository's docs; paths like /opt/mu300/lib/vpn are the module's, linked into each system by its hooks/link.

Everything through the VPN failed while the VPN itself looked healthy: it connected to its server, resolved names through the tunnel, and sbtun counted the packets going in. Applications got Connection refused from nc and Failed to send request: Operation not permitted from uclient-fetch, and sing-box logged one line per connection - router: pre-match[0] => sniff - and nothing after it. No outbound was ever selected.

The cause is the tun inbound's default system stack, which this 5.4 vendor kernel cannot support. It says so at startup, in a warning that is easy to read as cosmetic:

inbound/tun[tun-in]: enable offload: set udp offload: TUNSETOFFLOAD: invalid argument

"stack": "gvisor" carries its own TCP/IP and does not ask the kernel for any of it. With that one field, apk update goes from "8 unavailable, 145 distinct packages" to "OK: 11168 distinct packages available", with the kill switch active the whole time.

Worth remembering while chasing something like this: DNS kept working throughout, because it is hijacked and answered inside sing-box rather than carried as a TCP connection. A tunnel that resolves names but carries no traffic points at the stack, not at routing or the firewall - both of which were searched first, and neither of which had a rule with a non-zero counter.

26c. SMS needs PDU mode, and Turkish needs more than that

Text mode (AT+CMGF=1) looks like the easy way and is unusable here. Whenever the sender is a name rather than a number - which is most of what a SIM in a router receives - this modem returns the address mangled:

+CMGL: 1,"REC READ","144414+4140224P444",,"26/09/17,17:18:47+12"

The PDU for the same message says type-of-address 0xD0, alphanumeric, and the packed septets spell ADANA BLD. Changing AT+CSCS does not help: IRA, GSM and HEX all return the same broken string, HEX simply in hex. Text mode also cannot tell you that three stored messages are one long message.

So sms works in PDU mode and decodes the frames itself, in awk, because busybox awk is the only interpreter on the device - no python, no lua, no perl. It does have and(), or(), lshift() and rshift(), and printf "%c" writes a raw byte for anything under 256, which is enough to emit UTF-8 a byte at a time.

Turkish arrives as ordinary GSM 7-bit with a header saying to read it against a different table. The user data header carries information element 0x25 (national language locking shift) with value 0x01, and without honouring it the text comes out the right shape with the wrong letters - hastası as hastasì, bağışta as baøìæta, Aladağ as Aladaø. Eight positions move (0x04 0x07 0x0B 0x0C 0x1C 0x1D 0x40 0x60), and they are exactly the Turkish ones. The header has to be walked element by element for this: the concatenation element is not always first, and the language element never is.

Sending picks the encoding from the text - GSM 7-bit while every character fits it, UCS-2 otherwise, which is what makes ığşçöü ÇĞİÖŞÜ survive. Verified by sending to the SIM's own number and reading it back intact.

26e. The Xray engine, and a connectivity test that could only say no

(Now the VPN module of dikeckaan/mu300-linux-vpn: see 26b.)

Update 2026-10-07: since PR #31 the engines (Xray-core, hev-socks5-tunnel, sing-box) are not in the Ubuntu or OpenWrt images. They are an optional release asset, mu300-extra-vpn.tar.gz, installed with mu300-extra install vpn or by the installer's question. mu300-vpn looks in extra/vpn/bin first. Since PR #49, Tailscale's own traffic also goes through the tunnel (TAILSCALE=0 opts out). The engine choice below still holds (mu300-vpn, ENGINE default). mu300-vpn now defaults to ENGINE=xray: Xray-core does VLESS, hev-socks5-tunnel owns a plain kernel TUN (xtun) and hands each flow to Xray's SOCKS port on loopback. Neither installs routes, so the script does, with sing-box's rule prefs and table (9000-9010, table 2022): Xray's own sockets carry mark 0x2d0 and go to main, as do the LAN and the server's address; everything else goes to xtun. The device's own DNS - dnsmasq's upstream, which is the carrier resolver and does not answer from the far end of a tunnel - is DNAT'd to REMOTE_DNS. Every exit path removes all of it, because routing left behind by a dead engine is what made sing-box's crashes look like a dead modem.

The kill switch does not carry over, even though Xray's sockets carry the same mark: before the tunnel exists the server's name is resolved through dnsmasq and its certificate fetched with openssl, both unmarked, and the kill switch drops both - the engine never comes up and the device is left with nothing. sing-box does its bootstrap lookup on its own marked socket, which is why it never had this problem. So an unset ENGINE picks sing-box when KILL_SWITCH=1 (what an updated device with an old vpn.conf has), and ENGINE=xray with the kill switch on runs without it and says so.

Measured on OpenWrt: the device's exit IP is the server's, apk add works through the tunnel, and a Wi-Fi client's flows are forwarded into xtun. The Ubuntu side uses the same script but has not been run on the device.

allowInsecure is gone in Xray 26. Its replacement, pinnedPeerCertSha256, accepts exactly one leaf certificate. For a link that asks for allowInsecure the script manages the pin: fetched once with openssl when there is none and stored as TLS_PIN_SHA256 in vpn.conf, left alone on later starts, and fetched again only when Xray reports peer cert is unrecognized (against pinnedPeerCertSha256) - a renewal - after which the service restarts itself. Xray reports that failure at info level, which a warning log level hides completely; the script runs Xray at info with the access log off and passes only warnings and worse to the system log. xray tls ping is no substitute for openssl here: it tries without SNI first, and a server that ignores that attempt keeps it waiting past any sensible timeout. (The server this was tested against presents a Let's Encrypt certificate that expired in December 2025 - which is why its link asks for allowInsecure. The pin skips the expiry check.)

busybox nc on this OpenWrt has no -w. nc -w 6 HOST PORT prints the usage text and exits 1, so a reachability test built on its exit status reports every destination as closed. That produced a confident and wrong "this SIM reaches nothing but the carrier's DNS" - the same bearer carried the VPN minutes later. Test TCP with wget -T or curl -m, check the tool's own exit status rather than a pipe's, and run the test once against something that must succeed before believing a failure. To test the bearer while a tunnel runs, route a single address around it: ip rule add pref 8999 to <addr> lookup main, test, delete the rule.

26f. One VPN command for every protocol: profiles and engine drivers

(Now the VPN module of dikeckaan/mu300-linux-vpn: see 26b.)

mu300-vpn spoke one protocol: a VLESS link in vpn.conf. People have WireGuard configs, OpenVPN files, Clash/mihomo subscriptions and raw Xray/sing-box JSON from their panels, so it now keeps named profiles under /etc/mu300/vpn (profile import|add|edit|use|remove|export|show|list, settings, engines, check) and runs the active one through a driver per engine (/opt/mu300/lib/vpn/<type>.sh: drv_check, drv_gen, drv_start, drv_alive, drv_stop, drv_import...). The core owns what the drivers must not differ in: the kill switch, the routing (rules 9000-9010, table 2022), the DNS nat and the Tailscale rules. The decisions:

  • ENABLE stays in vpn.conf. Everything else moved, but the switch has too many readers to move with it: mu300-update and android-install.sh (a VPN in use keeps its engines across an update), wifi-client (the kill switch is fatal only when the VPN is on), mu300-extra (refuses to remove the vpn extra while ENABLE=1), the dashboard, and every older image, which must find a working VLESS VPN after a downgrade. So on/off write that one line and vpn.conf keeps its legacy keys; wifi-client and the dashboard read KILL_SWITCH and the engine from the store first and fall back to vpn.conf.
  • Migration by snapshot diff. At every start (any command, as root) the legacy keys of vpn.conf are compared with legacy.snapshot, the keys as last migrated; only a key whose value changed since is applied (a setting set, or profile legacy updated). The first run moves everything, a later run does nothing, and a later edit of vpn.conf - the old README's way, or an older image's save_pin after a downgrade and upgrade - wins for the keys it touched while settings made with the new commands are kept otherwise. A plain "vpn.conf wins" would undo every settings set; "the store wins" would ignore the edit the old instructions tell people to make.
  • Marks per engine. The kill switch lets only traffic marked 0x2d0 (720) out on an uplink, and rule 9000 keeps marked traffic off the tunnel, so each driver marks its engine's own sockets: Xray's sockopt.mark on every outbound (and on every dialer nested inside one - xhttp's downloadSettings, a dialerProxy), sing-box's route.default_mark, mihomo's routing-mark, WireGuard's wg set fwmark, OpenVPN's --mark. No engine needs an exception in the kill switch, which is unchanged.
  • The resolve window. A server name (WireGuard's Endpoint, OpenVPN's remote, a link's host, the vnext servers of raw JSON) has to be resolved before the tunnel exists, and with the kill switch up the device's own DNS is dropped too (26e's reason Xray needed the sing-box substitute). The core opens the download window's ruleset with only the DNS sets filled, resolves, and puts the full kill switch back - one nft transaction each way, never a gap. VLESS on Xray behind the kill switch still runs on sing-box, as before, so the existing tests hold.
  • Raw configs are parsed once, strictly, and rebuilt from an allowlist. A panel's JSON runs as root and could open a listener on the LAN, expose an API, bind another interface or write a file. It is read by jq once (json_strict: one object, no duplicate keys, no two keys equal under Go's case folding, since the engines' decoders match field names without regard to case and jq keeps the last duplicate silently) and the engine gets a new document built from what the allowlist accepts, with the inbound, the log, the mark and the bootstrap DNS written last so they always win. An allowlist, not a denylist, because each engine release adds features (some of which listen) faster than a denylist would follow. No jq regex (OpenWrt's jq may lack it) and jq's own errors are never shown (they quote the file); refusals name a key from our own lists, never a value. What a config may do - pick outbounds, route between them, name its DNS - is also its exposure: a direct/freedom outbound goes past the kill switch with the engine's mark, by the config's own choice.
  • OpenVPN never reads the user's file. The .ovpn is tokenized with openvpn's own lexical rules (what the two could read differently is refused: a backslash, a quote inside a word, a </ prefix inside a key block), held to an allowlist of directives and key blocks, and openvpn runs only $RUN/openvpn.conf, which we write, with our options after it: --route-noexec and pull-filters for redirect-gateway, route, setenv, block-outside-dns, and only our own --up script. Not --route-nopull: it would also drop the pushed dhcp-option DNS, which is the one thing from the server the up script wants.
  • sing-box keeps auto_route. Its own routing does exactly what the core does (same prefs, same table), so the driver says DRV_ROUTES=self and the core only adds the Tailscale rules and the DNS nat, as before.
  • jq is in the images (Ubuntu, OpenWrt, Arch): the raw-JSON drivers need it, and wireguard-tools goes into Ubuntu and Arch (OpenWrt has it). Nothing else grows; mihomo is the new vpn-mihomo extra.

Measured on the U30 Air (OpenWrt, mainline), stated as what was seen and no more: the migration of the device's working legacy VLESS vpn.conf produced profile legacy with the same exit IP, without the link ever being read or printed. Import from stdin, check, and switching legacy -> a WireGuard profile -> legacy worked, with the routes and rules of the previous profile cleaned up each time and the tunnel up. Then the carrier: on the U30 Air's SIM, UDP to the WireGuard port never reaches the server - tcpdump on sipa_eth0 shows the marked packets leaving the device, and the same UDP sent from a Mac on another network arrives at the server - and OpenVPN over TCP connects but the TLS handshake times out, while the same .ovpn completes from the home network. The carrier drops that UDP and DPI-blocks OpenVPN's TLS; the VLESS profile goes through. The WireGuard and OpenVPN drivers were verified on the device up to that point, no further.

Default boot

17. Linux as default without losing the Android fallback

  • LK decrements tries_remaining before booting a slot and rolls back when it finds tries == 1 && !successful. The one-shot trial arms slot b with tries = 2.
  • Default-Linux mode never sets successful_boot. Instead:
    1. init skips the slot-a restore when /etc/mu300/default-boot in the rootfs says linux (slot b is left at tries = 1);
    2. mu300-boot-ok.service runs 30 s after multi-user.target and writes the tries = 2 block again.
  • A boot that never reaches mu300-boot-ok therefore leaves tries = 1, and the next boot rolls back to Android.
  • Verified: mu300-next-boot linux + reboot returned to Linux and re-armed slot b; mu300-next-boot android + reboot booted slot a.

Update 2026-10-07: the list above is the first version, and the rest of this section replaces three things in it. Slot b is re-armed with tries = N + 1, not 2. mu300-boot-ok waits for the USB network and SSH, not for multi-user.target (mu300-boot-ok.service, still 30 s). Since PR #39, an arm from Android after LK's own fallback restarts init's count (stage=boot-tries-restart, the boot-tries block in boot/init). Before that, in exactly that case, init counted N + 1 and sent the first boot after su -c mu300-linux back to Android.

One interrupted boot was enough to lose Linux. Re-arming with tries = 2 gives Linux exactly one boot that may fail. mu300-boot-ok runs about a minute after power-on, so pulling the plug once during that minute - or a power cut, or a crash - sent the next boot to Android. The initramfs has its own counter meant to allow five such boots, but LK always got there first, so it never mattered. (uboot_log shows it plainly: bootable slot 1 ... tries_remaining: 1, successful_boot: 0, check rollback slot 1 tries: 1, Booting slot_a.)

Now the user picks N, 1-6, at install (default 5; stored in .mu300/boot-attempts on the Linux disk, changed later with mu300-next-boot attempts N), and slot b is re-armed with tries = N + 1. LK decrements on every boot and rolls back at 1, so N boots in a row that never reach boot-ok are allowed and the next one is Android. The field is three bits, hence the upper limit. The initramfs counter now reads the same N and fires on the same boot, as a backstop.

Update 2026-10-09: locked Linux. mu300-next-boot lock arms the Linux slot successful = 1 (byte 0xEF for slot b: prio 15, tries 6, successful). LK never counts a successful slot down, so it never rolls back; the initramfs skips its backstop when it sees the bit in misc and .mu300/boot-lock on the disk (the bit alone, set by anything else, keeps the backstop), and its standalone fallback (no system to start) stays on telnet with /run/to-android instead of restoring Android's slot. mu300-update arms the usual attempts (--trial, 0x6F) before it writes a boot image or rolls one back, and mu300-boot-ok locks again after the first good boot. Verified on the U30 Air (7.2.9): lock -> ef; a new boot image -> 6f; its first boot -> ef again; a boot with .mu300/boot-tries at 9 stayed in Linux with stage=boot-locked (no backstop).

  • The block is rebuilt at run time from the initramfs' tries = 2 block, because mu300-update does not replace the boot image and an older one carries only that block. Byte 14 is slot b's prio | tries << 4 | successful << 7; the CRC-32 over the first 28 bytes comes from gzip, whose stream trailer is the same CRC-32. Before writing anything the script rebuilds tries = 2 and requires it to match the initramfs' block byte for byte, and falls back to that block otherwise.
  • An older boot image still has the initramfs counter fixed at five, which sends a device to Android after four failed boots whatever N says.
  • Measured with N = 5 on OpenWrt, with boot-ok suppressed for two boots: LK booted slot b from tries = 6, then from 5, then from 4 - two unconfirmed boots in a row stayed in Linux - and the next good boot re-armed 6. Not run to exhaustion; the rollback at tries = 1 is the LK behaviour above.

Update 2026-10-12: "Reboot to start the updated openwrt-luci" when a reboot starts Android. A U30 Air with Linux on slot a (Android on b) was updated v2026.10.17 -> v2026.10.20 from a Linux boot, and the reboot went to Android. The image was fine: /etc/mu300/default-boot said android (the device had been switched to Android by hand earlier), so that boot was itself a one-shot trial armed from Android, and the init log of it says exactly that - stage=misc-restored (init writing Android's slot block back, §1) and no stage=default-boot-linux, with .mu300/boot-tries at 0 (no backstop ever fired; the updated kernel had come up in 4.9 s). mu300-update's --trial is a quiet no-op in that state (mu300-next-boot answers "default boot is not linux, nothing to do" and exits 0), and its last line still promised a reboot. Now mu300-next-boot --trial exits 3 when there is nothing to arm and 1 when it can only write the initramfs' one-shot block (one boot, not N, §32); mu300-update says both, and what it prints last after a boot image, a system or a kernel changed is how to start Linux by hand (mu300-linux) instead of a reboot that goes the other way.

Boot-ok used to wait for every service. It was ordered After=multi-user.target, so one service that never finished - mobile-data stuck on a busy AT channel in an older Ubuntu image - kept the boot unconfirmed however usable it was, and the next reboot counted it as failed. It now follows only the USB network and SSH: a boot you can log in to is a good one. Measured on Ubuntu: SSH at 47 s, boot-ok at 79 s, independent of the rest.

mu300-os also carries default-boot to the system it switches to. The initramfs reads it from the system it boots, so switching from one where Linux is the default to one where it was never set made the first reboot there go to Android.

Parity with Android

18. Services and drivers Android runs that the minimal port lacked

  • cp_diskserver persists modem NV (nr_fixnv*, nr_runtimenv*); on first start it immediately wrote pending "dirty" NV data, so without it modem NV changes are lost. refnotify handles modem reference-clock requests. Both run from the same chroot; srtd needs Android's binder radio HAL and is skipped.
  • Drivers that load cleanly after the modem is up: sprd_soc_thm, thermal-generic-adc, sprd_cpu_cooling (binds cpufreq and CPU hotplug cooling to soc-thmzone with trips at 70/85/110 °C), leds-sc27xx-bltc (RGB status LED), zte_card_holder_det, sc27xx-vibra, sprd_cp_dvfs, sprd_ddr_dvfs. zte_sar loads but the aw9610x SAR sensor is not populated on this board (-201).
  • Android disables audio entirely (no sound cards).
  • Android's hotspot (WifiConfigStoreSoftAp.xml) lives on the metadata-encrypted /data, so Linux cannot read it; it has to be copied while Android runs. No factory default Wi-Fi credential is stored in a readable partition.
  • RAM: Android uses about 960 MiB of the 1.4 GiB; Ubuntu with all services about 480 MiB, of which ~100 MiB is unreclaimable vendor-driver slab. journald is capped (RuntimeMaxUse=16M).

19. systemd ordering pitfall

  • A unit Before=ssh.socket that keeps default dependencies is ordered after basic.target, while ssh.socket is before sockets.target (before basic.target). systemd silently drops ssh.socket from the boot transaction and SSH never starts. Units that must run before sockets need DefaultDependencies=no.

20. Diagnosing early power cuts

  • The initramfs log loop ends at switch_root and journald flushes only after local filesystems are up, so a power cut in the first seconds of systemd leaves no log. mu300-early-recorder.service keeps writing dmesg to the boot_b log area for the first five minutes.

    Update 2026-10-07: it now writes every 2 s for the first 90 s, then every 10 s (§31d). It runs up to 300 s on Ubuntu (mu300-early-recorder.service) and up to 420 s from OpenWrt's preinit (openwrt/overlay/lib/preinit/05_mu300_early_recorder). It writes only what it has collected, not the full 8 MiB.

20b. Telling a userspace reboot from a power cut, and finding who asked for it

/sys/fs/pstore/console-ramoops-0 survives into the next boot and separates the two cases in one line. A power cut or a watchdog leaves the log ending mid-sentence; a deliberate reboot ends with the kernel's own

[   46.468782]c0 [    T1] reboot: Restarting system with command 'shell'

[T1] is the task that made the call, and on OpenWrt that is procd: busybox reboot does not call the syscall itself, it hands the request to init, so every userspace reboot on this image shows up as pid 1 no matter who started it. The pstore line therefore says "userspace asked", never who. Three things together do say who, and all three write to /mnt/mu300-disk/.mu300/ so they survive the reboot they are recording:

  • not a wrapper on /sbin/reboot. That was tried and it deadlocks the device: on OpenWrt reboot hands the request to procd, and procd runs /sbin/reboot itself on the way down - straight back into the wrapper, which execs busybox, which tells procd again. Nothing reboots, reboot simply returns and the machine keeps running, and the only sign is the audit file gaining an entry whose caller is pid=1 /sbin/procd. Hours were lost to this twice over: once wondering why the device would not reboot, and once reading the two entries an earlier operator's reboot had left as evidence of something deliberate. If a wrapper is wanted anyway, it must call reboot(2) directly (busybox reboot -f) rather than exec the applet that talks to init,

  • a line at the top of each /etc/rc.button/* handler - OpenWrt's reset handler reboots on a short press (SEEN < 1), so a bouncing key is a plausible cause and worth ruling in or out explicitly,

  • a kprobe on the syscall for anything that bypasses /sbin/reboot, which needs no module:

    echo 'p:mu300reboot __arm64_sys_reboot' > /sys/kernel/debug/tracing/kprobe_events
    echo 1 > /sys/kernel/debug/tracing/events/kprobes/mu300reboot/enable
    cat /sys/kernel/debug/tracing/trace_pipe >> /mnt/mu300-disk/.mu300/reboot-trace.log &
    

    trace_pipe is worth the reader process: the trace buffer itself does not survive the reboot, and procd sleeps a second before it calls the syscall, which is long enough for the line to reach the disk.

gpio-keys on this board exposes KEY_VOLUMEDOWN, KEY_VOLUMEUP and KEY_POWER (B: KEY=1c000000000000 0) and no KEY_RESTART, so /etc/rc.button/reset cannot fire here; /etc/rc.button/power runs poweroff, which the kernel would log as "Power down" rather than "Restarting system".

LAN, Wi-Fi bands and regulatory

21. One LAN for USB and Wi-Fi

  • br-lan (192.168.77.1/24) bridges usb0 and wlan0; one dnsmasq serves both.

    Update 2026-10-07: 192.168.77.1 is the F50's default. The U30 Air uses .78 (mu300-lan-ip, §33b), and lan.conf or LuCI can change either.

  • cfg80211 refuses to bridge wlan0 ("Device does not allow enslaving to a bridge") because IFF_DONT_BRIDGE stays set: the SC2355 driver marks the interface as AP but returns an error from change_virtual_intf when tearing down the previous firmware mode fails, so cfg80211 skips clearing the flag. kernel/patches/wlan_combo-allow-bridging-ap.patch.

  • After moving modules, delete old copies: depmod indexes every subdirectory and modprobe loaded stale drivers from an extra.old/ directory for several boots.

22. Regulatory database

  • This 5.4 kernel only has the sforshee regdb certificate; current wireless-regdb is signed by wens, so iw reg reload fails with -ENODATA, the domain stays 00 and 5 GHz is NO-IR. Android's own regulatory.db is signed by a different certificate and is rejected too. kernel/patches/regdb-wens-certificate.patch adds mainline's wens.hex. cfg80211 tries to load the database before the rootfs is mounted, so userspace runs iw reg reload first.

23. Only one AP; 5 GHz AP needs the DS Parameter Set element

  • iw list: #{ managed, AP } <= 1 — only one AP interface, so 2.4 and 5 GHz cannot be served simultaneously.
  • Symptom: with hostapd on channel 36 the firmware answered CMD_START_AP with SPRD_CMD_STATUS_NOT_SUPPORT_ERROR (HT/VHT), or accepted it and never sent beacons (non-HT), for every country, channel, rate set and HT/VHT/PMF setting tried. Android's SoftAP on the same firmware runs on 5180 MHz with 80 MHz.
  • Stock (ZTE) and realme sc2355_start_ap are identical, so the command payload was captured on Android with a kprobe on sc2355_send_cmd_recv_rsp (msg->data at +24, command id at data-11). Android's beacon contains a DS Parameter Set element (03 01 24) on 5 GHz — Unisoc's hostapd adds it — while upstream hostapd only adds it on 2.4 GHz. The firmware takes the AP channel from that element.
  • kernel/patches/wlan_combo-5ghz-ap-ds-params.patch inserts the element when hostapd omits it. Verified: 802.11a/n/ac AP on channel 36 at 80 MHz (seen by a client, disappears when hostapd stops). The firmware offers 5 GHz AP only on 36-48 and 149-165 (its ACS channel list); hotspot-start uses HT40/VHT80 there, and hotspot-verify still falls back to 2.4 GHz if the firmware refuses.
  • The wiphy rate table lists HT MCS rates as legacy bitrates, so hostapd advertises odd "extended rates" (some with the basic-rate bit); Android does the same and the firmware ignores them.
  • hostapd's 20/40 MHz coexistence scan (HT_SCAN) completes on this driver; the log line after it can lag because hostapd's stdout is block-buffered.
  • The stock driver prints the SoftAP passphrase to the kernel log (vendor_softap_convert_para); Android dmesg captures contain it.

26. Modem resets and mobile data recovery

  • The modem firmware occasionally resets: it sends an smsg (type 12, "channel 0 not opened" on the AP side), sipa_delegate: modem_reset, and modem_control stops and reloads the modem through Trusty. It comes back with +CFUN: 0, no registration and no PDP context, while sipa_eth0 keeps its stale address, so clients lose internet. Android's RIL reconnects silently.

  • mobile-data watch (mu300-mobile-data-watch.service) checks AT+CGACT? and the interface address every 30 s and runs up again after two failed checks; mobile-data down sets /run/mu300-mobile-data-down so a manual disconnect is respected. Verified by switching the radio off: data returned without intervention.

    Update 2026-10-07: the check also compares the interface's address with the context's (AT+CGPADDR). A context can come back with a new address while sipa_eth0 keeps the old one (§31c).

26d. USSD, and the AT lock that made the channel look dead

Three separate traps, and the first one hid the other two for an evening. mu300-ussd handles all three.

  • The AT lock meant two things at once. /run/mu300-at/lock was both "mu300-atd holds the channel", which lasts for the life of the system, and "one client at a time", which lasts for one command. Whichever ran second won: a client removed the daemon's directory as it exited, after which the lock behaved as a plain client mutex and everything worked — so the collision stayed invisible. Restart the daemon and it takes the directory back, and from that moment every client waits out its full 90 s and prints mu300-at: busy at a completely idle modem. Ownership is now /run/mu300-at/owner; lock is the client mutex alone.
    • The failure looks exactly like a wedged SIPC channel, which sends you after the modem instead of the lock. What tells them apart: cat /run/mu300-at/owner/pid against ps, and whether +CSQ is still ticking in urc/stty_nr0.log — a wedged channel goes quiet, a blocked lock does not.
    • Do not diagnose this by polling mu300-at in a loop. Each call takes the client lock, so the loop queues up behind the command already waiting for its answer and genuinely jams what was only blocked.
  • A USSD code has to be sent as hex. AT+CUSD=1,"*101#",15 answers +CME ERROR: 3, and still does after AT+CSCS="GSM" — so this is not the character set behaving as documented. AT+CUSD=1,"2A31303123",15 is accepted whatever AT+CSCS says.
  • The answer arrives on a different channel than the command. The command gets a bare OK on /dev/stty_nr1; the +CUSD turns up seconds later on nr0, the unsolicited channel. Anything waiting for it on nr1 waits for ever. mu300-atd's drainer logs nr0 to /run/mu300-at/urc/stty_nr0.log, and that log is what to read — waiting on a file also costs the modem nothing, which is the point after the trap above.
  • drain() in mu300-atd now appends what it reads to urc/stty_nr1.log instead of discarding it, so a late answer on the command channel is recoverable too. +CMTI (a new SMS) lands there the same way.
  • The third +CUSD field is a CBS coding scheme, not an SMS one: 15 is the GSM alphabet, 72 is UCS2, which is what a Turkish menu comes back as. The body is hex-dumped one byte per character, not packed septets. awk -v mode=ussd -v hex=... -v dcs=... -f sms-pdu.awk decodes both.
  • Verified end to end: mu300-ussd '*101#' returns the SIM's own number, and a dcs=72 body decodes with its Turkish characters intact.

27. Where the missing ~550 MiB of RAM goes

  • Memory: 1430144K/2097084K available ... 617788K reserved. The device tree reserves 464 MiB for the modem firmware (cp-modem@88000000, needed for 4G/5G), 24 MiB for Trusty (tos-mem), 8 MiB SIPC shared memory, 3 MiB DDR training data and a few small areas; the kernel image (~35 MiB) and the page tables for 2 GiB (~32 MiB) make up the rest. cma_share (48 MiB) is still usable for movable pages.
  • Not needed on Linux: logobuffer (9 MiB, there is no display) and sysdump-uboot (16 MiB, bootloader crash dumps). kernel/patches/of-reserved-mem-skip.patch adds CONFIG_OF_RESERVED_MEM_SKIP (the boot image command line is not passed on by LK, so a cmdline option alone would not work); MemTotal grew from 1447 to 1473 MiB.
  • mu300-zram.service adds lz4 zram swap of half the RAM (swappiness 100); settings and the off switch: 162.

28. Mali-G57 GPU (OpenCL) without Android

  • The stock mali_kbase.ko (DDK r40p0) does not load: 166 of its 335 imported symbol CRCs differ from this kernel. realme's kernel_modules master branch has the same DDK (gpu/natt/mali, r40p0-01eac0, UK 11.36, platform qogirn6pro); an older checkout of the tree has r34p0 (UK 11.31), which Android's r40p0 userspace would not accept. kernel/build-mali.sh builds it; it probes 23140000.gpu as "arch 9.0.9 r0p1" and creates /dev/mali0.
  • Userspace is Android's libGLES_mali.so (it is also libOpenCL.so and the Vulkan ICD), a bionic library with a 37-library closure (VNDK apex, bionic, gralloc/mapper HIDL stubs). It runs in the existing vendor chroot with LD_LIBRARY_PATH covering vendor, egl, VNDK and bionic; /dev/ion is enough for OpenCL buffers.
  • Test programs are built for bionic with plain clang (--target=aarch64-linux-android29, linked against the device's libc.so/libdl.so/libOpenCL.so) and a small _start that calls __libc_init (tools/gpu/), so no NDK is needed. android-gpu-run /system/bin/cltest: "OpenCL 3.0 v1.r40p0-01eac0", device "Mali-G57 r0p1", 4M-element kernel verified correct.
  • There is no display, so GLES/Vulkan are only usable off-screen. The driver adds about 45 MiB of memory use.

OpenWrt

29. OpenWrt 25.12 next to Ubuntu

  • Layout: the ext4 area holds /openwrt (and /ubuntu, or Ubuntu directly in the root on first installs); /.mu300/boot-os selects the system and init starts /lib/systemd/systemd or procd's /sbin/init. The disk stays mounted at /mnt/mu300-disk; mu300-os ubuntu|openwrt switches. (Update 2026-10-07: a third system, openwrt-luci, OpenWrt with the MU300 control panel, sits next to them (§35). mu300-os switches to any system directory on the disk.) openwrt/build-rootfs.sh builds the rootfs from the official armsr/armv8 tarball (checksum-verified) with apk, our kernel modules flat in /lib/modules/<release> (ubox kmodloader), the vendor chroot and procd services (mu300-vendor, mu300-hw, mu300-post).
  • Cellular WAN is a netifd protocol (proto mu300cell, option apn), so LuCI/fw4 handle routing, DNS and NAT; mobile-data watch calls ifup wan after modem resets.
  • Pitfalls found on the device:
    • procd mounts /dev as a 512 KiB tmpfs: copying the 85 MiB Android property area gives empty files and modem_control never boots the modem (power cut at ~290 s). The property area is now bind-mounted (also on Ubuntu, saving the RAM).
    • procd preloads /lib/libsetlbf.so into services; the chroot runners unset LD_PRELOAD or the bionic linker fails.
    • ujail drops capability 38 (CAP_PERFMON), unknown to 5.4, so jailed services crash-loop; procd-ujail is removed.
    • OpenWrt's busybox lacks od, timeout, losetup, telnetd; the static busybox provides them, plus a tiny mountpoint script (neither busybox has it).
    • GNU stty fails on the modem tty ("unable to perform all requested operations"); it is non-fatal now.
    • wifi/netifd wireless handlers are in wifi-scripts (with iwinfo, wireless-regdb), not pulled in by wpad.
    • macOS keeps the ECM link inactive after netifd reconfigures usb0; a hotplug hook re-enumerates the gadget on every LAN ifup.
    • The kernel had no nftables sets (CONFIG_NF_TABLES_SET), so fw4's ruleset (ct state vmap {...}) was rejected as a whole and there was no NAT; the fragment now enables sets, objref, flow offload, redirect, quota and friends.
    • OpenWrt's regulatory.db is unsigned; this kernel wants the signed one (Debian's wireless-regdb).
    • cfg80211 requests regulatory.db at 1.6 s, before the rootfs exists; the direct load fails and the request sits in the sysfs firmware fallback for 60 s (no userspace helper answers it, neither on OpenWrt nor with systemd-udevd), and iw reg reload returns ENOENT meanwhile. regdb-load answers the pending requests through /sys/class/firmware, then reloads; the country is applied before netifd starts hostapd.
    • Attended sysupgrade ("Check online for firmware upgrades") and sysupgrade would flash a whole-disk armsr image (own GPT, kernel 6.12) over the eMMC and brick the device. The packages are removed and /sbin/sysupgrade only allows configuration backups.
    • wifi-scripts generates an open "OpenWrt" network on first boot; openwrt-wifi-config replaces it once (marker /etc/mu300/wifi-configured) with the imported SSID/WPA2 settings.
  • Verified after reboots: 5 GHz AP (channel 36), cellular WAN, a USB client's traffic leaves with the modem's public IP; memory use about 140 MiB.
  • The early recorder runs from preinit, so a failed OpenWrt boot leaves dmesg, ps, logread and the Android logcat in boot_b for tools/collect-logs.sh.

30. Installer notes

  • Android's /system/bin/sh (mksh) does 32-bit arithmetic: byte offsets of the Linux region (27 GiB) overflow, so the device script works in sectors. mksh also lets a failing EXIT trap replace the exit status; the installer checks for an explicit success line instead.
  • adb shell/exec-out read stdin and swallow answers piped into a script; every call uses </dev/null.
  • Android restarts once shortly after booting back from a Linux fallback; start the installer when Android has settled.
  • A first-generation install (Ubuntu directly in the filesystem root) is replaced by /ubuntu; init still boots the old layout if no /ubuntu exists.

Bluetooth

25. SC2355 Bluetooth on BlueZ

  • Transport: sprdbt_tty (realme wcn/bluetooth/driver/tty-pcie, built with BSP_BOARD_UNISOC_WCN_SOCKET=pcie) exposes an H4 tty /dev/ttyBT0 over the WCN PCIe link and registers a bluetooth rfkill that powers the BT function. btattach -B /dev/ttyBT0 -P h4 creates hci0.
  • Vendor init (Android libbt-sprd_suite, Marlin3): before the stack starts, send 0xFCA0 with the 176-byte PSKey block from bt_configure_pskey.ini (BD address at bytes 20..25, little endian), 0xFCA2 with the 252-byte RF block from bt_configure_rf.ini, then 0xFCA1 00 00 01 (dual mode, enable). tools/bt-init/mu300-bt-init.c does this. Without the PSKey upload the controller reports a fixed placeholder address.
  • The firmware advertises Hold Mode and Park State in its LMP features, but Write Default Link Policy Settings returns Invalid HCI Command Parameters for any value that includes them (0x0000/0x0001/0x0004/0x0005 accepted, 0x0007 rejected). The 5.4 kernel sets every advertised mode, so the init sequence aborts and hciconfig hci0 up fails with EINVAL. kernel/patches/bluetooth-marlin3-link-policy.patch requests only Role Switch and Sniff (Bluetooth is built in, so this needs the kernel rebuild).
  • Android keeps the real BT address in /data/vendor/bluetooth/btmac.txt on encrypted /data; Linux uses BDADDR= from /etc/mu300/bluetooth.conf or a stable locally administered address derived from machine-id.
  • Verified: bluetoothd powers the adapter and LE/BR-EDR scanning lists nearby devices.
  • Rebuilding with a modified tree appends -dirty to the kernel release and breaks module loading; .scmversion with -gb50db5b6224c in the source tree keeps the release string stable.

Mainline 6.18 as a daily kernel

Everything here was measured on the test device (64 GB F50, Vodafone TR, 5G NSA) with 6.18.54 and the upstream/ modules, running the release's Ubuntu and OpenWrt images.

Update 2026-10-07: the port has been on 6.18.55 since PR #26 (KV in upstream/build.sh), and it also builds against 7.2.9, shipped as mu300-kernel-7.2.tar.gz. Sections 31e onwards were mostly measured on 6.18.55 and 7.2.9.

31. Ubuntu on 6.18, and what it takes

Ubuntu had never been booted on the mainline kernel. With the kernel bundle from upstream/make-bundle.sh, installed by mu300-update (modules into every system, the boot image built on the device), it boots in under 45 s and runs the hotspot, USB NCM, Bluetooth, the modem with SMS, the VPN and mobile data - the downlink included, which had never been shown on 6.18: the delegate's handshake completes and a 20 MB download goes through.

Speed at one spot, alternating kernels within minutes (signal -99 to -107 dBm, so downloads say little): upload is about twice as fast on 6.18 (0.29-0.34 MB/s against 5.4's 0.167 MB/s). 5.4 never exceeded exactly 166 650 B/s in any upload, with or without the VPN - a ceiling that constant is the device's, not the network's.

31a. Wi-Fi RX: sync_for_device stopped invalidating (hang under load)

A client uploading over Wi-Fi hung the board within 40 s. The Marlin3 driver waits for the device to finish an RX buffer by reading a flag in it and "refreshed" the buffer between retries with dma_sync_single_for_device(). On arm64 that call invalidated DMA_FROM_DEVICE buffers until 5.19 and cleans them since, so the CPU kept reading a stale line: every check failed (hw still writing, 369 times in the hung boot's log), the checksum taken from the same stale descriptor was wrong (hw csum failure), and each failure went to the 115200 baud console at loglevel 8 from the RX path. dma_sync_single_for_cpu() is the call for reading what the device wrote. After the fix: 3 x 15 MB uploads and a 30 MB download over Wi-Fi, no error. The IPA driver syncs the right way round already.

Consequence for 5.4: IPv6 TCP and UDP from Wi-Fi clients get through on 6.18 (SSH and DNS over IPv6 measured), but not on 5.4, whose Wi-Fi driver carries wlan_combo-rx-software-checksum.patch - the only difference in that path. The patch's "hw csum failure" may well have had this stale read as its cause too.

31b. The modem units' ordering cycle (both kernels)

cp_diskserver was ordered before mu300-vendor, which runs before sysinit.target, while its default dependencies put it after sysinit.target: a cycle, which systemd broke by dropping cp_diskserver and refnotify from the boot transaction (on 5.4 it happened to break it elsewhere). On 6.18 it showed because the modem's nodes appear about 18 s in, after the units' ConditionPathExists=/dev/modem had been evaluated. cp_diskserver has no default dependencies now, the conditions look for the driver (/sys/module/sprd_modem_loader), and mu300-vendor waits for the node.

31c. A context that comes back with a new address (both kernels)

After the radio or the network dropped the bearer, the LTE modem attaches again by itself and the default context is active again - with a new address, while sipa_eth0 keeps the old one: it sends and never receives. The watchdog only asked whether the context was active and the interface had an address. It compares the address (AT+CGPADDR) now. AT+CFUN=4 from scratch: radio back on, new address noticed, internet back after 72 s.

31d. Evidence of a failed boot

Two boots in about twenty (one Ubuntu, one OpenWrt) died shortly after switch_root - the OpenWrt one between 11 and 21 s by the early recorder - and left nothing. Three gaps, all closed:

  • The 6.18 config had no lockup detectors, so softlockup_panic/hardlockup_panic from boot/init had nothing behind them. Soft and (buddy) hard lockup detectors now panic; hung tasks are only reported.
  • mu300-early-recorder was never enabled in the Ubuntu image; it is, and writes every 2 s for the first 90 s.
  • pstore works: sysrq-c -> panic -> Linux again a minute later, with the panic in /var/lib/systemd/pstore/dmesg-ramoops-0. systemd-pstore moves the records out of /sys/fs/pstore at boot, which is why that directory looked empty after the failures. Also: the Wi-Fi driver's per-frame traces pushed a boot's messages out of the ring buffer within a minute (now pr_debug, and log_buf_len=4M), and systemd's 10 min reboot watchdog was rejected by the UMP9620 PMIC watchdog (maximum 300 s), so a hang during reboot was not caught (RebootWatchdogSec=2min).

31e. sipa-set-rps: a thread that never started

The vendor comments the thread's wake-up out ("zsw changed", to keep rps_cpus fixed) but still creates it, so it sat in its pre-start state - uninterruptible - for good: one more on the load average, and on 6.18 a hung-task report every two minutes. It is not created any more.

sipa-free-N and sipa-fill-recv-N had the same pre-start sleep for a different reason: they are created with kthread_create() and first woken in the IPA's runtime-PM resume, which never comes on a device without a SIM. On the second F50 (no SIM, Ubuntu) under release v2026.10.08's 6.18.54: both in D state, the 1-minute load 2.34 at 5 minutes of uptime, two "blocked for more than 120 seconds" reports at 246 s. They now start at once and wait, interruptibly, for a flag set where the vendor woke them (6.18.55 #7): both in S state, load 0.27 / 0.32 / 0.19 at 11 minutes, 0 reports. F50 #1 (SIM) on the same kernel: mobile data and its VPN up (exit address shown, GitHub reached), both threads running. The vendor 5.4 kernel has the same threads in D state (plus sipa-set-rps, slog-0-0 and the Wi-Fi TX thread: load about 5.4 at idle on the second F50); 5.4 reports no hung tasks, and it was left as it is.

31f. The delegate on OpenWrt: -EINPROGRESS taken for a failure

On OpenWrt the downlink died on some boots and the board crashed on others, and the recorder and pstore (31d) caught both crashes in the delegate's connection thread dele-4-5: a call through NULL (pc : 0x0, lr : conn_thread+0x188 [sipa_dele]) and a soft lockup, 22 s in console_flush_all. The probe log explains them:

sipa_rm: driver CB returned with -115
sipa_rm: SIPA_RM_RES_PROD_CP state changed 1->3
sipa_rm: SIPA_RM_RES_PROD_CP does not exist
sipa_delegate soc:ipa-apb:sipa-dele: cp_delegator_init failed: -22

OpenWrt brings the WAN up before the delegate is loaded (at ~80 s), so CONS_WWAN_UL is already granted when sipa_delegator_start() makes it depend on PROD_CP. That starts requesting the producer and returns -EINPROGRESS - which the vendor code took for a failure: it deleted PROD_CP again, cp_delegator_init() ignored that result, failed on the next dependency ("does not exist"), and the failed probe freed the delegator under the connection thread it had already started. On Ubuntu the delegate is loaded before there is traffic, the call returns 0, and none of this happens. Fixed in the module: -EINPROGRESS is success, the result of sipa_delegator_start() is checked, the Wi-Fi offload dependencies (unused here) are warnings, and the delegator is no longer devm-allocated. The 5.4 kernel has the same driver in its own tree and the same crash on OpenWrt ("Kernel panic - not syncing: CFI failure (target: 0x0)" in dele-4-5, caught while testing v2026.09.29); it gets the same fix as kernel/patches/sipa-delegate-einprogress.patch.

31g. Three warnings on every boot, three vendor bugs

6.18 printed three WARNING:s on every boot; each one is a bug in the vendor drivers:

  • kernel/softirq.c:429 __local_bh_enable_ip from sc2355_free_cmd_buf: the Wi-Fi command list's complock is taken with spin_lock_bh in the PCIe tx-complete interrupt, and the same lock is taken with only bottom halves off in process context - that interrupt arriving on the CPU holding it spins forever. Both places now use spin_lock_irqsave.
  • tty_port_link_device from mtty_probe (sprdbt_tty): the tty driver is allocated with one line and a second, never used port is linked at index 1 - past the end of driver->ports[]. 5.4 has no check there and writes it; 6.18 refuses with the warning. The second port is no longer linked.
  • dev_addr_check, "sipa_eth0: Incorrect netdev->dev_addr": sipa_eth, seth and sipa_usb wrote their random MAC straight into netdev->dev_addr; eth_hw_addr_random() sets it through dev_addr_set().

A look at dmesg itself (Ubuntu's journal misses the first seconds of the kernel log) found two more:

  • device_create_file / sysfs_create_file_ns, "Attribute base_addr: read permission without 'show'", four times per boot: sipx, sblock, sbuf, smem, smsg and the mailbox each created a base_addr attribute with neither show nor store, on an embedded platform_device that is never registered - it could never be read. Gone.
  • dev_addr_check for sipa_dummy0: the same direct dev_addr write as above; now eth_hw_addr_set().

And the idle load average of 2.0 was two kernel threads parked in D state for good: slog-0-0 polls every 2 s for the modem log to be switched on with an uninterruptible msleep(), and the Wi-Fi SC2355_TX_THREAD waits for work with wait_for_completion(). They now sleep interruptibly and in TASK_IDLE; the idle load is about 0.4.

7.x adds one of its own: a workqueue has to say whether it is per-CPU or unbound (WQ_PERCPU, which 6.18 has too, or WQ_UNBOUND), and trusty and six Mali queues said neither ("trusty-nop-wq is using neither WQ_PERCPU or WQ_UNBOUND"). They say WQ_PERCPU now - what the kernel picked for them anyway.

The Wi-Fi lock and the Bluetooth port come from the same vendor sources as the 5.4 modules, so the 5.4 build patches them as well (kernel/patches/wlan_combo-tx-complock-irqsave.patch, sprdbt-tty-one-port.patch); there the second port really was written past the end of ports[], since 5.4 does not check.

The 6.18 bundle also carries modules.builtin and modules.builtin.modinfo now: without them depmod warned and modprobe of a built-in driver failed. Three boots after the fixes: no warnings, Wi-Fi AP, mobile data, Bluetooth (24 devices in a scan) up.

31h. Power-off, and the command line's crutches

6.18 had only the PMIC restart (patch 0001): poweroff fell through to PSCI SYSTEM_OFF. The same patch now registers a power-off handler that does what the vendor's sc27xx-poweroff does for the UMP9620 - clear LDO_XTL_EN and SLP_LDO_PD_EN in SLP_CTRL (0x2248), then write 1 to PWR_PD_HW (0x2020). It cuts the power: ramoops lives in RAM, and after reboot the next boot finds the old console there ("reboot: Restarting system"), after poweroff it finds nothing. The F50 has no battery, so on a powered USB port the PMIC switches it on again about a minute later; unplugged, it stays off.

The command line still carries four bring-up flags. Measured on the running system, what each one keeps:

  • clk_ignore_unused: 315 of 551 clocks are on with no driver holding them (bus, config, DSP, camera, thermal, PWM clocks ...). This is where power could be saved - and where the risk is, because the modem, the Wi-Fi firmware and the vendor modules touch hardware behind some of them without the clock API. Not changed yet.
  • pd_ignore_unused: nothing - the only generic power domain (sipa-sys) has active devices (USB, IPA).
  • regulator_ignore_unused: one regulator, LDO_VDDSIM0 - the SIM's supply, which the modem uses and no Linux driver claims. Without the flag the kernel would switch the SIM off. Required.
  • fw_devlink=permissive: required. Without it (and pd_ignore_unused) the board booted but the USB gadget never came up - it waits for suppliers in the vendor device tree that no driver provides - and since Linux itself was fine, the boot counted as good and the board stayed in a Linux without USB until it was forced back to Android.

31i. A Wi-Fi card that is late at boot panicked the board

Rebooting OpenWrt on 5.4 again and again (testing v2026.09.29), one boot ended in "WCN BOOT: error: Waiting for PCIe scan card timeout", sprd_pcie_remove, "Unable to handle kernel paging request at virtual address ffffffffffffffe8" in __wake_up_locked from complete(), and a panic - back to Android. The SC2355 does not always show up on the PCIe bus within the 5 s the vendor driver waits; the timeout then removes the half-probed card, and sprd_pcie_remove() completes remove_done, which only sprd_pcie_remove_card() initialises - a completion that was never set up. It is initialised before every scan now, remove checks for a probe that never set its data, and a timed-out scan is tried once more before Wi-Fi and Bluetooth are given up. Both copies of the driver: the 5.4 tree (kernel/patches/wcn-pcie-scan-timeout.patch) and upstream/modules/wcn_bsp.

31j. SD host under mainline

The stock device tree of the F50 (read from /proc/device-tree/soc/ap-ahb under 6.18) describes three sprd,sdhci-r11 hosts, all status = "okay":

node sprd,name bus-width properties
sdio@22200000 sdio_emmc 8 non-removable, no-sd, no-sdio, HS200/HS400/HS400ES
sdio@22210000 sdio_sd 4 cd-gpios = <0x170 35 0>, no-mmc, no-sdio, sd-uhs-sdr50, sd-uhs-sdr104, vmmc-supply, vqmmc-supply, sd-detect-pol-syscon, sd-hotplug-{debounce-cn,debounce-en,protect-en,rmldo-en}-syscon
sdio@22220000 sdio_wifi 4 no-sd, no-mmc, SDR50/SDR104

The mainline port used to let only the non-removable host probe, so the F50 showed mmc0 alone with a card in the slot. The gate now lets the eMMC and the sdio_sd host through; sdio_wifi stays unprobed (Wi-Fi is on PCIe).

/proc/device-tree/aliases (read under 6.18.55) has no mmc entries at all, only cooling devices, eth*, i2c*, serial*, spi*, v4-modem* and a few others. The host numbers therefore come from the probe order, not from an alias: mmc0 is 22200000.sdio (the eMMC) and mmc1 is 22210000.sdio (the slot), under 6.18 and 5.4 alike. That the eMMC is mmcblk0 is what init and the installers rely on when they look at mmcblk[1-9] for the card - which under mainline held only by luck (31l).

Phandle 0x170 is gpio@2000c0, sprd,qogirn6pro-eic-sync. Mainline's sprd-eic binds it, but as a chip of 24 lines (gpiochip3: 24 GPIOs), and the slot's card detect is line 35: the lookup fails, mmc_of_parse() returns -EPROBE_DEFER at about 2.09 s, and the host would stay deferred. mmc_of_parse() requests the CD GPIO before it reads the write protect GPIO, the bus mode properties (sd-uhs-sdr104, no-sdio, no-mmc, ...) and the power sequence, so it returns before any of those. For that host alone the port therefore removes cd-gpios from the node (of_remove_property), runs the parse again (now without a CD GPIO: -ENOENT, which it accepts) and sets MMC_CAP_NEEDS_POLL; it logs "MU300: CD GPIO deferred, polling the card slot". sdhci-sprd has SDHCI_QUIRK_BROKEN_CARD_DETECTION, so without a CD GPIO every poll that finds no card tries to start one.

The first version of this edit only masked the -EPROBE_DEFER and kept the half-done parse; the measurements of that build (the card ran at 50 MHz "high speed", every poll tried SDIO, SD and MMC) are these, on the F50 with a 32 GB SDHC card (SL32G, manfid 0x000003), kernels built 2026-10-04:

  • 6.18.55: mmc0 mmc1; mmcblk1 type SD, 62333952 sectors (29.7 GiB); "new high speed SDHC card" at 2.61 s; 50 MHz, 4 bits, timing "sd high-speed", 3.30 V. 64 MiB of random data written at offset 8 MiB with conv=fsync in 4.0 s and read back with iflag=direct in 5.3 s; cmp equal. No mmc1 line with crc, timeout or error (the brief's grep -ciE "crc|timeout.*mmc1" counts 5, all of them "CPU features: CRC32" and four "sprd-wlan: CRC value" lines).

  • The log with the card in: 4 mmc1 lines, the same at 55 s, 89 s, 211 s and 313 s of uptime. The poll is silent: the mmc1 interrupt counter grew by 117 in 121 s (about one request a second), with no new log lines.

  • 7.2.9: the same 4 lines and deferral message, mmcblk1 type SD, same size; 64 MiB written in 4.7 s, read in 4.8 s, cmp equal, no mmc1 crc/timeout/error line; 64 interrupts in 67 s; sdio_wifi unbound.

  • 5.4 (release v2026.09.30's kernel): mmc0 mmc1 mmc2 (the vendor driver also probes sdio_wifi); /dev/mmcblk1 and /dev/mmcblk1p1, type SD, 62333952 sectors. The vendor EIC driver gives the card detect ("Got CD GPIO"), and the card runs as "ultra high speed SDR104" after tuning, at 23.75 s (the vendor modules load late). That time did not come back: on the card installation (31k, "Kernel 5.4") seven boots had mmcblk1 at 3.40 to 3.63 s, well before init looks for it. Init still allows a card under 5.4 up to 30 s instead of 8 when it waits at all (a host that waits for its card-detect line instead of polling).

  • That build, card pulled at 392 s of uptime: "mmc1: card aaaa removed", /dev/mmcblk1* gone, and the log stayed at 5 mmc1 lines from 419 s to 603 s.

With the complete parse (6.18.55 #4 and 7.2.9 #4), booted without a card: mmc0 mmc1, no /dev/mmcblk1, cd-gpios gone from /proc/device-tree/.../sdio@22210000. Both kernels logged five "mmc1: Got command interrupt 0x00000001 (or 0x00020000) even though no command operation was in progress" with an SDHCI register dump each (Cmd 0x371a = CMD55, 0x081a = CMD8; Resp[0] 0xffffffff), all between 5 s and 28 s of uptime: 91 mmc1 lines. The count then stayed at 91 at 68, 130, 192 and 253 s (6.18) and 69, 131, 192 and 254 s (7.2). The empty slot's poll costs about 19 mmc1 interrupts a second (6.18: 3516 in 184 s; 7.2: 3513 in 184 s); top showed 100 % and 96 % idle.

With the card in at boot (both #4 kernels): "new UHS-I speed SDR104 SDHC card" at 2.45 s (6.18) and 2.44 s (7.2), ios 208 MHz, 4 bits, timing "sd uhs SDR104", signal 1.80 V (vddsdio reads 1800000 uV), 4 mmc1 lines and none of the "Got command interrupt" dumps: those come from the empty slot. 64 MiB at offset 8 MiB, twice each, cmp equal, no mmc1 crc/timeout/error/busy line: 6.18 write 3.78 s and 3.72 s (16.9 and 17.2 MiB/s), read 2.49 s and 2.38 s (25.7 and 26.9 MiB/s); 7.2 write 3.70 s and 3.72 s (17.3 and 17.2 MiB/s), read 2.37 s and 2.60 s (27.0 and 24.6 MiB/s). Against the half-parse build's high speed mode: reads about twice as fast, writes about the same.

A card inserted while 6.18 #4 ran (booted without it) was found by the poll: "new UHS-I speed SDR104 SDHC card" at 279.3 s of uptime. It never became usable: about 2.3 s after each detection "Card stuck being busy! __mmc_poll_for_busy", "tried to HW reset card, got error -110", "mmcblk1: unable to read partition table", "card aaaa removed", and 0.4 s later the next detection. 14 detections in 37 s (279 s to 316 s), 156 mmc1 lines by 306 s; /dev/mmcblk1* present only between a detection and its removal. After the last removal ios showed 400 kHz, 1 bit, legacy, 3.30 V while vddsdio read 1800000 uV. A reboot with the card in gave the working SDR104 card above.

The loop was looked for again without hands (2026-10-05, 6.18.55 #7, F50 #1 running its internal system so that the card was not the root): the sdio_sd host unbound from sdhci_sprd_r11 and bound again five times (once, then with 0, 30, 1 and 1 s between). Each time "card aaaa removed", then "new UHS-I speed SDR104 SDHC card" about 0.35 s after the bind, mmcblk1p1 back, ios SDR104 at 1.80 V, and 0 "stuck being busy" or mmc1 error, timeout or crc lines. A rebind is a fresh probe with a power cycle of the slot, so it is not the case above (a host that had polled an empty slot for minutes); that one needs a card put in by hand and stays open. No kernel change was made.

Why the CD GPIO was out of reach, and the empty slot's log noise (issue #181). Mainline's gpio-eic-sprd.c maps at most three banks of eight lines per controller (SPRD_EIC_MAX_BANK 3, the SC9860's layout); the UMS9620's sync controller lists six banks in its reg (0x2000c0, 0x2100c0 ... 0x2500c0, Unisoc's qogirn6pro.dtsi), so the chip came up with 24 lines and line 35 (the fifth bank) was rejected by of_gpio_simple_xlate(): the GPIO lookup never found a chip and reported -EPROBE_DEFER for ever. Unisoc's 5.4 driver has SPRD_EIC_MAX_BANK 8 (that is the "Got CD GPIO" of the 5.4 log). The fallback above (drop cd-gpios, MMC_CAP_NEEDS_POLL) is what made the empty slot noisy: sdhci-sprd has SDHCI_QUIRK_BROKEN_CARD_DETECTION, with which sdhci_get_cd() answers "present" whenever no CD GPIO is set, so every one-second poll ran a card initialisation (CMD0, CMD8, CMD55 ...) against nothing; a command the controller gives up on still produces a late command interrupt after the core has finished the request, and sdhci_cmd_irq() logs those at error level with a register dump ("Got command interrupt 0x00000001 even though no command operation was in progress", Cmd 0x371a = CMD55, 0x081a = CMD8, Resp[0] 0xffffffff): 19 dumps in 9 minutes on the F50 under 7.2.10, none with a card in, none on the U30 Air (no slot). upstream/patches/0014-gpio-eic-sprd-eight-EIC-banks.patch raises the limit to Unisoc's 8 (nothing else in the driver depends on it: the bank count comes from reg, the interrupt handler walks the banks the chip has), so mmc_of_parse() finds the line at the first try, the port's fallback does not run, and the core requests the EIC line's interrupt (both edges; the sync EIC supports IRQ_TYPE_EDGE_BOTH) instead of polling: an empty slot is not touched after the one rescan at start, which mmc_gpio_get_cd() ends before any command. Expected on the device: gpiochip3 with 48 lines, no "MU300: CD GPIO deferred" line, cd-gpios still in /proc/device-tree, no "Got command interrupt" dump, the slot's interrupt counter at rest, and a card inserted later found by the interrupt (the stuck-busy loop of the polled slot above may or may not recur: it needs the test by hand).

31k. The Linux filesystem on the SD card

Measured on the F50 with the same SL32G card (29.7 GiB, 62331871 sectors in mmcblk1p1) on 2026-10-04/05, with the installer of this branch, the 6.18.55 #4 bundle and the v2026.10.08 root filesystems, Ubuntu 24.04 and OpenWrt on the card, the earlier installation still in the internal region.

  • Formatting. Android's /system/bin/mke2fs (1.46.2) with -b 4096 -m 0 and one inode per 256 KiB for this card (about 121000 inodes; the ratio grows with the card, up to 1 MiB, while at least 65536 inodes remain). The format and the unpacking of both systems took about 70 s. Ubuntu 24.04 is 10790 tar entries and OpenWrt 1482, so 65536 inodes still leave room for an <os>.old of each during an update. The default of one inode per 16 KiB is millions of inodes on a 128 GB card; that is what kanoqwq found slow and failing there.
  • Where it went. The summary said writes: SD card /dev/block/mmcblk1p1, boot_b, 32 bytes of misc; the device log marked the internal installation: the SD card boots first, and /.mu300/root-on-sd was in the internal filesystem. Booted: /run/mu300-root-dev /dev/mmcblk1p1, /mnt/mu300-disk the card, Ubuntu's findmnt / /dev/mmcblk1p1[/ubuntu] with LABEL=mu300sd in its fstab; the hotspot up in both systems; mobile data connected (this test SIM carries traffic only through a VPN, so nothing further was tried there).
  • Update. mu300-update boot with a 6.18 bundle that has no ./features refused (this kernel bundle cannot read the SD card, and this system runs from it; nothing was changed, boot_b unchanged); with the sdcard bundle it installed the 31 modules into both systems and the device booted from the card again.
  • Reboots. A loop rebooted OpenWrt on the card 19 times; 18 came back on the card and 1 hung (the 10th, below): 1 failure in 19. Of the 18, 17 came up undisturbed, each with the card found at 2.43 to 2.46 s ("new UHS-I speed SDR104"), 0 mmc1 error, timeout or crc lines, and SSH 106 s after the reboot (91 s of uptime); in the 12th the cable was pulled and plugged back in while the board was starting, and the cold boot after that came up on the card as well. None landed on the internal system. Two restarts from outside the loop (reboots meant for another board on the same address) also came up on the card, as did the five reboots of the steps before the loop.
  • One boot hung. The 10th reboot stopped at 15.09 s of uptime: init had found the card (stage=sd-root dev=/dev/mmcblk1p1 at 8.08 s), switched to OpenWrt at 8.13 s, procd had loaded /etc/modules.d, and the last line in console-ramoops is mali 23140000.gpu: GPU identified as 0x1 arch 9.0.9 r0p1 status 0. A good boot goes on with "No priority control manager is configured" 9 ms later. No panic, no oops, no watchdog reset. The board then did not enumerate on USB (the hub port showed a connected device that was never enabled). After it was powered again, LK started Android (slot b had tries_remaining: 1, not successful). It happened once in 19, in the Mali driver's probe, long after the card was mounted, so it does not look like the card. It may be a hang in the Mali driver under 6.18, or the power may have dropped at that moment (the board has no battery, and its cable was found to need replugging later the same night). Which of the two is open. It came back on 2026-10-05 with 6.18.55 #7 (the IPA thread fix of 31e), on a soft reboot from the card after four good boots of that kernel on F50 #1 (two from the card, two of the internal system; one of each after arming from Android): the board did not enumerate (the dock port showed "connect" and never "enable"), and a power cycle of that port (which does not cut the board's power on this dock) did not bring it back. About 20 minutes later it was in Android on its own: LK found slot b at tries_remaining 1 (armed at 6). That was one hung Linux boot, not five: LK's log has no final bootargs in the four boots after it - each found the PMIC watchdog's reset flag, went into its sysdump and was reset before the dump was done (31m). That boot (console-ramoops) had found the card (stage=sd-root at 5.06 s), switched to OpenWrt at 5.12 s and ends at 7.19 s ("random: crng init done", in OpenWrt's preinit), with no panic or oops; dmesg-ramoops was an old one. Armed again from Android, it booted from the card at once. So the hang is not the card; what it is stays open (31m).
  • Uninstall. Internal kept, card erased: erased (/dev/block/mmcblk1p1), the internal root-on-sd marker removed, the internal systems intact; install.sh --check then reported existing mu300sd filesystem: no.
  • Without the card. Simulated by relabelling the card's filesystem away from mu300sd on F50 #1 (2026-10-05, 6.18.55 #7, OpenWrt on the card, the older installation still in the internal region with its root-on-sd marker): the card stays in the slot and is set up at 2.45 s as on every boot, but holds no mu300sd. With a foreign label (photos) init mounted the internal system at 5.21 s, waited for a card for 8.85 s (stage=sd-root-missing (marker present, booting the internal system) at 14.06 s) and started the internal OpenWrt; with no label at all the same, 5.19 s and 14.05 s (8.86 s). The wait stayed at 8 s: the card that is there is set up (sd_coming false), so the 30 s allowance is not used. Labelled mu300sd again from the internal system (e2label), the next boot started the card again (stage=sd-root dev=/dev/mmcblk1p1 at 5.09 s). On this board the internal OpenWrt has default-boot android, so init restored slot a on those fallback boots (stage=misc-restored): the reboot after each landed in Android, and su -c mu300-linux started Linux again. A system of the user's in default-Linux mode would stay in Linux. A card that is physically pulled was not tried (no hands at the board), nor a device with no internal system and no card (it would have meant erasing F50 #1's internal installation); for those there are the unit tests of the root selection (tests/test_boot_init.py, RootSelect).
  • Kernel 5.4. Release v2026.10.08's 5.4 bundle with this branch's init in its generic ramdisk and sdcard in ./features, installed on the card system with mu300-update kernel 5.4 (2026-10-05): 7 boots, 2 with the init from before the longer wait and 5 with the one that has it, all from the card (/run/mu300-root-dev /dev/mmcblk1p1, OpenWrt). mmcblk1 at 3.40 to 3.63 s and p1 at 3.43 to 5.35 s; the vendor modules done at 10.23 to 11.00 s and stage=sd-root dev=/dev/mmcblk1p1 at 11.65 to 12.49 s, so init found the card on its first look and never waited; 0 mmc1 error, timeout or crc lines in the five boots counted. The wait that now runs past 8 s while a card may still be coming was checked against the live 5.4 sysfs: a card that is set up stops it (sd_coming 1), a 5.4 host with no card device yet keeps it going (0). Back on 6.18.55 with the same init: 2 boots from the card, mmcblk1 at 2.46 and 2.47 s, stage=sd-root at 8.05 and 8.12 s.
  • U30 Air. No SD host at all: /sys/class/mmc_host holds mmc0 only, /sys/block only mmcblk0* (Android, stock kernel). sd_probe finds nothing, and the installers never ask.

31l. The card slot took mmc0

31j's "mmc0 is the eMMC by probe order" does not hold under mainline. On F50 #1 (6.18.55, OpenWrt on the card, 2026-10-05), boot 19 of a 20-boot soft-reboot loop came up with the card on mmc0 (mmc0: new UHS-I speed SDR104 SDHC card, mmcblk0: mmc0:aaaa SL32G) and the eMMC on mmc1 (stage=persist-target dev=/dev/mmcblk1p38). init then looked for the card on mmcblk[1-9] (the eMMC, no mu300sd) and for the internal region on /dev/mmcblk0, the card: the first candidate offset lies past the card's end, dd bs=1 skip= cannot seek there and busybox reads its way instead, byte by byte. No stage line after usb-bind-done for 297 s, then stage=timer-reboot at 302 s; the next boot was normal. From outside it looked like a hang (no SSH for 6 minutes).

Both sdhci-sprd hosts probe asynchronously (PROBE_PREFER_ASYNCHRONOUS) and the index is taken in sdhci_pltfm_init(), first come first served. In the other 19 boots of that loop the two hosts registered 0.05 to 20 ms apart (the slot's first in one of them, already holding index 1). Before the polled card slot (31j) the slot's host deferred on its card-detect GPIO and always came second.

  • Kernel port (upstream/port/install.py): the card slot's host returns -EPROBE_DEFER until the eMMC's host is added (checked before sdhci_pltfm_init(), which allocates the index). The slot registers about 0.28 s after the eMMC now, the card is set up at about 2.75 s instead of 2.45 s and stage=sd-root comes at 5.10 to 5.16 s instead of 5.04 to 5.07 s.
  • init and the Linux tools no longer rely on the number: init takes the eMMC as the mmcblk disk whose card type is MMC and the card candidates from the SD disks, looks for the region only on the eMMC and never past its end, and writes <eMMC>@<offset> to /run/mu300-root-dev (mu300-update takes any @ there for internal); early-recorder and android-vendor-start find the eMMC's partitions by name or type. (The Android-side tools run on the stock kernel, where the eMMC is mmcblk0, and are unchanged.)
  • Every Linux-side lookup by GPT name - init's misc and boot_<slot> (the BCB, the persistent log, /run/mu300/misc-dev for mu300-next-boot), early-recorder's log partition, mu300-update's kernel partition and the by-name links - looks only at the eMMC: the disk of type MMC, else the first mmcblk disk that is not SD, never a card. A card can carry the same names (a raw clone of a device backup) and would otherwise be written to.
  • ueventd-perms.sh no longer touches block devices by number: Android's mmcblk1p* rule (the card, for vold, root:system) is dropped - no vendor daemon run here opens the card, and gid 1000 is the first user on Linux - and mmcblk0rpmb became mmcblk*rpmb (only the eMMC has an RPMB partition).
  • The cost of the kernel wait: if the eMMC's host never binds, the card slot's host stays deferred, so there is no root on the card without a working eMMC host.

Verification on F50 #1 (6.18.55 with the port, OpenWrt on the card, soft reboots): the eMMC on mmc0 in 20 boots of 20; the new init told the eMMC and the card apart correctly in 10 boots of 10.

31m. Hard hangs in the first seconds under 6.18 (open)

Investigated on F50 #1 on 2026-10-05: OpenWrt on the card, soft-reboot loops from the Mac (reboot, SSH expected within 200 s). The boots of the card system had two temporary preinit hooks: a 1 s heartbeat into the kernel log (with the cluster frequencies) and a copy of the previous boot's console-ramoops onto the card.

kernel boots hard hangs other
6.18.55 #7 (f50-leds-fixes) 20 1 (Mali probe, boot 12) 1 init stall, the card on mmc0 (31l)
main + the mmc fix, old init 20 0 -
main + the mmc fix, new init 10 1 (preinit, boot 1) -

Together with the two earlier ones (31k's 10th reboot, the 12:55 one in 31k), there are two signatures:

  • The Mali probe. The last line is mali 23140000.gpu: GPU identified as 0x1 arch 9.0.9 r0p1 status 0 (12.85 s; 15.09 s in 31k). Up to that line the log matches a good boot line for line. A good boot prints No priority control manager is configured 9 ms later. In between, the probe powers the GPU off (top force-shutdown, GPLL off, vddgpu DCDC disabled, 10 us) and on again within milliseconds (DCDC on + 10 us, GPLL, top power, soft reset, clocks, top_state polled), and then reads COHERENCY_FEATURES.
  • About 7.2 to 7.6 s, in OpenWrt's preinit. The last line is random: crng init done (7.19 and 7.55 s). The heartbeat came at 6.54 s and not at 7.55 s. Nothing in that window loads modules or touches the GPU. In both, the heartbeat stops together with the kernel log: no soft or hard lockup report (the buddy detector is built in), no hung-task report (the timeout was 8 s in these boots), no panic. The whole SoC stops, the way it does on a bus access that never completes. The PMIC watchdog (procd: 30 s) then resets the board.

One hang costs five tries. After the PMIC watchdog's reset, LK (a userdebug build) sees hw watchdog rst int pending and goes into sprd_sysdump: a minidump plus a zlib-compressed full RAM dump (40 s for the first 848 MiB). It is reset again before the dump is done, so the flag stays set and the next LK does the same. LK's log shows no final bootargs for those boots: no kernel was started. Each round takes a slot b try. The board ends in Android about 20 minutes after the hang (1274 and 1290 s measured). The same pattern appears for the 00:36 and 12:55 hangs of 2026-10-05 (LK boots 36-39 and 48-51). A reboot that is not a watchdog reset (a panic, init's 300 s timer) goes straight back to Linux.

Ruled out or not reproduced on a running board:

  • CPU DVFS: all three clusters through all their frequencies with the userspace governor, 377146 changes in 100 s, no hang.
  • vddgpu and GPU power cycling: 400 cycles through power_policy (always_on, then coarse_demand, then wait until vddgpu is off), no hang.
  • f50-leds-fixes' sipa change (F3): the hangs occur with and without it, and before the modem starts.
  • Found on the way: rmmod mali_kbase panics with an SError in mali_platform_term() (regmap_update_bits on a GPU-side register with the GPU off), after a dump_stack from mali_poweron_clear_flag(). Nothing unloads Mali, so it is not a boot path. It does show that a GPU-side access at the wrong time is fatal on this SoC. Still open: which access stalls the bus. A hang rate of about 2 in 50 boots needs a reproducer, or 100+ boots per variant, before a change (for example a delay or poll before the probe's first GPU read) can be measured.

31n. Wi-Fi powered off and on at the same time: an Oops in the RX interrupt

F50 #1, OpenWrt from the card on 6.18.55 (main's code), 20 soft reboots: one hang (boot 11). This one left pstore:

15.494580 sprd-wlan: Power off WCN (1 time)          <- end of the probe, wlan0 already registered
15.494597 WCN PCIE: [+]mchn_deinit(7, 1)              ... 9, 11, 4, 5: about 24 ms each
15.543125 sprd-wlan: iface 'wlan0' deleted            <- netifd: station iface out, AP iface in
15.616675 ...  iface 'wlan0'(5c:7d:..) type 3 added
15.627387 misc wlan wlan0: iface_open
15.627393 misc wlan wlan0: Power on WCN (0 time)
15.627399 WCN BASEstart_marlin [MARLIN_WIFI]
15.627422 sprd-wlan: pcie_post_init: register 6 ops   <- while the probe is still in mchn_deinit(10)
15.636823 sprd-wlan: ctx_id:0 cmd_id:9 [CMD_SYNC_VERSION]rsp received
15.640183 WCN PCIE: [-]mchn_deinit(10)                <- the probe's power-off goes on: hif = NULL
15.640193 WCN BASEstop_marlin [MARLIN_WIFI]
15.648698 Unable to handle kernel paging request at virtual address 00000000000030b8
pc : pcie_rx_handle+0x34/0x1e0 [sprd_wlan_combo]
lr : mchn_hw_pop_link+0x8c/0xa0 [wcn_bsp]
 mchn_hw_pop_link <- edma_rx_pop_isr <- hisrfunc <- msi_irq_handle <- sprd_pcie_msi_irq   (CPU 0, swapper)
Kernel panic - not syncing: Fatal exception in interrupt

The board did not reset after panic=5; it came back in Android about 8 minutes later.

The cause is in the driver, not the bus. power_cnt is atomic, the transitions behind it are not. The probe registers wlan0 and then powers the chip off from the probe thread, outside RTNL. OpenWrt's netifd replaced and opened the interface within 130 ms. The open's power-on saw the count at 0 and ran start_marlin + post_init while the probe's power-off was still in post_deinit. That power-off then finished: it cleared sc2355_hif.hif after post_init had set it, and stop_marlin powered the chip down under a live interface. The next RX MSI, on a channel the open had registered again, read hif->rx_mgmt through the NULL hif (0x30b8, a field offset from NULL). iface_open and iface_close are both under RTNL, so a hotspot or wifi down/up restart cannot do this; only the probe and remove can. main's PCIe post-init change (wlan_combo-pcie-post-init-retry) only restores the static channel table and did not widen the window. The 5.4 driver has the same code; Ubuntu's hostapd opens wlan0 about 10 s after the probe, which is why the Ubuntu boots never showed it.

Fix, both kernels (upstream/modules/sprd_wlan_combo, kernel/patches/wlan_combo-wcn-power-serialise.patch):

  • sprd_iface_set_power holds a mutex (hif->power_lock) across the whole transition, so an open waits for the probe's power-off and then powers on from scratch.
  • pcie_rx_handle drops a list that arrives without a context (no hif or no rx_mgmt) and logs once ("RX on channel N with no Wi-Fi context"). The TX pop handlers and pcie_rx_fill_mbuf already had such checks on 6.18 (14c).
  • sc2355_hif.hif is published with a release store before the channels are registered, read with an acquire load, and cleared only after they are unregistered.
  • Found in review:
    • The probe's error paths and remove powered off after sprd_core_free had freed priv, and hif with it. They now power off first.
    • A power-on that failed in post_init or the version sync left the chip started with the count at 0, and after a failed sync the channels stayed registered too. It is now undone the way a power-off does.

Measured on F50-B (Ubuntu 24.04, 6.18.55 with the fix):

  • 30 soft reboots, each started only after mu300-boot-ok had confirmed the one before: 0 Oops, 0 "no Wi-Fi context" lines, pstore empty, every boot confirmed.
    • 14 boots in hotspot mode (AP up every time). A 15th, at 23:47, was the user unplugging the board and is not counted.
    • 16 boots as a Wi-Fi client (joined KEDI 5G every time). In these, a temporary unit opened wlan0 as soon as the driver registered it, to recreate the pstore boot's timing (Ubuntu's hostapd opens about 10 s later).
    • In all 16 the open came 1 to 16 ms after the probe's power-off began, about 140 ms before that power-off's stop_marlin. That is the window of the Oops. In all 16 the open's start_marlin came after it.
  • 30 hotspot restarts (systemctl restart mu300-hotspot, a full WCN power-off and power-on each): AP up after every one, 0 Oops.
  • The 6.18.55 and 7.2.9 modules build. The 5.4 patch applies after the others and compiles against the 5.4 tree; the module link was not run.

Not covered:

  • edma_chn_deinit (wcn_bsp) frees a channel's ring lock and mbuf pool after a bare msleep(20), without masking the channel or synchronize_irq.
  • mchn_hw_pop_link reads mchn->ops[chn] twice.
  • An MSI still running on another CPU while a channel is torn down is therefore still possible. It is pre-existing and was not seen.
  • The 5.4 driver also lacks 6.18's TX-side checks (14c).

31m's silent hangs (the SoC stops at the Mali probe or at crng init done, no log) do not match this: here the kernel logged an Oops and panicked. A chip powered down by stop_marlin under a live PCIe link could stall a bus access, though, so this fix may remove some of that class. Not shown.

31o. KVM, and the module set a router needs

The mainline config (allnoconfig plus mu300-mainline.config) never had CONFIG_KVM, so 6.18 and 7.2 had no /dev/kvm, although the firmware starts every CPU at EL2 (CPU: All CPU(s) started at EL2 on all three kernels). The vendor 5.4 kernel has it: on F50-B, 5.4.254 logs kvm [1]: Hyp mode initialized successfully (nVHE: 5.4 runs the host at EL1). With VIRTUALIZATION/KVM built in, 6.18.55 and 7.2.9 log kvm [1]: VHE mode initialized successfully (IPA size limit 40 bits, GICv3 system registers, no GICv2 emulation: the stock DT has no GICV region). A static test program (KVM_GET_API_VERSION 12, a VM, one vCPU, four guest instructions whose store to an unmapped address must come back as an MMIO exit with the value 42) passed on 5.4, 6.18 and 7.2.

The same change brought the modules people expect on a router or a small server, as modules so the Image stays small: netfilter (conntrack helpers, queue/log, the remaining nft expressions, ipset types, the xt matches and targets iptables-nft and Docker use through nft_compat, IPVS, br_netfilter), tunnels and links (bonding, team, dummy, ifb, macvtap, ipvlan, vxlan, geneve, VRF, IPIP/GRE/FOU, ip6 tunnels and GRE), IPsec (xfrm_user, ESP/AH/ IPcomp, xfrm interfaces), L2TP, PPPoE, PPTP, MPPE, TLS, socket diagnostics, tc (HTB, HFSC, netem, fq, PIE, flower, u32, ematches, police/mirred/ctinfo/ct and the other actions), vhost-net/vsock, USB (QMI/MBIM/Huawei NCM/EEM modems, AQC111, printers, MediaTek/Ralink/Realtek Wi-Fi sticks with mac80211, btusb, snd-usb-audio, uinput/uhid), device mapper (crypt, verity, snapshot, thin), MD RAID 0/1/10, NBD, filesystems (btrfs, f2fs, XFS, ntfs3, HFS+, FUSE, ISO 9660/UDF, NFS client and server, CIFS, ksmbd), the crypto user API with XTS/CTR/CBC/GCM/CCM/ ChaCha20-Poly1305 and the ARMv8 AES/GHASH engines, and binfmt_misc. Built in, because they cost little and container runtimes look for them: /proc/config.gz (check-config scripts read it without loading a module), PSI, the net_prio/net_cls/misc cgroups, CFS bandwidth, block throttling. What was built in stays built in: three defaults the new options would have turned into modules (SIT, the AX8817X and CDC subset USB drivers) were left out of the fragment. Not taken: legacy iptables/ebtables tables (NETFILTER_XTABLES_LEGACY: Ubuntu and OpenWrt run iptables over nftables), kexec (arm64 has it only with PM_SLEEP_SMP, not built here).

6.18.55 before 6.18.55 after 7.2.9 before 7.2.9 after
Image (bytes) 16 281 608 17 311 752 16 705 544 17 864 712
modules in the bundle 31 (vendor) 360 31 377
bundle (mu300-kernel-*.tar.gz) 9.4 MB 15.7 MB 9.6 MB 16.4 MB

The modules unpack to 20 MiB (6.18, debug sections stripped) under /lib/modules/<release>. Boot time on F50-B (Ubuntu 24.04, no SIM) did not move: kernel 5.50 s before, 5.43 s after (7.2: 5.42 s); userspace is 3 min 42 s both times, the mobile-data watch waiting for a modem without a SIM.

Packaging: build-modules.sh now runs modules_install (stripped) and puts the kernel's own modules flat into out/modules next to the vendor ones, refusing a vendor module with an in-tree name. The layout on the device did not change: mu300-update already put the bundle's flat directory under extra/ on Ubuntu, where depmod indexes every module there (modprobe dm-crypt pulls in dm-mod), and flat into /lib/modules/<release> on OpenWrt, where ubox's kmodloader resolves dependencies from each module's depends=. With a set this size it now replaces the modules of an earlier bundle of the same release instead of adding to them (a module a newer bundle dropped stayed loadable). The generic ramdisk still loads only module-order.txt. On F50-B, modprobe of 34 new modules (sch_cake, ntfs3, cdc_ether, cdc_mbim, dm-crypt, vhost_net, xfrm_user, esp4, pppoe, bonding, vxlan, btrfs, nfs, cifs, snd-usb-audio, btusb, mt7921u, br_netfilter, ip_vs, ifb, act_mirred, algif_skcipher and others) succeeded on 6.18 and 7.2, a cake qdisc went onto a dummy link, and no Oops followed; USB network, the Wi-Fi client and the 5 GHz hotspot came up on both.

OpenWrt's packages ask for kmod-* packages, which apk installs from the feed for OpenWrt's own kernel (6.12); build-rootfs.sh then deletes lib/modules/6.* as it always did, so apk's database is satisfied and the running kernel's modules (built in, or from the bundle) are what loads; the /etc/modules.d lists the kmods leave behind make kmodloader load the matching mainline modules at boot. The images now carry wireguard-tools and luci-proto-wireguard, PPTP and L2TP (xl2tpd), 6in4/6rd/DS-Lite, GRE and VXLAN with their LuCI protocols, ipset, and SQM (sqm-scripts, luci-app-sqm; cake is built in on mainline and on 5.4, ifb a module on both); apk resolves the whole set together (65 kmods). xl2tpd starts at boot and listens on UDP 1701, which fw4 closes on WAN. The images also carry the 6.18 modules from upstream/out (about 20 MiB unpacked, some 6 MB more in the tarball), so the switch to 6.18 needs nothing more. Not tried on an OpenWrt device in this round.

31p. BTF and eBPF for dae, and the tracing that broke boots

dae (github.com/daeuniverse/dae, an eBPF transparent proxy; tested v2.1.1, linux-arm64, checksum from its release) needs kernel 5.17 or newer, BTF and a list of BPF options. Neither mainline kernel had BTF or the BPF JIT, and dae v2.1.1 refused to start on v2026.10.18's 7.2.9: load eBPF objects: ... program tproxy_lan_ingress_l2: load program: invalid argument: callbacks are not allowed in non-JITed programs. The 5.4 kernel is too old for dae and was not changed.

Now in mu300-mainline.config, for both kernels: DEBUG_INFO_DWARF5, DEBUG_INFO_BTF, DEBUG_INFO_BTF_MODULES, MODULE_ALLOW_BTF_MISMATCH (a module with bad BTF still loads), BPF_JIT, BPF_STREAM_PARSER, NET_INGRESS, NET_EGRESS and NETKIT (dae's preferred dae0 pair; it uses a veth pair without it). The DWARF is compressed (DEBUG_INFO_COMPRESSED_ZSTD): vmlinux is 157 MB instead of 312 MB, and two build trees fit in one docker volume again. The build image has dwarves (pahole 1.31 on Ubuntu 26.04), and build-modules.sh now runs strip --strip-debug on the out-of-tree modules, which keeps their .BTF; without it every vendor module carries megabytes of DWARF.

Not taken: kprobes and tracing. dae's list also has KPROBES, KPROBE_EVENTS and BPF_EVENTS (with PERF_EVENTS and FTRACE under them). With them, 7.2.9 came up 14 times in a row on F50-B and failed the 15th boot, then 21 times and failed the 22nd: 2 failures in 36 reboots. Both times the same thing at the same moment, about 11.5 s after start, as the modem's kbc_start_cp ran in Trusty and the Wi-Fi card's first PCIe scan failed as usual (Device found, but not active): page tables and the printk buffer overwritten (Bad page map with self-referencing PTEs, faults in vfs_read, jbd2_write_access_granted, get_data, and in both boots a fault at the same address ffffffffffad82a0), a panic, and LK's watchdog dumps until the board fell back to Android about 20 minutes later. Without the tracing group, the same kernel came up 47 of 47 times (6.18: 16 of 16); stock v2026.10.18 7.2.9 did 100 of 100 the day before. What writes there is not known. The tracing options change where early allocations land rather than doing anything at 11.5 s themselves, so this looks like a DMA write (modem or Wi-Fi) into memory the kernel owns, which another kernel layout may hit too; a kernel change that moves the early allocations needs a reboot loop of 40 or more. What dae loses without them: dae trace, the kprobe that accounts for its sockmap TCP offload (the fentry variant needs the function tracer), and bpf_get_current_task for process names in cgroup programs (it logs a warning and uses bpf_get_current_comm).

dae on F50-B (Ubuntu 24.04, Wi-Fi client of a home network, wan_interface: wlan0, a shadowsocks node on the Mac over USB LAN; the oracle-arm test server was not reachable because the Mac's tailnet was logged out): it loads in 1.2 s, creates the netkit pair dae0/dae0peer "via netlink API (performance mode)", and holds 14 SCHED_CLS, 4 CGROUP_SOCK_ADDR (connect4/6, sendmsg4/6) and 2 CGROUP_SOCK programs, 21 maps, tcx links on wlan0 (ingress, egress) and dae0, and 6 cgroup links. curl https://ifconfig.me answered 200 and the shadowsocks server logged established tcp tunnel ... <-> 34.160.111.145:443 for each request; 50 MB from Cloudflare came at 16.5 MB/s through dae and the proxy, 20.0 MB/s direct once dae was stopped (dae0 removed with it). The same test passed on the kernel without tracing, with the warning above.

Measured (Image as built, before wrap-image.py adds 1.5 MiB; memory 20 s after boot on F50-B):

6.18.55 v2026.10.18 6.18.55 BTF 7.2.9 v2026.10.18 7.2.9 BTF + tracing 7.2.9 BTF
Image (bytes) 17 512 456 21 649 416 18 069 512 26 925 064 22 337 544
of it .BTF - 4 019 543 - 4 875 150 4 104 758
modules in the bundle 20.3 MiB 23.8 MiB 21.9 MiB 34.6 MiB 25.7 MiB
ramdisk segment (bytes) 1 776 099 1 832 495 1 777 340 1 836 866 1 833 918
MemTotal (kB) 1 501 344 1 455 776 1 447 840 1 451 616
MemAvailable (kB) 1 312 360-1 321 424 1 270 356-1 274 324 1 249 648-1 264 200 1 254 696-1 288 712
kernel boot (systemd-analyze) 5.25 s 5.40 s 5.34 s
reboots on F50-B 100/100 (10-10) 16/16 100/100 (10-10) 34/36 47/47

So BTF costs about 4 MiB of RAM (it is read-only data, in rodata: 3028K before, 7060K after) and the boot is 0.1 s slower; the modules' own BTF is about 4.4 MB on disk. The boot image (header, wrapped 7.2 kernel 23.9 MB, F50-B's device ramdisk 6.5 MB, generic segment 1.8 MB) is 32.3 MB: under the 48 MiB where init keeps its persistent log in the same partition (64 MiB), with about 18 MB to spare.

Updating on the device

32. Old kernels, an idle IPA, and an update that ended in Android

A report: a device on the vendor 5.4 kernel, updated with mu300-update, only ever started Android afterwards. Reproduced on the test board with an older installer boot image (kernel #11 of 20 September) and the systems of v2026.09.21. The boot image of v2026.09.27 (kernel #13) does not have the problem below: its downlink works after four and a half idle minutes, with the same failed power-off messages in the log. Which of the published boot images have it was not established, so the update protects all of them:

  • After about two minutes without mobile traffic the IPA tries to power off and fails (Polling check power off reg timed out, sipa power off maybe fail). From then on the downlink is dead until the next boot: rx_packets of sipa_eth0 stops, TLS handshakes time out, and neither the data watchdog (the address is still right) nor a reconnect of mobile data brings it back.
  • The old mu300-update downloaded one system, unpacked it for a few minutes - exactly the quiet time the IPA needs - and then started the next download. curl had no timeout and hung there, and twice the board reset without a trace (no pstore, no persistent log) right when the next network transfer started: once between the two systems, once at the start of the boot image step. A reset while boot_b is being written leaves slot b unbootable, and LK then falls back to Android on every boot - the reported symptom.

A reset does not have to hit the boot_b write to end in Android, though. With the boot scheme of the older boot images slot b is armed for one boot (tries_remaining 2, see 1); a crash leaves it at 1, and LK's log on the next start reads check rollback slot 1 tries: 1 - Have not get right slot - Android, for good, with boot_b intact. su -c mu300-linux in Android (or the Magisk module's button) arms slot b again and Linux starts as before; the newer boot images count failed boots instead (5 in a row before Android).

mu300-update now:

  • downloads everything the update needs (the systems and the kernel bundle) first, checks every file against the release's SHA256SUMS, and only then changes anything; the unpacking and the boot_b write need no network;
  • keeps the IPA from going idle while it runs: a ping every 3 s (to 1.1.1.1 and to 223.5.5.5, which is reachable from mainland China). With it, a 26 MB download after four otherwise quiet minutes on kernel #11 ran at 5 MB/s; without it the download after the same pause never started;
  • cuts off stalled transfers (--connect-timeout, --speed-limit) and resumes partial files, so a dead downlink is an error message ("reboot, then run mu300-update apply right away") instead of a hang;
  • stops the data watchdog while it installs, so no redial happens in the middle of the boot_b write.

The full old-user path (installer boot_b with kernel #11, both systems reinstalled, boot image written) then took 40 s, and the board started the new kernel.

32a. The offset in init, replaced by every boot image update

A user installed 6.18 with the installer and got "MU300 standalone Linux ... automatically reboots to Android after 300 seconds": the root filesystem was not found. boot/init finds the Linux region at ROOT_OFFSET, a number in the file - our test board's region (27762098176). The installer writes the device's own offset into that line, but that init lives in the device's ramdisk segment, and the generic segment behind it - what mu300-update puts there for every kernel and boot image update since v2026.09.27, and what the installer adds for a mainline kernel - brings its own init, which replaces the file, with the default. On every device whose region is somewhere else, each such boot image went looking at the test board's offset, dropped into standalone mode and went back to Android: the boot image did not have to be broken for "the update always ends in Android", which is very likely what the report of section 32 was too. The test board never showed it: its region is the default.

init now finds the region itself, as the installer places it - the first 2 MiB boundary after the last partition (from sysfs) - and takes the first candidate that holds the mu300root filesystem (ext4 magic and label), the number in the file only as the last one. Tested with a generic segment whose default was wrong on purpose: "stage=root-offset found=27762098176 (default 12884901888)", and the board booted. A device left in Android by this needs one reinstall from a computer (the installer's update keeps settings and data); from v2026.09.29 on every generic segment carries the new init.

Found on the way: the account merge rewrote /etc/passwd and friends in place (a reader at first boot could see a half-written file: Failed to resolve user 'messagebus'); it now writes a copy and renames it, and mu300-accounts runs before tmpfiles, sysusers and D-Bus. rollback removed <os>.broken even when that was the system still running (only rm's --preserve-root stopped it), and apply, rollback and clean could remove <os>.old while it was the running system (an apply or rollback without the reboot in between); all of them now check whether a directory is the running root ([ / -ef dir ]) first.

32b. The Magisk installer on a device: an unmount that worked, and a password file with one system

On the second F50 (Android on slot a, Magisk 30.6, an Ubuntu and an OpenWrt on the internal region), zips built from a local release of main: every run of the installer, a dry run included, stopped after unpacking with "could not unmount the Linux filesystem", nothing written. The read-only look at what is installed had mounted and read the filesystem; android-mount-mu300root.sh -u then failed, because Android's umount (toybox) frees the loop device of what it unmounts and the losetup -d after it ends in "No such device or address". The computer installers, uninstall and reset-password never look at -u's status; the Magisk installer does. The helper now detaches only a loop that is still attached.

With that fixed, the OpenWrt 6.18 zip (with MU300_MODE=wipe in /data/adb/mu300-install.conf: a fresh region) installed in 32 s and booted (/run/mu300/linux-slot b, boot-ok counted); the wipe line became a comment. The Ubuntu 24.04 5.4 zip then installed beside it in 36 s as an update, OpenWrt untouched (its LAN setting kept), and mu300-os switched between them. But its password file replaced the first one: the OpenWrt root password, still the one in use, was then nowhere on the device. The file now keeps the other system's entry while that system stays on the filesystem (not after a wipe); on the device, OpenWrt and then Ubuntu again left a file with both, and the OpenWrt shadow hash matched the password in it.

Update 2026-10-07: since PR #40 an update (keep mode) leaves the system's accounts and passwords as they are. No password is generated and no password file is written. A password is made only for a new filesystem, a wipe, a system added beside another, or when MU300_PASSWORD/MU300_PASSWORD_RESET=yes asks for one. The install refuses a system that would be left with an empty password or the image's default. See android/magisk/installer/mu300-install.sh and tools/android-install.sh. No device test of that change is recorded.

32c. Packages installed on the device, and the settings they left behind (#116)

An update puts the release's image in place and keeps /etc/config (OpenWrt) and /etc/mu300. Packages added on the device (apk add) were gone afterwards and their settings stayed. A user with OpenClash lost the internet: while it runs, OpenClash points dnsmasq at itself (dhcp.@dnsmasq[0].server=127.0.0.1#7874, noresolv=1; its init script, change_dnsmasq) and reverts that when it stops, but the update had copied /etc/config/dhcp while it was running. The new system had dnsmasq forwarding to a port nothing listened on: no DNS. Its own /etc/config/openclash was inert without the program; fw4 skips an include whose path is missing (openclash's is in /var/etc). Argon's theme entry in /etc/config/luci stayed and pointed at files that were gone.

Since then mu300-update apply and the installers' update write down what was added (OpenWrt: /etc/apk/world; Ubuntu: dpkg's packages apt did not pull in) less the image's own list (/etc/mu300/image-packages, written at build time; older systems: the new image's world and packages.txt), move those packages' own etc/config files to /etc/mu300/orphaned-config/ (never one the new image has), and mu300-user-packages installs them again at the first boot and puts the files back. A LuCI theme whose files are not there goes off LuCI's list. The DNS leftover is handled fail-closed (DNS privacy first; for some users the internet is only usable through the VPN): after the reinstall step, a loopback forwarder is touched only when its port is a value in the set-aside settings of a recorded package that is definitively absent (failed in the feeds, given up, skipped), nothing binds it over a window of looks, the project's own settings do not name it and the VPN is off - and then only when another server stays. The only forwarder is reported (status, the login note) and stays: mu300-user-packages repair-dns removes it on request and only then lets dnsmasq use the connection's resolvers (the file as it was: orphaned-config/etc/config/dhcp.before-dns-repair). Tested in a container of the openwrt-luci rootfs with real apk and uci; no device test recorded yet.

ZTE U30 Air

33. The same board with a battery

The U30 Air (ro.product.device U30Air, firmware U30Air_SSV1.0.0B14) is ums9620_2h10_feimao like the F50: same SoC, same 64 GB eMMC and partition layout (partitions end at sector 54218752, so the Linux region is at the same offset), and its stock kernel is the very source this project builds (Enceka's tree is named after it). Its /proc/config.gz differs from the F50's in 19 symbols, all about the battery and its surroundings: ZTE's "SQC" charger stack (sqc_charger, sqc_bq2560x, sqc_netlink, charger_policy_service, zte_power_supply, zte_misc), SC27XX_PD, GPIO and LDO LEDs, a SAR sensor (SAR_PARA bougain instead of anthurium) and an NFC tag. Two are built in on the U30 Air (I2C_CHARDEV, I2C_SMBUS); everything else is a module or a bool that only changes modules.

The first boot with the F50 modules (one-shot trial) reached switch_root and ran, but the host never saw USB: sprd-charger-manager probed with -517 for good, because the U30 Air's device tree describes the SQC charger manager, and the F50 build of that module is charger-manager.c while VENDOR_SQC_CHARGER swaps in charger-manager-sqc-comm.c. The USB PHY and dwc3 wait on the charger/Type-C side, so no gadget.

kernel/build-u30air.sh builds the F50 config plus kernel/u30air.fragment in a second build directory and keeps what differs. The Image has to stay the F50 one, so the check is the set of symbols vmlinux exports: I2C_SMBUS=m changed it (the i2c core gains of_i2c_setup_smbus_alert), and no U30 Air driver needs it, so it is left out; I2C_CHARDEV is a module. Comparing whole files marks nearly every module as different (build id, symbol table order), so the comparison is on .text, .rodata, .data, .modinfo and __ksymtab_strings; that leaves 15 modules. The load order (boot/module-order-u30air.txt) is the F50's with the charger block replaced, checked against every module's depends= (the fuel gauge needs the charger manager, which needs the SQC modules and charger_policy_service).

init picks the set: /etc/mu300-device (written by the installer into the device segment of the ramdisk, which an update's generic segment does not replace), else the device tree (/charger_policy_service exists only on the U30 Air). The set is used only when linux-modules/u30air/kernel.release matches uname -r, since a mainline kernel's generic segment brings its own modules and order but leaves these in place.

With them: 93/93 modules, USB network, the hotspot, Bluetooth, mobile data, /sys/class/power_supply/battery (capacity, status) and the charger's usb/ac online flags. The battery LED is the charger's own; the others are gpio-leds (pwr_green, net_blue/net_red/net_green/net_white, wifi_blue/wifi_white), driven by mu300-led. No LEDS_TRIGGER_NETDEV in this kernel, so the Wi-Fi LED follows the hotspot service, not traffic.

Update 2026-10-07: that LED list is wrong. Of the GPIO LEDs only net_blue is wired. The others are LDO-switched camera supplies and the PMIC's keypad backlight sink, and the remaining six gpio-leds light nothing (§33f).

33a. misc and boot_b were looked up before the eMMC existed

sdhci-sprd is one of the vendor modules, so the eMMC appears only once they are loaded (about 10 s in). init looked for misc and boot_b before that: 20 s of polling for nothing, then misc-NOT-FOUND - slot a was never restored by init, and there was no persistent log (persist-target dev=none). It happened on the F50 as well; the trial boots there were rescued by the bootloader's own counting. The lookup now runs after the modules (misc and boot_b at 10.7 s on both devices), and the reboot timer, which started earlier, reads boot_b from /run/bootb.

33b. Two devices on one computer

Every device had 192.168.77.1 and the same USB MAC addresses (02:50:00:00:77:0x). The subnet now goes with the kind of device (F50 .77, U30 Air .78; mu300-lan-ip, lan.conf still overrides it) and the gadget MACs are 02:50:<md5 of the serial>:<subnet>:0x. mu300-vpn always keeps the device's own LAN out of the tunnel: a vpn.conf copied from an F50 said LAN_CIDRS=192.168.77.0/24, which on a .78 device would have sent every reply to its USB and Wi-Fi clients into the tunnel.

33c. Mainline on the U30 Air: the USB PHY waited for a Type-C driver that does not exist

The first 6.18 boot on the U30 Air came up completely - systemd, mobile data, the VPN, the hotspot - with no USB at all: no network, no serial console. Its persistent log said 25310000.ssphy: cannot add phy and dwc3: failed to initialize core. After LK's dtbo merge the PHY's extcon on the F50 is /extcon-gpio (linux,extcon-usb-gpio, which mainline has), on the U30 Air typec@380 - the PMIC's Type-C block, sprd,sc27xx-typec, which has no driver under mainline, so usb_add_phy_dev() deferred for ever. Both boards have the VBUS GPIO node: the ssphy driver now points the property at it when it names the Type-C block. Found with the device's own log, since there was no USB to look through: init persists it into boot_b, and it was read from Android afterwards (tools/collect-logs.sh).

A boot without USB is also a boot you cannot end: it counted as good, so only failing five boots by hand brought the device back. build-boot-image.py --trial-guard SECONDS is for such experiments: init leaves a timer running past switch_root (from a copy of busybox in /run, reached through its working directory, since switch_root deletes the ramdisk and moves /run) that reboots unless /run/stay exists by then; with a one-shot trial that is back in Android. A reading of the PMIC registers through debugfs (regmap/spi4.0/registers) during these tests locked up a CPU for 23 s and panicked the board - the ADI bus does not take a full register sweep.

Two more things that only show with two devices on one computer: every gadget had the USB serial number MU300LINUX, and macOS gave the second device a serial port but no network interface; it is now MU300LINUX-<serial number>. And under mainline /proc/cmdline is the kernel's forced command line, without androidboot.serialno: init reads the bootloader's from /chosen/bootargs in the device tree.

Under 6.18 and 7.2 the U30 Air has USB, mobile data, the VPN, the hotspot, Bluetooth and its LEDs (CONFIG_LEDS_GPIO). The battery is not reported: its charger and fuel gauge (the SQC stack and sc27xx-fgu on the UMP9620) have no mainline drivers (for the charger IC see 33d: it does not charge without one). (Update 2026-10-07: both are reported now. Patches 0004-0006 add the UMP9620 fuel gauge, and mainline's bq256xx drives the charger and switches charging on, which Android had left off (§33d, PR #55).) Kernel bundles now name the devices they run on (./devices): mu300-update and the installers do not put a bundle from before this onto a U30 Air.

33d. The U30 Air's battery under mainline

Under 6.18 the PMIC's efuse, ADC and fuel gauge (sprd,ump9620-efuse/-adc/-fgu) appeared as platform devices with no driver: mainline's sc27xx drivers know the SC2731/SC2730 family only. Patches 0004-0006 add UMP9620 from the values in Unisoc's 5.4 drivers:

  • efuse: 64 blocks, read directly from a window at 0x40 once the controller's RTC clock is on and ungated
  • ADC: its own scale table and ratios, a battery-voltage detection graph for scale 1, calibration from two efuse words per graph (bits 15:4), and a vote for its 26 MHz clock in an AON register (sprd_adc_pm_reg) around each conversion
  • fuel gauge: enable bits at 0x2008/0x2010, the 4200 mV calibration in bits 15:7. bat-temp is the NTC's voltage on this board, not a temperature (71.2 "degrees" at first): the battery node's voltage-temp-table converts it. Without a charger driver the status came from the battery current (patch 0010 now takes it from the charger, see below). Mainline read a discharge current as ~2 billion: u32 cur - 8192 wraps below zero; the vendor driver casts to s64 first.

The first status fallback asked for the capacity, whose calibration asks for the status: a stack overflow in the first second of every boot. Five of them in a row put the device back into Android by itself - the fallback did its job - and the panic was in pstore.

The charger is an SGM41511 (part 0010 in REG0B, a bq25601), I2C bus 6 at 0x6b, DT node charger@6b with ti,bq2560x_chg, monitored-battery, extcon, an otg-vbus regulator and the vendor vindpm-value (4270 mV), and no interrupt. Under 5.4 the vendor SQC stack drives it. An earlier version of this section said that under mainline it "charges on its power-on defaults"; that was wrong. The chip runs on the battery and keeps its registers across a reboot, so mainline found it as Android had left it. Read on the U30 Air under 7.2.9 (2026-10-06):

00:04 01:8a 02:8b 03:6f 04:58 05:87 06:67 07:40 08:24 09:00 0a:80 0b:14

REG01 has CHG_CONFIG (bit 4) at 0: charging off. REG00 has the input current at 500 mA, REG02 the charge current at 660 mA, REG04 VREG at 4.208 V, and REG05 the watchdog off. REG08 reports a USB host (SDP) with power good and no charging. Under 6.18 and 7.2 the battery never charged, and drained while the device was plugged in. The fuel gauge still said Full, 100 % at 3.88 V, because its status came from the current.

Mainline's bq256xx driver now handles the node. port/install.py adds the compatible to its OF and I2C tables with the bq25601's data, and patch 0009 changes the following for that node only:

  • No register cache. The driver's cache starts from the power-on defaults, so every read-modify-write would have written them back over Android's values (and over mu300-usb's OTG bit in REG01).
  • The charge current is at most 1.98 A, Android's value. The battery node says 3 A, which is too much for this 4050 mAh cell. VREG is at most 4.208 V: Android's REG04 has that, while the node says 4.3 V. Termination is on and the watchdog off. VINDPM comes from vindpm-value, rounded up to the chip's 100 mV steps.
  • The node has no input-current-limit-microamp, and the driver's default of 2.4 A is too much for a 500 mA USB port. The input current is 500 mA until a charger type is known. The type comes from the UMP9620's own charger detection (sprd_pmic_detect_charger_type(), as sc2731_charger and the Unisoc kernel use it): SDP 500 mA, CDP 1.5 A, DCP 2 A, and usb_type from the same result. The charger's own input detection (IINDET_EN in REG07, then VBUS_STAT in REG08) drives D+/D-, which on this board are the USB gadget's lines to the computer. It runs only when the PMIC device or its result is missing, and the driver says so once. With it, SDP or unknown is 500 mA, CDP 1.5 A, DCP 2 A and non-standard 1 A. (Since 238 the USB PHY runs the PMIC's detection and the charger takes its result; IINDET_EN is no longer used.) The type is read at probe and again on every VBUS change. With no interrupt, those changes come from the extcon. If the node's extcon is not the extcon-usb-gpio device (on the U30 Air the PHY's points at the PMIC's Type-C block, which has no driver, 33c), the driver uses that device, as the USB PHY does. Each run also switches charging on.
  • charge_type on /sys/class/power_supply/bq256xx-charger is the userspace switch: N/A stops charging, also across plugs, and Fast starts it again. status, online, usb_type, input_current_limit and constant_charge_current are there as well. There is no second bq256xx-battery supply.
  • The fuel gauge is in the charger's supplied_to, and patch 0010 makes it take its status from bq256xx-charger, as it does from the SC27xx chargers.

The driver owns 6-006b now, so mu300-usb reaches the chip with i2cget/i2cset -f and leaves its watchdog off. On expiry, the watchdog would drop the driver's settings. Nothing answers at 0x6b on the F50 (24). If its DT has the node, the probe stops at the first read.

On the U30 Air under 7.2.9 (2026-10-06) the driver binds (part 2, rev 0), switches charging on (Android had left CHG_CONFIG at 0), and the fuel gauge reads +219 mA at 3.888 V, status Charging. Two things were wrong in that first build:

  • sc27xx-pmic spi4.0: failed to detect charger type, so the driver fell back to IINDET_EN. On that Mac CDP port the result was usb_type 0 and 500 mA; Android uses 1.5 A there. port/install.py had given the UMP9620 the SC2730's detection register, 0x1b9c. The UMP9620's BC1.2 status register is 0x239c (UMP9620_CHARGE_STATUS in Unisoc's sprd-bc1p2.h), with the bits mainline expects: DONE 11, SDP 7, DCP 6, CDP 5. The edit now uses it, and input detection has to be tested again.
  • sc27xx-fgu/capacity read 575. The FGU's always-on user area keeps the last capacity across a reboot, and Android keeps it in 0.1 %. Until then the status had been Full, and the calibration that runs whenever the battery is not charging forced anything above 100 back to 100. Patch 0011 reads and saves that value in 0.1 % on the UMP9620, and clamps the reported capacity to 0-100. (Its format was wrong: see 2026-10-07 below.)

2026-10-07, U30 Air under 7.2.9 with 0009-0011: charged from about 60 % (Android said 65 % at 4.04 V under 1.3 A) for about 1.5 h at 1.1-1.3 A. Then bq256xx-charger said Full (charge_type Trickle), and the battery rested at 4.146 V with +2 mA, so it was physically full. sc27xx-fgu said status Full and capacity 58, and over the whole charge the capacity had read 57.5, 59 and 58. Two faults in the driver, and a third that is still open:

  • The user-area format. Unisoc's 5.4 driver (sc27xx_fgu_save_last_cap()/read_last_cap(), FCC_PERCENT 1000) keeps the capacity as whole percent in bits 7:0 and tenths in bits 11:8. That makes 575 (0x23f) 63.2 %, close to Android's 65 %, not 57.5 %. Android's own capacity is in 0.1 % internally (its sc27xx-fgu capacity read 615 when battery said 65), but that is not what it stores. The 0.1 % that 0011 wrote back would read as something else under Android (580 = 0x244 = 68.2 %). Mainline's arithmetic is in whole percent throughout (init_cap, ocv2cap, the delta from the coulomb count over total_cap), and 0011 had converted at the user area, so the units inside the driver agreed. The value read was the wrong one.
  • No calibration at the end of a charge. Mainline sets 100 % only when the OCV is above the top of the OCV table. The charger ends at VREG 4.208 V, below the top of the table (4.3 V and up for these cells), so with Full and 4.146 V nothing moved the 58. Mainline also writes the user area only on a first power-on, so every boot started again from the value Android had left.
  • Open: the coulomb count should have added about 40 % (1.6-1.8 Ah of a 4050 mAh cell). Its arithmetic matches the vendor's (clbcnt * 10 / 72 / cur_1000ma_adc mAh, the same registers, 2 Hz) and does not overflow at these values, and nothing calibrates while the status is Charging. A reboot during the charge would explain the 59 -> 58 step (each boot restarted from the stale saved value), but not the small rise. charge_now (uAh) is the raw counter: it should rise by about 1.2 Ah per hour at 1.2 A. If it does not, the UMP9620's counter needs something the driver does not do.

Patch 0011 is replaced (0011-power-sc27xx-fuel-gauge-UMP9620-saved-capacity-and-full.patch). On UMP9620 it reads the saved value in Android's format and writes whole percent, which is the same number in both formats. A value that is not a capacity in that format goes to the OCV. So does a multiple of 10 with tenths, which the first 0011 may have written: the OCV table decides it right away with the battery at rest (under 50 mA), and under load the value is taken in Android's format. Either way dmesg says boot capacity N % (saved 0x...) or ... from the OCV. The capacity is written to the user area whenever its whole percent changes. A Full from a charger driver (not 0006's guess from the current) sets 100 % while the OCV table puts the battery at 70 % or more. The reported value stays within 0-100. Built for 6.18.55 and 7.2.9. Not yet tested on the device.

33e. USB host on the U30 Air, and a trial guard that outlived its trial

Mainline had the gadget side of the dwc3 only: no host stack, no /sys/bus/usb at all. With dual-role dwc3, xHCI, mass storage, HID and the USB network/serial drivers it is a host as well, and it still starts as a gadget (the dwc3 node has usb-role-switch and no default mode: peripheral), so the USB network to a computer comes up as before. Two things the vendor stack does elsewhere:

  • The role. Under 5.4 the PMIC's Type-C block decides; it has no mainline driver, so the role is chosen from userspace: dwc3 opens its role switch to it in 7.2, patch 6.18/0007 does it on UMS9620 in 6.18 (a patch 7.2 does not need goes into patches/<version>/). dwc3 tells the PHY about the role through otg_set_vbus(), which the PHY did not provide: it has an otg structure now (host eye pattern, A-type ID, D+/D- pull-downs).

  • The 5 V. vbus-supply is the charger's otg-vbus regulator, and the charger (SGM41511, part 0010 in REG0B, on the I2C controller at 22a0000) has no driver under mainline. mu300-usb sets its OTG_CONFIG bit (REG01 bit 5) and turns its watchdog off (REG05 5:4), which would otherwise return it to its defaults 40 s after the write, boost included. It refuses host mode while REG08 reports power good (a computer or charger on VBUS), and turns the boost off at boot: the chip runs on the battery and keeps its registers across a reboot.

    Update 2026-10-07: the charger has a driver under mainline now, bq256xx (§33d, PR #55). mu300-usb still sets the OTG bit, but through i2cget/i2cset -f while the driver owns 6-006b. It leaves the chip's watchdog off, because the watchdog would drop the driver's settings.

A Logitech receiver (HID) and a flash drive (FAT, mounted and read) worked through a USB-C adapter under 6.18 and 7.2. The drive read at ~3 MB/s with or without the PHY's host settings; it is an old stick, not yet compared elsewhere. HDMI through the same adapter needs DisplayPort alternate mode over USB-C, which this project has on neither kernel.

Two restarts during these tests, both about 600 s after boot, were not the USB: mu300-update keeps the device segment of whatever image is in boot_b, and boot_b held a --trial-guard 600 experiment - so every boot restarted after ten minutes. init now honours a guard only in a trial boot (Linux not the default), and says so.

33f. The U30 Air's LEDs: three kinds of wiring, and lights that never went out

Under mainline the network and Wi-Fi lights stayed lit whatever Linux did. Lighting each LED the kernel knew, one at a time, while someone watched the device, showed where they are:

light colour wired to
battery white, red, blue the PMIC's RGB LED (sc27xx-bltc): its green channel is white
network blue GPIO 117 (net_blue)
network white LDO VDDCAMA0
network red the PMIC's keypad backlight sink (keyboard-backlight)
Wi-Fi white LDO VDDCAMA1
Wi-Fi blue LDO VDDCAMA2

Update 2026-10-16: the network light's white and blue mean the SIM in use (white slot 0, blue slot 1), not 5G and 4G (§154).

Update 2026-10-16: which Wi-Fi colour means which band was a guess here, and the wrong way round (§152): ZTE's firmware lights the white one (VDDCAMA1) on 5 GHz and the blue one (VDDCAMA2) on 2.4 GHz.

The device tree's six other GPIO LEDs (pwr_green, net_red, net_green, net_white, wifi_blue, wifi_white) light nothing; they come from a ZTE board file shared with other products, and Android never writes them either. The lights that never went out were the LDO ones: ZTE's zte_ldo_leds switches the camera supplies VDDCAMA0-2 (3.3 V) through vddcamaN_status, mainline had no consumer for them, and regulator_ignore_unused kept the bootloader's "on". leds-zte-ldo (upstream/port) makes them zte-ldo0..2 and starts them dark, and leds-sc27xx-kpled (after Unisoc's keypad driver, current mode) brings the red back under its Android name. What each colour means was read from Android: sampling /sys/class/leds with the radio off shows the network LED cycling red / white / off, and vddcama0 lit on 5G. mu300-led now follows it (blue on 4G, white on 5G, red without service); mobile-data reads the access technology (AT+COPS?) again on every watchdog round, since it changes under a live connection.

The PMIC's LED also carries the heat alarm (thermal-guard, now running on 5.4 too; whether it also caps there, §139): one colour at a time, since the white outshines red and blue when they are mixed.

Update 2026-10-16: the battery LED shows the battery now, as ZTE's firmware does, instead of white for "Linux is up" (§151).

33g. The U30 Air's NFC tag

The device tree's st,st21nfc at i2c@2260000 0x08 is a leftover: nothing answers there. The tag is a Fudan FM11NT08 dual-interface EEPROM at 0x57 on the same bus (I2C bus 2), which answers only while GPIO 190 (ZTE's ntag-reset-gpio, driven by its fm11tag module under 5.4) is low; GPIO 127 is its field-detect interrupt. The memory is NTAG-like: UID and lock bytes, the capability container e1 10 6d 00 (872 bytes of NDEF), then the NDEF TLV from 0x10. ZTE's Fm11ntagService writes a WSC Wi-Fi record (WPA2-PSK, AES) with the hotspot's name and password; mu300-nfc wifi writes the same bytes (compared page by page against ZTE's: nothing to write).

A phone got nothing from the tag at first, under Linux and under Android alike, although the field-detect interrupt counted every tap. ZTE's web interface had NFC off (settings global webserver_nfc_switch_status=0, the factory state of this unit); switching it on there once made the tag answer phones from then on, under Linux too, so the switch is kept in the chip, presumably in its configuration block at 0x3b0 (which also holds the I2C address). The data area was unchanged by it: reading all 1 KiB with the switch on and off, the only difference is bit 5 of byte 0x3bf (0x20 set: off), in the configuration block at 0x3b0 that also holds the I2C address (0x57 at 0x3b3). mu300-nfc on|off changes that bit alone. With it on, URLs and text written by mu300-nfc reached a phone; a Wi-Fi record joins Android phones, while iOS reads URL records by itself but does nothing with a WSC record.

33h. A trial guard that outlived its experiment, again

The U30 Air restarted about every ten minutes after coming back from Android (su -c mu300-linux). init said stage=trial-guard 600s: the device segment of boot_b still held the guard of an old --trial-guard 600 experiment, and mu300-update keeps that segment. 33e made init honour a guard only in a trial boot, but a boot from Android with mu300-linux is exactly that. The generic ramdisk segment, which every update appends behind the device segment, now carries an empty etc/mu300-trial-guard (a later file replaces an earlier one), and an experiment's guard goes into a segment of its own behind the generic one.

33i. A reboot "with the hotspot off" that never brought it back

Reported: after rebooting from mu300-toolkit because the hotspot was on, SSH was gone. The toolkit's "join a network" offers exactly that reboot when the radio is the access point (this driver cannot turn an AP back into a station), and wifi-client scan-mode on left /etc/mu300/wifi-scan-mode in place until a network was joined: the hotspot stayed off at that boot and at every boot after, and whoever had come in over it had no way back but USB. The flag is now taken at boot into /run (mu300-wifi-scan-mode.service), for that boot only, a transient timer brings the hotspot back after 10 minutes when nothing was joined, and the toolkit says before the reboot that a session over the hotspot ends there and where to come back. Newer-release notes at login came in the same change.

33j. Two devices restored from one backup

A second F50 restored from the first one's backup came up with the same androidboot.serialno (the bootloader reads it from the restored data), so 33b's gadget identity was the same on both: the same USB serial number and the same host MAC. macOS gave the one network interface to whichever enumerated last, and the other had none. init now adds the eMMC's serial (androidboot.emmcid, which the bootloader passes on both boards; it is the product serial field of the eMMC's CID, hex characters 21-28): the USB serial number is MU300LINUX-<serial>-<emmc serial> and the MACs are 02:50:<md5 of both>:<subnet>:0x. Not read from the CID in /sys when the argument is missing: init sets up USB before the modules that find the eMMC are loaded (and under mainline the eMMC may or may not be there yet), so the identity would change from boot to boot; without the argument it is the serial number alone, as before.

Decided for every device, not only for clones (a device cannot tell it is one): after this update each computer sees a new network adapter once - macOS sets up a new interface by itself (measured on the U30 Air and an F50: an address 45-48 s after the reboot), Windows installs the adapter again and may ask once more which kind of network it is on, and a computer that kept a setting for the old adapter (a fixed address, a firewall rule by MAC) has to be told about the new one.

33k. Vendor driver fixes from the U30 Air test, measured

Before and after on the U30 Air (the "before" being the kernels of the overnight test), per boot:

before after
reboots on 6.18.55 1 panic in 5: 855 sipa_dele get pd fail ret = 1, soft lockup in cp_dele_on_commad, a 68 s shutdown 20 of 20 clean: no get pd fail, no lockup, no new pstore dump, shutdown 20-30 s, mobile data on every boot
cannot create duplicate filename (sipc debug devices) 12, with 13 call traces 0 and 0; the four /dev/sipc_* once
br-lan: hw csum failure (Wi-Fi RX) 1 per boot 0 over a boot and ten Wi-Fi joins of a phone
IPv6 TCP from a Wi-Fi client to the device's link-local never connected (the SYN was dropped for its firmware sum) connects
to free list empty / out of time 302 / 46 in 5 minutes 0 / 0
USB ping from a Mac, 100 at 100 ms (NCM) 4.98 ms 1.46 ms

Throughput did not move beyond its spread: phone -> device 537-555 vs 553-571 Mbit/s, device -> phone 424-474 vs 410-453, Mac -> device over USB 337 vs 333, device -> Mac 268 vs 267, both ways at once 190/153 vs 215/148.

  • sipa_dele: pm_runtime_get_sync() returns 1 for a device already active; the vendor loop took it for a failure and retried every millisecond for ever. A failure is now answered with SMSG_VAL_DELE_REQ_FAIL. What the CP does with that answer to ENABLE is not known (the vendor never sent one), and the failure needs runtime PM switched off under a suspended device, which these tests did not produce.
  • Wi-Fi RX: the firmware's sum is checked against the frame's pseudo-header and only a match is trusted (CHECKSUM_UNNECESSARY); IPv4 options, IPv6 extension headers and a UDP length short of the IP payload are left to the stack, since where the firmware starts its sum is not documented.
  • Wi-Fi PCIe post-init runs on every power-on of the chip (each hotspot start): 5 restarts, 5 post-inits. Its error path, which used to leave the channel table NULL for the next power-on and the failed channel half set up, was reviewed, not produced.
  • Rejected: the fork's reorder change (its timer was not pushed forward by out-of-order frames before either; the change would let a new hole be skipped almost at once, and 20 ms is short for block-ack retries), its CHECKSUM_NONE for every frame, and its latency probes.
  • Measuring Wi-Fi with an Android phone: flushing the phone's neighbour entry for its gateway made Android give up the network and join another saved one; cmd wifi set-network-selection-config enabled enabled -a 2 keeps it on the network it is on while testing (and -a 0 restores it).

The second F50

33l. The charge limit, a Type-C source's current, and the Wi-Fi phy's address (a community build reviewed)

A community build for the U30 Air, v2026.10.15-charge2 by oswaldxdd (github.com/oswaldxdd/mu300-linux, tag v2026.10.15-charge2, commit 321f771: a snapshot of the source under experimental/u30air-charge2/source, the same files as its release zip), replaced the U30 Air's 7.2 charging with its own stack: a native SGM41511 driver with the stock JEITA tables and a kernel-enforced 0-100 % limit, a 1655-line fuel gauge with capacity learning (records hashed to the eMMC CID), and Unisoc's whole Type-C/PD/TCPM stack (about 8800 lines of vendor code). Its sources are GPL with their headers. What was taken, and how:

  • The charge limit, as a feature of mu300-power rather than of a second charger driver: CHARGE_TO is any whole number 0-100. 1-99 stops charging at N % and starts it again under N-5 (at once when the limit was changed); 0 never charges, the device runs on the charger; 100 lets go at once. The build's 0 % held the battery for good, but the SGM41511 still supplements a load its input does not cover from the battery, so on a 500 mA port the battery would drain to the cut-off while plugged in: the guard never holds it under 5 %. The temperature guard keeps the last word. mu300-power charge-limit [N]; System > Power has a number field (U30 Air only).
  • A Type-C source's current. BC1.2 sees a hub or splitter with a charger behind it as an SDP: 500 mA. The build got the source's offer from the TCPM stack. Only one register of it is needed: the UMP9620's Type-C block (typec@380, no driver here) runs its state machine on its own, and STATUS (+0x1c) holds the state in bits 4:0 (2: attached as a sink) and the source's Rp in bits 7:6 (1: 1.5 A, 2: 3 A). Patch 0012 makes bq256xx take the larger of BC1.2's current and the Rp's (3 A taken as 2 A). On the Mac's USB-C port (an SDP) the status read 0x6082 (sink, 3 A): input 2000 mA, the battery charging at 1.6 A instead of 0.36 A. Right after a USB role change the block was still in attach-wait (0x6001) when the VBUS event came, so the read waits up to 1.5 s for the attach.
  • USB host on outside power. mu300-usb host refused while something powered the port. With a splitter (charger and a USB network adapter on one port) that is the case to support: host with the boost left off.
  • The Wi-Fi phy's address (/sys/class/ieee80211/phy0/macaddress) was all zeros; it is now the factory address LK passes (the one wlan0 had already), on both boards.

Left out: the native charger and fuel gauge (they replace patches 0006/0009-0011, which are tested, for 7.2 only and for every 7.2 kernel - the F50 runs the same one), capacity learning and the 0.1 % display (a full learning cycle was not verified by its author), the TCPM stack (PD at 5 V gives nothing over the Rp read), and the build's mu300-usb, which drops the boost and with it host mode on battery.

33m. The ABSSV U30 Air's charger bus under mainline, and a pin controller (issue #102)

A second U30 Air firmware variant, U30Air_ABSSV1.0.0B14 (chip id UMS9620-AB; ours is SSV1.0.0B14): under 6.18/7.2 the charger never binds (bq256xx-charger 6-006b: error -19: no charger: -5, an I2C NACK on the first register read), the battery discharges on the cable, and under Android and the project's 5.4 kernel the same unit charges. Bus 2 (the NFC tag) works in the same boot, so the I2C subsystem is fine; bus 6 is dead to every device on it. One trap the reporter found: i2cget -y 6 fails on every kernel of this unit, Android included, while the in-kernel charger driver works - and i2cdetect -y 6 wedges the controller until a reboot - so userspace SMBus reads prove nothing about this bus; only the driver's bind does.

What the two stacks do with the bus-6 pads (SCL6/SDA6, pins 188/189 of the pin controller at 0x642e0000):

  • Mainline boots with the vendor DTB unchanged (upstream/README.md), so the DT the kernel sees is Unisoc's: the pin controller /soc/aon/pinctrl@2e0000 (sprd,qogirn6pro-pinctrl) with the board's groups, and i2c@22a0000 without pinctrl-names/pinctrl-0. No group names SCL6/SDA6 at all (42 groups: audio, eMMC, SIM, keypad), and the board's own states on the controller are hogs named gpio_4 ... gpio_124, not default, so the vendor kernel applies none of them at probe either. On every kernel the pads are as LK left them.
  • Mainline had no pin controller driver for this SoC (only the SC9860's), so /sys/kernel/debug/pinctrl was empty and nothing could set or even read a pad.

Patch 0013 ports Unisoc's pinctrl-sprd-qogirn6pro.c (GPL-2.0, 511 pins) onto mainline's pinctrl-sprd core: the core takes the common/misc register offsets from the SoC driver (0x44/0x444 here, 0x20/0x4020 on the SC9860) and the pin encoding grows to Unisoc's (5-bit register index). It binds to the vendor DTB's node as it is. For the charger bus it does what a DT group would: it logs both pads' registers (the bootloader's state) and puts them on func1 (the pad's own function, the I2C) when they are not - pinctrl_sprd_qogirn6pro.i2c6_fixup=0 only logs. Whether the ABSSV LK really leaves the pads elsewhere is the open question: the same LK boots 5.4 and mainline, and 5.4 does not touch them either, so the first boot of the patched kernel on that unit decides (the log line QOGIRN6PRO_SCL6: ctl 0x... (funcN) misc 0x..., iic_inf6_sel N). The register addresses, for a devmem comparison between 7.2 and 5.4 on the same unit: IIC_INF6_SYS_SEL = bits 27:24 of 0x642e0020 (which AP controller drives pad pair 6; 6 on the reporter's unit under Android), SCL6/SDA6 control 0x642e0228/0x642e022c (function select in bits 5:4: 0 = func1), their misc registers 0x642e0628/0x642e062c, and the i2c6 controller at 0x222a0000.

What else differs between 5.4 and mainline on that bus, should the pads turn out identical: the vendor i2c driver sets I2C_NACK_EN | I2C_TRANS_EN in I2C_CTL where mainline sets I2C_EN | I2C_INT_EN only, and it has a soft reset (RESET_AP_AHB_I2C6_SOFT_RST) on a transfer timeout; both drivers take the same clocks (CLK_I2C6_EB, CLK_AP_I2C6 from ext_26m) from the same DTB.

On our (SSV) unit the pin controller must change nothing: the log shows the pads' state, and the fixup only writes when the function select is not func1.

The reporter's boot of that kernel settled the pads: SCL6/SDA6 were on func1 already (ctl 0x00000000 (func1) misc 0x00083088, iic_inf6_sel 6 for both), the four clients 6-0030, 6-0034, 6-0063, 6-006b exist, and the charger still fails its first read (no charger: -5). So the pads are not the difference.

What reading ZTE's charger driver gives instead: the chip may not be at 0x6b at all. The U30 Air's 5.4 kernel builds drivers/vendor/common/sqc_v8/sqc_bq2560x.c (CONFIG_VENDOR_SQC_BQ2560X=m in kernel/u30air.fragment; its bq2560x:bq2560x_charger_probe enter is the line in the reporter's 5.4 log), not drivers/power/supply/bq2560x-charger.c. Its bq2560x_get_chip_vendor_id() reads REG0B at the node's address and, when that read fails, sets info->client->addr = SGM41513_I2C_ADDR (0x1a) and reads again; part 0 there is an sgm41513, part 1 an sgm41513A. The client keeps its name, so sysfs shows 6-006b whichever chip the board has. For the chip at 0x1a the driver codes two fields differently (info->client->addr == SGM41513_I2C_ADDR in bq2560x_charger_set_current() and bq2560x_charger_set_termina_cur()): the fast charge current in eight ranges of eight steps (5, 10, 20, 30, 60, 60, 120, 120 mA from 0, 40, 130, 300, 540, 1020, 1500, 2460 mA) and the termination current in sixteen steps (5 ... 240 mA, or six times each with REG0D bit 0 clear); every other register it uses is the same for both chips.

That fits everything the reporter measured, which a dead bus does not:

  • mainline gets a NACK (-5, in the log 2 ms after the I2C core's first line), not a timeout (-110): the controller ran the transfer and nothing acknowledged 0x6b. Patch 0009 gave up there, as it should on the F50, which has the node and no chip;
  • i2cget -f -y 6 0x6b 0x00 fails on Android and on 5.4 on that unit while the vendor driver charges through the same bus: what a driver that went on at 0x1a looks like from outside;
  • the other three devices (ptn38003a redriver 0x30, aw883xx amplifier 0x34, flash 0x63) have no driver under mainline, and whether they answer was only ever tried with i2cget, on a unit where i2cget also fails for the charger that works. "Bus 6 is dead to every device" was never shown; one failed read at 0x6b was.

What is not measured: that the ABSSV unit's chip is at 0x1a. Its 5.4 log decides without any new kernel (dmesg | grep bq2560x_get_chip_vendor_id: failed to get vendor id ret=-5 followed by chg_IC_name=sgm41513 for a chip at 0x1a; pn=0x2 with chg_IC_name=sgm41511 or bq25601 and no "failed" line for one at 0x6b). Our SSV unit has an SGM41511 at 0x6b (part 2 in REG0B, FINDINGS 33d).

Patch 0015 does what ZTE's driver does, for the ti,bq2560x_chg node only: when the read at the node's address fails, the same read at 0x1a through a client of its own (devm_i2c_new_dummy_device), and when that answers, the regmap on that client, the SGM41513's two tables (Android's 1.98 A is code 52 there; the bq25601's 60 mA steps would have written 33, which is 600 mA on that chip; the battery node's 300 mA termination current is code 6 in the times-six range), the precharge current left as the chip has it (ZTE's driver has no code for it), model_name sgm41513, and nothing at 0x6b (-5): the SGM41513 at 0x1a in the log. A failure now names both reads (no charger: -5 (and -5 at 0x1a)), so one boot on the ABSSV unit also says when the idea is wrong. Compiled only (the one object, W=1, on 6.18.56 and 7.2.10 with the other patches applied); not booted on any device, and no SGM41513 was available to test against. What the patch takes to be the same on that chip without ZTE's driver showing it: OTG_CONFIG, VBUS_STAT, PG_STAT and IINDET_EN. mu300-usb still addresses 0x6b for host mode and would have to follow once the chip is confirmed.

What else was compared, in case the chip is not at 0x1a either:

  • sprd-i2c 22240000.i2c: probe ... failed with error -22 is the camera's bus (i2c0, one child, sensor-main@20), not the charger's: its node says clock-frequency = <1000000> (read on our unit: 000f4240), mainline's i2c-sprd.c takes 100 kHz and 400 kHz only and returns -EINVAL for anything else, the vendor driver also takes 1 MHz. Our SSV unit has no i2c-0 under 7.2.10 either. Harmless for the charger.
  • Clocks and supplies: the forced command line (CONFIG_CMDLINE_FORCE) carries clk_ignore_unused pd_ignore_unused regulator_ignore_unused on every unit, so mainline switches off nothing the bootloader left on; the i2c6 clocks are the same three on both units (ext-26m source, i2c6-eb enable, ap-i2c6, 26 MHz; i2c6-eb counts 0 on the reporter's unit only because nothing was using the bus when it was read, 1 on ours where the charger is polled).
  • Bus timing at 400 kHz (i2c6's clock-frequency, 00061a80 on our unit), from the two sprd_i2c_set_clk(): mainline divides SCL 40 % high / 60 % low and writes a start hold of 6 * 26 MHz / 10^7 = 15 source clocks (0.58 us); ZTE's 5.4 driver has "ZTE modify 400K&100K duty 20200827", 31 % / 69 %, and a start hold of 18 * 26 MHz / 10^7 = 46 (1.8 us). A board with slower edges could NACK under mainline's and not under ZTE's; nothing measured says this unit does, and our SSV unit and the NFC bus of the ABSSV unit (also 400 kHz) work with mainline's. This is the next thing to try if 0x1a does not answer.
  • I2C_CTL: the vendor driver also sets I2C_NACK_EN | I2C_TRANS_EN (bits 22, 21) and resets the controller (i2c_rst) after a transfer timeout. Mainline sets neither bit and still sees a NACK as -5 at once and not as a timeout on this unit, and bus 2 works on the same unit with the same driver, so these are unlikely to be the cause; the reset only ever runs after a timeout, which mainline did not have.

34. LEDs, and the defects from a second board's test

A second F50 (restored from F50 #1's backup, with its own eMMC and factory Wi-Fi address) was tested from a user's point of view; what came out of it, measured on 2026-10-05:

  • LEDs. The F50 has the PMIC's RGB LED and the keypad backlight sink (keyboard-backlight, 0-127), nothing else. ZTE's Android (read from /sys/class/leds on the second F50, no SIM) lights sc27xx:red without service and keyboard-backlight at 48 while the hotspot is up (0 when it is stopped, 48 again when it starts). The Wi-Fi light stayed dark under Linux because mu300-led mapped no Wi-Fi LED on the F50. Now: network blue on 4G, white (the green channel) on 5G, red without service; Wi-Fi keyboard-backlight 48. Every state was driven and read back on both F50s; on F50 #1 (OpenWrt) the hotspot switched off and on the way LuCI does it (uci set wireless.ap0.disabled=1; uci commit; reload_config) gave 48, 0, 48 (mu300-led wifi sync from a procd reload trigger on wireless, which follows wlan0 for two minutes: turned off and on again at once, hostapd took 63 s to report AP-ENABLED, and the LED followed within a second).
  • mu300-update. It already skipped systems at the release's version (ubuntu: already v2026.10.08); a rollback's ubuntu.broken (655 MB) stayed on the disk through every update. apply now removes stale <os>.broken copies, never the running root, before counting free space: used space 2.8 G before, 2.2 G after.
  • Early kernel messages. journalctl -k shows nothing: journald has ReadKMsg=no, and kmsg-forward writes warnings as journalctl -t kernel. It also read with dmesg --follow-new, so the boot's first seconds (the call traces of 6.18) were never written. The first start of a boot now forwards the buffer from its start, with the kernel's timestamps: on the second F50 the journal began at [0.000000] under 5.4, and had 24 messages from the first 3 s under 6.18. A ring buffer that has already wrapped (5.4's vendor chatter wraps it within hours) is lost either way; this is about the boot.
  • 5.4 Wi-Fi MAC. The vendor driver takes the address from Android's /mnt/vendor/wifimac.txt; under Linux it used a random 40:45:da:... on every boot. It now reads LK's androidboot.wifimac from /chosen/bootargs, as the mainline port does: 5c:7d:ae:b4:0b:d0 (the second F50's bootargs) over two 5.4 boots and a 6.18 one; F50 #1's is 5c:7d:ae:b4:0b:be.

The third system

35. kanoqwq's fixes, measured: openwrt-luci on F50 #1 and the U30 Air

The third system (OpenWrt with the MU300 control panel, built from this branch) was installed next to the systems already there - F50 #1 on its card (/openwrt, /ubuntu, now /openwrt-luci; kernel 6.18.55, boot image v2026.10.08), the U30 Air on its internal region (/ubuntu, now /openwrt-luci; 7.2.9) - with the vendor files, hotspot.conf and the password of the system of the same device, and booted with mu300-os openwrt-luci. Both devices went back to their own system afterwards. The boot images were not replaced: what only a new init does (K5/K9 early lease from the initramfs, K6 RNDIS, the USB mode the panel saves, K1's "never a kept copy") is covered by the unit tests, not by these boots. The reboots are soft reboots (F50 #1 cannot be power-cycled remotely; the U30 Air has a battery), not cold boots.

Two defects showed on the first boot and are fixed:

  • android-vendor-start (from main, the slot work): L=$(cat /run/mu300/linux-slot) under set -e ended the script when the boot image does not publish that file, before modem_control; procd restarted it every 10 s and the AT channel never answered (8 restarts in 100 s, no valid answer to the RIL handshake every 36 s). Any device whose rootfs is newer than its boot image had no modem. Now the slot falls back to the command line.
  • Every check of a dead AT owner printed mu300-at: line 96: can't open /proc/7668/cmdline into radio.log (tr < /proc/$pid/cmdline 2>/dev/null reports the failed redirection before its own 2>/dev/null applies). And mu300-sms named its lock with cksum, which OpenWrt's busybox does not have (cksum: not found in the panel's SMS details).

Per boot, from /run/mu300/boot-timeline and radio.log (seconds after the kernel started):

F50 #1 (9 boots) U30 Air (11 boots)
vendor start -> props (K40, K41: no logdw second) 0.01 0.01
RIL handshake AT+SMMSWAP=0 answered (K57) 24.5-25.0, 9/9 OK 24.9-25.6, 11/11 OK
radio on (CFUN: 1) after one AT+SFUN=4 28.0-28.6 28.6-29.3
registered (K23: within 60 s, "wait modem alive timeout" never) 30.1-30.7, 0 timeouts 30.8-31.4, 0 timeouts
sipa-dele loaded by the dial (K45-K47) 35.3-40.9 40.0-41.7
address on sipa_eth0 37.4-43.1 42.1-43.9
radio-warmup done (K20) / its dial waited for it 31.3-32.7 / yes 33.5-34.1 / yes
hostapd ENABLED, "AP not up, retrying" (K15) 9/9, 0 11/11, 0
nr6/nr7 dashboard daemons (K19), early lock hook cleared (K65) 9/9, 9/9 10/10, 10/10
USB host (macOS) answers ping after the reboot command 24-27 s, lease 3600 s (preinit, K11) 24-25 s, lease 3600 s

A tenth F50 boot hung hard (no USB, back in Android after about 20 minutes, su -c mu300-linux brought it back): the known 6.18 hang of FINDINGS 31m, counted apart. K23 and K57 passed on soft reboots (F50 #1 9 + 1 hang counted apart, U30 Air 11); cold boots not run (F50 #1 cannot be power-cycled remotely, the U30 Air has a battery). On the U30 Air, ten ifdown wan; ifup wan gave the WAN back in 8.15-8.17 s each, dmesg | grep -ci "cfi\|sipa_dele.*panic" 0, one AT+SFUN=4 in the whole run.

  • K4 (region probe through a loop device): busybox dd seeks. The probe at the region offset took 0.01-0.04 s on the F50 and 0.05-0.08 s (with sudo) on the U30 Air: nothing to win, not taken.

  • K12 (one 100 ms rebind at boot instead of the lease check): macOS got its lease on every boot with both running, but the Windows host was not reachable and no Linux USB host was attached, so the gate (three hosts) did not pass. The usb-ready instance went; --if-no-lease and the re-enumeration (K10) stay.

  • K6 (RNDIS in one configuration): not measured, no Windows host; kept (only an explicit RNDIS choice uses it, and mainline kernels have no RNDIS, where the saved choice falls back to NCM).

  • K25/K26 early lease on a custom LAN: with network.lan.ipaddr=192.168.90.1 the Mac was on 192.168.90.200 25 s after the reboot command, and on 192.168.77.200 25 s after changing it back.

  • Relay IPv6 (K30, K35-K37) without NDP relay: the carrier gives a /64 by RA (2a00:1880:a00a:ee32::/64 on the F50) and fills +CGCONTRDP's IPv6 address with the interface identifier only (0.0.0.0.0.0.0.0.24.219..., the prefix zero) and two IPv6 DNS servers (2a00:1880:101:c::1, ::3). The phone on Wi-Fi and the Mac on USB took SLAAC addresses in that /64 from the relayed RA; ndp-learn routed it to br-lan at metric 128; no /128 route existed anywhere. A DNS query over IPv6 from the Mac's SLAAC address to 2a00:1880:101:c::1 was forwarded (nft counters 1 out, 1 in) and answered. Wider traffic could not be tried: both lines were in the carrier's walled garden (no credit: DNS answered, ICMP and HTTP did not, the same under the device's own Ubuntu). The spoofed-NS test was not run (no tool to craft one on the LAN side); ndp-learn takes no LAN input at all. uci show dhcp has no ndp/ndproxy option. A changed network.wan.ipv6 reaches mu300-ndp only at the next boot, as its header says.

  • SMS (K58, K69): sending failed on both lines whatever AT+CAVIMS was (+CMS ERROR: 28 on the U30 Air, 313 on the F50, the same with 0 and 1): the lines have no credit, so AT+CAVIMS=1 is kept (no difference measured) and receiving was not tried. AT+CMGL=4 marks messages read on this modem: on F50 #1's SIM the first listing showed 35 as REC UNREAD, the second 35 as REC READ. Since 2026-10-09 the pool moves what it holds off the SIM (each slot read back with AT+CMGR and deleted only while it still holds the PDU that was pooled, after the pool's file is on the disk): a full SIM (35/35 on the U30 Air's) took no more messages, and the second part of a long reply then never arrived, so the pool never saw it. On that SIM one sync moved 34 slots off, and the missing part of the waiting message arrived within a minute.

  • Update keeps the user's settings (I3): on openwrt-luci with the language, theme, pdptype and ipv6 changed, mu300-update's apply_one with a newer image and a reboot kept all four, and dhcp had no NDP option. The device check covered those four (91-mu300-luci). The update now keeps the user's network settings too: 90-mu300 is split the same way (first-install defaults behind system.mu300.defaults; an install from before it is told by wan proto mu300cell), so the LAN address and mask, ip6assign, the APN, hostname, time zone and br-lan's members stay as the user set them; flow offloading too, except once on the first update of an install from before the marker, which switches it on (mu300-ttl turns it off again at boot while a TTL is set). Checked on the U30 Air: its openwrt-luci from before the marker, hostname changed to u30test, updated by apply_one with the new image: after the reboot the hostname, LAN address and ip6assign 60 were kept, the marker was set, WAN and the Mac's lease came up. Open: the pinned USB host entry keeps its address when the LAN moves to another subnet (a later fix should re-derive it from the LAN).

  • TTL and the flowtable (K28, R23): mu300-ttl set 64 turned flow offloading off and the sipa_eth0 flowtable went (1 -> 0); off brought both back.

  • TTL in tc keeps the flowtable (mainline): the nft rule sits in postrouting, which an offloaded flow never reaches: nf_flow_offload_ip_hook (ingress of br-lan) rewrites the packet and hands it to neigh_xmit -> dev_queue_xmit on sipa_eth0. dev_queue_xmit still runs clsact's egress hook (sch_handle_egress) before the qdisc, for every packet whichever way it came, so a matchall filter there with pedit ex munge ip ttl set N pipe csum ip (and ip6 hoplimit set N) rewrites offloaded and device-own traffic alike, and flow offloading can stay on. Needs NET_SCH_INGRESS (clsact), NET_CLS_ACT, NET_CLS_MATCHALL, NET_ACT_PEDIT and NET_ACT_CSUM (mu300-mainline.config: the last three are modules, loaded one by one - OpenWrt's kmodloader modprobe takes one module per call) and a tc that has pedit's ex syntax (OpenWrt's tc-tiny 6.18, which sqm-scripts brings, does). The 5.4 vendor kernel has no act_pedit: there mu300-ttl keeps the nft rule and turns offloading off. matchall cannot replace a filter (tc filter replace answers EEXIST once one is there), so apply deletes its own (prefs 10 and 11) and adds them again; the filters belong to each sipa_eth* (all 16 get them), and mobile-data's bring-up calls mu300-ttl apply. Checked on the U30 Air (7.2.9, openwrt-luci): set 64 put both filters on every sipa_eth*, the counters grew with traffic (538 packets for a 1 MB download), flow_offloading stayed 1 and no nft table was made; set 65 changed the key to 0x41; the filters removed by hand came back with ifup wan; off removed them all. The VPN was on during the check, so the forwarded LAN traffic left through xray's own sockets rather than an offloaded flow.

  • The panel: every page (Status, Network locks, SMS, AT terminal, Adapter settings, Device management) in a browser set to English, German, Turkish and Chinese on both devices: no Chinese in English, German or Turkish, no string of the catalogs left in English in Turkish or Chinese, German shows English. Backend refusals (a bad number, an over-long SMS) have Turkish and Chinese entries; a radio switch during a dial answers "busy".

    Update 2026-10-07: since PR #48 LuCI and the panel have a language switch. English, Turkish and Chinese are in the images, and 46 languages in all come with the lang extra (mu300-extra install lang, or System > Languages in the panel). German now comes from that extra.

  • LEDs (K38, K39, K68): not ported here. The F50's lamp states were measured with someone watching and are implemented by the f50-leds-fixes work (FINDINGS 34); the fork's boot chase, lamp switches and LED page follow that branch.

36. Power profiles: idle radios, the charging boot, the charge guard

The U30 Air ran flat in a day or two of hotspot use. Two causes, both seen before: the charger IC charged on its power-on defaults and was never told anything (33d; the bq256xx driver of PR #55 now drives it, so the guard below has a node to write), and a boot that Android's LK started because a charger was plugged in ("charger mode") came up as a full hotspot with the modem dialling, in a pocket. mu300-power (one /bin/sh script, mu300-power.service or /etc/init.d/mu300-power) answers both. Design: docs/superpowers/specs/2026-10-06-power-profiles-design.md.

What was built:

  • Profiles plugged, battery, saver, picked automatically (saver below SAVER_BELOW % on battery, by the fuel gauge's capacity only) or forced with mu300-power profile NAME. Each has four knobs: WIFI_IDLE (minutes without a client, 0 never), RADIO_IDLE keep|lte|off, LEDS_IDLE on|off, CPU full|eco. Defaults: plugged 0 keep on full, battery 10 off off full, saver 5 off off eco. A bad value in /etc/mu300/power.conf counts as the default and status names it.
  • Idle is "no Wi-Fi station, no USB host, no key press" for WIFI_IDLE minutes. Then the hotspot goes down, the LEDs follow LEDS_IDLE, and the modem follows RADIO_IDLE: mobile-data suspend lte only switches EN-DC off with AT+SPENDC=2 (the lock adapter's measured "off" value; no stack restart, the data connection is untouched) and resume restores AT+SPENDC=1 only if EN-DC was on before; suspend off is the radio off (AT+SFUN=5) with data down, and resume runs radio_on and redials itself; mobile-data up refuses to dial while the modem is suspended off, except from resume. On OpenWrt the daemon runs with MU300_NETIFD=1, so suspend off is ifdown wan before AT+SFUN=5 and resume redials with ifup wan: netifd keeps owning the WAN's address, route, firewall, DNS and IPv6. Idle wakes on a key, a computer on USB, a Wi-Fi station, or plugging in (the edge battery -> plugged, not being plugged: idle on the charger, a forced profile and the battery-less F50 stay idle). Every wake brings the hotspot up first, then the LEDs and the CPU, then the modem, whose dial can take minutes.
  • State is kept across daemon restarts within a boot. The daemon's TERM trap wakes the radios without a dial (mobile-data resume nodial: the radio on, the watcher redials) and does nothing during a shutdown (the held power key and the low-battery poweroff leave /run/mu300/power/shutdown; Ubuntu also says stopping). The units keep a 150 s stop timeout (TimeoutStopSec=150, procd term_timeout 150) for the radio lock. A failed action is logged and retried by the following loops.
  • Charging boot: init writes /run/mu300/boot-mode and, in a charger boot, /run/mu300/charging-boot. The Ubuntu hotspot and mobile-data units skip on that file; the daemon enters the charging boot only on its first start of a boot, and leaves it only by the Wi-Fi key (mu300-power wake wifi; a computer on USB or the power key does not). It powers the device off only unplugged (no charger online, no extcon USB=1, the battery not Charging), below 5 % for three loops in a row, never on one sample. OpenWrt's early radio warm-up skips a charging boot.
  • Charge guard: charging off at battery temp above 45.0 C or below 0 C, on again below 40.0 C and above 3.0 C; with CHARGE_TO=N (0-100, §33l) off at N % and on below N-5. It writes the bq256xx charger's charge_type (N/A off, Fast on). bq256xx reads N/A whenever it is not charging, so Fast is written only when the guard itself turned charging off (/run/mu300/power/charge-off); the driver resets its switch at probe, so a marker lost with /run leaves nothing off. It logs only when that marker changes, and a failed write turns the guard off for the boot with one log line. No reading means no change.
  • Panel: System -> Power on openwrt-luci (state, profile, knobs, charge limit), catalogs in all 31 languages.

Method for the numbers: mu300-power log 5 /tmp/power.csv writes epoch,mV,mA,mW,capacity,temp,state,profile every 5 s. Each row is a 3-minute run unplugged, the hotspot idle (a client associated, no traffic) unless the row says otherwise, mu300-power set or the verbs between runs. The fuel gauge's current_now is negative when discharging; the draw is the mean of the run's mA (and W) after the first 30 s. Android's own idle figure comes from dumpsys battery / the same gauge on the Android side for the target line.

Row What is on Measured (mean W) Measured on
baseline everything, as before the profiles pending pending
LEDs off baseline with the LEDs dark (mu300-led idle) pending pending
hotspot off modem on, Wi-Fi off pending pending
LTE only EN-DC off (mobile-data suspend lte), hotspot on pending pending
modem off AT+SFUN=5, hotspot on pending pending
all off idle: hotspot, modem and LEDs off, the floor pending pending
eco CPU=eco on the baseline pending pending
Android idle the stock firmware at rest (the target) pending pending

What the defaults rest on: not on these numbers (there are none yet) but on the design. Radios are what drains a hotspot with nobody connected, so battery and saver switch them off after a few minutes; plugged keeps everything because the supply covers it; saver is the profile with the CPU in eco. The thresholds (45/40 C, 0/3 C, 5 % for three loops) follow the spec; the fuel gauge reports capacity=100 at 3.88 V today (33d), which is why nothing acts on the voltage. The table is filled in by the device series, with the date of each run.

Open questions for the device:

  • Does AT+SPENDC=2 without a stack restart really drop the NR leg (check AT+SPENDC? and the band readings), or only after the next attach?
  • Does procd's term_timeout apply on this OpenWrt build (that /etc/init.d/mu300-power stop waits for the wake rather than being killed at the default timeout)?
  • What the bq256xx charge_type node does on writes: N/A stops charging, Fast resumes it, or the driver rewrites it from its own state.
  • The unit tests ran under dash and bash on the dev host; busybox ash (the shell on OpenWrt) has not run them there.

The device-test incident (2026-10-07, U30 Air, OpenWrt). A measurement script took the device down with the raw actions while mu300-power's state still said active: mu300-led idle on, wifi down, mobile-data suspend lte, mobile-data suspend off. The last one never returned and the script's later steps never ran; mu300-power log stopped writing at the same moment. Every key press then did nothing: mu300-power wake only left a flag for the daemon, which saw active and had nothing to do, and mu300-led wake lit nothing under the idle flag. Every LED dark, no reaction to any key, for hours - a device that looks powered off. xray meanwhile ran out of its 1024 descriptors (accept4: too many open files) with the modem off and needed a restart.

Why suspend off did not return, from the code (no device access for the analysis; the steps of suspend off after suspend lte, as of 4e62326): do_suspend off first resumes lte (resume -> under_radio_lock resume_lte_raw), then down (the script ran by hand, so without MU300_NETIFD=1: the systemd path, ip/nft on sipa_eth0 behind netifd's back), then under_radio_lock suspend_off_raw, then one line to stderr. Every wait in it is bounded but long: the radio lock 120 s twice, each mu300-at call up to 90 s for the client lock plus T + 31 s of budget (AT+SPENDC=1 126 s, AT+CGACT=0 41 s with its 5 s lock wait, AT+SFUN=5 131 s) - about 9 minutes at worst, not hours. What is not bounded: the direct-tty path when no AT daemon runs (the open and write of the SIPC tty block in the driver; the drain loops of mobile-data's at() and of mu300-at read for as long as the channel talks); ip, nft and the disable_ipv6 write, which wait on the RTNL lock behind an OpenWrt wifi down (it returns at once and netifd tears the AP down afterwards; a Wi-Fi driver stuck in that teardown holds RTNL); and the write of the final message to a terminal that is gone. The last fits all three symptoms: the script ran in an SSH session, and an SSH session over the hotspot dies with wifi down (over the WAN, with suspend off). The server side notices only when TCP gives up (~15 min of retransmissions with dropbear's defaults), and until then a write that fills the pty blocks; then it hangs up, and SIGHUP stops the script and every job of the session - log among them - wherever they are. A suspend off stopped that way leaves the mode file off and the "down" flag, so the watcher stands aside for good, and nothing else ever looked. The most likely cause is therefore the dead session, with the RTNL wait as the second candidate; which one it was can be read on the device next time (ps for a mobile-data still there, its /proc/PID/stack and wchan; logread for the session's end).

What changed (the design: bootability and "a key always shows life" over everything else):

  • Keys always show life. mu300-buttons runs mu300-led wake first on every press, before it looks at any state, and mu300-power wake after it in the background. mu300-led wake lights the LEDs for LED_TIMEOUT (a minute when it is 0) under the idle flag too; sleep --if-due puts them out again while idle. No daemon is involved.
  • Wake by inspection. mu300-power wake restores whatever is down by looking, not by the state file, and needs no daemon: the AP down (no hostapd.wlan0 on ubus / mu300-hotspot not active) and wanted -> up; the modem's mode file -> mobile-data resume; the LED idle flag -> mu300-led idle off; cpu7 offline -> online, and eco's own 1.5 GHz cap on policy4 -> cpuinfo_max_freq (another cap is the toolkit's or thermal-guard's and is left, and nothing is lifted under thermal-guard's alarm); the VPN if mu300-power stopped it; then active. The daemon's own wake is the same function. One idle entry or restore runs at a time (/run/mu300/power/busy, a dead or stale holder is taken over); a second wake while one restores returns at once. The panel's wake runs it in the background (rpcd ends a call at 30 s).
  • Nothing can hang. Every external step of mu300-power runs under a deadline (a background job, a watchdog that kills the job's whole process tree, and a USR1 to the waiting shell for a child stuck in the kernel; busybox has no timeout in /bin): probes 5 s, LEDs 10 s, wifi/systemctl/VPN 30 s, the modem 90 s, the background LED sync 150 s (MU300_POWER_*_DEADLINE). The tree is stopped until a look finds nothing new, then every process any look saw is killed (one reparented between two looks too). mobile-data suspend|resume end within MU300_SUSPEND_DEADLINE (60 s) whatever the modem does: AT through mu300-at with -t <= 20, a 10 s client-lock wait and a 22 s budget (MU300_AT_LOCK_WAIT, MU300_AT_BUDGET), the radio lock 20 s, each external step 15 s; HUP ignored; their output goes through a file and a bounded write. On a failure or a timeout they leave the files consistent - no mode file, no "down" flag of their own - so the watcher restores whatever is off, and they exit non-zero. An lte step that failed (also an AT+SPENDC=1 answered ERROR or not at all: only OK counts, as mu300-at exits 0 on ERROR) leaves /run/mu300-mobile-data.endc-restore (unless EN-DC was off before): every resume sends AT+SPENDC=1 until it answers OK, and mu300-power's wake and self-check call resume while it is there; the watcher ignores it. The Wi-Fi key's toggles run in the background under a deadline too, and the hold's direction (is the hotspot up?) is asked within 5 s (MU300_BUTTONS_PROBE_DEADLINE): no answer counts as down, and the key turns it on. On OpenWrt they go through netifd (ifdown/ifup wan) also when run by hand.
  • The VPN while the modem is off. RADIO_IDLE=off stops mu300-vpn (systemd or procd) once the modem is off, if it was running (/run/mu300/power/vpn-stopped; a suspend that keeps failing never touches it, and a Wi-Fi client uplink keeps it), and the wake starts it again before the modem, so a KILL_SWITCH=0 dial is never ahead of it - unless the service was disabled or ENABLE=0 meanwhile (asked through mu300-vpn enabled, which prints ENABLE and touches no network; a probe that fails or times out counts as wanted); a start that failed is retried by the self-check at most every 120 s; lte leaves it alone. The service stop keeps the kill switch (nft table inet mu300_vpn stays; only ENABLE=0 and mu300-vpn off remove it), and the engine's routes go with the engine: with KILL_SWITCH=1 nothing unmarked leaves on sipa_eth* or the Wi-Fi client while it is stopped; with KILL_SWITCH=0 nothing holds traffic back, as on any stop, and the bearer is down anyway. Both service definitions raise the descriptor limit to 65536 (LimitNOFILE, procd limits nofile).
  • Self-check. Each loop, while the state says active: a modem mode file, or (with WIFI_IDLE=0) the hotspot down although nobody turned it off on purpose, is logged and restored. On purpose means the Wi-Fi key's hold (mu300-buttons writes /run/mu300/power/hotspot-off with the hold's uptime before the wake of that press starts, until the next hold; a marker older than the toggle's deadline + 30 s (180 s) is dropped once the hotspot is seen up), UCI (wireless.@wifi-iface[0].disabled or wireless.@wifi-device[0].disabled = 1: the panel, wifi-client), the unit disabled on Ubuntu, a Wi-Fi client (/run/mu300-wifi-client.active) or the scan-mode boot. A hotspot that idle took down (hotspot-idled) comes back whatever a hold marker says, but not for a Wi-Fi client or in scan mode. The hotspot is not looked at in the first 120 s of a boot nor within 120 s of any hotspot on; one that does not stay up is retried at a doubling interval up to 30 min, logged once per step. A modem left with EN-DC off is resumed too, and a VPN left stopped is started (see above).

For measurements this means: the raw actions by hand are undone by the daemon's next loop (the modem) and by any key. Use mu300-power idle and the profiles, or stop the daemon first, and run long measurements under nohup or setsid with the output in a file, never through the session the hotspot carries.

37. System suspend

Can mainline sleep the way Android idles - the AP asleep, the modem awake? Tested on F50-B (6.18.55, Ubuntu, USB-powered, the SIM without service: +CEREG: 2,8) on 2026-10-06 with the config change of branch suspend-spike (CONFIG_SUSPEND, PM_DEBUG, PM_ADVANCED_DEBUG, PM_SLEEP_DEBUG, PM_WAKELOCKS, PM_AUTOSLEEP - autosleep built, off - and the tick change below). Short answer: yes, the firmware does it; what stood in the way was three drivers and one config default (all fixed below, in the follow-up).

The firmware. /sys/kernel/debug/psci on the release kernel already says SYSTEM_SUSPEND is supported (PSCI v1.0 under the DT's arm,psci-0.2). The vendor 5.4 kernel has no platform suspend driver either; mainline's psci_init_system_suspend() registers mem. With the options: /sys/power/state = freeze mem, /sys/power/mem_sleep = s2idle [deep].

Results (rtcwake -s 20; pm_test stages first):

run result
freeze, pm_test=freezer / mem, pm_test=devices return after 5 s, everything works afterwards
mem, pm_test=processors, periodic tick panic: hard lockup on CPU1 after the CPUs came back, board restarted by itself
one CPU offline/online, periodic tick, no suspend the same panic: the CPU's timers never fire again
mem processors / core, NO_HZ_IDLE + HIGH_RES_TIMERS return after 5 s
freeze (s2idle), Wi-Fi up returns at once: the PCIe WAKE# irq calls pm_wakeup_hard_event() during noirq suspend
s2idle, Wi-Fi up, PCIe power/wakeup disabled 20 s (1.08 s, a WAKE# wakeup, back to sleep, 18.97 s), RTC wake through the PMIC irq (23); USB network, Wi-Fi client, AT, Bluetooth all fine
mem (PSCI SYSTEM_SUSPEND), Wi-Fi up returns after 0.43 s: Marlin3 pulls WAKE# low right after its L2 entry; USB, Wi-Fi, AT, BT fine
mem, Wi-Fi and BT closed 19.94 s asleep, RTC wake (IRQ 23); USB, AT, BT fine; Wi-Fi does not come back
s2idle, Wi-Fi closed 20 s; Wi-Fi does not come back either

So PSCI SYSTEM_SUSPEND enters and returns, the DDR content survives, the CPUs come back, and the modem keeps running across it (AT answers at once, sprd-mpm sees its channels awake, no modem restart). No callback failed (suspend_stats: 0 failures in every run) and no Call trace outside the two panics.

The tick. allnoconfig leaves HZ_PERIODIC (250 Hz) without high-resolution timers. cpuidle's power-down states stop the local timer, so cpuidle_register_driver() puts every CPU into the periodic broadcast once (tick_broadcast_mask: ff, all arch_sys_timer shut down, the sprd_timer IPIs the tick to all eight CPUs). tick_broadcast_offline() takes a CPU out of that mask and nothing puts it back when it comes online; without TICK_ONESHOT, tick_broadcast_enter() still lets it into the power-down state, and it never gets a timer interrupt again (arch_timer count frozen, taskset -c 7 sleep 1 never returns, the buddy watchdog panics ~30 s later). Suspend takes CPUs 1-7 down and up, so it hit this every time. NO_HZ_IDLE + HIGH_RES_TIMERS (arm64's defconfig) gives the one-shot broadcast that is armed on every idle entry: hotplug and suspend work. It also stops waking all eight CPUs 250 times a second at idle; its effect on idle power was not measured here.

What broke in the spike (the PCIe WAKE#, Wi-Fi after a suspend, the PMIC watchdog) was taken apart on branch suspend-drivers (2026-10-06/07, F50-B, the same kernel plus the changes below; logs in /root/susp2/). Two of the spike's conclusions were wrong, and the table above reads differently with what was found:

  • WAKE# was the firmware's debug log. wcn_bsp's sprd_ep_resume() sends at+armlog=1 after every resume (vendor code), and its sysfs default turns the log on at every chip power-on; wifi-start's at+armlog=0 did not outlive the next power-on (Bluetooth's start powers the chip up again). With the log on, the firmware pulls WAKE# within 0-2 s of every L2 entry to push log packets. Measured with PCIe wakeup enabled and Wi-Fi up: log on, mem returned after 1.0-1.3 s (pm_wakeup_irq 18, the WAKE# line); echo 0 > armlog_status, the full 20 s, woken by the RTC; the next resume turned the log on again and the sleep after it returned after 4 s. Fixed in wcn_bsp: the log is off by default and the resume leaves it as it was (echo 1 > /sys/devices/virtual/misc/wcn/devices/armlog_status turns it on for debugging). Three mem runs in a row with Wi-Fi up and PCIe wakeup enabled then slept the full 20 s.
  • "Wi-Fi does not come back after a suspend while it was closed" was a suspend while it was open. Without a WoWLAN configuration cfg80211's wiphy_suspend() closes every interface (cfg80211_leave_all: the P2P device's CMD_CLOSE, the station's CMD_DISCONNECT), and the WCN PCI function, which suspends asynchronously, had usually taken the bus down by then: both commands were dropped (send [CMD_CLOSE] fail because bus done), the firmware kept them open, and the driver thought them closed. Wi-Fi itself reconnected after the resume. The next close and open of Wi-Fi - with or without a suspend in between - then got the firmware assert (WCN Assert in mchn.c line 137 ... get_wcn_bus_ops, chn10), after which the chip is in "card dump" and only a reboot helps. In the spike the Wi-Fi-up runs came first, so the closed-Wi-Fi runs got the blame. Reproduced on demand: a Wi-Fi-up mem, then ip link set wlan0 down/up and no second suspend: assert. On a chip with no Wi-Fi-up suspend since its power-on, sleeps with Wi-Fi closed (Bluetooth on) were fine three times out of three (mem, s2idle, mem), and so was one with the chip off (Wi-Fi and Bluetooth closed). iw phy phy0 wowlan enable any before the sleep avoided the assert, which proved the mechanism. Fixed in sprd_wlan_combo: WoWLAN "any" is configured when the wiphy registers, so cfg80211 leaves the interfaces as they are, and the firmware learns about the sleep through the PCIe channel's power_notify (CMD_POWER_SAVE), as before. The station stays associated across the sleep (no reconnect); a hotspot stays an access point. iw phy phy0 wowlan disable brings the old behaviour back. A device link that orders the WCN platform device's suspend before the PCI function's was tried first: the commands then reached the firmware, but the queued disconnect made power_notify refuse the suspend (Q not empty suspend not allowed, -EBUSY) and the next sleep ended with CMD_SET_REGDOM timeouts and an assert; dropped.

Fixed, measured on F50-B (6.18.55, these changes; each run rtcwake, pm_wakeup_irq 23 = the RTC):

run result
idle, release kernel (periodic tick) arch_timer 0/s, timer broadcast IPIs 1725/s, sprd_timer 246/s, all IRQs 2162/s (20 s, twice)
idle, NO_HZ_IDLE + HIGH_RES_TIMERS arch_timer 400-520/s, broadcast IPIs 112-120/s, sprd_timer 170/s, all IRQs 980-1125/s
cpu7 offline/online ×3, then CPUs 1-6 at once no lockup, taskset -c N sleep returns on every CPU (release kernel: panic)
mem 20 s, Wi-Fi client up woken by the modem after 11.5 s (see wake sources); Wi-Fi associated, ping fine
mem 90 s, Wi-Fi up, radio off (AT+CFUN=4) 91.1 s asleep, no reset; the PMIC watchdog counts again afterwards (CTRL 0xa, counter running)
mem 120 s, Wi-Fi up 120.8 s, Wi-Fi associated, ping fine
mem ×2, Wi-Fi up, then wlan0 down/up no bus done, no assert, Wi-Fi rejoins
Wi-Fi closed (BT on): mem and s2idle, then open no assert, Wi-Fi rejoins, ping fine
s2idle 20 s, Wi-Fi up 21.3 s, RTC
mem 20 s, hotspot (AP) up 21.2 s; still an AP on channel 36 with hostapd running (no client was at hand to associate)
mem, Wi-Fi up, PCIe power/wakeup enabled woken by WAKE# after ~1 s: with WoWLAN "any" the firmware wakes the host for traffic, as asked

The rest:

  • The PMIC watchdog (ump9620-pmic-wdt) keeps counting while the AP sleeps. It is now stopped in its suspend_noirq callback, if it was running, and loaded with a fresh count and started again in resume_noirq
    • what the vendor's sprd_wdt does for the AP watchdog. A hang in the last suspend steps or the first resume steps is not covered; the vendor accepts the same window.
  • pcie-sprd's WAKE# is no longer IRQF_NO_SUSPEND and wake-armed for good: pm_wakeup_hard_event() only when device_may_wakeup(), the line is disabled for the sleep like any other and unlazily (IRQ_DISABLE_UNLAZY), so that it is masked in the EIC - PSCI SYSTEM_SUSPEND returns on any interrupt that reaches the GIC, whatever the kernel thinks of it - and armed (enable_irq_wake) only when power/wakeup is enabled. It is off by default: echo enabled > /sys/devices/platform/soc/26100000.pcie/power/wakeup makes Wi-Fi traffic wake the device. With it off the firmware's WAKE# request waits for the resume (wake# value:1, wake down count:N in the log).
  • ums9620-ipa-sys-pd: power off maybe failed on every suspend, harmless; the USB gadget drops for the sleep (br-lan: port usb0 disabled) and comes back.
  • The PM debug options cost nothing at runtime: pm_print_times and pm_debug_messages are 0 by default, so a suspend logs what it logged before; they stay (pm_test).

Wake sources. The RTC (PMIC irq 23) every time. The modem wakes mem by itself: the mailbox irq is IRQF_NO_SUSPEND, as in the vendor 5.4 driver, and its interrupt reaches the GIC, which ends PSCI SYSTEM_SUSPEND; no change was needed. With the radio on, the first sleeps ended after 11.5, 20 and 11.7 s on irq read smsg: dst=5, channel=6, type=4 (the AT channel's sbuf event): the modem's unsolicited +CSQ/+CESQ signal reports on stty_nr0, every few seconds, and mobile-data's registration poll (up, every 2 s, while there is no service). With AT+CFUN=4 the sleep ran to the alarm. A long sleep with the radio on needs those reports off (what Android's RIL does on screen-off) - for mu300-power, not the kernel. Not tested yet (needs a hand or a SIM with service): the power key (it shares the PMIC irq 23 with the RTC), a USB plug (a PMIC EIC line), an incoming SMS (a +CMTI URC on the same channel as the reports, so it should).

What mu300-power can rely on: mem with Wi-Fi up, down or the chip off; Wi-Fi as it was afterwards; sleeps longer than the PMIC watchdog's 60 s; PCIe wakeup as an opt-in. What it has to arrange: the modem's signal reports and the mobile-data poll off before a long sleep, or the modem wakes the device every 10-20 s.

Not measured: power. The F50 has no battery; the U30 Air (fuel gauge) is where suspend's saving can be measured, unplugged.

Logs of every run stayed on F50-B under /root/susp/ (the spike: *.log, dmesg before/after, /proc/interrupts, the two panic records) and /root/susp2/ (the follow-up, with the scripts that ran them). F50-B was left on the 6.18.55 build of branch suspend-drivers (radio on, Wi-Fi client, one more 20 s mem checked). The 7.2.9 build of the branch compiles, kernel and all modules; it has not been booted yet.

39. The SMS pool: durable before the SIM lets go, long messages that never complete, forwarding

Where a message can be lost. This modem is told AT+CNMI=2,1 (mu300-smsd): it stores a new message on the SIM (or ME) and announces it with +CMTI, it does not hand over a +CMT that the host must acknowledge. The SIM is the safe copy, and the only "acknowledgement" is the pool's AT+CMGD once the message is pooled. That used to follow a global sync, which on this device flushes the SD card's loop image too and can stall for seconds. Now each new message file is fsynced before its rename, and the pool directory, next_id and the pool's parent before the first AT+CMGD (busybox's fsync applet on OpenWrt; coreutils sync FILE... elsewhere; the global sync only with neither). next_id is written aside and renamed, and the highest id in the pool counts too: an id file a power cut left empty would have restarted the ids and overwritten message 1.

Parts that never come. A long message waited on the SIM until all its parts were there - for ever, if one was lost. $POOL/partial now remembers when each waiting message was first seen and whether it was unread then (AT+CMGL marks what it lists read, §35); after MU300_SMS_PARTIAL_WAIT (an hour) the parts that did arrive are pooled with [...] for each missing one and an incomplete: HAVE/TOTAL header (the panel says so under the text). A part that turns up later is pooled at once as a message of its own. sms watch (every system) holds a long message back the same way.

Forwarding (Cellular > SMS forwarding, mu300-sms-forward): driven by the pool (mu300-sms hands over new ids), never by the modem. HTTP goes through ucode's uclient module in a helper that reads the whole request on stdin, so the bot token in Telegram's URL and the webhook's headers are never in a command line; uclient sends a POST body chunked. Found on the device: uclient.connect() to a refused port returns null, and calling request() after it segfaults ucode, so the helper checks connect first; a timeout ends with data_eof and status 0. ssl_init({verify: true}) refused self-signed, expired and wrong-host certificates (badssl.com: errors 3 and 4).

Checked on the U30 Air (7.2.9, openwrt-luci, v2026.10.17 with these files copied over, then restored): sending to the SIM's own number failed (+CMS ERROR: 28, the line has no credit, as in §35), so received messages were stored with AT+CMGW=<len>,0 (SMS-DELIVER PDUs, received-unread) and went through the same listing, pooling and AT+CMGD as a real one. A single message: pooled, off the SIM, forwarded to a webhook on the Mac (JSON, the custom header) within the 30 s sync. With wrapped fsync/sync/mu300-at: fsync of the file, then of the directory and next_id, then AT+CMGR/AT+CMGD, and no global sync. Parts 1 and 3 of 3: waiting (state written once), pooled with the wait lowered as first [...] third, incomplete: 2/3; part 2 injected afterwards was pooled by the next periodic sync as [...]second[...]. Webhook down: connect, attempt 1, next in 30 s, attempt 2, next in 60 s, delivered when it came back; the queue file left /etc when empty. A fake Telegram token: HTTP 401, not retried. Every process's command line sampled ~45 000 times during deliveries: no token, URL or header. The keyword filter skipped a message without the keyword. The page in English and Turkish (save, a refusal translated, the test button, the log). Not tested: e-mail (the image has no msmtp), the SMS target (no credit), a real incoming SMS from the network.

40. The boot chain of the Linux slot: what is loaded per slot, and what the installers copy

The problem. Linux boots from the slot Android does not run from, and LK boots that slot with that slot's own bootloader chain. Linux, though, starts Android's modem: android-vendor-start rewrites androidboot.slot_suffix to Android's slot (§5, PR #30), so modem_control loads nr_modem, nr_phy and pm_sys of Android's slot and hands them to the Trusty TA kernelbootcp (kbc_verify_all_avb2, SEC_KBC_START_CP) - the Trusty of the Linux slot. On a device that never took an OTA both slots hold the factory build and nothing differs. After an OTA Android's slot holds the new build and the other slot still the factory one (issue #86: on a U30 Air on B18, slot a's uboot_a, sml_a, vbmeta_a, trustos_a "belong to the factory build"), so a Linux boot runs the factory TEE against the new modem images. kano's advice, which the maintainer took: "sync uboot, teecfg, trustos, sml across the A/B slots - copy the partitions of Android's slot into the other slot; it solves 99% of the problems."

What is loaded per slot, from F50-B's uboot_log (16 MiB ring, 108 boots in it, read-only from Linux):

  • uboot, sml, teecfg, trustos: the secure-boot images. Fastboot downloads of them log uboot_verify_successful, sml_verify_successful, teecfg_verify_successful, trustos_verify_successful (each checked against the signature chain before it is written, download slot: trustos_b), and at every boot LK finds them already in place (fdtdec_decode_region: sml-mem@bd000000, tos-mem@bd020000, zte_tee smc get tos addr, uboot_set_root_of_trust succeeded, pass_chip_uid_to_tos()): the SPL loaded the selected slot's set before LK. stock/README.md already treats trustos as verified together with sml, uboot and vbmeta, one chain per firmware build.
  • vbmeta: LK's avb_slot_verify() reads vbmeta_<slot> and through it boot, dtbo, vendor_boot, nr_modem, nr_phy, pm_sys (Loading vbmeta struct in footer from partition nr_modem_b, ...) and the chained vbmeta_system, vbmeta_vendor, vbmeta_product, vbmeta_odm, vbmeta_system_ext of the booted slot; the device is unlocked (allow_verification_error is 1, Device Status is unlock, skip boot image verify!), so a mismatch is logged and booted anyway. The root of trust LK hands to Trusty comes from that verification.
  • The SPL itself (splloader) is not a by-name partition: it is in the eMMC boot areas, mmcblk0boot0 and mmcblk0boot1 byte-identical on F50-B, and LK manages it itself (slot 1 booted fail, rolling back spl and reboot into normal, exchange boot slot!!!).

What the installers copy: uboot, sml, teecfg, trustos and vbmeta - the four of kano's list and the vbmeta that is verified with them - from Android's slot to the Linux slot (tools/android-bootchain.sh; the copy in the switch module is kept identical by a test). Nothing else, by a fixed list that also refuses any NV-like name:

  • never the NV and calibration partitions (nr_fixnv1/2, nr_runtimenv1/2, nr_deltanv, prodnv, miscdata, persist, calinv, isedata, ztecfg, ztepersist): on F50-B nr_fixnv1_a and nr_fixnv1_b differ, each slot's NV belongs with that slot;
  • never boot, init_boot, vendor_boot, dtb, dtbo, super, userdata, misc, and never a partition of Android's slot;
  • not the modem images (nr_modem, nr_phy, pm_sys, ch_sys). The evidence does not ask for them: Linux runs Android's slot's copies already (above), and LK only reads the Linux slot's for their AVB footers, which an unlocked device ignores. They also sit beside the per-slot NV. If a device with a synced chain still fails at the handoff, they are the next thing to look at.
  • not hypervsior, ise, avbmeta_rs, common_rs1/2, logo: nothing in the LK log loads them per slot (common_rs1_a and _b differ on F50-B; the others are identical there).

How it is done (every check before the first write; a refusal changes nothing and stops the installation): Android's slot from ro.boot.slot_suffix (_a/_b only); an F50/MU300 or U30 Air by model; getprop must exist and the running slot's boot partition must not hold a Linux image (never from Linux); misc's bootloader_control must say Android's slot booted successfully, and the other slot may outrank it only when it holds our Linux image (an armed trial), not an OTA waiting for its reboot; both by-name links of each image present, two different devices, the same size. Then per image: the same sha256 on both slots - skipped; different - both slots' images are copied into the Linux filesystem (.mu300/bootchain/<date>/<name>_<slot>.img and SHA256SUMS, each read back against the partition), then Android's image is written to the Linux slot (dd conv=fsync, sync, blockdev --flushbufs and drop_caches before the read-back) and its sha256 compared. A mismatch writes every image back that was already written, verifies those too, and stops the installation before the boot image is written: Linux is not armed, Android is untouched. The host installers also pull the backup into work/bootchain/<date>. MU300_SYNC_BOOTCHAIN=0 (install.ps1 -NoBootchainSync, MU300_SYNC_BOOTCHAIN=0 in the Magisk conf) skips it, and a device taken as an F50 although its model is not recognised is never synced. Later, from Android: su -c 'mu300-linux bootchain' (what differs) and su -c 'mu300-linux bootchain sync' (backup in /data/adb/mu300-bootchain/<date>). There is no Linux-side command: from Linux the booted slot is the one to be written.

On the test boards: F50-B (B09, never updated) has uboot, sml, teecfg, trustos, vbmeta and every vbmeta_*, the modem images, dtb, dtbo, vendor_boot, hypervsior, ise, logo identical on both slots (read from Linux, 2026-10-11): the installers there say "identical on both slots" and write nothing. Not yet run on a device whose slots differ (one that took an OTA); issue #105's power-off at the Trusty/modem handoff was traced to a kernel change by its reporter, and this is not claimed as its fix.

Users' reports

38. Three defects from users' reports, 2026-10-07

Three issues came in with their own measurements, two of them with the fix; what follows is what was taken from them, checked against the code, and what the release carries.

38a. A read past the end of the eMMC never returns (#43, #52, #65)

Every installer probes the free region for an existing mu300root with three tiny reads of its superblock: dd if=/dev/block/mmcblk0 bs=1 skip=$((OFF + 1080)) count=2, where OFF is the first 2 MiB boundary behind the last partition, and once more at the fixed offset of the first releases, 27762098176. On the F50 of #65 the partition table ends 2 MiB before the end of the eMMC (61079552 sectors, the last partition ends at 61075456), so the first boundary behind it is the end of the disk, the last boundary before the backup GPT lies before it, and region_probe's arithmetic gave a region of -4 MiB (the same number issue #32 had seen) whose superblock starts 2 bytes past the last sector. The eMMC driver of this device never completes a read past its end: the dd stays runnable at 100 % of one core, survives kill -9, and every retry adds another one - four of them held the SoC at 97 °C in #65 until a reboot. #52 (the Magisk installer, OpenWrt to the card) showed the same dd at byte 31272731704, which is that very offset; #43 had pinned the installer's silence to region_find_existing without seeing why. The legacy offset is the same trap on the 32 GB variant: it lies beyond that eMMC altogether and was read all the same.

Fixed in tools/storage.sh (region_find_existing, which install.sh and the Magisk installer share, and region_on_disk, which the probe loops of uninstall.sh and tools/reset-password.sh call), in install.ps1 and in uninstall.ps1 (RegionOnDisk): a region whose boundaries cross is an empty one (SIZE=0; the installers then offer the card or the repartitioning, as they do for any region that is too small), and a candidate superblock is read only when it lies on the disk. The SD-card installation of #52 and #65 goes through without a single read past the end. tests/test_installer.py (Region) runs the layout of #65 against the functions and checks that no dd crosses the disk's last byte.

Not taken from #65: a wall-clock limit around every device command in install.ps1, and a port of sd_release to the host side. The card is released on the device, by tools/android-install.sh, before anything is written to it (both installers run that script); the reads before it only look at the card. The limit is worth having for the day another request is lost, but it is the larger change and is not needed once nothing is read past the end.

38b. RNDIS: the port kept the bridge's address (#45)

An OpenWrt system installed with NCM (the default) and switched to RNDIS later has usb0 in its bridge section and not rndis0; the LAN hook (hotplug.d/iface/10-mu300-usb, K9/K27) puts rndis0 into br-lan on every LAN ifup. It did that after the loop that takes the early server's address off the bridge's ports, and that loop only looks at ports: rndis0 was not one yet, kept 192.168.77.1/24, and then became a port - the bridge and one of its ports with the same address, two equal routes, and the device could not reach its own Wi-Fi client nor the USB host, with the serial console the only way in. MRWOODEN measured it on an F50 (6.18, openwrt-luci, Windows without UsbNcm.sys) and sent the fix: join first, then take the address off; and after the hook's own re-enumeration of the gadget (K10) put the gadget netdevs back into the bridge, in case the rebind left one bare (with a configfs gadget the netdev is made with the function and should survive an UDC rebind, so this is a guard, not a mechanism that was seen; netifd would re-add a port it has in its configuration, usb0, and never one it never had). Applied as sent, except that only a netdev that was a port before the rebind is made one again: a user who took usb0 out of br-lan for an interface of its own keeps it that way. With the regression tests (test_early_dhcp: the RNDIS netdev that is not a port yet; the usb0 that is not a port stays out). Verified on the reporter's device: br-lan the only holder of the address, both the Wi-Fi client and the USB host served by the one dnsmasq, rndis0 still a port after the rebind.

38c. fw4 on 5.4: the boot ruleset without the LAN, and a reload that always fails (#67, #61)

AgentFan0315 took a fresh openwrt-luci on 5.4 (v2026.10.11) apart layer by layer: Wi-Fi and USB clients associate, their DHCP requests enter the kernel (an ingress counter on wlan0 climbs), and die before any rule: the live inet fw4 table has no iifname "br-lan" jump input_lan and no srcnat_wan jump, while fw4 print renders both. Two things stack:

  1. fw4 renders a zone's rules from the devices its networks have at the time. S19 firewall runs before S20 network, so at boot neither br-lan nor the modem's sipa_eth0 exists, and the LAN's input rules and the wan's masquerade are left out of the first ruleset - to be filled in by the reload that every ifup triggers (hotplug.d/iface/20-firewall). That is how plain OpenWrt works too.
  2. On 5.4 that reload fails. fw4 replaces its ruleset in one transaction (flush table inet fw4, or delete flowtable inet fw4 ft, then the table again with its flowtable ft). The 5.4 kernel refuses a flowtable that names a device another flowtable of the same table has, and it counts the one the same transaction has just deleted: that one leaves the table's list only at the commit, and 5.4's nf_tables_newflowtable walks the list without regard to the pending deletion (the check skips inactive entries from 5.13 on). flowtable ft { ... } Error: Resource busy, the whole transaction is rejected, and the S19 ruleset stays. The flowtable exists from S19 on because the earlyusb zone names usb0, which init has made by then, and fw4 puts every zone device that exists into ft (a device without a /sys/class/net entry is left out, see openwrt/patches/fw4-sipa-offload.patch; that is what makes naming br-lan and sipa_eth0 in the zones safe at S19). The first ruleset is therefore the one with the flowtable and without the LAN, and nothing after it can replace it. Deleting the flowtable on its own (nft delete flowtable inet fw4 ft), in a transaction that is committed before the reload, is enough: the reload then creates it afresh.

So the LAN had no DHCP, no LuCI and no NAT on every boot of a 5.4 openwrt-luci, which is also what #61 reports (installed with 5.4 and the panel: detected as a USB network, "no ssh and no webui", Wi-Fi visible but nothing connects; the serial console at ttyGS0 is the way to mu300-next-boot android in that state). The mainline kernels update a flowtable in place and were never affected, which is why the maintainer's own tests (31, 35, on 6.18 and 7.2) did not see it.

Two fixes, both in openwrt/overlay:

  • uci-defaults/90-mu300 names the devices of the lan and wan zones (br-lan, sipa_eth0) next to their networks, once, on every system (the reporter's workaround, the pattern of the earlyusb zone): the S19 ruleset is complete whatever the reloads do. Verified by the reporter across reboots.
  • hotplug.d/iface/19-mu300-fw4, on a 5.4 kernel only, deletes the stale flowtable right before 20-firewall's reload, under the same conditions 20-firewall reloads on: an ifup of an interface that is in a zone. The reload succeeds; the offloaded flows of the moment take the ordinary path until the flowtable is back.

Not covered by those two on 5.4: a reload that is not an ifup's - the firewall saved in LuCI, fw4 reload or fw4 restart by hand, a package's reload (PassWall2, #95), and mu300-vpn's own /etc/init.d/firewall reload after it adds the tunnel to the wan zone. Since #95 the flowtable is deleted from fw4's own path: openwrt/patches/fw4-old-kernel-flowtable.patch makes /sbin/fw4 delete inet fw4 ft in a transaction of its own before start/reload apply the ruleset and before restart checks it, on kernels before 5.13 only. Turning software flow offloading off is no longer needed for that; it would cost the fast path on the one kernel that has none other.

38d. Reports that were already fixed, or are not defects

  • #20 (soft lockup in sipa_dele, get pd fail ret = 1 at 149 lines a second, 6.18.54 of 2026-09-28): the vendor loop that retried pm_runtime_get_sync() every millisecond and took its 1 (already active) for a failure - §31f, fixed on 2026-10-05 and in v2026.10.11's 6.18 bundle.
  • #64 (IPv6: relay or NAT66?): both, on purpose. The openwrt-luci system relays the carrier's RA and DHCPv6 to the LAN (clients get public addresses from the bearer's /64) and masquerades v6 egress through the device's own address (masq6, 91-mu300-luci, K30), because the carrier routes one address per bearer and replies to a client's public address would otherwise not come back; ndp-learn routes the /64 to br-lan for the same reason. The masq '1' of the wan zone is IPv4 only (fw4's masq6 is the v6 one). Plain OpenWrt keeps extend and neither.

38e. Relay IPv6 after the carrier renumbers (#87)

Reported on a carrier that gives one /64 by RA on sipa_eth0 (dhcp.lan ra and dhcpv6 relay, a second OpenWrt relaying behind the device): after the carrier's /64 changes, LAN clients keep addresses from every earlier /64, and IPv6 over the relayed public addresses fails (connections hang) while NAT66 from the ULA works; ifdown/ifup of wan brings it back for a while. Read in the code, not measured on a device:

  • ndp-learn routed one /64 to br-lan: the first sipa_eth0 global address /proc/net/if_inet6 listed. A PDP re-activation that mu300cell-v6.sh rides out without an ifdown (+CGEV, refresh_bearer) leaves the old SLAAC address on sipa_eth0 beside the new one (only setup and teardown flush; the carrier measured in mu300cell.sh gives infinite lifetimes), so after such a renumber the LAN route could stay on the old /64 while odhcpd relays the new RA and clients SLAAC in the new one: every NAT66 reply to them left by the bearer. A wan restart flushes the old address, which matches the report. Fixed: ndp-learn routes every /64 the bearer holds and drops the route of one that left.
  • Nothing withdraws an old /64 from the LAN. odhcpd in relay mode forwards the upstream RA's prefix options with their lifetimes as they are (it only rewrites the L, A and P flags, the source link-layer address, DNS and MTU; forward_router_advertisement in src/router.c) and keeps no prefix state, and the carrier sends nothing for a prefix of a previous PDP context. Clients keep such addresses for the lifetime the carrier gave, and a client that picks one as its source gets no NAT66 replies once the /64 has left the bearer (no route to br-lan). A deprecating RA (preferred lifetime 0) for the old /64 has to come from the device itself. Fixed: ndp-learn sends one with ra-deprecate (ucode, raw ICMPv6 socket; ucode-mod-socket in the panel image) on br-lan, valid lifetime 2 h (the floor RFC 4862 lets a host apply), router lifetime what is left of the carrier's router, in three rounds 10 s apart. It waits until a different /64 is on the bearer: a WAN restart flushes the bearer and usually gets the same /64 back, which must not be deprecated. Measured on an F50 (openwrt-luci, 6.18; a macOS client on the USB LAN): a /64 that left the bearer was withdrawn within one round and the client marked its addresses deprecated (ndp -p: pltime 0, vltime 7200) while the live /64 stayed preferred and the default router stayed; a WAN restart that got the same /64 back withdrew nothing. Not measured: a real carrier renumber (the carrier here kept its /64 across WAN restarts), and a second relay behind the device, which forwards the RA like any other.

40. One stuck AT command wedged the control panel

Report (U30 Air, openwrt-luci, v2026.10.18): an AT command hung on one of the panel's pages; after that the whole panel was useless, also after a reboot, and later it came back by itself. The dashboard's battery tile, which needs no AT at all, stayed empty. The logs of that boot were in RAM and gone.

What could do that, measured on the U30 Air (2026-10-11):

  • mu300-at's lock wait was ten times longer than asked. It counted 0.1 s naps with sleep 0.1 || sleep 1, and OpenWrt's /bin/sleep refuses a fraction (sleep: invalid number '0.1'), so every nap was a second: MU300_AT_LOCK_WAIT=1 took 10 s on the device, the panel's 5 s wait 50 s, the 12 s of every collector and lock read two minutes, mobile-data's 90 s a quarter of an hour. rpcd ends a call at 30 s (rpcd -t 30) and the browser at 20 s (LuCI's rpctimeout), but the client went on waiting, took the lock long after nobody wanted the answer, and sent the command anyway. The wait is now seconds on the clock (MU300_AT_LOCK_WAIT=0 is one try).
  • Requests that read the modem inline. lock_get read eight AT commands inside the request whenever there was no cache - after every reboot, since the cache is in /run, and the home page asks at once. signal ran a collector round inside the request, and a collector waited each command's whole budget (T + 31 s) on each of four channels. rpcd killed the call, never its children: they ran on, held the pool slots and the nr1 lock, and the page started new ones. Now lock_get serves the cache and reads in the background (one reader at a time), and a collector round has a deadline (14 s for the page's live read, 12 s and 25 s in the background).
  • One slow call blanked the page. LuCI sends the calls a page makes in the same moment as one HTTP request, and uhttpd answers them one after the other: the status snapshot (battery, CPU) waited behind the lock reading, and when the browser gave up at 20 s every call in the request failed together. uhttpd's max_requests 3 does not apply to /ubus (measured: a fourth call was answered at once beside three slow ones). Every panel call now goes on its own (nobatch), and the polls back off after failures.
  • After a reboot the panel asked for the lock state with no cache, while mobile-data's bring-up and the boot replay of saved locks (an SFUN restart) held the modem; with the ten-fold waits above that is minutes of busy channels, which fits "even after a reboot, then it came back by itself".

Reproduced safely: the nr1, nr6 and nr7 daemons stopped (SIGSTOP; never a restart, see 13b) for 150 s. With the fix, sysinfo and status answered in 0.5 s throughout and the dashboard showed battery and CPU within seconds of a reload, the AT terminal said "busy" after 3 s, lock_get fresh served the cache after 12 s, signal gave up at 14 s, at most three collectors were alive at any time, and everything was back by itself once the daemons ran again.

Also in the fix: AT commands that take minutes or change the modem beyond the answer need a confirmation in the terminal (scans run as a background job of at most three minutes; band, mode and cell locks are said to persist into Android, #96); a client holding the AT lock past the deadline it wrote for itself (lock/until) is ended. The panel keeps a log of its calls - method, time taken, outcome, never a value - in RAM, copied to /etc/unisoc-modem/panel-ops.log at most every five minutes and at shutdown, with the previous boot's copy beside it (Device page, "Recent modem operations"). Two LuCI status pages are put in front of: Channel Analysis scans as soon as it opens and on every poll, and a scan takes this driver's access point off its channel (a Mac on the hotspot did not rejoin), so with an access point it waits for a click; System Log reads 250 lines every 15 s instead of 1000 every 5 s (the ~19 s AT round trips seen with it open were not reproduced: one 1000-line log read costs 0.02 s here).

A second per AT command on OpenWrt (fixed). OpenWrt's /bin/sh refuses a fractional read -t too ("read: invalid timeout"), so mu300-atd drained a whole second before every command: every AT command took about a second and the panel's fast collector round seven. The daemon now runs itself again under a shell that takes fractions when its own does not: the static busybox next to it (/opt/mu300/bin/busybox ash), else bash. On Ubuntu, dash already hands over to bash 5, which takes them, so nothing changes there. mobile-data and mu300-nfc nap through the static busybox's sleep as well (bash has no sleep of its own, and /bin/sleep refuses "0.2": mobile-data's lock polls waited whole seconds, and mu300-nfc's bare sleep 0.2 did not wait at all). Measured on the U30 Air, before and after a reboot onto the change (mu300-at -t 2 AT+CSQ, five in a row on each panel channel; a cell fast round):

nr1 nr6 nr7 fast collector round
before (/bin/sh) 1.04 s 1.04 s 1.04 s 7.37 s
after (busybox ash) 0.13 s 0.13 s 0.13 s 1.08 s

(The first command on each channel after the boot still takes a second: nothing has ended cleanly yet, so the first drain is the slow one, by design.)

Security

41. The vendor daemons' own account

Found on an F50 (Ubuntu 24.04, kernel 7.2.9): /dev/disk/by-partlabel/nr_fixnv1_a (the modem's calibration NV, which nothing can restore) and persist were ubuntu:ubuntu 0660, so any process of the login user could overwrite them without sudo; /dev/data0_gnss and /dev/mali0 were 0666, and so were spipe_pm*, ion, dma_heap/*, ... where the kernel has them. modem_control and refnotify ran as ubuntu too: the login user could ptrace them (modem_control keeps CAP_CHOWN and CAP_BLOCK_SUSPEND, refnotify CAP_SYS_TIME).

  • Cause: gen-ueventd-perms.py translated Android's ids as numbers. Android's system is uid 1000, and uid 1000 is the first human account on a distribution (ubuntu; alarm on Arch). Modes were taken over as they were, 0666 included.
  • The number is in the binaries. Both daemons begin main with switchUserToSystem: setgroups (1000 1001 2000 3010), prctl(PR_SET_KEEPCAPS), setuid(0x3e8) (an immediate in the code, mov w0, #0x3e8), then capset down to what they keep. They never call setgid (they ran with gid 0) and nothing else checks the uid (getuid is not even imported). A failed setgroups or setuid is logged (setgroups failed, uidset failed) and they carry on.
  • Fix: a system account mu300vnd (the images: rootfs/assemble.sh, arch/build-rootfs.sh; a system without it: android-vendor-start makes it before anything else uses it). android-run starts the two daemons as it with setpriv: no other groups, no new privileges, and only the capabilities they keep on Android plus CAP_SYS_CHROOT for chroot, which their own capset drops - their setuid(1000) then fails, harmlessly. android-vendor-start starts modem_control through android-run (still an exec, so the task name stays modem_control). cp_diskserver never switches users on Android either and stays root.
  • ueventd-perms.sh: system and radio become mu300vnd (owner $V, group $VG), graphics on a node Android gives everyone (mali0, ion, dma_heap/*, sprd_dmabuf, pvr_sync: 0666) the video group (root:video 0660), anywhere else root, as is every other Android id and every id the generator does not know. No node is left with bits for others, nothing is writable by everyone, a node that is root's alone is 0600. Root's alone: input events, the USB serial console ttyGS* (getty and login hand it out as on any Linux: a serial login still works) and firmware_class's path (whoever writes it chooses the firmware the kernel loads) - all three were ubuntu's. The RTC stays root's but is the vendor group's: refnotify opens /dev/rtc0 (root:root 0660), which it reached through gid 0 before ("RefNotify open /dev/rtc0 failed, error: Permission denied" until it was). The ids are looked up when the script runs, in /etc/passwd and /etc/group; without the account (OpenWrt, the initramfs: no account at 1000 there) it is uid/gid 1000, which the daemons switch to themselves, and the GPU's group is root.
  • Nobody gains anything: tests/test_vendor_ids.py applies the script of v2026.10.18 and the new one to every node they name (a glob as one name) and fails if ubuntu, a second login user in the usual groups (video, render, input, dialout, ...) or everyone else can do anything with a node they could not before. 333 of 349 nodes changed; the only one more open is the RTC, for the vendor group (it was not touched before).
  • The generator's inputs are in android-vendor/ueventd/ now (the /dev rules of the device's ueventd.rc and the chown/chmod lines of its vendor init *.rc), and a test checks the committed script is the generator's.
  • Updates: mu300-update takes the new image's /etc/passwd and adds the old system's human accounts, so an updated system has the image's mu300vnd; the nodes are handed out by name at every boot, so its uid does not matter.
  • Measured on F50-B (Ubuntu 24.04, 7.2.9, no SIM), the three files replaced on a v2026.10.18 system: the account made at boot (mu300vnd 999/991); modem_control and refnotify Uid 999, Gid 991, no groups, NoNewPrivs 1, CapEff 0x1000000001 and 0x2000000 (as on Android); cp_diskserver root; the modem booted (modem@0..2 start over), AT OK, +CFUN: 1, +CPIN +CME ERROR: 10 (no SIM, as before), AT+CGMR answers; nr_fixnv1_a and persist mu300vnd:mu300vnd 0660 and head on them as ubuntu "Permission denied"; no world-writable node in /dev besides the standard ones, nothing in /dev or /sys owned by uid 1000; mali0 root:video 0660 and cltest (OpenCL) passes; Wi-Fi client still connected; ttyGS0, input/event0 and the firmware path root:root 0600, and a login on the serial console works (login gives ttyGS0 to the user, getty takes it back); timedatectl reads the RTC; up past the PM watchdog's ~290 s. The vendor log has the same errors as before the change (no /dev/cp_dump, no /proc/bootconfig, no property service) plus the two logged failed switches. Not measured: the 5.4 kernel, OpenWrt (unchanged there but for the modes), the modem with a SIM.

41a. OpenWrt with shadow-useradd: the modem's nodes the vendor account's, the daemons uid 1000 (issue #314)

Reported by Xiaol1n173 (F50, OpenWrt 25.12.5, v2026.10.17.3, 7.2.11): the modem never started - run_state: 255, every SIPC sbuf state: 0, mu300-atd gave up waiting for /dev/stty_nr4, modem_control at 100 % CPU as uid 1000 with EACCES on /dev/modem, /dev/pmsys, /dev/chsys, /dev/trusty-ipc-dev0 and the nr_* partitions, all 999 0660. shadow-useradd was installed (nothing needs it).

  • Cause (confirmed in the code and on F50-C). Three scripts each decided on their own who the vendor daemons are (§41). android-vendor-start made mu300vnd wherever useradd exists; ueventd-perms.sh gave the nodes to mu300vnd wherever /etc/passwd has it; android-run started the daemons as it only where command -v setpriv finds one, else chroot as root, after which the daemons setuid(1000) themselves. OpenWrt has no util-linux setpriv, so with shadow-useradd the nodes went to 999 and the daemons ran as 1000. (Where busybox has its setpriv applet, which has no --reuid, command -v found it and the exec setpriv --reuid=... failed: no modem_control at all.)
  • Fix. One decision, android-run's: the vendor account is used only where it exists and setpriv can start a program as it (setpriv --help names --reuid: util-linux's does, busybox's does not). android-run --switches says whether it can, android-run --user prints the account it starts modem_control/refnotify as (nothing: they switch to 1000). android-vendor-start makes the account only where useradd exists and android-run --switches succeeds, and passes android-run --user to ueventd-perms.sh as MU300_VENDOR_USER; empty means uid/gid 1000 even where mu300vnd exists (the reporter's board keeps the account its earlier boots made). ueventd-perms.sh run without the variable (the initramfs' copy) looks mu300vnd up by name as before. Ubuntu and Arch (util-linux setpriv, the account in the image) are unchanged.
  • Test. tests/test_vendor_ids.py (OneDecision): for every combination of account (there or not), useradd (there or not) and setpriv (util-linux's, busybox's, none) - on a PATH without this machine's own - the uid ueventd-perms.sh gives the nodes after the account block is the uid modem_control runs as; 999 only with util-linux's setpriv; no account is made that nothing would run as. Nine of the twelve combinations failed before.
  • Measured. F50-C (OpenWrt 25.12.5, vendor kernel 5.4.254, this tree's scripts of main): shadow-useradd installed (the release's package, offline), one reboot: useradd made mu300vnd 999/999 at boot, /dev/modem, /dev/pmsys and nr_modem_a's node 999 999, modem_control and refnotify uid 1000 (modem_control at 587 % in top), cp_diskserver root, run_state: 255, refnotify logging "open /dev/spipe_nr8 failed, error: Permission denied" every second, mu300-at no answer. About five minutes into that boot the board went off the bus (the PM watchdog §v9 cuts power when modem_control never loads the PM firmware). F50-B (Ubuntu 24.04, 7.2.11, mu300vnd 999/991 in the image) with the three new scripts: android-run --user mu300vnd; after a reboot the nodes 999 991, modem_control/refnotify uid 999, run_state: 1, +CFUN: 1 (as before). With /usr/bin/setpriv moved away (the reporter's situation: the account there, no setpriv): android-run --user empty; after a reboot the nodes 1000 1000, the daemons uid 1000, run_state: 1, +CFUN: 1. Ubuntu's busybox applet as setpriv (setpriv: unrecognized option '--reuid=0'): --switches 1, --user empty. F50-B restored to its release scripts and setpriv afterwards (999, modem up).

42. No access point on a DFS channel (user report, 2026-10-11)

A user's SC2355 device on OpenWrt 25.12.5, hotspot on channel 60 (5 GHz, 80 MHz, country CN): hostapd logs start_dfs_cac() failed, -1, Interface initialization failed, AP-DISABLED, and the hotspot never comes up; channel 149 works.

  • Cause. 52-64 and 100-144 are DFS channels in every regulatory domain (wireless-regdb flags them DFS, the kernel radar detection; a few countries also have 36-48 or 149-165 so). An access point there must first listen for radar (CAC); hostapd asks the driver through NL80211_CMD_RADAR_DETECT, and cfg80211 answers -EOPNOTSUPP when the driver has no start_radar_detection op. Neither SC2355 driver has one: not sprd_cfg80211_ops (common/cfg80211.c) nor the sc2355 ops (sc2355/init.c) of upstream/modules/sprd_wlan_combo, and not the vendor tree the 5.4 module is built from. No interface combination of the wiphy carries radar_detect_widths either. The firmware does define the commands - CMD_RADAR_DETECT (77) and EVT_RADAR_DETECTED (0xA1) are in sc2355/cmdevt.h and the API version table - but nothing in the driver sends or handles them. (The vendor tree's merlion driver, another chip, implements start_radar_detection over the same command number 77, in 11h.c; a port to the sc2355 would need its CAC and radar events measured against real radar before it could be offered.) Android's SoftAP never uses these channels either: its ACS list is 36-48 and 149-165 (§23).
  • Decision. The hotspot never goes onto a DFS channel; nothing tries to make DFS work. Every layer that picks or writes the channel keeps it off them, and a DFS channel is replaced, never refused, so the hotspot does not stay down:
    • opt/mu300/lib/wifi-channels.sh (shared by the tools below): the firmware's channels a country allows without DFS and without NO-IR, from wireless-regdb's db.txt - the full 36-48 + 149-165 except in about 70 countries (no 149-165 in TR, JP and much of Europe's neighbourhood; no 36-48 in BD, PK and a few more; no 165 in ID; none at all in the world domain 00 and five countries, which use 2.4 GHz). The default is 36, else 149; the width is 80 MHz where the block of four is allowed (36-48, 149-161), 40 for a pair, 20 for 165.
    • Ubuntu hotspot-start: CHANNEL= from hotspot.conf goes through it (a DFS channel becomes the default with one line on stderr, in the journal; auto is the default); when the kernel's flags (iw list) still refuse the channel it tries the country's other channels before falling back to 2.4 GHz (it used to fall back at once).
    • OpenWrt openwrt-wifi-config: the first configuration from hotspot.conf writes the resolved channel, the width as VHT80/40/20, channels (the country's list, hostapd's chanlist for ACS) and acs_exclude_dfs 1. At every later boot it rewrites a DFS channel set in LuCI to the default (the htmode narrowed to what fits), so LuCI shows the channel the hotspot really uses. mu300-wifi-band 5 writes the same. The Android import keeps writing CHANNEL=auto.
    • wifi-scripts (openwrt/patches/wifi-scripts-no-dfs.patch, applied by openwrt/build-rootfs.sh with --fuzz=0 like the fw4 patches, the build stops if it no longer applies): hostapd.uc reads the capability from the driver - no interface combination with radar_detect_widths - and for such a driver, on 5 GHz, an explicit channel the kernel flags radar becomes 36, else 149, else the first allowed one, with the width narrowed to what the allowed channels hold (160 becomes 80), and a wifi-scripts: channel 60 is a DFS channel and this driver cannot detect radar ... line in logread; auto gets acs_exclude_dfs=1. This is what catches a DFS channel chosen in LuCI's Network > Wireless before the next boot. Drivers that can detect radar are untouched.
  • Not changed. LuCI's channel list still offers the DFS channels: luci-mod-network marks a channel unavailable only when iwinfo reports it restricted (NO-IR without radar), and iwinfo does not report radar at all; hiding them would mean patching LuCI's own (minified) page. The driver is not changed either: the only ways to make cfg80211 refuse an AP there (clearing IEEE80211_CHAN_RADAR would let an AP start without CAC, which is not allowed; marking the channels disabled would cost the Wi-Fi client its DFS networks) are worse than the user-space guard. The Wi-Fi client (wifi-client) still joins networks on DFS channels: radar detection is the access point's job.
  • Tested (tests/test_wifi_channels.py): the table, the replacement and its one line, auto, the widths, under dash, bash and busybox ash; hotspot-start's hostapd configuration with a stub iw; openwrt-wifi-config and mu300-wifi-band with a stub uci, and again with the real uci and ash of the v2026.10.18 openwrt-luci rootfs; and, with MU300_WRT_IMAGE naming an OpenWrt 25.12 image, the patch applied to the feed's wifi-scripts (OpenWrt 25.12.5, ImmortalWrt 25.12.2 and the v2026.10.18 rootfs) and the hostapd configuration they generate for a fake wiphy with and without radar detection. Not yet on a device: the hotspot on 36 after LuCI was set to 60.
  • ACS on this driver, and a channel list off its band (#424, U30 Air, v2026.10.28.1, 6.18.59): ACS works (auto: ACS-COMPLETED freq=2412 channel=1 within 2 s on 2.4 GHz, HT20 and HT40; 36 on 5 GHz with the list). But the channels list openwrt-wifi-config writes for 5 GHz stayed when LuCI changed the band to 2.4 GHz with auto: hostapd got chanlist=36 40 44 48 with hw_mode=g, said ACS: No available channels found and the access point never came up. The same patch now drops list entries that are not on the radio's band (device_chanlist_band(), a range when either end is off it), with one wifi-scripts: channel list: ... not on the 2g band, left out line, and the whole list when nothing is left, so ACS uses the band. Tested in the 25.12.6 feed's scripts for a fake wiphy (tests/test_wifi_channels.py) and on the device.

43. adb over USB to Linux: adbd in the gadget, and what FunctionFS does to the rest of it

mu300-usb adb on|off (off by default) puts AOSP's adbd into the USB gadget next to the network function and the ACM console: adb shell, push, pull, forward from a computer, as with Android.

Update 2026-10-13: adb is on by default now, and adbd lets every computer in unless it is told to take keys only (mu300-usb adb auth open|keys): §70. What this section says about the daemon, the gadget and FunctionFS stands; "off by default", "auth_required = true on Linux, always" and "no setting that turns the check off" do not.

Which adbd. Ubuntu 26.04 (not 24.04) packages Debian's adbd 34.0.5, but Debian patches it to require no authorisation at all on Linux (adbd-don-t-require-authorization-on-Linux.patch) and it listens on TCP 5555 when it finds no FunctionFS: a root shell for anyone on the LAN and the hotspot. It is also glibc-only. Alpine's and nmeum's android-tools build the host tools, not the daemon. So tools/adbd/build.sh builds it: the daemon's sources from nmeum's android-tools 34.0.5 release tarball (AOSP with BoringSSL vendored; SHA-256 pinned), a CMakeLists of its own for adbd alone, static against musl in Alpine 3.20: one aarch64 binary of 2.49 MB (stripped) for Ubuntu and OpenWrt, built in under two minutes, shipped in the images (/opt/mu300/bin/adbd). JDWP, adb over Wi-Fi (pairing) and mDNS are stubbed out (stubs.cpp), and protobuf with them. mu300-adbd.patch:

  • auth_required = true on Linux, always (ro.adb.secure=1). Keys come from /etc/mu300/adb_keys and /root/.android/adb_keys only; Android's framework socket, through which the "allow USB debugging?" dialog approves a key, is never taken (it would come from the environment, ANDROID_SOCKET_adbd). An unknown key gets unauthorized and stays there.
  • USB only: FunctionFS on Linux (Debian's patch), and no TCP or vsock listener whatever the properties or the environment say (ADBD_PORT); without FunctionFS adbd exits.
  • umask 022 instead of 0, and pushed files keep the computer's mode without group/other write (Android copies the owner's bits to group and others: a pushed file was rw-rw-rw-).
  • adb shell without a command starts the user's login shell (bash on Ubuntu, ash on OpenWrt), TMPDIR=/tmp.
  • musl: UsbFfsConnection::StopWorker waited for pthread_kill(t, 0) to say ESRCH, which musl does not for a thread that has exited but is not joined; adbd hung for good at the end of the first USB connection (an unbind, a computer that goes away). The worker now says when it is done.

The gadget. ffs.adb is the third function of configs/c.1 (f3): the network and the console keep their interface numbers (macOS' NCM, Windows' RNDIS binding by MS OS descriptor for interface 0). VID/PID stay; adb finds the interface by its class (ff/42/01). While adb is in the gadget, bcdDevice is 0x0303 (0x0304 with RNDIS), as Windows caches MS OS descriptors per VID/PID/bcdDevice, and the descriptors are on with NCM/ECM too, so that adbd's WINUSB compatible ID reaches Windows (not tried on Windows: the Windows host was not reachable).

boot/init makes and binds the gadget before any system runs; adbd comes later, so mu300-adbd run (the mu300-adbd service, systemd and procd) rebinds once: it starts adbd, waits for its descriptors (ep1 appears), unbinds, links f3, binds again. FunctionFS needs the descriptors before the bind and refuses a bind without them, so a gadget that will not bind with adb is bound without it. Two kernel behaviours shape the rest:

  • ffs_closed() calls unregister_gadget_item() - the whole gadget comes off the UDC - whenever the last file of a bound FunctionFS instance is closed, and adbd closes and reopens its endpoints at the end of every connection. Android's init binds the gadget again (sys.usb.ffs.ready); here the loop of mu300-adbd run does, after five seconds (mu300-usb-reset and OpenWrt's LAN hook unbind on purpose and bind again themselves), not in the U30 Air's host role.
  • adbd closes and rewrites its descriptors every second while no bind comes (timed out while waiting for FUNCTIONFS_BIND); a bind in that gap fails, so binds are retried 0.2 s apart.

Measured on F50-B (Ubuntu 24.04, 7.2.9 with CONFIG_USB_CONFIGFS_F_FS=y, macOS host, adb 37.0.1): adb devices shows MU300LINUX-324950664950-203d8329 (Android's adb on the same board is 324950664950); with no key authorised and with the key file taken away, unauthorized ("adb: device unauthorized"); with the key, adb shell is root with a login bash on a pty, push 38.7 MB/s and pull 41.9 MB/s (20 MB, checksums equal), adb forward works. mu300-usb adb on/off, three boots with adb on (NCM, RNDIS, NCM) - with RNDIS a Mac has no network but adb works, a way in that does not need the network - the gadget unbound by hand (as FunctionFS does it): adb and SSH back after 6-8 s; mu300-usb-reset --ready: adb stays. adb off leaves the gadget as boot/init made it (bcdDevice 0x0301, no MS OS descriptors, no FunctionFS mount). Not tried: OpenWrt, the vendor 5.4 kernel, a U30 Air being unplugged and plugged again, Windows.

How the hang showed: echo disconnect > /sys/class/udc/*/soft_connect (meant to look like an unplug) ended adbd's connection, and adbd hung in it, holding its endpoints: FunctionFS never took the gadget off the controller, the loop saw it bound and had nothing to do, and the pulled-down gadget stayed off the bus until the board was unplugged (its root port on the Mac cannot be power-cycled). Without adb a soft disconnect stays too, until echo connect; with the fixed adbd it was not tried again.

Network namespaces on the vendor kernel

44. Network namespaces on 5.4: the vendor's fragment sysctl, torn down by the wrong namespace (#103)

Reported with four boots' worth of pstore on an F50 running OpenWrt on 5.4 with Docker (two containers, restart=always) and a Codex sandbox: about 25 s after boot a WARNING in retire_sysctl_set from cleanup_net, then within a second a fatal exception in an unrelated process in __kmalloc, or on the netns worker itself:

Workqueue: netns cleanup_net
pc : count_subheaders+0x18/0x74
lr : unregister_sysctl_table+0x28/0xa8
 xfrm_sysctl_fini+0x34/0x50
 xfrm_net_exit+0x18/0x50
 cleanup_net+0x2e4/0x54c
Kernel panic - not syncing: Fatal exception

and, after a sandbox command finished, kernel BUG at mm/slub.c:308 (a double free) in kfree from the same xfrm_sysctl_fini.

Cause, in the vendor tree (net/xfrm/xfrm_sysctl.c, under CONFIG_XFRM_FRAGMENT, a Unisoc option - "only for sprd" says its Kconfig; it is not upstream, and linux-5.4.y has not changed this file since 2017, so no stable fix exists to take). The option adds a net/core/enable_xfrm_fragment sysctl, a global switch for fragmenting before ESP, and registers it with a second ctl_table_header whose pointer, and its kmemdup'd table, live in two static variables. xfrm_sysctl_init() runs for every network namespace and overwrites both; xfrm_sysctl_fini() runs for every namespace and unregisters and frees whatever they point at, without clearing them. With one namespace at a time the globals happen to track it. With two alive - Docker's containers, dnsmasq's, a sandbox - the first to exit unregisters and frees the newer namespace's registration and leaves its own behind in a dying namespace (retire_sysctl_set's warning); the second's exit then walks a freed header (count_subheaders) and frees the table again (slub.c:308), or the stale memory has been reused and another process's allocation goes wrong. A failed second registration also freed the first table while leaving it registered. The entry was 0660 and, unlike the four xfrm_* entries next to it, not hidden from namespaces owned by an unprivileged user namespace, whose "root" has CAP_NET_ADMIN over them: a global kernel switch writable from unshare -Urn.

Fix (kernel/patches/xfrm-sysctl-fragment-per-netns.patch, the reporter's candidate taken as proposed): the entry becomes the fifth member of xfrm_table, so each namespace's copy is registered and torn down with that namespace's own net->xfrm.sysctl_hdr, exactly like the four upstream entries; the second header, its table and their error path are gone. The switch stays one global int with default 1, get_xfrm_fragment() (used by the ESP output path) is unchanged, so are the path and the mode. One visible change: the entry now follows the table's rule and is absent in a namespace of a non-initial user namespace (unshare -Urn sees no enable_xfrm_fragment; the host's stays 1). No struct changes, so the module bundle is unaffected.

Reproduce (unpatched 5.4; do it on a board you can reboot, the panic is on teardown and takes the kernel with it): two namespaces have to be alive at once, so for i in $(seq 200); do unshare -n true & unshare -n true; wait; done - or simply starting Docker with two containers - and the warning, then the panic, follow within a few iterations after the netns worker runs. unshare -n true in a single-threaded loop does not trigger it (one namespace at a time keeps the globals consistent), which is why a plain namespace test can pass on the broken kernel. The reporter's patched kernel passed 460 lifecycles (sequential and four-way parallel) and 10 sandbox runs on an F50 across two boots with no recurrence; our build of the patch (release config, ThinLTO) is in PR for #103, with the loop above to run on our F50 before the release.

45. rmmod sprd_wlan_combo panicked in __run_timers (issue #146)

Found on the U30 Air during the #123 test (7.2.9, also on main): with Wi-Fi idle (wifi down, OpenWrt), rmmod sprd_wlan_combo panics in __run_timers within a second. Not a timer that one deinit forgot: the port's platform remove tore nothing down. The vendor's sprd_wlan_remove (common/sprd_wlan.c) ends in return sprd_iface_remove(pdev); the mainline port dropped that line with the SC2332/SIPC variants, so remove logged one line and returned. The module was then freed with the recovery watchdog of PR #100 (iface_wd.tick, a delayed_work in the module's .bss, on system_wq, rearming itself every second) still armed, and with the wiphy, wlan0, the WCN reset notifier, the misc device and the inetaddr notifiers all still registered on the freed priv: the watchdog's timer is the first to go off. The vendor 5.4 driver still has the call (and no watchdog), so only the mainline module was affected.

Fix (upstream/modules/sprd_wlan_combo):

  • sprd_wlan_remove calls sprd_iface_remove() for the PCIe variant again: watchdog stopped first, the chip powered on for the close commands, the notifiers, the interfaces and the wiphy unregistered, the chip powered off, TX/RX torn down, priv freed.
  • sprd_iface_remove no longer returns on a failed WCN power-on with everything still registered: a platform remove cannot refuse, the device is unbound and the module freed either way. The power-on only fails from a count of 0 (no interface open), so the teardown goes on without the chip and skips the power-off that would have balanced it.
  • Two timers that live in priv and had no owner where priv is freed: the scan timer (timer_shutdown_sync in sprd_core_free; a scan still running is reported done by iface_deinit_vif, which deleted it, but nothing did so unconditionally) and the TCP ACK timers (sc2355_tcp_ack_deinit used del_timer under the seqlock the callback takes, so a timeout running on another CPU could outlive the deinit; a timer_shutdown_sync pass after the lock is dropped waits for it).

Built for 6.18.56 and 7.2.10 (modules only). Device test: see the PR for #146.

46. SMS sends failed with IMS "Busy Everywhere" until the SMSC was written back; the panel lost slow sends (#176)

Reported on openwrt-luci v2026.10.20, China Broadnet (PLMN 46015), U30-class board (UMS9620): every send from the panel to the carrier's service number failed, incoming messages worked. The modem's URC log had +SPIMSREASON: 1,512,"SMS FAILED: CODE:600 REASON:Busy Everywhere" (the IMS stack's SIP 600 on the submission), and the panel's operations log sms_send - killed. The reporter's one-shot test through the same mu300-atd, with two changes made together, succeeded at once (+CMGS: 1, OK, and the service answered within seconds):

  • AT+CSCA? answered "2B38...",145 (the modem's CSCS is "HEX", so the address reads as hexadecimal: +86...), and that exact string and type were written back with AT+CSCA="2B...",145 - the same value, not another SMSC, and CSCS left alone. What this puts right inside the modem is not known; SMSC state after the IMS registration is the guess. Only OK counted.
  • the whole send (CSCA, AT+CMGF=0, AT+CMGS) ran under one acquisition of mu300-at's client mutex (/run/mu300-at/lock). mu300-sms took it once per command, so between its commands any other client (the panel's collectors, mu300-smsd's sync) could run, and the modem's state between PDU mode and the submission was never guaranteed to be what the previous command left.

The two were changed together, so which one was decisive is not known. Both are now in mu300-sms's send:

  • at_lock: mu300-sms takes $ATDIR/lock itself, the way mu300-at does (a holder that is gone is taken over, the wait is MU300_AT_LOCK_WAIT seconds of the clock, mu300-at: busy when it gives up, so the panel's verdict is unchanged), and tells the mu300-at calls under it with MU300_AT_LOCK_HELD=<pid>. mu300-at borrows the lock only when lock/pid names that live process; anything else and it takes the lock as before. The lock is released after the submission, before the pool lock (a path holding the pool lock makes no AT call, so send and sync never wait for each other - that rule stands).
  • smsc_refresh: AT+CSCA?, the address and type parsed strictly ("[+0-9A-Fa-f]+",[0-9]{1,3}), written back unchanged. A query that fails or answers something else skips the refresh (logged on stderr), and a write the modem refuses is logged and the send goes on: the SMSC in use is the same either way, and the submission's own answer says what is wrong. Nothing ever picks another SMSC or touches CSCS.

The submission stays one write, AT+CMGS=N<CR><PDU><Ctrl-Z>, as before. Waiting for the modem's > prompt first would need a byte-wise read in mu300-atd (the prompt has no newline, so the daemon's line reads never see it; it is collected with the reply), and what read -t leaves in its variable when it times out on a partial line is not the same under every shell the daemon runs under (bash, busybox ash) and has not been measured on the device - in the one process that owns the channel, where a modem left waiting at the prompt for a PDU that never comes is a wedged channel. The reporter's successful send used the combined write too, as every send on the U30 Air has.

The panel: mu300dash sms_send ran mu300-sms inside the rpcd call, which rpcd ends at 30 s, while mu300-sms waits up to 40 s for +CMGS (and its whole transaction longer). A slow send was killed with the call - the message gone out or not, with no result anywhere but a killed line. sms_send now validates and starts the send detached (setsid mu300dash sms-job, the at_job pattern), answering started; sms_job says running and then the verdict sms_send used to give (ok/busy/Sending failed with the modem's last line) with done:1; the page asks every second. A second send while one runs is busy (the AT channel is in use), never a second submission; a job that died without a result says so and is not resent. The job logs how the send went in the operations log (sms_send result 2.31s ok), which is what the report was missing.

Device test (a U30 Air whose line answers mu300-sms send 7000 KALAN with a two-part reply): the send through /opt/mu300/bin/mu300-sms send 7000 KALAN must show AT+CSCA? and the same-value AT+CSCA= in the daemon's answer files, /run/mu300-at/lock gone afterwards, and the reply pooled; through the panel's SMS page the toast must go "Sending…" and then "Sent" with the operations log carrying sms_send ... ok and sms_send result ... ok.

The Ubuntu side, sms send (every system's SMS tool, its own send path, no pool), has the same two since: the same at_lock/at_unlock and smsc_refresh (held only when the daemon's fifo is there - without it mu300-at opens the tty itself and takes no lock either), and the submission as the same one request AT+CMGS=N<CR><PDU><Ctrl-Z>. It used to send AT+CMGS=N as a request of its own and the PDU as another: the > prompt has no line ending, so the daemon never saw an answer to the first (its whole 10 s), counted it as a silent command and drained up to 25 s before writing the PDU - and between the two any other client could get in. Device test (an F50-B with a registered SIM): sudo sms send 7000 KALAN must answer sent (reference N) within seconds, with AT+CSCA? and the same-value AT+CSCA= in the daemon's answer files, /run/mu300-at/lock gone afterwards, and sudo sms list showing the reply.

47. A system the Magisk zip added beside another had a password nobody saw (#167)

Reported as "cannot log in to openwrt-luci / openwrt" on a board that had Ubuntu first and the two OpenWrt systems added later with zips (F50-B). The one-boot image's root::: was the first suspect and a red herring: the installer always replaces that line. Found by mounting the board's Linux disk from Android and looking at the hashes without reading them: each added system's root had a proper SHA-512 hash - of a random 12-character password that mu300-install.sh's build_password made because the install was a new system (KEEP_PW=0) and mu300-install.conf had no MU300_PASSWORD. That password was written only to /data/adb/mu300-linux-password.txt, a root-only file, and shown once in Magisk's output; every later zip replaced the file, so the second added system's password was in no file at all. The ubuntu account still had the password the user knew, and the panel's mu300-os <os> switch booted a system nobody could log in to. (dropbear/rpcd refusing empty passwords was not it.) The board was recovered with tools/reset-password.sh openwrt-luci from Android, which works for an added system too.

Decision (the project owner's): the zip's password for a system it installs is fixed and well known, like the images' - Ubuntu's user ubuntu has the password ubuntu; OpenWrt's and openwrt-luci's root has no password (the empty field stock OpenWrt ships with: dropbear and LuCI let root in until one is set with passwd or in LuCI, System > Administration). No random password any more, neither for a first install nor for an added system. A MU300_PASSWORD in /data/adb/mu300-install.conf still wins when given (hashed with the bundled busybox's mkpasswd as before, for every system it installs); it is never shown or written down. An update of a system that has accounts of its own keeps carrying them over (KEEP_PW), as before; an empty OpenWrt root or an Ubuntu ubuntu that is still ubuntu counts as the images' default, not as a password to keep, so an update of such a system gets the default again (the same thing). MU300_PASSWORD_RESET=yes now means "the images' own password again".

How: build_password hashes ubuntu for Ubuntu (a fresh salt each time) and leaves the hash empty for OpenWrt; mu300-install.env gets one more line, PW_SET=1, which tells android-install.sh to put PWHASH into the system's own account even when it is empty (OpenWrt's root without a password) - PW_SET=0 is the update that keeps the accounts, and the computer installer, which never writes the key, behaves as before. android-install.sh no longer refuses a system whose account would be "empty or the image's default": those are the intended accounts now, and the mark that has mu300-update carry some <os>.old's accounts over at boot is removed whatever the path. The plan, the closing message and the note in /data/adb/mu300-linux-password.txt say which account and password work (password for root: none yet - set one with passwd, or in LuCI (System > Administration); password for ubuntu: "ubuntu"), in the three languages; the file keeps the other system's block as before, and holds no secret any more. Device test: a zip install of openwrt on a board that has Ubuntu must end with the root: none yet line, the file must note it under user: root, and ssh root@192.168.77.1 into the booted OpenWrt must log in with no password; LuCI's login on openwrt-luci likewise, and passwd there must take.

48. The stock virtual thermal zone on mainline (mu300_thermal), and thermal-guard's handoff to the kernel

Under 6.18 and 7.2 nothing in the kernel throttled the CPUs: the mainline port registers the 19 on-die sensors (sprd_thermal_r5p0, §31) and the cpufreq cooling devices (CONFIG_CPU_THERMAL), but no thermal zone had a trip point, so the two never met and thermal-guard capped scaling_max_freq from userspace (85 °C a step down, 75 °C a step up, 105 °C power-off). kanoqwq's fork (clean-tf-7.2, 5c8c2f9) brought the kernel's own throttling back with an out-of-tree module; the review of 2026-10-11 deferred it for coordination with the guard and a device test. This is that work.

What the stock device tree says (the F50's live DTB, decompiled; mainline boots the vendor DTB unchanged, §31):

  • The 19 physical zones (lit0-3, mid4-6, big7, apcpu0/1, gpu, ai0/1, ank0-5, …) have polling-delay = 0 and no trips; so have the four board NTC zones (chg, nr, pa, board).
  • One zone has trips: soc-thmzone, polling-delay 1000 ms, polling-delay-passive 100 ms, sustainable-power 3000. Trips: trip-point@0 passive 70 000 mC (hysteresis 1 000), trip-point@1 passive 85 000 (hysteresis 1 000), soc_crit critical 110 000 (hysteresis 2 000). Cooling maps, all on the 85 °C trip: cpu@0 (contribution 1024), cpu@400 (410), cpu@700 (410), and five vendor nodes under /cooling-devices (cluster0/1/2-cooling sprd,cluster-cooling; gpu-cooling0 sprd,mali-power-model; npu-cooling0 sprd,npu-power-model) that no mainline driver registers.
  • Its sensor is /virtual-sensor@0, compatible = "virtual-thermal", #thermal-sensor-cells = 1, with thmzone-cells naming eleven of the physical zones (not sensors): lit0-lit3, mid4-mid6, big7, gpu, ai0, ai1. The vendor kernel's sprd_soc_thm ("virtual-thermal") reports the hottest of them; that is the zone sprd_cpu_cooling binds the clusters to on 5.4 (§18).

(a) an out-of-tree module, or (b) the device tree and the kernel config? Mainline has nothing for (b): neither 6.18.56 nor 7.2.10 has a driver matching virtual-thermal or any aggregating ("hottest of") thermal sensor (grep -rl 'virtual-thermal\|aggregat' drivers/thermal/ is empty in both trees), and the trips cannot be moved onto a physical zone, because the kernel boots the vendor DTB as LK hands it over (a custom DTB hung in setup_machine_fdt, upstream/README.md). What is needed is a driver for that one sensor node; it can live in upstream/port/ (built in, a new Image) or in upstream/modules/ (loaded from the rootfs like the vendor modules). Chosen: the module, upstream/modules/mu300_thermal (after kanoqwq's, GPL-2.0, rewritten with the DT facts above and a probe that defers only while a physical zone is not registered yet and fails on a wrong tree): it needs no kernel image change, so no untested boot image on anyone's board; build-modules.sh builds it for both kernels and the bundles carry it; it is tested with insmod/rmmod on the release kernel; and the seconds between boot and extra-modules are covered by thermal-guard as before. The same source can become a built-in port/ driver later if that ever matters. The module is 90 lines: it looks the eleven zones up by name (thermal_of names a zone after its node, so the node name is the zone type), registers itself with devm_thermal_of_zone_register(dev, 0, ...) and returns the hottest of the zones that read; a zone that fails to read is left out of that round (one flaky sensor must not silence the zone with the cooling maps bound to it), and only when none reads does get_temp fail - then the core logs it once, skips the update (no trip is evaluated, the cooling devices keep their state) and the zone's sysfs temp read fails too, which thermal-guard takes as "cap it myself" (below). Never is an unreadable sensor reported as cold. The thermal core does the rest: the zone with its trips, the cooling maps (the five vendor cooling nodes are ignored, thermal_of_should_bind only matches a registered cooling device's node), step_wise on the passive trips, and thermal_zone_device_critical at 110 °C (hw_protection_action defaults to shutdown in both kernels).

How the kernel's cap and ours compose. cpufreq_cooling lowers a cluster through a frequency QoS request (FREQ_QOS_MAX); scaling_max_freq shows the resolved policy->max (the lowest of all requests) and writing it sets only the user request. So a profile's ceiling (mu300-cpu, /run/mu300/cpu-ceiling, PR #111) holds under the kernel's throttling without any help - the lower of the two wins, and when the kernel lifts its cap the ceiling is what is left - while mu300-cpu status reads the throttled value and reports throttling from the cooling devices' cur_state, as before. What must not happen is two controllers on one knob: thermal-guard stepping scaling_max_freq down at 85 °C while step_wise lowers the QoS at the same temperature, and later lifting a cap (ours) while the kernel still holds its own. Hence the handoff, in thermal-guard:

  • The kernel is told by its release: every 5.x we ship is the vendor kernel, which throttles and protects itself, so there the guard only runs the LED alarm (as before). "A zone has trip points" no longer means "vendor": with the module the mainline zone has them too, and on mainline the guard's 105 °C power-off must stay.
  • On mainline, every round: when an enabled zone with a passive trip at or below HOT (85 °C) has every cpufreq-* cooling device bound to it (thermal_zoneN/cdevK links against cooling_deviceM, compared with test -ef) and its temp reads a number within 15 °C of the hottest reading of the round (a zone whose sensors all fail reads nothing; a stale or zero value sits far below the die, and a kernel that sees no heat would not throttle), the kernel throttles and the guard only watches. On that transition it lifts the caps it set itself (a marker, /run/mu300/thermal-capped, set at HOT and cleared when nothing is below the ceiling; it outlives a restart, so a cap from before the module loaded does not stick for ever) back to the profile's ceiling, and leaves scaling_max_freq alone from then on. A cap that is not ours (eco's 1.5 GHz, a profile's) is left. With the zone gone (rmmod), a cluster left out of the maps, the zone disabled or its reading not to be trusted, it caps again, with a log line on each transition. Bindings alone are not trusted: the handoff would otherwise fail open.
  • The 105 °C power-off stays on mainline in both states; the kernel's own 110 °C critical trip is the second line. The LED alarm is unchanged on every kernel.

extra-modules loads the module right after the PMIC watchdog: modprobe mu300_thermal, else insmod from the bundle's directory (/lib/modules/<release>/mu300_thermal.ko on OpenWrt, extra/ on Ubuntu, where depmod may not have indexed a bundle yet); the vendor 5.4 kernel has no such file and nothing is tried. Tests (tests/test_device_scripts.py, ThermalGuard and SipaDele): the vendor kernel by release (LED only), mainline without the zone (caps, powers off), the handoff with the bound zone (no step at 90 °C, power-off at 105 °C still), a zone whose temp is missing, not a number, stale (40 °C against 90 °C sensors) or whose passive trips lie above HOT (all cap), a cluster left out, a disabled zone, no cooling device at all, the marker lifted on the handoff and after a restart, capping again when the zone is gone, and the loader's modprobe/insmod/already-loaded/failed paths; under dash, bash and (test -ef, grep -qsx on an unmatched glob checked separately) busybox ash.

Built against the release trees: mu300_thermal.ko for 6.18.56 (vermagic=6.18.56 SMP mod_unload aarch64, 9 000 bytes with BTF) and 7.2.10 (vermagic=7.2.10 SMP preempt mod_unload aarch64), no warning.

The panel. System > CPU has a read-only "Thermal" card from standard thermal sysfs (mu300-cpu status --json's new thermal array: every zone's type, temperature, trip points and the cooling devices bound to it with their states; zones with trips first). It writes nothing: the trips stay the device tree's (the fork's trip editor was not taken).

Device test (F50-B, Ubuntu 24.04, v2026.10.22, kernel 7.2.10, 2026-10-12). The board had been up 5 minutes on the release kernel; the test copies of thermal-guard and mu300-cpu were put in place (the release ones kept and restored at the end) and mu300_thermal.ko (the 7.2.10 build) inserted by hand - nothing of the boot image or kernel changed.

  • Before: 19 zones, none with a trip point; cooling devices cpufreq-cpu0 0/9, cpufreq-cpu4 0/9, cpufreq-cpu7 0/10, devfreq-23140000.gpu 0/2; hottest 39.2 °C.
  • insmod: mu300-virtual-thermal virtual-sensor@0: soc-thmzone: the hottest of 11 zones; thermal_zone19 type=soc-thmzone mode=enabled policy=step_wise, trips 0 passive 70000 hyst 1000, 1 passive 85000 hyst 1000, 2 critical 110000 hyst 2000; cdev0 -> cooling_device2 (cpufreq-cpu7) trip 1 weight 410, cdev1 -> cooling_device1 (cpufreq-cpu4) trip 1 weight 410, cdev2 -> cooling_device0 (cpufreq-cpu0) trip 1 weight 1024 - the three maps of the 85 °C trip, with the DT's contributions; the five vendor cooling nodes left out, as expected. Three seconds later thermal-guard: kernel thermal zone soc-thmzone throttles the CPUs: watching only, power-off at 105000 mC stays. mu300-cpu status --json listed 20 zones; the soc entry: three trips, three cooling devices at state 0.
  • Load, yes >/dev/null on all 8 cores: 38.7 → 64.1 °C in 5 s, 78.0 at 30 s, 84.4 at 50 s, 85.3 °C at 65 s; then the kernel throttled: cooling states cpu0=1 cpu4=1 cpu7=1 and scaling_max_freq read 1846/2171/2041 MHz against the user values 2002/2301/2210 (the QoS cap shows through policy->max), the temperature held at 84.4-85.3 °C, the states flapping between 0 and 1 around the trip (100 ms passive polling, 1 °C hysteresis). thermal-guard wrote nothing (its only line in that time: too hot (SoC 85327 mC): LED alarm on) and mu300-cpu status said thermal throttling: active from the cooling states. Writing cpuinfo_max_freq into policy7/scaling_max_freq under the cap read back 2210000 with the state at 1 a moment later - inconclusive, the states were flapping at that second; the cool-down sample right after showed the cap again (policy7 cur 1703 / max 2041, state 1).
  • Load off: 85.3 → 60.1 °C in 5 s, states 0/0/0 and scaling_max_freq back to 2002/2301/2210 by itself (the user request was never changed), cooled down (SoC 64103 mC): LED alarm off.
  • rmmod: kernel thermal zone soc-thmzone gone: capping cpufreq again within 5 s, no zone with trips left. The loader path: the .ko copied to /lib/modules/7.2.10/extra/ and the new extra-modules run - loaded mu300_thermal (modprobe had no index, insmod by path took it), the zone back, thermal-guard handed over again 5 s later. The guard alone, with the service stopped and HOT set 2 °C under the current temperature for two rounds: scaling_max_freq 2002000 2301000 2210000 → 1703000 2054000 1872000 (two steps each) and the marker /run/mu300/thermal-capped present; a cool run lifted them back to 2002000 2301000 2210000.
  • End state: the release thermal-guard and mu300-cpu restored (same md5 as the backup), the service active, the module not loaded and no mu300_thermal.ko under /lib/modules, /run/mu300 without thermal markers, uname -r 7.2.10 - the release kernel, which was never replaced (no mu300-update kernel, so no rollback-boot needed).

Open: the U30 Air (same SoC, its own DTB) is untested; its thmzone-cells may name other zones, which the module reads from the tree. Not taken, as the review decided: the fork's CPU voltage-offset driver.

139. thermal-guard asks the vendor 5.4 kernel too whether it throttles (#229)

§48 let thermal-guard decide by the release: "every 5.x we ship is the vendor kernel, which throttles and protects itself" (§18: sprd_cpu_cooling binds the clusters to soc-thmzone, 70/85/110 C), so on 5.4 it ran the LED alarm only - no cap, no power-off. Issue #229 (F50, openwrt-luci v2026.10.25, 5.4.254, sustained load): the SoC passed 80 C with the alarm flashing, and after about 30 minutes the unit reset by itself, no panic and no pstore; its dmesg had sprd_cpu_cooling: get thermal zone ank0-thmzone failed for ank0-ank5, prometheus6-tzone0 and prometheus7-thmzone. Not measured on our boards: the report and the code.

  • What those lines say and what they do not. The zone names are not the F50's (its tree has lit0-3, mid4-6, big7, ank0-5 among the physical zones, §48, with no trips, and soc-thmzone with them): the driver looks up a list of names that is partly another board's, so the lines alone do not show that the soc-thmzone binding failed on that unit too. Whether the vendor kernel throttled there is not known; that it reset hot under load is.
  • Now the release decides nothing. The question §48 asks mainline - an enabled zone with a passive trip at or below HOT that has every cpufreq cooling device bound and reads within 15 C of the hottest zone - is asked on every kernel. native_cpu_cooling already counts 5.4's cooling-device names (thermal-cpufreq-N) beside mainline's (cpufreq-cpuN). Where 5.4 binds as §18 measured, the guard watches only, as on mainline with mu300_thermal; where it does not, the guard caps at 85 C and lifts at 75 C, as on mainline without the module. The 105 C power-off now holds on 5.4 too (its own critical trip is 110 C, when the zone works). A first round that finds no such zone logs no kernel thermal zone throttles the CPUs (kernel <release>): capping cpufreq here ..., so the device's own log says which way it went.
  • The cost where 5.4 does throttle with cooling devices of another name. Then the guard does not see it and caps too: two caps on one clock, the lower wins (§48), so the CPUs run slower than the kernel alone would let them while hot - the safe side of the mistake. Reading the 5.4 thermal sysfs on a board (below) settles it.

Tests: tests/test_device_scripts.py ThermalGuard - 5.4 without a bound zone caps and powers off at CRIT like mainline (the test that pinned "5.4 only watches" is replaced), 5.4 with its zone bound through thermal-cpufreq-N watches only and keeps the power-off.

Open: the 5.4 thermal sysfs on an F50 and a U30 Air (/sys/class/thermal/thermal_zone*/{type,mode,trip_point_*}, the cdev* links and cooling_device*/type) and which way the guard goes there; a load run on 5.4.

155. The settings as one file, and back (mu300-backup)

Status: current (unit tests on the fake device of tests/test_api.py; not yet run on a device).

Why. An update keeps the settings (§85), a new installation, a second device or a lost card do not: the hotspot, the APN, the locks, the VPN profiles, SMS forwarding, the keys were typed in again by hand.

What. rootfs/overlay/opt/mu300/bin/mu300-backup (one program for Ubuntu and OpenWrt; it takes mu300-api's helpers by sourcing it as a library, MU300_LIB=1):

  • export [-o FILE|-] [--encrypt] [--with-password] [--only S,...]: one JSON document, {"format":"mu300-backup","version":1,"created","source":{device,system,release,hostname},"sections":{...}}, with the sections wifi (name, password, band, channel, hidden, on), data (APN, PDP type, authentication, user, password, data roaming), sim (the boot SIM), locks (the lock tool's saved mode endc lte nr cell, openwrt-luci), vpn (on/off, the active profile's name, the settings KILL_SWITCH TAILSCALE IPV6 REMOTE_DNS BOOTSTRAP_DNS LAN_CIDRS, the profiles the user made - name, type, configuration, options; OpenVPN's user and password from auth.txt - and the subscriptions with their address), sms_forward (the panel's settings, secrets included, openwrt-luci), lan, system (host name, time zone, SSH on/off), ssh_keys (the login user's: root's /etc/dropbear/authorized_keys on OpenWrt, ubuntu's ~/.ssh/authorized_keys on Ubuntu; a line with options in front is left out, and said so) and with --with-password password (the hash from /etc/shadow). Settings are read where they live (hotspot.conf, mobile-data.conf, lan.conf or UCI; the VPN module's profile show --json --reveal and subscription show --reveal, which it gives root alone). Never in a file: the path of an engine binary (XRAY, SING_BOX, ...: a file that set one would choose what runs as root), profiles that came from a subscription (it brings them back), runtime state.
  • The file is written 0600 (aside, then renamed; never through a link); without -o it is ./mu300-backup-HOST-DATE.json (.enc when sealed).
  • import FILE|- [--dry-run] [--force] [--only|--skip S,...], show FILE.

The seal. openssl enc -aes-256-gcm was the first choice and does not exist: OpenSSL 3's enc refuses AEAD ciphers ("AEAD ciphers not supported"; LibreSSL's takes the name and writes no tag at all). age ships in neither image; openssl does in both (Ubuntu's openssl, OpenWrt's openssl-util, which the VPN module needs). So: MU300-BACKUP-ENCRYPTED 1, a line naming cipher=aes-256-cbc kdf=pbkdf2 digest=sha256 iter=600000, then openssl enc -aes-256-cbc -pbkdf2 -iter 600000 -md sha256 -a of sha256=<hex> + the document. The key and the IV both come from the passphrase and the file's salt; the SHA-256 inside the encryption is checked before the document is read, so a wrong passphrase, a changed character or a cut file is refused ("the file was changed after it was encrypted"). The passphrase (8-256 characters) reaches openssl on a pipe of its own (-pass fd:3), never on its command line; the rounds a file names are taken between 10000 and 5000000 only.

The import. In order, and nothing changed until the end of step 4:

  1. The file (4 MiB at most) is opened and checked against the format with one jq program: every key known, every value of its kind and size, no control character in anything but a VPN configuration and SMS forwarding's texts. Anything else and the whole file is refused (exit 2).
  2. A file of another device type is refused without --force; one of the other system gives what both have (locks and SMS forwarding are skipped where there is no panel, and said so).
  3. This device is read in the same form, and one jq program lists the steps: only what differs. Secrets are compared and never shown ("the password changes"). Nothing is removed: a VPN profile, subscription or SSH key the file lacks stays. Locks the device has and the file has not are reset first (lock reset, the verified one, §48), then the file's are applied.
  4. Every step is checked by the rules of what will apply it: mu300-api's setters in a new check mode (MU300_API_CHECK=1: wifi.set wifi.power data.set sim.select lock.set lan.set system.hostname system.timezone system.ssh stop after their own field checks with {"ok":1,"checked":true}), the forwarding adapter's (MU300_FWD_CHECK=1, after its checks, before it writes), and for the rest mu300-backup's own (VPN names by mu300-api's rule, types, configurations as text, subscription addresses https:// only, settings by the module's own rules; SSH keys as OpenSSH public keys; a password hash as SHA-512/SHA-256 crypt, bcrypt or yescrypt - yescrypt not on OpenWrt, whose musl cannot read it). One refusal and nothing is changed (exit 1); "unsupported" (no hotspot.conf yet, no VPN module) skips that step. --dry-run stops here.
  5. The steps run (what can cut the connection last: SSH keys, password, SMS forwarding, VPN, SIM, mobile data, locks, system, hotspot, LAN): through mu300-api's setters, the lock tool directly (one at a time: through the panel each would start detached and the next would find the lock busy), the forwarding adapter (with clear naming the secrets the file has none of: the adapter keeps a saved secret that comes empty), the VPN module's CLI (a configuration and a subscription's address on its stdin; OpenVPN's user and password into the profile's auth.txt, since profile set takes them on its command line), chpasswd -e (busybox's on OpenWrt) on its stdin, and the keys file written aside and renamed (never through a link: ubuntu's home is its own). A step that fails is reported and the others go on (exit 1).

Security review of the first version (before merge). An imported file is untrusted, and three holes were found and closed:

  1. Values that become options. Values of the file reach command lines as positional arguments (mu300-vpn profile add TYPE NAME -, profile set ID KEY VALUE, settings set KEY VALUE, subscription add NAME - --type T --interval N, lock apply KIND VALUE). A value starting with - (--json, --insecure) would be read as an option. The profile type's rule allowed - first ([a-z0-9-]+), and option values were only "one line of text". Now every value that goes onto a command line passes arg: taken exactly from the step (no trailing newline lost to $(...)), not empty, no control character, never starting with -. The type is [a-z0-9][a-z0-9-]{0,15}, subscription type and interval are checked again where they are used, the profile id the module answers must look like one, and a lock value goes through mu300-api's rule and arg. No -- was added to the module or the lock tool: nothing reaches them that could be taken for an option.
  2. A line break inside a value. Each of allowed (is_ascii_line, then grep -x), text_ok and hash_ok refused one already, so HASH\nroot:HASH never matched. But the format's patterns used test("^...$"), and jq's ^ and $ are the ends of a line, not of the value. So an option key A\nB passed the format, and the shell then split it into two keys. The patterns now use \A...\z, and every one-line field refuses any control character at the format level. chpasswd -e gets exactly one line, root: or ubuntu: and a hash checked again just before.
  3. Keys split into words. for _k in $(jq -r '.options | keys[]') is now a loop over indices with each key read exactly, and checked against an anchored pattern.

Tests for each: --json as a type, a type and an option key with a line break, a hash followed by a second shadow line, a lock value with a line break, --help and -x as lock values (the lock tool is never called), --insecure as an option value, --json as a subscription name and -x as the active profile.

The API and the panel. mu300-api backup.export {passphrase, with_password} answers {"name","encrypted","file"}

  • the one reply that carries secrets on purpose - and backup.import {file, passphrase, dry_run, force, only, skip} answers a dry run at once (valid, text) and otherwise starts the restore as the job (job.status); the request may be 6 MiB for this method alone. The file and the passphrase reach mu300-backup on its stdin (the job's input file is root's and removed when the job starts). On openwrt-luci, System > Backup of settings (view/mu300/backup.js) calls mu300dash backup_export/backup_import/backup_job, which pass the request to mu300-api; run_m keeps their replies out of the call log (their length only). The file is made in the browser and never stored on the device. The panel's page is in every catalog of the panel. No page on Ubuntu's Cockpit panel yet: the API is there for it and for the web installer's device manager.

Tests (tests/test_backup.py, every shell): every section exported on Ubuntu, OpenWrt and openwrt-luci, the mode, no link followed, no engine path; the seal (wrong passphrase, one character changed, rounds from a hostile header, a short passphrase); a dry run that changes nothing and a restore of what differs (hotspot.conf, mobile data's roaming, lan.conf, the keys merged, chpasswd -e with the hash on stdin); a round trip with a fake VPN CLI (profiles, subscription, settings, active, on); another model with and without --force; an OpenWrt file on Ubuntu; hostile files (17 refused by the format, 11 by the setters' rules, 7 VPN values), each leaving the device as it was; the lock tool (reset, then the file's locks) and the real forwarding adapter (refusing an ftp:// address, nothing written); the API methods and the job. In none of them a secret in an argument list, a job file or what is printed. tests/test_sms_forward.py: the adapter's check mode.

On a device (2026-10-17, F50-B Ubuntu 24.04 7.2.11, F50-C plain OpenWrt 6.18.57; test builds of this branch with the other open PRs).

  • OpenWrt refused every file, its own too: not a valid backup: a value of the wrong kind. OpenWrt's jq (1.8.1) is built without Oniguruma, so test, capture and gsub raise "jq was compiled without ONIGURUMA regex library" and the schema's try turned that into a refusal; the SMS-forwarding export (openwrt-luci) used capture/gsub too. The program now uses no regular expression in jq: characters are checked by code point (l refuses C0, DEL and C1 as [[:cntrl:]] did; word, optkey, lowalnum stand for the three anchored patterns), and the forwarding file is split at its first =. OpenWrtJqWithoutRegex / LuciJqWithoutRegex run the OpenWrt and panel tests through a jq that refuses any program using them; both failed before the change.
  • Not on PATH: mu300-backup export said "not found" on Ubuntu; it is in path-commands now.
  • Ubuntu: export --encrypt (0600, the MU300-BACKUP-ENCRYPTED header), show, import --dry-run ("nothing to change"); the SSID changed by hand and the APN through mu300-api data.set, then import: both back, the hotspot and mobile data came back up (the restored hotspot.conf differs only in the order of its lines).
  • OpenWrt (with the fix): export, show, a dry run of its own file ("nothing to change"); the F50-B file, encrypted, taken with "from ubuntu, taken on openwrt: what both systems have" (hotspot, LAN address); a file with the login hash: F50-B's is $6$, which musl takes ("login password: changes"; the yescrypt refusal stays a unit test); the SSID changed in uci and restored by import, WAN still up.
  • The panel (luci-app-mu300's files copied onto F50-C's plain OpenWrt for the test): System > Backup of settings renders (passphrase twice, the login-password tick, restore with "Show what would change"; Restore disabled until a preview), no console error; ubus call mu300dash backup_export returned the file, plain and sealed.
  • Not run: a download and restore through the page in a browser, the VPN and lock sections, the size limit through rpcd/ubus.

160. The eMMC at a cold boot: a failed HS400ES no longer ends the boot; the core falls back to HS200, then HS/DDR52

The report (issue #226, a user, 6.18.56, release v2026.10.16.1): after a cold boot (powered off five minutes or more) the modem never came up, because there was no mmcblk0 and so no modem firmware:

mmc0: SDHCI controller on 22200000.sdio [22200000.sdio] using ADMA 64-bit
mmc0: mmc_select_hs400es failed, error -84
mmc0: error -84 whilst initialising MMC card
... the same three more times ...
mmc0: Failed to initialize a non-removable card

Every cold boot of his failed; warm reboots of the same kernel sometimes came up at HS400ES; an unbind and bind of the host on the running system failed the same way. The vendor 5.4 kernel (its own eMMC driver) came up at HS400ES at 200 MHz on the same unit. We saw it once ourselves, on an F50 after a sysrq reboot (§112's run: "on that boot the eMMC did not come up"); a normal reboot after it was fine. With the root on the eMMC that boot has no system at all.

What the log says. -84 is -EILSEQ, a CRC error. mmc_select_hs400es prints its own message before the summary line for every step but two: the CMD13 status checks after the switch to HS at 52 MHz and after the host went to HS400 with the enhanced strobe (mmc_switch_status(card, true), where a CRC error is fatal). There is no inner line, so it is one of those two, most likely the last: the card switched, the host latches the response with the strobe, and the CRC does not match. Why only at a cold start (the PHY's DLL, a delay value from the device tree, a supply still settling) is not known; it is not looked into here. The four lines are mmc_rescan's four attempts (400, 300, 200, 100 kHz initial clocks), each with a power cycle of the card, and every one went to HS400ES again.

Changed (upstream/patches/0021-mmc-HS400ES-failure-falls-back-to-HS200.patch, both mainline kernels): when the timing selection of mmc_init_card fails (the selection itself, HS200 tuning or HS400 after it, HS400ES tuning, DDR52), the failed timing is taken out of the host's caps, with one warning (mmc0: HS400ES failed (-84), the next initialisation uses HS200), and the next attempt takes the next slower one: HS400ES (HS400 goes with it) -> HS200 -> HS with DDR52 -> HS. mmc_rescan's four attempts are exactly that ladder. The core chooses the card type from the host caps again at every initialisation, of a new card and of a known one (a reset, a resume), so the same lowering holds there. The core's own line then says which timing was taken: mmc0: new HS200 MMC card at address 0001. A boot whose HS400ES works runs no new code. The lowered caps last until the host is bound again, in practice until the next boot, which tries HS400ES again. A removed card (-ENOMEDIUM) lowers nothing; the SD slot is set up by sd.c and not touched.

Considered and not taken: turning HS400ES off in the device tree for everyone (half the read speed on every unit that works; mainline runs on the stock device tree's capabilities); a retry inside mmc_select_timing without a power cycle (the card is half switched; mmc_rescan's attempts power it off and start again from CMD0); plain HS400 with tuning as the first fallback (never run on this host: HS200 is the known-good step below).

Cost. At HS200 the bus is 200 MHz single data rate, half of HS400ES's bus rate: sequential reads should drop from §93's 270-300 MB/s on the F50 to at most about 190 (not measured); writes (§93: 180-215 MB/s) are bound more by the eMMC itself. Only on a boot that fell back.

The test hook. sdhci_sprd.fail_hs400es=N (sdhci-sprd module parameter, default 0, also writable at /sys/module/sdhci_sprd/parameters/fail_hs400es): the next N HS400ES selections get a CRC error (-EILSEQ) on every CMD13, only while a new card is set up at HS400ES - the failure of the report, at the place the log points to. Mainline forces its command line (CONFIG_CMDLINE_FORCE; the bootloader's and the boot image's loglevel=5 are not read), so a test kernel gets it at build time: MU300_CMDLINE_EXTRA=sdhci_sprd.fail_hs400es=1 for upstream/build.sh appends it to CONFIG_CMDLINE after the config check. Releases never set it (a unit test checks the workflows).

Unit tests: tests/test_static.py (test_mainline_emmc_timing_falls_back): the ladder, exactly the four timing failures routed through it, the hook off by default and limited to CMD13 during a new card's HS400ES, the build switch after the config check and in no workflow. Built locally, 2026-10-16: 6.18.56 and 7.2.10 with build.sh (the patch applied with no offset or fuzz, also to 6.18.57 and 7.2.11; no compiler warning in either file; both Images carry the new messages), and a 7.2.10 test build with MU300_CMDLINE_EXTRA=sdhci_sprd.fail_hs400es=1, whose CONFIG_CMDLINE and Image end with it. On a device (F50-B, Ubuntu 24.04, 2026-10-17; test kernels with this patch and the other open kernel PRs): 7.2.11 and 6.18.57 normal boots: new HS400 Enhanced strobe MMC card, no fallback line, ios timing 10 at 200 MHz. A 7.2.11 build with MU300_CMDLINE_EXTRA=sdhci_sprd.fail_hs400es=1: test: this HS400ES selection fails, mmc_select_hs400es failed, error -84, HS400ES failed (-84), the next initialisation uses HS200, error -84 whilst initialising MMC card, then new HS200 MMC card at address 0001 0.33 s later; ios timing 9 (HS200) at 200 MHz, the system booted with mobile data and the hotspot, and the parameter read 0. Still not run: cold boots, the runtime rebind, throughput at HS200. Before that, the plan as written:

# 1. normal boots, both boards, 6.18 and 7.2: unchanged
dmesg | grep -iE 'mmc0|hs400|initialisation uses'     # "new HS400 Enhanced strobe MMC card", no fallback line
cat /sys/kernel/debug/mmc0/ios                          # timing spec: 10 (mmc HS400 enhanced strobe), 200 MHz
# 2. the forced failure: a test kernel built with MU300_CMDLINE_EXTRA=sdhci_sprd.fail_hs400es=1
dmesg | grep -iE 'mmc0'   # "test: this HS400ES selection fails", "mmc_select_hs400es failed, error -84",
                          # "HS400ES failed (-84), the next initialisation uses HS200", "new HS200 MMC card"
cat /sys/kernel/debug/mmc0/ios                          # timing spec: 9 (mmc HS200); the system boots, modem up
cat /sys/module/sdhci_sprd/parameters/fail_hs400es     # 0
# with fail_hs400es=4: the same HS200 boot, and the parameter reads 3 (after the first failure the host has no
# HS400ES left to try)
# 3. on a running system with the root on the SD card (F50): the same without a reboot
echo 1 > /sys/module/sdhci_sprd/parameters/fail_hs400es
# nothing of the eMMC mounted; the modem stopped (its firmware partitions are on the eMMC)
echo 22200000.sdio > /sys/bus/platform/drivers/sdhci_sprd_r11/unbind
echo 22200000.sdio > /sys/bus/platform/drivers/sdhci_sprd_r11/bind
# 4. cold boots: power off >= 5 min, N times per board (the release kernel): count fallbacks; a unit like
#    #226's should now boot every time, at HS200 when HS400ES fails
# 5. at HS200: dd read/write throughput and a §93-style soak (write, verify, reboot, e2fsck -fn)

162. zram by default: one script for every system, settings in a file, an off switch, zstd on mainline

What was there. zram swap has been on since 27: zram-start (Ubuntu's and Arch's mu300-zram.service before swap.target, OpenWrt's mu300-hw) made lz4 zram of half of MemTotal, priority 100, vm.swappiness=100, vm.page-cluster=0. Nothing could change it or turn it off short of masking the unit. Its "already on" check was swapon --show, which OpenWrt's busybox swapon does not have (so it never saw a live swap there); its -p is in OpenWrt's busybox (FEATURE_SWAPON_PRI default y in 25.12's Config-defaults.in), as are mkswap and swapoff.

Kernels.

  • 5.4 vendor (kernel/linux.config): ZRAM=m (the fragment's =y is refused, fragment-rejected.txt), ZSMALLOC=m, ZRAM_WRITEBACK/ZRAM_DEDUP; zram there compresses through the crypto API, and CRYPTO_LZ4, CRYPTO_ZSTD are built in, CRYPTO_LZO a module: every compressor is offered. Left as it is.
  • 6.18.56 and 7.2.10 as shipped (upstream/out*/kernel.config): SWAP, ZRAM, ZSMALLOC, ZRAM_BACKEND_LZ4, default lz4, all built in; ZSTD_COMPRESS/ZSTD_DECOMPRESS built in already (for CRYPTO_ZSTD) but ZRAM_BACKEND_ZSTD not set, so comp_algorithm offered [lz4] alone. mu300-mainline.config now sets ZRAM_BACKEND_ZSTD=y: a bool, the library is there, so the Image grows by the backend's glue only (a few KiB). Both versions have the option with the same selects (drivers/block/zram/Kconfig at v6.18 and v7.2).
  • PR #256 (every module): all-modules.py keeps every =y at =y and leaves bools alone outside the families it opens, so zram, zsmalloc and both backends stay built in; nothing here depends on a module.

Why not systemd's zram-generator or OpenWrt's zram-swap. Ubuntu ships systemd-zram-generator, but the same script serves Ubuntu, Arch and OpenWrt (busybox), with one settings file, and has run since 27; a second mechanism would only add a place where the two disagree. OpenWrt's zram-swap depends on kmod-zram, a 6.12 module that the image removes with every other kmod (the kernels are ours). The images install neither (a test checks).

Changed.

  • mu300-zram (on PATH): start (the boot; zram-start stays as the name OpenWrt's mu300-hw calls), stop, on/off (now and for every boot: ZRAM_ENABLE in /etc/mu300/zram.conf, a file of the user, kept by updates), status (size, compressor, priority, and what the swapped-out pages cost: mm_stat's orig_data_size against mem_used_total), brief (a line in mu300-toolkit info). The toolkit's System menu has "Compressed swap (zram)".
  • Settings, each optional and checked (a value out of range or not a number takes the default): ZRAM_SIZE_PERCENT (50; 1-200), ZRAM_ALGORITHM (lz4; one the kernel does not offer falls back to lz4, logged), ZRAM_PRIORITY (100), ZRAM_SWAPPINESS (100; 0-200, and 100 where the kernel refuses more: 5.4 stops at 100). /opt/mu300/lib/zram.conf.example explains them; it is in /opt/mu300 so OpenWrt has it too.
  • The "already on" check reads /proc/swaps; under a live zram start only sets the sysctls again, it never resets the device. off swaps off first and resets only after that worked: with too little free RAM for what zram holds, swapoff fails, zram stays on and the command says why.

Sizes and memory. MemTotal is ~1473 MiB (27), so the default is ~736 MiB of swap. An empty zram costs nothing (zsmalloc allocates per stored page); a full one holds those pages in about 736/2.5 ~ 290 MiB with lz4 or ~210 MiB with zstd (typical anonymous memory; text and JSON pack better, already-compressed data worse), plus about 0.1 % of the swap size for zram's own table. Swappiness 100 weighs swap and file cache equally, which suits a swap that is RAM; up to 200 makes sense on mainline when file cache matters more (a busy Docker/KVM host with little I/O), it is a setting rather than a new default because no device run has compared the two.

Tests. tests/test_zram.py under each shell, against a fake /sys/block/zram0 and /proc: defaults, every setting, the fallback compressor, hostile and out-of-range values, switched off, already on, no zram in the kernel, on/off keeping the other settings, a failed swapoff, status/brief; the wiring (unit, the three images, mu300-hw, PATH), no second zram setup in any image, both mainline compressors and 5.4's options.

On a device (2026-10-17, test builds with the other open PRs). F50-B, Ubuntu 24.04: on at boot on 7.2.11 and 6.18.57 (708/732 MiB, priority 100), comp_algorithm [lz4] zstd; ZRAM_ALGORITHM=zstd then stop/start: zstd; a 1.2 GB compressible load swapped 30 MiB into 6 MiB (4.3:1), no OOM; mu300-zram off held over a reboot (no swap, "zram off"), on brought it back; mu300-zram and the toolkit line on PATH. F50-C, plain OpenWrt (busybox), the release's 6.18.57 without the zstd backend: on at boot from mu300-hw, zstd not offered by this kernel (lz4 ), using lz4 in logread, off/on. Open: memory pressure with Docker or a KVM guest, lz4 against zstd.

166. Mainline's soc-thmzone did not hold a full CPU load: step_wise followed the sensors' noise

PR #272's device test (§133, F50-C, 6.18.56/6.18.57) found that the toolkit's 10-minute CPU stress (8 awk loops) took the SoC from 44 to 102.6 C in under 3 minutes, and twice on to thermal-guard's 105 C power-off, with soc-thmzone bound (§48: passive 70/85 C, the three cpufreq maps) and the guard "watching only". The vendor 5.4 kernel holds the same load at 80-91 C. After five of those hot shutdowns or reboots the next boot found no eMMC (§133; HS400ES when hot, #226 / PR #283).

Measured again (F50-C, OpenWrt v2026.10.16.1, 6.18.56, 2026-10-17), one sample a second of the zone's temperature and the three cooling devices' cur_state (cpufreq-cpu0/4/7, max_state 9/9/10), 8 awk loops: 38 C at 0 s, 85 C at 23 s, 90.9 C at 120 s, 95.3 C at 150 s, 98.5 C at 185 s (stopped there by the test's own safety limit). The states never went past 3, and flapped 0-1-2-3-0 between one sample and the next. So the kernel throttled, but by one or two steps where the load needs four or five.

The cause: the trend. What was checked and is not it: the zone's polling (polling-delay 1000, polling-delay-passive 100, as the DT says), the governor (step_wise, the only one in mu300-mainline.config), the trips (the maps are on the 85 C trip, hysteresis 1 C), the maps' limits (THERMAL_NO_LIMIT both ways: every step of every cluster), the clusters (all three bound, the A76s too), the zone the cooling devices are bound to (the module's soc-thmzone, cdevN_trip_point 1). What is it: gov_step_wise.c (6.18.56 and 7.2.10 alike) steps a bound cooling device one up on a raising trend and one down on a dropping one while the zone is above the trip, and lifts the whole of it on one dropping reading under the trip. Without a get_trend op the core's trend is this reading against the last one, 100 ms earlier. The zone's reading is the hottest of eleven on-die sensors, which moves by a degree or more between two polls whatever the load does; the die itself follows the CPU power within a second (85 to 77 C within a second of a release, back to 88 C a second later). So the state was a random walk around zero, raised and lowered on noise, while the package crept up at about 0.1 C/s. The vendor kernel throttles the same zone with the power allocator (IPA, sustainable-power 3000) and cluster hotplug (thermal-cpu-N cooling devices); mainline has neither for this SoC (IPA would need a kernel with the governor and an energy model for sprd-cpufreq-v2, i.e. new kernel images).

The fix, in the module (upstream/modules/mu300_thermal, no new kernel image; built for 6.18.56 and 7.2.10, no warning): mu300_thermal gives the zone a get_trend (mu300_trend.h, plain C the tests compile on the host). It keeps the last 32 readings and takes the slope between the mean of the last half second and the mean of half a second about a second earlier, with a dead band of 1 C/s:

  • at or above the trip + 3 C (88 C): raising, a step more every poll, unless the SoC is falling by more than 1 C/s;
  • from the trip less its hysteresis (84 C) to 88 C: raising above the trip when the slope rises; one step back, at most one a second, when the slope falls or the SoC is under the trip; else stable (the state is kept);
  • from 80 to 84 C: stable. step_wise would lift every step at once here on a dropping trend, and the die is 10-20 C hotter within a second of that under a full load (fix 1 below did that);
  • under 80 C: dropping (the cooling is lifted).

The rate limit is the zone's, shared by its two passive trips; at the temperatures where it matters the 70 C trip is 3 C or more below and answers raising or stable without touching it.

Run (8 awk loops, 10 min) at 30 / 60 / 120 / 180 / 300 / 450 / 570 s, C peak mean 2-10 min above 90 C awk iterations
before (release module) 85.1 / 84.3 / 90.9 / 97.3 / - / - / - 98.5 at 185 s, stopped - - -
fix 1 (1-s slope, no averaging, margin 5 C) 86.0 / 90.4 / 90.7 / 86.8 / 86.3 / 85.8 / 83.7 96.5 88.1 25 % 1 124.6 M
fix (this PR) 82.2 / 84.6 / 82.0 / 81.0 / 82.7 / 81.7 / 82.4 91.2 (one sample) 82.3 0.2 % 1 094.8 M

With the fix the states climb to 2 within 30 s, 3-4 by 3 minutes and 5 by 6.5 minutes, and stay; the clusters ran at 1334 / 1627 / 1475 MHz on average (2-10 min) of 2002 / 2301 / 2210. Fix 1 swung 84-92 C with the states going 0-8 and back every few seconds. The cost of holding 82 C instead of swinging around 88 C is 2.7 % of the work done (awk iterations). The power-off never came near: before, it would have come at about 4 minutes. Not run on 7.2.10 (the module is built; the governor and the core's trend code are the same, diff of gov_step_wise.c and thermal_helpers.c empty).

Belt and braces.

  • thermal-guard no longer only watches when a bound zone throttles: when the hottest sensor reaches 92 C anyway (MU300_THERMAL_BACKSTOP), it lowers scaling_max_freq one step a round on top of the kernel's cap, the A76 clusters (policy4, policy7) from 92 C, the A55 cluster (policy0) too from 95 C (MU300_THERMAL_BACKSTOP_ALL), and lifts its caps a step a round again at or below 85 C (HOT), never above a profile's ceiling. It logs once per hot spell: kernel thermal zone soc-thmzone does not hold the SoC (... mC): capping cpufreq on top of it .... The marker says backstop, so a restart of the guard (which looks like a handoff to it) does not lift those caps at once. The 105 C power-off stays. This holds on every kernel where a zone is bound, the vendor 5.4 too (§139).
  • The toolkit's stress test stops itself when the hottest sensor reaches 95 C (MU300_STRESS_LIMIT), kills the load and starts its summary with STOPPED EARLY after mm:ss: the SoC reached N C, the limit is 95 C ..., so the test recommended for checking a device never powers it off.

Device test of the two (F50-C, same day, 6.18.56). The release mu300_thermal.ko back in (the runaway one), the running thermal-guard replaced by this one, then the new mu300-toolkit stress cpu 10 from 45.8 C: kernel thermal zone soc-thmzone does not hold the SoC (92652 mC): capping cpufreq on top of it ... at 85 s, once; from there the SoC stayed at 85-91 C (mean 87.6 C from 2 to 10 minutes, peak 92.6 C), the A76 clusters one step under the kernel's cap, no stop at 95 C needed and no power-off; the toolkit's summary: max 93 C, averages 1560 / 1783 / 1669 MHz. After the load the guard lifted its caps by itself (scaling_max_freq 2002 / 2301 / 2210 MHz, marker gone). The stop, with MU300_STRESS_LIMIT=80000: STOPPED EARLY after 00:03: the SoC reached 88 C, the limit is 80 C ..., no awk left. Each of the four runs started at 41-51 C after a cool-down, and none ended in a hot reboot.

Tests: tests/test_mu300_thermal.py (the trend compiled on the host: noise is no trend, the bands, the rate limit, the lower trip; a plant model of step_wise against a die that follows the power within half a second, where the core's trend passes 95 C and this one holds it under 90 C on average), test_device_scripts.ThermalGuard (the backstop: A76 clusters from 92 C, all from 95 C, logged once, lifted at HOT up to the profile's ceiling only, the power-off at 105 C still) and ToolkitStress (stops at the first sample at 96.5 C with the message; the limit configurable).

Open: the eMMC after a hot shutdown (PR #283's HS200 fallback); a run on 7.2.10 and on the U30 Air; whether a governor with an energy model (IPA, as the vendor kernel) is worth new kernel images.

49. The SIM's own number in the panel: CNUM, else the IMS identity, on full rounds only

The panel showed IMEI, IMSI and ICCID but not the SIM's own number (MSISDN). Ported from kanoqwq's fork (0d93695, reviewed in docs/superpowers/reviews/2026-10-11-kano-clean-tf-7.2.md: "CNUM on full rounds only, never in the fast tier"), measured so far on this machine only (unit tests; the device checks are in the PR).

  • Two sources. AT+CNUM reads the number the SIM carries (+CNUM: "","+905551234567",145; type 145 is international, a "+" is put in front when the SIM left it out). Many SIMs carry none - the answer is OK alone or an empty string - and the number then comes from the IMS public identity the operator provisions, AT+SPPAURI? (what the stock RIL's getPAU reads): a tel: URI first, else a sip:/sips: URI whose user part is an international number. A bare numeric SIP user part is the IMSI on many networks and is not taken as a number. 3 to 15 digits (E.164), nothing else, or nothing at all - the panel never guesses.
  • Where in the tiers. The IMS identity exists only once IMS is registered, later than the SIM is read at boot, so the number cannot live in the 6 h identity cache (sim.json) the way IMEI/IMSI/ICCID do: a miss at boot would stay a miss for hours (kano's own regression). It is asked on full rounds only (cell, every ~5 s while the page is open): an empty answer is asked again on the next full round (two commands, about 0.3 s at the measured 0.13 s per command, §40), a number found is kept in /var/run/unisoc-modem/own-number for the boot and not asked again (a SIM change goes through a reboot, the same assumption the identity cache makes). The fast tier (1.5 s) never sends either command, and neither does mu300dash's live signal read.
  • Personal data. The number reaches the browser in status's cell.msisdn / cell.msisdn_src (sim or ims), a read-only method of the existing ACL; the home page shows it under ICCID, masked like the IMSI (+905****567) until "Show SIM identifiers", and the row is not there at all when neither source has one. It is never written to flash: sim.json stays IMEI/IMSI/ICCID, the runtime files are root's only (umask 077), the collector prints nothing, and the panel's operations log keeps its rule (method, time, outcome - no IMSI or numbers). Translations: Own number in all 31 catalogs (tools/luci-i18n.py update).

50. Three guards for the installers: the boot image read back from the medium, bounded SD-card stages, no re-run in the same boot

What #52 looked like from the outside (§38a): the Magisk installer, OpenWrt to the card, silent for good, a dd at 100 % of one core that kill -9 did not end, and every retry adding another one until the board was rebooted. §38a removed that read past the end of the eMMC, so the known trigger is gone; what stayed was that nothing in either installer would have told the user anything if the card, or the SD host, stopped answering for another reason: a command stuck in the kernel sits in D state, the installer waits on it forever, and install.sh's su_do never returns. kanoqwq's TF installer (tf-stage.sh, tf-install-worker.sh, read as a reference) has three ideas for that, taken here in our own shape - one android-install.sh, no slot layout of its own, no vold scan beyond sd_release:

1. The boot image is read back from the medium, into a file. Both installers verified boot_<linux slot> after writing it - install.sh with sha256sum of the whole partition, the Magisk installer with mu300-update's write_boot, which hashes a dd | head -c | sha256sum pipeline of the first pages - and a mismatch stopped before misc. Two things were weaker than they looked: a read that fails inside a pipeline leaves a short hash and no word of why, and a read right after the write may be served from the page cache rather than the eMMC. Now every install drops the caches (echo 3 > /proc/sys/vm/drop_caches) and reads back exactly the image's length in whole 4096-byte blocks with one dd into a file ($T/mu300-boot.rb for the computer installers, $W/boot/readback for the zip), whose exit status counts; the sha256 of the file's first len bytes must be the image's. The Magisk installer's boot_readback does this after write_boot's own check and reads the AVB footer block back too, and its refusal says which step failed (dd failed, short read, sha256 differs): boot_b read back from the eMMC is not the image that was written (sha256 differs); Linux was not armed: misc was not changed, so Android keeps booting. install.sh and install.ps1 keep their message (boot_b verify failed (slot a still active, Android keeps booting)). What is written where is unchanged.

2. The long SD-card stages run bounded, in a process group of their own. In SD mode android-install.sh runs the format (mke2fs, 900 s), each system's unpack (tar, 3600 s; the vendor tarball 900 s), the removal of the old or half-installed system (900 s) and a final flush (sync, 1800 s, before the OK line, where the trap used to sync after it) through stage_run NAME LIMIT CMD: the command in a session of its own (setsid, Android's toybox has it; without it a plain background job), its pid and its exit status in files, and the installer polling every 2 s instead of waiting on it. A stage ends when it passes its limit, or when the card's completion counters (/sys/class/block/mmcblk1/stat: reads and writes completed, sectors read and written - not the time fields, which move while a request only waits) have not changed for 120 s. Then the group gets TERM and KILL (a process in D state ignores both, and is never waited for), the run says what happened and what to do - the unpack ubuntu stage timed out (no I/O progress on mmcblk1 for 120 s) and was stopped; nothing more is written / reboot Android before running the installer again / the card stays mounted at ..., with no sync and no unmount (both would wait on that request) - and exits 1 before MU300-INSTALL-OK, so neither installer writes the boot image or misc. The EXIT trap (sd_exit) then flushes and unmounts nothing: a sync or an umount would hang on the same request. On the eMMC the stages run as before (STAGE_DISK empty): Android keeps the eMMC's counters moving, and it has not failed this way. When the stat file cannot be read the stall rule is off and the run says so; the limit still applies. The counters are read from $MU300_SYSFS, the clock is date +%s, the knobs for tests are MU300_STAGE_STALL and MU300_STAGE_POLL.

3. No second run in the same Android boot. A timeout writes mu300-install.stalled - the first line Android's /proc/sys/kernel/random/boot_id, the second the stage, the time and the reason - into MU300_LOCK_DIR (/data/local/tmp for the computer installers, /data/adb for the zip, whose work directory is new each run and gone at its end). android-install.sh checks it before anything else; the Magisk installer checks it in main right after env_check, before the plan: a lock of the running boot is a refusal (an earlier run of the installer timed out in this Android boot (stage unpack ubuntu, ...): the SD card request it waited on is still stuck in the kernel / reboot Android, then run the installer again), a lock of an earlier boot is stale and removed, and a run that goes through removes its own. The zip also keeps the device script's output at /data/adb/mu300-device-install.log (mode 600) when that script fails, and says so; install.sh names its work/device-install.log, install.ps1 now writes one.

Tests: tests/test_android_install.py (Stages: the stall and the deadline end a stage and its grandchild and write the lock; progress keeps it alive; no counters means the limit only; the eMMC runs it plainly; the same-boot re-run is refused and a stale lock removed; a clean run leaves no lock; sd_exit after a timeout runs no sync and no unmount; under set -e the OK line never comes; the wiring), tests/test_magisk_installer.py (a dd whose read-back differs or fails: misc unchanged, Linux not armed; the lock of this boot refused before the plan, a stale one removed; the lock directory handed to the device script; the kept log). macOS has no setsid (the tests stand one in with Python's os.setsid) and no timeout; the stages are driven by the script's own date +%s loop, so nothing else is needed. In a container where the test runner is PID 1 the killed grandchild stays a zombie, which the test counts as dead.

Not done here, for a device with a card: (a) a card installation from a computer and from a zip must still go through, with [device] creating ext4 mu300sd, installing <os> and MU300-INSTALL-OK in the log, no mu300-install.stalled afterwards, and mu300-stage.* gone from the work directory; (b) the stall path itself - pull the card during the unpack, or hold the SD host's clock - must end the stage within about two minutes with the three lines above, leave the lock in /data/local/tmp or /data/adb, and the next run must be refused until a reboot, after which it must go through; (c) cat /sys/class/block/mmcblk1/stat must change while tar writes to the card (if the counters do not move for a healthy card, the rule would end a working stage: the field numbers are the ones of the kernel's Documentation/admin-guide/iostats.rst); (d) the time the format and the unpack take on a slow card against the limits (900 s, 3600 s); (e) setsid present in Android's /system/bin (toybox), and the zip's busybox not in the device script's PATH; (f) the boot image read-back on both installers: dd into the file, then the hash, visible in strace or by the file's existence while it runs.

51. SMS delivered directly (+CMT), acknowledged only once the pool has it; the SIM path stays as the fallback

Until v2026.10.22 the panel's SMS pool (openwrt-luci: mu300-smsd, mu300-sms, §46) learned of a new message the roundabout way: the modem stored it on the SIM and said +CMTI: "SM",n on nr0, mu300-smsd saw the line in mu300-atd's URC log and ran mu300-sms sync (AT+CMGL=4, decode, pool, AT+CMGD per slot). Two writes to the SIM per message, a listing of the whole store, and the SIM as the only safe copy until the pool had it. kanoqwq's fork delivers directly instead (GSM 27.005 +CNMI with mt=2: the modem forwards the SMS-DELIVER as a +CMT: frame and waits for AT+CNMA); this is that mechanism, ported into this tree's layout.

Mechanism. mu300-smsd starts as before: AT+CNMI=2,1,0,0,0, a first sync (what the SIM holds), then AT+CMGF=0, AT+CSMS=1, AT+CNMI=3,2,2,0,1. If any of the three is not OK (or MU300_SMS_DIRECT=0 says not to ask), AT+CNMI=2,1,0,0,0 is asked again and only the +CMTI path runs, exactly as before. With direct delivery on (/run/mu300-smsd.direct exists) every new message comes as two lines on nr0, where +CMTI came too: +CMT: ,<length> and the PDU. mu300-atd's nr0 drainer (and its drain and collect on the command channel, should a frame come there) hands both lines to mu300-cmt-spool on its stdin - never argv, which is public - and that writes the PDU as $POOL/incoming/cmt-<epoch>.<random>.ready via mktemp and rename, fsyncing the file and the directory (busybox fsync, or coreutils sync FILE; never a global sync). The URC log gets one fixed word, +CMT (PDU spooled) or +CMT (not spooled): not the header, which in text mode would carry the sender, and never the second line. A frame inside a reply is taken out of it (a client parsing AT+CMGL would read the PDU line as one of its own). Every 5 s mu300-smsd pools each *.ready with mu300-sms import-pdu FILE and only then sends AT+CNMA=1; an import or an acknowledgement that fails ends the round and is retried, three failed rounds in a row set the files aside as *.failed and fall back to the SIM path. import-pdu refuses anything the codec makes no message of, then parks the PDU in $POOL/parts (mktemp, rename, fsync) and absorbs the parked parts with the same decoding and grouping a SIM listing goes through, so a long message's parts wait for each other there as they did on the SIM, with the same MU300_SMS_PARTIAL_WAIT; the periodic sync lists the SIM and the parked parts together, so a part whose siblings never come is pooled after the hour, and the parts of one message join across the SIM (a class 2 part) and the air. The pool's dedupe (fingerprint, tombstones) applies: a message the modem delivers again after a lost acknowledgement is not pooled twice, and one deleted from the pool stays deleted. The daemon exports MU300_AT_LOCK_WAIT=8, so a client stuck on the AT channel cannot hold the receiver behind mu300-at's 90 s default. Everything that writes as root into the pool (import-pdu, the spooler, the daemon's spool loop) refuses symbolic links and directories that are not ours (own_dir/own_file, mu300-update's lock rule) and makes the directories mode 700.

What the modem does (U30 Air, Vodafone TR). AT+CNMI=? gives (0-3),(0-3),(0-3),(0-2),(0-1), AT+CSMS=? (0-1). It answers OK to AT+CNMI=3,2,2,0,1 and then reports +CNMI: 3,2,1,0,1 - it keeps a bm of its own, so the daemon's periodic check (every full sync, after which it re-applies the setting) looks at mt alone. ds=0 rather than the fork's ds=1 on purpose: nothing here asks for status reports (no SRR bit), and a report routed to the TE would need an acknowledgement of its own, which is the one thing that makes the modem drop the routing by itself (27.005: no CNMA in time, mt and ds back to 0). A two-part reply from 7000 came as two frames (+CMT: ,157 then +CMT: ,75, three seconds apart), the second only after the first was acknowledged; the SIM/ME store stayed at "ME",0,0. The modem held an unacknowledged message for two minutes without dropping the routing (measured by accident: the daemon was stopped between the frame and its import, the spool kept both PDUs, the restarted daemon imported and acknowledged them and +CNMI? still said 3,2,1,0,1).

Device test (mu300-sms send 7000 KALAN, the line answers within seconds):

daemon.info mu300-smsd[9008]: sync: 0 new, 0 on the SIM, 42 in the pool, 0 moved off the SIM
daemon.err  mu300-smsd[9008]: mu300-smsd: direct delivery is on (+CMT frames into /etc/mu300/sms-pool/incoming)
daemon.info mu300-smsd[9008]: import: 0 new, 43 in the pool, 1 waiting for its other parts
daemon.err  mu300-smsd[9008]: mu300-smsd: pooled and acknowledged cmt-1791808049.ePLCmA.ready
daemon.info mu300-smsd[9008]: new: 000049 from 7000 2026-10-12 15:27:29
daemon.info mu300-smsd[9008]: import: 1 new, 44 in the pool
daemon.err  mu300-smsd[9008]: mu300-smsd: pooled and acknowledged cmt-1791808053.iFAgce.ready
# /run/mu300-at/urc/stty_nr0.log:   +CMT (PDU spooled)  (twice; no PDU, no header fields)
# AT+CPMS? -> +CPMS: "ME",0,0,"ME",0,0,"ME",0,0        AT+CNMI? -> +CNMI: 3,2,1,0,1
# mu300-sms show 49 -> sim index:   not on the SIM; ubus call mu300dash sms_list lists 000049 (the panel's page)

The fallback, forced with MU300_SMS_DIRECT=0: the modem did not take direct delivery (or MU300_SMS_DIRECT=0); new messages are stored on the SIM and announced (+CMTI), +CNMI: 2,1,0,0,0, and the same send answered through the old path - +CMTI: "SM",2 in the URC log, new: 000053 from 7000, sync: 1 new, 1 on the SIM, 48 in the pool, 2 moved off the SIM, sim index: 1,2, the SIM empty again afterwards. The service restarted went back to direct delivery.

Tests (tests/test_sms_pool.py, tests/test_device_scripts.py Atd): import-pdu pools a message with no AT command, is idempotent, honours tombstones, joins parts and leaves the waiting ones parked, pools a stale part by a sync, joins a SIM part with an air part, refuses non-hex/odd/undecodable/overlong PDUs and every link (a spool entry, the parts directory, the pool), fsyncs the parked part before the pool is touched; the spooler writes mode 600 into a 700 directory with the two fsyncs and nothing else, refuses bad frames and linked directories; the daemon (Linux only: it tells a live holder by /proc) asks for direct delivery after the first sync, acknowledges after the import and in spool order, falls back on each refusal and on MU300_SMS_DIRECT=0 with +CMTI still working, never acknowledges a failed import, gives up after three rounds, keeps the file when the ack is refused, puts the routing back when +CNMI? says the modem dropped it, sets a linked spool entry aside; mu300-atd on a pty spools a frame from nr0, from inside a reply (kept out of the answer), from a drain, logs the fixed word only, drops a text-mode frame (sender and text reach nothing), and goes on without the spooler.

Ubuntu. mu300-atd and the spooler are on every system, so a +CMT frame there is spooled too and never logged - but nothing on Ubuntu asks for direct delivery, and that is deliberate: the system's SMS tool, sms, has no daemon and no pool; sms watch polls the store (AT+CPMS?/AT+CMGL), which cannot miss a message, and sms list/read read the SIM. A message routed to the TE needs something running to acknowledge it, or the modem drops the routing and stores the next ones unannounced; a daemon with a pool is what openwrt-luci has and Ubuntu does not. So on Ubuntu the modem stays in its storage mode (the fork's smsd is openwrt-luci only here as well), and a PDU that ever lands in /etc/mu300/sms-pool/incoming there (someone set AT+CNMI mt=2 by hand) is kept, unacknowledged, for an mu300-sms import-pdu that does not exist on that system - documented rather than half-built.

52. The lock reset deleted the saved locks whether or not the modem took them: a verified reset

lock reset (PR #99; the Locks page's "Reset all to automatic", and "Reset locks and switch" before an OS switch) sent the seven automatic values, deleted the five saved settings, restarted the stack and refreshed the cache. It never looked at an answer: a write the modem refused, a silent channel, or a mode query that failed (the mode write carries the modem's own slot1 and primary-SIM fields read a moment before) all ended the same way, with the saved settings gone and the page reading back whatever the modem had. kanoqwq's fork (23361ce, reviewed in docs/superpowers/reviews/2026-10-11-kano-clean-tf-7.2.md) does this properly; its version sits on an asynchronous lock-job queue (lock-apply.sh, lock-jobs.sh) that was not wanted here. The semantics are ported onto our synchronous tool; the job queue is not.

What lock reset does now (openwrt/luci-app-mu300/root/usr/libexec/unisoc-modem/lock):

  1. One reset at a time, as before (the apply directory; a dead holder's directory is taken over). A tombstone an earlier reset left (below) is finished first.
  2. AT+SPTESTMODE? must answer, and the two fields that go back out (slot1, primary) must be digits, or nothing is sent: "The modem did not answer the mode query; nothing was sent". Every other AT string of the reset is a fixed constant.
  3. The seven writes (SP5GRAN=1, SPTESTMODE=134,<m1>,<prim>, SPENDC=1, SPLBAND=1,0,0,0,0,0, SPLBAND=2,0,0,0,0, SPFORCEFRQ=12,4, SPFORCEFRQ=16,4) each have their answer checked: an explicit ERROR/+CME ERROR stops the reset there ("The modem refused a write", with the command). Silence is not a failure - several vendor setters apply the value and omit the final OK (the boot replay already relies on that) - the read-back decides.
  4. Read-back before the restart: SPTESTMODE? first field 134, SP5GRAN? 1, SPENDC? 1, SPLBAND=0 an empty mask or the full LTE table, SPLBAND=3 an empty mask or the full set of the NR bands SP5GCMDS lists that the SPLBAND codec can carry (n6 is supported and not encodable, so the capability list itself is the wrong comparison), SPFORCEFRQ=12,3 and 16,3 exactly 12,3 / 16,3. Three tries a second apart; a mismatch names the step.
  5. The one stack restart (under mobile-data's radio lock, as every apply), then the same read-back again, up to ten tries three seconds apart: right after SFUN=4 the modem answers CFUN? but not the lock reads for a few seconds (the guard in do_get exists for the same reason).
  6. Only now the saved settings go: a reset_pending tombstone is written first, then mode endc lte nr cell are deleted, then the tombstone. A reset interrupted between the two (a kill, a reboot) leaves the tombstone, and the next apply finishes the deletion before it saves its own setting, the next replay (early or late) before it reads anything to replay - so a half-deleted set is never replayed and a fresh setting is never deleted later. The replay switch (auto_apply) stays, as before.
  7. The result - {"state":ok|failed|interrupted|running,"ts","end","pid","error","step","cmd"} - goes to /var/run/unisoc-modem/lock-reset.json and to stdout (exit 1 on a failure). lock get carries it as reset, so mu300dash lock_get does too: the page polls that, since the reset was already started detached from the rpcd call (setsid lock reset, PR #137's budget) and now takes 8-10 s plus whatever the radio lock makes it wait. A result still running whose pid is gone is reported as interrupted. A failed reset keeps the saved settings, says why ("Reset failed: ... The saved lock settings were kept."), and refreshes the cache, because the modem may hold part of the automatic values by then - a partial write cannot be rolled back. The home page's "Reset locks and switch" stops on a failed reset instead of switching to an Android that would come up with the locks the modem still has.

Measured on F50-B (openwrt-luci v2026.10.22, kernel 7.2.10, Netgsm on LTE B1, EARFCN 100, PCI 69):

  • lock apply lte 1 (CLI, 5.3 s) and mu300dash lock_set cell=lte:100,69 (rpcd, detached, done 6 s later) read back as +SPLBAND: 0,0,0,1,0 and +SPFORCEFRQ: 12,3,100,69, saved as lte=1, cell=lte:100,69.
  • mu300dash lock_set reset=auto: lock_get showed reset.state=ok 10 s after the call; the log: writes and first read-back in 2 s, SFUN 5 -> 4 7 s, the second read-back matched at its first try, reset verified (8s). Read-back afterwards: SPTESTMODE 134,134,0,19,3,1, SP5GRAN 1, ENDC 1, SPLBAND=0 -> 0,482,0,149,0, SPLBAND=3 -> 0,0,0 (a cleared NR mask reads back empty here; after a boot the same modem reported the full set 553,0,272 - both count as automatic), SPFORCEFRQ 12,3 and 16,3; the state directory empty.
  • A reset killed with SIGKILL 1.5 s after its start (during the writes: the modem already had the cleared masks, no restart yet): the saved lte kept, lock_get -> {"state":"interrupted","error":"The reset was interrupted"}, the apply directory left with a dead pid; the next lock reset took it over and verified in 8 s.
  • The tombstone: with reset_pending and a saved lte, lock apply endc on left endc alone in the directory; with reset_pending, lte and endc, lock replay early (its marker redirected) emptied the directory, wrote the marker and sent no AT command.
  • The CLI's final lock reset printed {"state":"ok",...} in 8.4 s and left no lock in the modem.

Not measured: a modem that refuses one of the seven writes, or that answers the read-back with something else - on this board every write took. Those paths are covered by the unit tests on a fake modem that answers each read from what the writes so far have changed (tests/test_unisoc_plugin.py), including the kill between the tombstone and the deletion (the rm stub kills the tool at that moment). The single apply paths still send their write and save the setting unverified; only their start now finishes a pending tombstone.

Noted during the test: F50-B's openwrt-luci system has LuCI's default LAN 192.168.77.1, the same subnet as F50 #1 on the same computer (its Ubuntu system is at 192.168.79.1); it was reached over its USB link-local address (root@fe80::50:78ff:fe24:7701%en17). The subnet-per-device rule of §33b holds only when every system of the board is configured.

53. A carrier name shown as hex: UCS2 from a modem whose character set is not UCS2 (#174)

A user's panel showed Carrier: 4E2D56FD8054901A beside PLMN: 46001 (F50, OpenWrt, 6.18, v2026.10.20; issue #174). That is 中国联通 in UCS2, as hex. Not measured on our boards (no SIM whose name is outside the default alphabet): the report, the code and unit tests.

  • Why it was not decoded. The collector (unisoc-modem/cell, cops_fragment) read a name as UCS2 hex only when AT+CSCS? said UCS2. This modem says HEX (§46) and does not treat the operator name the way that character set is documented: a name that fits the default alphabet comes as text (the panel has shown vodafone TR since it asks for names), and by this report a name the SIM or the network holds in UCS2 comes as that UCS2 in hex. So the character set does not say how the name is written; it did not for text-mode SMS addresses (§26c) or USSD (§26d) either.
  • The rule now. With character set UCS2: as before (any whole number of code units that is valid UTF-16 with no control character). With any other character set, or none read: the same decoding, but only for a text that cannot reasonably be a name - at least two code units (8 hex digits; CAFE, BEEF and FACE are words), not all decimal digits (a name of digits stays a name: 12345678, 00540054), and no private-use or non-character code point. Anything that fails stays the text the modem gave; with no name at all the page still names the operator from the PLMN (common.js). No carrier and no PLMN is hard-coded.
  • Nothing to clear. What is kept per PLMN in /var/run/unisoc-modem/operator is the modem's own line and its character set, not the decoded name; cell.json is rewritten every full round. The runtime directory is a tmpfs, and an update ends in a reboot, so no old value survives the fix.

Open: a name of two or more code units that are all decimal digits (U+8054 U+9010 would be 80549010) stays hex under a character set other than UCS2 - the price of leaving digit names alone. Not seen in a report.

136. A carrier name the catalog has in another case stayed English (#231)

A Chinese panel showed CHINA BROADNET for a China Broadnet SIM (F50, OpenWrt, 6.18; issue #231): the modem answered +COPS: 0,0,"CHINA BROADNET",11, the catalogs have msgid "China Broadnet", and a catalog key matches only exactly, so _() gave the name back unchanged and carrierName (common.js) returned it before it ever looked at the PLMN. Not measured on our boards (no such SIM): the report, the code and a unit test.

  • The rule now (carrierName): a name the catalog has exactly is translated, as before. Otherwise the name is looked up again with its case and spacing folded among the five mainland carriers the panel already knows by PLMN (CARRIER_NAMES, the same five messages, so no catalog changes), then by its PLMN (PLMN_CN); only a name that is in neither is shown as the modem gave it. One effect beyond the report: a mainland network whose modem name is not one of those five (CMCC, CHN-CT) is now named by its PLMN, as it was when COPS gave the numeric format. Networks outside that table are untouched (vodafone TR stays vodafone TR).
  • The lookup is an own-property test, so a name like constructor is not answered from the object's prototype.
  • tools/luci-i18n.py allows a non-literal _() argument only for the names it lists; the call stays _(carrier.name), the one that list has.

Test: tests/test_luci_i18n.py Languages.test_carrier_name_whatever_its_case, English and Simplified Chinese.

54. A webhook body of the user's own for SMS forwarding: values escaped for the type, never evaluated (#171)

The webhook of §39 sent one of two fixed bodies (JSON or a form with sender, time, text, device, message), which no chat service accepts as it is (issue #171: Lark/Feishu, DingTalk, WeCom, Slack, Discord, Bark, ntfy). Measured on this machine only (unit tests against the stub HTTP helper: dash and bash on macOS, busybox ash and dash with busybox 1.37 as awk in a Debian container); not sent from a device to a real service.

  • A backslash in a template was stored bare (found here, older than the body). The adapter wrote a template to its one line with gsub(/\\/, "\\\\"). What that replacement means differs between awks: macOS's awk writes two backslashes, busybox awk - the device's - writes one. So on the device a template's \n (two characters) was stored as it was and read back as a line break, and \" lost its backslash. Nobody reported it for the message template, but a JSON body is made of exactly those. esc_tpl now doubles backslashes with index() and a concatenation, with no replacement string; the test that pins it fails with the old code only where awk is busybox, which is why the macOS run never saw it.

  • What was added. A body template of the user's own (webhook_body in /etc/mu300/sms-forward.conf, stored on one line like the message template) with {sender}, {time}, {text}, {device} and {message} (the message template filled in), and a third type, plain text. The type is the Content-Type - which stays the device's to set, never a header of the user's - and decides how a value is written into the body: JSON as the inside of a string (quote, backslash and every control character escaped; the quotes are the template's), form percent-encoded, text as it is. An empty body is the standard one, byte for byte what it was; for plain text that is the message alone.

  • Why a message cannot break out of the body. One awk function (fill in mu300-sms-forward, which the message template now uses too) gets the template and the values in its environment and only copies them: no shell, no eval, no awk -v (which reads escapes), and one pass - a {sender} that arrives inside an SMS is text. The tests send a sender and a text made of quotes, backslashes, ","admin":true, $(...), backticks, &d=e and control characters through each type and parse what comes out.

  • Limits. The panel takes 2000 bytes of template and no control character but newline and tab; the forwarder refuses a filled-in body over 64 KiB (the webhook body is too large in the log, not retried), so a template that repeats {text} cannot grow without bound.

  • Not a secret. The address and the headers never come back to the page (§39); the body does, because a template that cannot be read cannot be edited, and an empty field has to mean "the standard body", not "keep". The page says so and tells the user to keep keys in the address or a header. A service that wants a key inside the body is the case this does not serve well.

  • Not validated. A JSON body is not checked when it is saved: the device has no JSON parser the tests can run, and a check that wrongly refused a valid body would be worse than none. "Send test" sends the saved body and the log shows the server's status.

Open, from the same issue: a service that answers HTTP 200 with its own error inside (DingTalk errcode, Feishu code) is logged as delivered - the HTTP helper passes on the status and nothing of the reply's body (sms-forward-http.uc), so that no reply reaches a log; and the delivery log (RAM, the last 100 lines) has no clear button. Both are §58. Section 53 is PR #195's (the carrier name); this branch does not have it.

55. Imported Android files nobody but root could read: the CP was never loaded (#127, #135, #170)

Three users' F50s (China Telecom SIMs, OpenWrt on an SD card, mainline 6.18 and 7.2) had no modem: mu300-atd restarted every 10 s with can't create /dev/stty_nr1: No such device, radio.log repeated no valid answer to the RIL handshake (AT+SMMSWAP=0), /sys/kernel/debug/modem/modem said run_state: 255, modem_base: 0x0. Two of them found the five imported trees under /opt/mu300/android (dev-properties, vendor, system, apex, linkerconfig) 0700 root:root, files and directories alike, and got a modem by chmod. PR #143 (v2026.10.20) had changed the account the daemons run as and the device nodes, not these files; #127's reporter measured v2026.10.20 and it still failed.

Why the modes matter. modem_control and refnotify do not stay root: mu300vnd through setpriv where the system has the account (§41), else their own setuid(1000). They keep CAP_CHOWN/CAP_BLOCK_SUSPEND and CAP_SYS_TIME, nothing that reads past a mode. cp_diskserver stays root and does not care.

Where 0700 came from. install.sh on macOS with its folder on FAT or exFAT. Measured on this Mac (an exFAT image, android-vendor/extract-subset.sh from the F50-B, then tools/vendor-overlay.py): the volume shows every file and directory as rwx------ owned by the user, the empty ld.config.txt made by : > included; gettarinfo stored that, the tool sets the owner to root, and the overlay's 390 entries were 375 -rwx------ root, 14 drwx------ root and the link. A time before 1980 is clamped there too: linker64 (1970 on the device) came out as Jan 1 1980, local time. #127's listing has the property files at Dec 31 1979 - that moment seen in UTC from a host east of it, as UTC+8 would be - where a system installed from an ordinary folder has Jan 1 1970. The initramfs copy is not affected: boot/build-boot-image.py decides 0755/0644 by os.access, which is why such a device still boots and only the installed system's copy is wrong. Windows (the subset comes from the device's own archive there) and a folder on a file system that keeps modes were never affected.

What each state looks like (F50-B, baseband 5G_MODEM_V2_22C_W25.39.4 - the same as #170's device - release v2026.10.22, the trees changed by hand and the board rebooted):

imported files system, kernel modem_control Trusty lines in dmesg result
all five trees 0700 openwrt-luci, 7.2.10 runs as uid 1000 none run_state: 255, modem_base: 0x0 (#127)
all five trees 0700 Ubuntu 24.04, 7.2.10 chroot: failed to run command '/vendor/bin/modem_control': Permission denied, the service restarts every 4 s none the same
vendor/etc alone 0700 Ubuntu 24.04 and openwrt-luci, 7.2.10 (Ubuntu's log) Failed to access xml, error /vendor/etc/modem_cp_info.xml: Permission denied (and _sp_, _ch_), modem_head_correct_load_info: can't get modem img!, then open /dev/spipe_nr2 failed, error: No such device every second enter SEC_KBC_GET_TEECFG_FLAG, g_wifionly_flag = 0, enter SEC_KBC_STOP_CP, SEC_KBC_STOP_CP() ret = 0, SEC_FIREWALL_UNLOCK_CP_DDR() ret = 0, kbc_send_response rc = 4, enter SEC_KBC_GET_LOAD_MODEM_FLAG - and nothing after it run_state: 255 (#170's dmesg, line for line)
vendor/etc alone 0700 openwrt-luci, 5.4.254 - (no vendor log, see below) the same lines, and nothing after them the same: the kernel makes no difference
as installed each of the above on 7.2.10 - ... GET_LOAD_MODEM_FLAG, one second of image loading, kbc_verify_all_avb2() ret = 0, SEC_KBC_START_CP() ret = 0, modem run = 1! three times data up 31-35 s after power-on

With the property area unreadable the daemons end earlier (Access denied finding property "ro.vendor.radio.modemtype", can't get modem type!: #127's log) and never call Trusty. A dump_table() len = 0 under SEC_KBC_STOP_CP is printed on a good start too; the sign is what follows GET_LOAD_MODEM_FLAG.

#170 reads "mainline never starts the CP, 5.4 does, same installation". Its dmesg is the third row. The F50-B, with the same baseband, starts the CP on 7.2.10 from that release's own Magisk zip (below), and with the files unreadable 5.4 fails exactly as 7.2 does. So the kernel is not what differed between that device's boots; what did is not known (asked in the issue: the modes of the trees, the vendor log, and how each kernel was put on - a Magisk zip imports the files again, mu300-update kernel does not).

The Magisk zip's import was measured for that reason (magisk --install-module mu300-magisk-v2026.10.22-openwrt-luci-k7.2.zip on the F50-B, Magisk 30.6): the modem started (run = 1 at 14 s, data at 32 s), so that path does not make 0700 here - but what it installed was wrong the other way. Under magisk --install-module the umask is 000, and collect_subset names only files, so tar made the directories itself: 16 directories 0777, linkerconfig/ld.config.txt 0666. And tar keeps Android's owners: 32 libraries (bionic, the VNDK) owned by uid 1000, six programs, linker64 and one directory by gid 2000. Uid 1000 is the first login account on Ubuntu, and root's cp_diskserver loads that libc: a login user could become root through it. (An install started in the Magisk app goes through the zip's update-binary, which sets 022; not measured. The owners do not depend on it.) Under a umask of 077 the same code makes vendor/etc 0700 - the third row.

The fix.

  • android-vendor-start, before anything else (block modes): one find over the five trees for anything not root's, a directory that is not 0755 (0711, Android's mode for the property area, is left), a file in a bin directory that is not 0755, a property file that is not 0444, any other file that is not 0644. Nothing found: no write, 6 ms. Else five find ... -exec set owner and modes (links untouched, -xdev), the check runs again, and one line says how many entries and the first - to stderr and to /dev/kmsg, because OpenWrt starts this service before its log daemon - with a vendor-modes-repaired (or vendor-modes-wrong) mark in the boot timeline. This is the part that repairs an installed system: mu300-update carries the vendor files over as they are.
  • tools/vendor-overlay.py: host_free_mode - the mode of an entry from where it goes (the same rule), never from the host. The same exFAT volume now gives drwxr-xr-x, -rwxr-xr-x in bin, -r--r--r-- properties, -rw-r--r-- for the rest.
  • tools/android-boot-image.sh: collect_subset, collect_gpu, collect_firmware and vendor_overlay run under umask 022 whatever the caller has (the caller's is not changed), and the overlay is chown -hR 0:0 before it is packed. mu300-install.sh and android-install.sh set umask 022 at the top. On the F50-B under Magisk's busybox, with the caller's umask 000 and 077: 334 -r--r--r--, 73 -rw-r--r--, 7 -rwxr-xr-x, 19 drwxr-xr-x, the property directory drwx--x--x, all root/root.
  • android-vendor-start makes /var/log before it starts logdw. On OpenWrt the service is S09 and /var/log is made by boot at S10; procd starts the script at once, and when it reached the line first the redirection failed and logdw never ran: no /var/log/android-logcat.txt on three of four boots here. #135 reported the same after a reboot ("logdw did not start"), #170 shows no vendor log at all, and #127 had one because the service had been restarted by hand.

Measured on F50-B with the new script (release v2026.10.22 otherwise):

  • openwrt-luci, 7.2.10, all five trees 0700 and the mixed owners an earlier zip install had left: repaired at boot, kbc_verify_all_avb2 at 13.8 s, up on sipa_eth0 at 31.7 s, daemons uid 1000, android-logcat.txt written.
  • openwrt-luci as the v2026.10.22 zip had just installed it: [ 12.053529] android-vendor-start: 57 imported Android files and directories had an owner or a mode the vendor daemons cannot work with (the first: /opt/mu300/android/vendor); now root's, 0755/0644/0444; marks vendor-start 11.98, vendor-modes-repaired 12.07; afterwards nothing world-writable, nothing not root's; run = 1 at 14.0 s, data at 31.9 s.
  • Ubuntu 24.04, 7.2.10, all five trees 0700: 427 entries repaired between 9.16 s and 9.23 s, run = 1 at 11.5 s, data at 34.8 s, daemons mu300vnd. The boot after it: no line, no mark, the modes unchanged.

Not measured: a Magisk zip built from this branch and installed end to end (its import functions were run on the device; the zip was not rebuilt), 6.18, the U30 Air.

56. The VPN page showed a refused config without its reason; the engines' own defects are in the VPN module's FINDINGS 26i-26m

"There is a problem in the VPN part, mihomo and the like" (no details, no issue): the non-default engines were run end to end on the U30 Air (OpenWrt openwrt-luci v2026.10.22, kernel 7.2.10, VPN module v2.0.0), from the command line and through the page's own calls (ubus call mu300vpn ...). What was broken is in the module, and written up there (mu300-linux-vpn FINDINGS 26i-26m): on a SIM whose carrier lets DNS through to its own resolvers only, sing-box, mihomo and dae never found their server (BOOTSTRAP_DNS 1.1.1.1 did not answer); a mihomo config with GEOSITE/GEOIP rules could not start, and switching to it took the working tunnel down; dae was stopped every 40 s by a start check that cannot pass on kernels from 6.6 on; a raw sing-box config that says nothing about DNS left the device and the router's DNS without names; logs ENGINE hid the engines' own errors, latency said "unreachable" for every server, and profile check ID, which the page calls, did not exist.

Two defects were the page's own. Its check asked for profile check ID, the spec's name for a command the module only has as check ID: the backend now calls check ID, which every module version answers (the module gets the other name too). And mu300-vpn ends a refused import, edit or switch with a line that says only that nothing was done, after the line that says why:

the mihomo config has no proxies or proxy-providers at the top level
profile not added

mu300vpn's cli took the last line of stderr as the message, so every refused config read "The profile could not be added - profile not added" (and "The config was not saved - profile t-mh not changed"), whatever was wrong with it: a YAML without proxies, a link dae cannot take, a config mihomo rejects. cli_message now takes the line before such a closing line (profile [ID] not added|changed, subscription [ID] not added|refreshed, profile ID does not check: ..., profile ID cannot run on this system: ...), never one of the CLI's note: lines, and the closing line itself when it stands alone. Measured on the device with the backend in place: the same three requests now answer with "the mihomo config has no proxies or proxy-providers at the top level", "the link turns the server's certificate check off (allowInsecure), and dae cannot pin the certificate ...", and "mihomo rejects the config as this driver rebuilds it (at rules[1], as mihomo counts) ..." (the last with the module's fix).

Through the page's calls, on the fixed module: profile_add (a mihomo YAML as text, an ss link as dae, a vless link as sing-box), profile_check, use, status with the exit address, logs per engine, killswitch on and off, sub_refresh (one, due) with job, latency (one, all), engine_remove refused while in use, profile_remove: all as the page expects. sub_add takes https only, which could not be served on the test link (the CLI's --insecure did the subscriptions there). Not looked at in a browser: the pages themselves.

57. A 64 GB unit whose partition table has userdata filling the disk, and no way to make room from Windows (#32)

Reported in issue #32, in three lines and without a number from the device: on a 64 GB unit a vendor firmware image replaced the partition table by one in which userdata "fills the entire disk"; install.ps1 refused it as a layout it does not know; and a 4096-sector alignment computation came out as -4 MiB. Nothing here was measured on a device. We have no unit with that table, and the issue has no -Check output, no sector and no name of the image. Not known: which image it was, where userdata begins in that table, whether it is the last entry, whether the other partitions are where the factory table has them, and whether the GPT's last usable LBA is the factory one.

What the code says about it:

  • The -4 MiB is the region arithmetic, and it is what a table that ends at the end of the eMMC gives. Both installers take the free region from the first 4096-sector (2 MiB) boundary behind the last partition - the next one even when the partition ends on one - to the last boundary but one before the backup GPT (region_probe in tools/storage.sh, the same two lines in install.ps1). With the figures of #9 (122159104 sectors, last usable LBA 122155007) and userdata up to the last usable LBA, the partitions end at sector 122155008 = 29823 x 4096: the start is 29824 x 4096 = 122159104, the end of the disk, and the end is 29822 x 4096 = 122150912, which is 8192 sectors or 4 MiB before it. Any table whose last partition ends in the last 2 MiB of this eMMC gives the same -4 MiB, so the number fits the report and does not tell where exactly userdata ends.
  • When the issue was written, install.ps1 printed that number ("only -4 MiB of free space after the last partition: this device has a different layout") and install.sh went on to offer_repartition. Since the fix for #65 a crossed region is an empty one in both, so Windows said "only 0 MiB" - and still had nothing to offer. The arithmetic is now a function there (FreeRegion) with the layout above among its tests.
  • install.ps1 had no make-room path at all; offer_repartition (#9b) existed in install.sh only. It now has OfferRepartition, the same steps in the same order: the first 34 and the last 33 sectors of the eMMC are copied to work\gpt\gpt.head and gpt.tail (that copy is the backup of the table) and nothing else is read; tools/resize-last-partition.py --show checks both GPT copies and refuses when userdata is not the last partition; at least 4 GiB stay with Android and Linux gets at least 800 MiB; the questions are the same (yes/no with no as the default, the GiB for Linux, the word ERASE typed as it is); the backup GPT is written before the primary; the table is read back and compared; the first 32 MiB of userdata are cleared so that Android formats it; the device reboots and the installer is run again. Only those three writes exist: the two copies of the table and the start of userdata. -Check prints the figures and writes nothing.
  • Two things the Windows path does that install.sh does not: it compares the SHA-256 of the two pushed files on the device with the ones the tool made before dd writes them (a push that failed or stopped halfway would be written as it is), and it deletes the table files of an earlier run before it reads the table, so one of them cannot stand in for a read that failed. Neither was seen to go wrong; both are cheap.
  • A refusal now carries its figures: the eMMC's size in GiB and sectors, the sector the partitions end at, the free MiB behind them, the 700 MiB needed there and what is missing; the tool's own reason when it refuses the table ("the last partition is 'x', not 'userdata'", a CRC that does not match); and, when there is too little to split, userdata's sectors, the 4096 + 800 MiB needed and what is missing.

What is tested, and what is not: tests/fakegpt.py builds the table of #9 with userdata extended to the last usable LBA (the other partitions' sizes are made up; only userdata's sectors and the order matter), and the real tool edits it. tests/test_resize_last_partition.py checks that the edit changes userdata's last sector and the CRCs and no other byte, and what is refused; tests/installer.Tests.ps1 runs OfferRepartition under Windows PowerShell 5.1 and PowerShell 7 against three stubs for the device and checks every answer that must change nothing, the order of the writes, and the refusals. Not run: install.ps1 on a Windows machine against a device, and either installer on a unit with this table. (2026-10-22, #357: liuwang97 ran prepare, reset and resume with install.ps1 on a 32 GB U30 Air under Windows 11; the resume stopped at once because it called ResumeFacts and the GPT helpers above their definitions, fixed by moving them and guarded by test_static.Ps1FunctionOrder. Their report, not repeated here.) The shrink itself has been done on one 32 GB unit (#9b, issue #2); whether Android formats a 64 GB userdata that was shrunk this way after a vendor flash is not known. uninstall.ps1 does not offer to grow userdata back; uninstall.sh does.

59. The VPN page said "the other engines stay IPv4": with the module's IPV6=auto they are asked now (#202)

Issue #202, third point: with IPV6=auto a sing-box tunnel stayed IPv4 whatever its server could do. That was what auto meant, and what the VPN page says under IPv6: "Automatic: WireGuard uses the IPv6 addresses of its config, the other engines stay IPv4." The change is in the VPN module (mu300-linux-vpn FINDINGS 26n): Xray, sing-box and mihomo are asked at every start - an HTTP request to two IPv6-only addresses through the tunnel, before any IPv6 is routed into it - and carry IPv6 only after an answer; mu300-vpn status --json says who decided (ipv6.source: probe, setting or config). Measured there on the U30 Air, both answers on all three engines.

Here only the sentence changes, in the page and in every catalog: "Automatic: WireGuard and OpenVPN use the IPv6 addresses of their config; Xray, sing-box and mihomo are asked at every start whether IPv6 works through the tunnel, and carry it only then; dae stays IPv4." The page's two rows need nothing: "The tunnel carries IPv6" reads ipv6.tunnel, which is the answer, and "IPv6 guard" stays "Active" beside a tunnel that carries IPv6 because it was asked (the module keeps the guard up through such a run: there is no moment between "refused" and "in the tunnel"), which is what its text says: IPv6 outside the tunnel is refused. The chip on the overview takes ipv6.tunnel first, so it says "IPv6 in the tunnel".

With a module from before this (v2.0.1 and earlier) the sentence is ahead of the device: there auto leaves those engines on IPv4, as the old sentence said. Not looked at in a browser: the page was not opened for this change (one string; tools/luci-i18n.py check passes), and the translations of the new sentence were written with it, not read by a speaker of each language.

60. /run takes files from every user: the daemons' directories there are checked, and a squatted name is put out of the way

Found while checking daemon runtime directories on F50-B (2026-10-13).

  • boot/init mounts /run as a plain tmpfs, which is mode 1777 - like /tmp, not the 0755 systemd would give it. Any local user (a service account, the vendor daemons' own account of 41) can make /run/<name> before the daemon that expects to own it: measured, an unprivileged user created a file there.
  • mu300-atd did mkdir -p /run/mu300-at and looked no further: in a stranger's directory, or behind his symlink, the command fifo is his to write (AT commands, as root's daemon) and every answer his to read.
  • rootfs/overlay/opt/mu300/lib/run-dir.sh, the shared runtime-directory helper: run_dir_ours (a real directory, not a symlink; the daemon's own uid; not writable by group or others) and run_dir_take, which makes the directory that - a plain mkdir, never mkdir -p (through a symlink that makes the directory where it points). The first version of the check refused a foreign directory and stayed down until somebody removed it, which turned the squat into a denial of service; the second removed it with rm -rf, which is a race - whoever squatted can still write /run, and busybox's recursive remove walks by path. Now nothing depends on what was seen and nothing is deleted recursively: a non-directory goes with rm -f --, an empty directory with rmdir (neither follows a symlink at that name, each fails harmlessly on the other kind), a directory with contents is moved whole into /run/.<name>.foreign.<pid> (made by mkdir: ours and 0700, or nothing is moved) and left there to be looked at, and what counts in the end is the check again. A caller who is not the owner gets the check alone and never creates the directory.
  • /run/mu300-at/urc is 0700 now: with caller id enabled every ring writes the caller's number into that log, which was world-readable. Every reader is root.

Measured on F50-B as root under dash, bash and busybox ash: a directory made first by another user (with a fifo named cmd in it) and a symlink to /etc were both put out of the way, /etc untouched, the second call silent; the AT daemon remained available. Open: /run is still 1777 - mount -t tmpfs -o mode=755 in boot/init is the real fix, and it is a boot change that wants its own device test. /run/mu300-at/answer.<pid> and /run/mu300/ are as they were.

58. A service's own error in an HTTP 200 answer to the SMS webhook, and a button that clears the delivery log (#171)

The two points §54 left open. The webhook counted any 2xx as "Delivered"; chat services answer 200 and put their refusal in the body. Measured on the U30 Air (openwrt-luci v2026.10.23, kernel 7.2.10) against a fake webhook on the LAN that answers like the services; not sent to any real service.

  • One rule the user sets, not a table of services. "The answer must contain": KEY=VALUE (webhook_expect in /etc/mu300/sms-forward.conf). With it, a 2xx is a delivery only when the answer is a JSON object whose top-level KEY is the scalar VALUE. Empty (the default, and what a page from before the field sends): any 2xx, exactly as before - the helper is not even asked for the answer then. The page's presets (errcode=0, code=0, code=200, ok=true) only fill the field in. A table of services in the code would be wrong the day one of them changes; none of the answers below needs more than a top-level key.

  • What the services answer (read from their documentation on 2026-10-13, not from a real request):

    Service Answer Rule Source
    WeCom group robot errcode 0 is success, "judge by errcode, not errmsg"; 93000 invalid webhook, 45009 rate limit, -1 busy errcode=0 developer.work.weixin.qq.com/document/path/90313 (the send page, /path/91770, shows no reply)
    Feishu / Lark custom bot {"code":0,"msg":"success","data":{}} (StatusCode/StatusMessage kept for old clients); 9499 bad request, 19021 signature, 19022 IP, 19024 keyword, 11232 rate limit. The page gives no HTTP status code=0 open.feishu.cn/document/client-docs/bot-v3/add-custom-bot
    Bark {"code":200,"message":"success","timestamp":N}; a failure is code 400 or 500 and the same HTTP status, so the status alone already catches it. A batch push answers 200 with a code per device inside data, which a top-level rule cannot see none needed (code=200 is harmless) bark-server router.go (CommonResp), route_push.go
    Slack incoming webhook 200 with the plain text ok; errors are HTTP 400/403/404 with a word (invalid_payload) none: with a rule set every delivery fails docs.slack.dev/messaging/sending-messages-using-incoming-webhooks
    Slack Web API a top-level boolean ok, error with a short code; the page gives no HTTP status ok=true docs.slack.dev/apis/web-api
    Telegram Bot API ok (boolean), description, error_code; the page gives no HTTP status. The Telegram target here is unchanged (status only) ok=true for a webhook pointed at it core.telegram.org/bots/api, "Making requests"
    DingTalk custom robot not read from its own documentation: open.dingtalk.com renders its pages by script and gave navigation only. Alibaba Cloud's help page quotes the reply 310000: sign not match; {"errcode":0,"errmsg":"ok"} is what every third-party write-up shows errcode=0 help.aliyun.com/document_detail/421895.html
  • Where the answer is read, and what leaves that place. sms-forward-http.uc still prints the status and nothing of the reply. Only when the caller sets MU300_FWD_ANSWER=4096 in its environment (never the request, which the user writes) does it add the first 4096 bytes of a 2xx reply's body after the status line; the rest is read and dropped as before. Those bytes go down a pipe into one awk (answer_verdict in mu300-sms-forward), which keeps at most 4096 bytes in memory and prints one line: answer ok, answer differs [TOKEN] or answer none. Nothing else of an answer exists outside that pipe: no file, no shell variable, no log.

  • Why awk and not jsonfilter or ucode's json(). A parser refuses an answer cut at 4096 bytes, and a delivery wrongly called failed is sent again. answer_verdict walks the text once, counting brackets and skipping strings, so a long answer whose key comes first still gives its verdict; a value the cut may have shortened is not looked at. It also runs in the tests under the shells and the awk the device has, which a ucode function would not (no ucode on the CI runner). The key and the value reach awk in its environment and are compared as text - a string by its content, anything else as written, so 0 is not 0.0 and "0" is 0 - never as a pattern, never through a shell. A key that is there twice must be right both times.

  • What a panel user can learn of an answer, and why it is kept this small. Before this, nothing of a reply came back: only the HTTP status. Whoever may open this page (the write ACL: the panel's administrator) could already make the device send a POST to any address it reaches, its own loopback and the LAN included, and see the status; that is unchanged, and there is no private-address blocklist, here or before - a webhook to a LAN service is a normal use. What is new is that a test, or a delivery, now says something about a JSON reply of that address. It is held to what a status check needs:

    • The rule: KEY is a name (a letter or _, then letters, digits, _; 32 at most), VALUE a whole number of 16 digits at most (a - before it allowed) or 1 to 16 lowercase letters. The adapter and the forwarder both check it. Only a top-level scalar is compared; an object or a list under the key counts as no value.
    • The log shows the value the service put there only when it is a whole number of 16 digits at most or a bare true, false or null: the service answered errcode=310000. Any other value - a text, a fraction, a longer number - is the service answered another errcode, without it.
    • One message, no errcode in the answer, for a missing key, an object or list under it, an empty answer, something that is no JSON object, and a key beyond the first 4096 bytes: no length, no type, no excerpt.
    • "Send test" from the panel is refused when another was started under 5 s ago (mu300-sms-forward test-gate, asked by the adapter; the command line's own test is root's and is not gated). The page's other actions have no such limit; this one is the only way to ask about an answer at will, and one test at a time was already the rule (the test lock).

    What remains, for the owner to judge: an administrator of the panel can point the webhook at an address only the device reaches and learn, per test (one in 5 s) or per forwarded SMS, about a reply that is a JSON object: whether it has a given top-level key with a scalar under it; whether that scalar equals a number or a lowercase word of the administrator's choosing; and, when the scalar is a whole number of up to 16 digits or true/false/null, that value itself. A numeric secret at the top level of a JSON reply (a PIN, a counter) could be read that way; a text secret could only be guessed at, a lowercase word of up to 16 letters per try. Nothing of a reply that is not a JSON object, and nothing below the top level, comes back at all. The same administrator can already read and change every setting of the device from the same panel.

  • Retried or not. The HTTP status decides first, as before. With a 2xx: another value under the key is the service saying it did not take the message, so it is retried like a 5xx (30 s, doubling, ten times) - another try cannot deliver twice, and rate limits (WeCom 45009, Feishu 11232) pass by themselves. No such value at all fails without a retry: nothing says the message was not taken, the rule most likely does not fit the service, and ten retries would then be ten copies of every SMS. A rule in the file that is not such a KEY=VALUE (the panel never writes one) sends nothing: the answer check is not KEY=VALUE.

  • "Send test" goes through the same deliver, so it shows the same verdict.

  • Clear. forward_log_clear (write ACL, no argument) -> forward logclear -> mu300-sms-forward log-clear, which unlinks /run/mu300-sms-forward/log (and log.part) and never opens it: a link at that name goes, what it points to stays. The queue and the retry state are not touched.

Measured on the device, through ubus call mu300dash forward_set / forward_test / forward_get (forwarding itself left off; the device has no timeout command, so the helper ran without one):

The fake service answered Rule Log
{"errcode":310000,...} none Delivered, HTTP 200
{"errcode":0,"errmsg":"ok"} errcode=0 Delivered, HTTP 200, errcode=0
{"errcode":310000,...} / {"errcode":93000,...} errcode=0 Failed, HTTP 200, the service answered errcode=310000 / =93000
Feishu's success body code=0, StatusCode=0 Delivered
{"code":19024,...} code=0 Failed, the service answered code=19024
Bark's success / HTTP 400 failure code=200 Delivered / Failed, HTTP 400
{"ok":false,"error":"invalid_auth"} ok=true Failed, the service answered ok=false
{"errcode":0,"errcode":7} errcode=0 Failed, the service answered errcode=7
errcode the text hunter2; errcode a text of $(touch ...), backticks, quotes, a line break, an escape sequence errcode=0 Failed, the service answered another errcode; no file was made
ok as text; an HTML page; 1 MB of every byte value; the key one level down only; an object under the key; 2 MB with the key last ok=true, errcode=0 Failed, HTTP 200, no ok in the answer / no errcode in the answer
HTTP 204, no body errcode=0 Failed, HTTP 204, no errcode in the answer
500 objects deep, then the key at the top; 2 MB with the key first errcode=0 Delivered
HTTP 500, 401 with {"errcode":0} errcode=0 Failed, HTTP 500, HTTP 401

The page refused errcode, errcode=0;id, errcode=$(touch ...), a=b=c and err code=0. A second forward_test right after one was refused ("A test was started a moment ago; wait a few seconds"), a third 5 s later started. Through the queue (the installed forwarder on a pool, configuration and log of its own, first wait 2 s): a service that answers errcode=-1 once and then errcode=0 gave "Will retry", then "Delivered" after 2 s; errcode=310000 every time gave two retries and "gave up after 3 attempts"; a missing key gave one "Failed" and one request. After all of it neither the answers' marker text nor hunter2 was in any regular file under /run, /tmp, /var or /etc/mu300, nor in logread. forward_log_clear emptied a log of 29 lines; with a link at the log's name, the link went and its target kept its content; the next test wrote a new 0600 file. In a headless browser (Playwright) the page showed the field, a preset filled it in, Save kept it and Clear emptied the table (looked at before the rule and the messages were narrowed; the page's script did not change after).

Not measured: any real service; the translations on a device (the test unit ran the changed files over an image built without them, so the page's new strings were English); what uclient does with an answer whose Content-Length is wrong or that never ends (the helper's 15 s timeout is unchanged). The unit tests (tests/test_sms_forward.py) ran under dash and bash on macOS and under busybox ash with busybox 1.37 as awk in a Debian container.

137. The SMS webhook's custom body: a placeholder no service refuses, and presets per service (#259)

The Custom body field (§54) showed {"msg_type":"text","content":{"text":"{message}"}} as its placeholder: the Feishu/Lark custom-bot body. A WeCom group robot answers that body (and the standard one, and plain text) with HTTP 200 and {"errcode":40008,"errmsg":"invalid message type"}; with the answer check (§58) empty, which is its default, the page's test then said "delivered" (issue #259, measured by the reporter with curl from a device; another user's WeCom works with {"msgtype":"text","text":{"content":"{message}"}} and the check errcode=0). Not sent from our boards to a real service.

  • The placeholder is now {"text":"{message}"}, the shape of no Chinese chat service in particular (Slack's incoming webhook takes it). A placeholder is pasted as it is; it should not look like the answer for one service.
  • Body presets under the field, as the answer check has them: WeCom, DingTalk fills in {"msgtype":"text","text":{"content":"{message}"}} (the two take the same text body), Feishu, Lark {"msg_type":"text","content":{"text":"{message}"}}. A preset also sets the type to JSON and, only when the answer check is empty, the check that service needs (errcode=0, code=0, both §58 presets), so the test reports the service's verdict and not the HTTP status. A check the user wrote is left alone; nothing is saved until Save. No new message (the menu reuses Presets; the service names are not translated, as in the check presets).
  • The sources are §58's table (DingTalk's text body from the same third-party write-ups as its reply).

Test: tests/test_sms_forward.py test_the_pages_body_presets_are_what_the_services_take - each preset body, through mu300-sms-forward with a hostile sender and text, is one valid JSON document of that service's shape, and its check is one of the page's check presets.

66. The OpenWrt image build tries a package download again

openwrt/build-rootfs.sh installs the image's packages from the OpenWrt feed inside the build container, one apk update, one apk upgrade and a handful of apk add. Each was run once under sh -e: a mirror that cut one connection in the middle of one package failed the whole image, and in CI the release with it.

kanoqwq's fork wraps its apk calls in a function that tries three times (clean-tf-7.2 33640d01, "retry interrupted OpenWrt package downloads"). Taken: that idea. Ours is a function named apk in the container's script, so that every call goes through it without being rewritten and a call added later cannot be forgotten; update, upgrade and add are tried three times, ten seconds apart, with a line on stderr for each new try; del and anything else run once. A package the feed does not have fails three times and then fails the build as before, half a minute later.

The same fork's 0886ee00 ("create block-mount metadata directory in fresh rootfs") repairs the build of its own patched block-mount, which we do not have (section 65).

Unit tests only (tests/test_static.py ApkRetry: the function cut out of the script and run under each shell with a stub apk that fails a number of times), and the same function once in busybox ash with a real apk (Alpine in a container: update, add, del, and a package that does not exist). Not run: an image build. To check, on the build machine and not on a device:

sh openwrt/build-rootfs.sh ...                  # as the release does: the image builds as before
# and once with the network cut for a few seconds during "apk add": a "trying again (2 of 3)" line, then the image

64. An update dropped the panel's saved locks (/etc/unisoc-modem)

The control panel of openwrt-luci keeps its state in /etc/unisoc-modem: lock-state.d (the network mode, band and cell locks it applied, which boot-replay applies again at boot), the SIM identity cache and the operations log. mu300-update builds the new system from the release's image and copies over what keep_list names; for OpenWrt that was etc/config etc/mu300 etc/dropbear etc/rc.local root, and tools/android-install.sh has its own copy of the list for an update from the computer. /etc/unisoc-modem was in neither, so every update left it behind in <os>.old.

What that does, from reading the code (not reproduced on a device): a mode or band lock lives in the modem's NV and stays in force (measured on an F50, #96), so after an update the modem is still locked while the panel's lock page shows nothing saved; a cell lock does not live in the NV and is kept only by the replay at boot, so it is gone.

Found in kanoqwq's fork, whose keep_list has etc/unisoc-modem since clean-tf-7.2 33869287 ("add voltage and forwarding controls; fix Wi-Fi log flood"; the line is one word of that commit). Taken: that word, in both of our lists. Nothing else of the commit.

Unit tests only (tests/test_update.py: apply_one on a fake disk carries etc/unisoc-modem/lock-state.d over; the two lists are the same). To check on a device with openwrt-luci:

# before the update: a band lock and a cell lock saved from the panel (Cellular -> Network locks)
ls -l /etc/unisoc-modem/lock-state.d; /usr/libexec/unisoc-modem/lock get
mu300-update apply && reboot
# after: the same files, the lock page shows the locks, and the log has the boot replay
ls -l /etc/unisoc-modem/lock-state.d; /usr/libexec/unisoc-modem/lock get; logread -e unisoc-modem
# the same once from the computer: install.sh --update (tools/android-install.sh's list)

63. A reused SMS reference number mixed long messages, or kept them from ever being joined

The parts of a long (concatenated) message carry a reference number, a total and a part number in their user data header. Both sms (every system) and mu300-sms (the panel's pool on openwrt-luci, the SIM path and the +CMT path of section 51 alike) took sender and reference number as the identity of a message. The reference is eight bits wide in most headers; senders count it up, draw it at random, or send every long message under the same one. So the same sender and reference come round again, and two things went wrong, both found by reading and reproduced in unit tests, not on a device (no device was available for this work):

  • Two messages under one reference at the same time were mixed. A later part overwrote the earlier one with the same part number, the totals were merged to the larger one, and all the slots were deleted together. With sms this needs nothing unusual, since the SIM keeps messages until somebody deletes them: of two two-part messages from one sender under one reference, sms list showed one, made of the newer parts. In the pool it needed a part still waiting for its siblings (up to an hour) when the next message came.
  • Every later message under the reference of one pooled incomplete was never joined. A message whose parts did not all come within the hour is pooled with [...] and a header partial: <md5 of its key>, so that a part arriving after that is pooled at once. The key was sender, reference and total, with nothing that ends its validity: the next long message under that reference, a day or a year later, had each of its parts pooled (and forwarded) the moment it arrived, as "1/3", "1/3", "1/3".

kanoqwq's fork fixed the same class of fault in its own importer (clean-tf-7.2 a5bd3e06, "reassemble multipart messages before inbox and forwarding"; its importer did not reassemble at all before that, which ours did). Taken from it are three ideas, none of its code: a group is keyed by more than the reference (it uses the reference's width, the total, coding, PID, language tables and SMSC as well); a reference used again is told apart by the distance between the service centre timestamps, ten minutes; and a long message remembers the PDUs of its parts so that a part delivered again is recognised. Changed against it:

  • Grouping is one place for both tools, sms-pdu.awk -v mode=group: decode's records in, the same records out with the key of their message added (multi:SENDER:REF:TOTAL@TIMESTAMP). Parts are one message when sender, reference and total agree, their timestamps are within 600 s of the first part seen, and the part number is not already there with another text. Coding, PID and SMSC are not part of the key: the decoder's records do not carry them, and two messages that agree in everything above and differ only there were not thought worth a change to a format two programs parse. The reference's width (8 or 16 bit) is not in it either, for the same reason.
  • Two messages of one sender, reference, total and second (a sender that numbers everything 0 and sends twice in a second) are told apart by a part number that is taken with another text; the parts go to the messages in the order they came. The fork refuses such a part and does not acknowledge it. Here a refused import is never acknowledged, the network delivers it again, and three failed rounds make mu300-smsd give direct delivery up (section 51), so one hostile or unlucky sender could switch +CMT off; a best guess that loses nothing was preferred.
  • A concatenation header that says nothing usable (part 0, part 5 of 3, no parts, an element of the wrong length or cut off by the header's end) makes the fork's decoder refuse the PDU. Ours now shows the text as a message of its own, for the reason above; before, such a part waited an hour for siblings that cannot exist, or (part beyond the total) lost its text.
  • The key of a waiting message keeps its name while its parts come in (the waiting state is handed to the grouping as known), so a part with an earlier timestamp arriving later does not start the hour over. The state file of the version before (keys without a time) is understood.
  • "The rest of a message pooled incomplete" is now a part with that partial: header and a timestamp within the same ten minutes of the pooled message's (sms-pdu.awk -v mode=near).
  • part_ids: <md5 of each part's PDU> on every long message in the pool, also on one pooled incomplete, and among the tombstones when it is deleted. A part delivered again (the acknowledgement of the last part did not reach the network: mu300-smsd keeps the spool file and imports it once more, section 51) used to be parked alone, wait its hour and be pooled and forwarded as an incomplete message of its own; it is now dropped as known.
  • The listings mu300-sms keeps in /tmp while it works hold message text; they are now made with umask 077 (the first of them always was, by mktemp; the others took the caller's umask).

What the fork does and this does not: it holds waiting parts in a directory of their own with one file per part and never shows an incomplete message. Ours pools what arrived after an hour, marked incomplete, which is section 39's decision (a lost part must not hold the others back for ever) and stays.

Unit tests only (tests/test_sms_pool.py: Codec, Listing, and in Pool the tests under "a reference number used again"), under dash, bash and busybox ash, the grouping also under busybox awk in a container. Not measured: any of it on a device with a real long message. To check on a device with openwrt-luci, with a second phone:

logread -f | grep -i sms &                       # must never show a number or text
# 1. a long message (three parts or more) from the phone: one message in the pool, whole
mu300-sms list; mu300-sms show ID
grep -c . /etc/mu300/sms-pool/partial 2>/dev/null; ls /etc/mu300/sms-pool/parts    # nothing left waiting
sed -n '1,/^$/p' /etc/mu300/sms-pool/msg/ID      # a part_ids line with one hash per part
# 2. the same long message twice within a minute, then again after 15 minutes: three messages, each whole
# 3. with the panel's forwarding on: each of them forwarded once, whole
# 4. Ubuntu, or any system: sms list  with those still on the SIM (AT+CNMI=2,1 path): each shown whole

65. An APN with a user name and a password (AT+CGPCO), and what else kanoqwq's APN page does

Until now the dial knew an APN and a PDP type and nothing else: network.wan.apn / pdptype on OpenWrt (LuCI, Network -> Interfaces -> wan), MU300_APN / MU300_PDP_TYPE in /etc/mu300/mobile-data.conf on Ubuntu, both kept across updates. An APN that asks for credentials (a private APN, some MVNOs) could not be used at all.

kanoqwq's fork added an APN page to its dashboard (clean-tf-7.2 3826be8b, "add persistent APN management and safe mount discovery"): up to 32 saved profiles, a profile bound to a SIM by its ICCID, an automatic choice for a few Chinese carriers by IMSI, credentials, an optional initial-attach setting (AT+SPCGAPNCFG). With it comes a note on what ZTE's B09 RIL does (docs/F50-ANDROID-APN-RIL-RESEARCH.zh-CN.md there, from reading librilcore.so): the ordinary data call sends the credentials after AT+CGDCONT and before AT+CGDATA as

AT+CGPCO=0,"<user>","<password>",<cid>,<auth>          auth: 0 none, 1 PAP, 2 CHAP, 3 PAP or CHAP

and not with the AT+CGAUTH other modems use. That agrees with what this tree already sent for the F50's internal SIM, taken from the stock RIL's trace: AT+CGPCO=0,"","",1,0 between its AT+CGDCONT and AT+CGEQREQ.

Taken: that command and its place in the dial. Not his code: his dialer part is bash regular expressions in mobile-data and a ucode profile store behind his dashboard's RPC. Ours:

  • mobile-data's context definition is a function of its own, define_context. With MU300_APN_USER, MU300_APN_PASSWORD and MU300_APN_AUTH (none, pap, chap, both; left out with a user name or a password: both, as Android does) it sends the command above after AT+CGDCONT and requires OK.
  • OpenWrt: username, password, auth on the wan interface, on the interface's page next to the APN, for the external SIM (the internal one dials its own APN, and is never offered another carrier's credentials). Ubuntu: three lines in mobile-data.conf.
  • Without credentials the dial sends exactly what it sent before (the external SIM: AT+CGDCONT alone; the internal one: its four commands, byte for byte, an ERROR to its empty form ignored as it always was).

Where the password is, and where it is not. Checked by the tests for every path (both systems, both cards):

command lines never. mu300-at - (new) takes the command on its stdin, and mobile-data uses that for this one command; mu300cell.sh hands the settings to mobile-data in its environment. As an argument it would be in ps for every user of the system.
environment of other processes mobile-data takes the credentials out of its environment before it starts anything, so mu300-at, mu300-sim, the LED, the VPN guard inherit none. /proc/<pid>/environ of the services is root's.
logs, stderr, traces never printed. Every refusal says what, not with what. set -x is off while the credentials are read and while define_context runs. /tmp/mu300cell.err and the system log get mobile-data's stderr, which never holds them.
the AT daemon mu300-atd writes its answer files mode 600 now (a modem that echoes commands would put the command there, and the file of a client that gave up stays behind), and throws a late echo (a line that starts with AT) away instead of appending it to the URC log. Whether this modem echoes at all is not measured.
settings files /etc/config/network (OpenWrt) and /etc/mu300/mobile-data.conf (Ubuntu), written by the user, uci or LuCI, never by these scripts. One function for both, settings_private: before credentials are used the file is made mode 600, and unless it then is the owner's alone there is no dial. A link is not followed to change anything; what it leads to must be private already. OpenWrt's first boot makes /etc/config/network 600 (uci keeps the mode), so it is private before anybody types a password; the example file says install -m 600. A release tarball that holds mobile-data.conf is refused by make-release.sh.
who can read it on OpenWrt root; and a LuCI login that was granted the network settings (rpcd's uci ACL on network), the same as a PPPoE password or a WireGuard key. The panel's own ACL (luci-app-mu300) grants uci on unisoc_modem only. ubus call network.interface.wan status and ifstatus wan show no protocol options, by reading netifd and the handler, which adds no data to them (the commands below check it on a device). A password typed into the panel's AT terminal by hand is in that terminal's history, like anything typed there.
the modem holds them once given (AT+CGPCO? would show them to root). /etc/mu300/apn-auth-set.sim0 (.sim1 for the internal card), an empty file, says so: one per card, since each has its own context.

Nothing falls back to a dial without them, and nothing stays behind. Credentials that cannot be used (a quote, a control character, 65 characters, an unknown authentication), credentials without an APN, a settings file others can read, a modem that does not answer OK: each ends the bring-up with a line saying which, and netifd or the watchdog tries again. The mark is written (a new file renamed into place, so a link there is replaced and never written through) before the credentials go out, and if it cannot be written they do not go out. It is removed only when the modem has answered OK to the empty form. So credentials taken out of the settings, or an APN changed to one without any, are taken back from the modem before the next dial; and a modem that does not let go of them gets no dial, rather than one that presents the old user name and password to the new APN's network.

One fault of the old code came out on the way: mu300-power's mobile-data resume and a mobile-data up run by hand have no environment from systemd, so on Ubuntu they dialled without MU300_APN (the modem usually still had the context, which hid it). With credentials that would have been a dial without them. mobile-data now reads what its environment does not say from mobile-data.conf itself, on every run (parsed as KEY=VALUE, never executed).

Not taken, and why:

  • Profiles, the binding to an ICCID and the carrier list: our APN is one setting per interface (and per card: apn_internal), kept across updates; nobody has asked for more. A per-SIM APN becomes worth it with dual SIM, which is being reworked (#166). It follows that the credentials belong to the settings, not to a card: a different card put into the device is offered them too, as it is offered the APN. (2026-10-27: the binding to an ICCID is taken now, as an opt-in on these same settings, not as a second store: FINDINGS 231.)
  • AT+SPCGAPNCFG (the initial attach APN): off by default in his tree too; nothing here needs it.
  • "An empty APN clears the modem's": his dial sends AT+CGDCONT=1,"IP","" whenever netifd passes no APN, so that removing an APN in the settings also removes it from the modem. Ours sends nothing for an empty APN, on purpose ("the modem keeps the context the SIM already defines"); whether a context once defined by AT+CGDCONT outlives the setting (it is in the modem's NV on other Unisoc firmware) has not been measured here. If it does, an APN taken out of the settings stays in force until something else defines the context. To measure before changing anything: mu300-at 'AT+CGDCONT?' before setting an APN, with it, after removing it and redialling, and after a reboot.
  • The patched block-mount of the same commit (and 0886ee00, which fixes its build): fstools' block info opens everything that matches /dev/sd*, which on this SoC includes the SIPC channel nodes (sdiag_* and the like), and an open and close of one of those desynchronises the channel (13b). His patch skips character devices that are not UBI before the probe. Our images do not ship block-mount, so nothing here runs block; a user who installs it (LuCI's Mount Points) would. Not taken now: it needs a package built with the OpenWrt SDK in the image build and a device to see both the fault and the fix, neither of which this work had. Worth doing before anybody documents mount points on a card. His guard header is LGPL-2.1-or-later (fstools' own licence).

Unit tests only: tests/test_mu300cell.py (MobileDataContext: the commands and their order for both cards; in every run the password on mu300-at's stdin and in no argument, no child's environment, no output and no trace; the refusals; the settings file gate for both systems; the mark; the file read by a run without an environment; and the protocol handler), tests/test_device_scripts.py (mu300-at -; mu300-atd on a pty with a modem that echoes), tests/test_sim_selection.py. No part of this has been sent to a modem: neither that the F50/U30 Air firmware answers OK to the command with credentials on the external SIM's context, nor that it answers OK to the empty form there (if it does not, removing credentials ends in "did not take back the earlier APN credentials" and no dial, until rm /etc/mu300/apn-auth-set.sim0), nor that a network then accepts them. To check, with a SIM whose APN checks credentials (or any SIM: most public APNs accept any user name and password, which shows the command is taken, not that it is used):

# OpenWrt
uci set network.wan.apn='<apn>'; uci set network.wan.username='<user>'; uci set network.wan.password='<password>'
uci set network.wan.auth='chap'; uci commit network; ifup wan
logread -e mu300cell; cat /tmp/mu300cell.err      # no "refused the APN credentials", and never the password
ifstatus wan | grep -m1 '"address"'; ping -c 3 1.1.1.1
ifstatus wan | grep -c '<password>'; ubus call network.interface dump | grep -c '<password>'    # 0 and 0
grep -rl '<password>' /run /tmp /var/log 2>/dev/null     # nothing (logread | grep -c '<password>': 0)
mu300-at 'AT+CGDCONT?'; mu300-at 'AT+CGPCO?'      # what the modem holds (CGPCO? may not be answered)
mu300-at 'ATE?'; cat /run/mu300-at*/urc/*.log     # does the modem echo; nothing of the command in the log
ls -l /etc/mu300/apn-auth-set.sim0 /etc/config/network # the mark; network is -rw-------
# while it dials, from a second shell: no AT+CGPCO in any command line or environment
while :; do grep -a -l CGPCO /proc/[0-9]*/cmdline 2>/dev/null; done
# take them out again: the next dial sends AT+CGPCO=0,"","",1,0 once, the mark is gone, data still comes up
uci delete network.wan.username; uci delete network.wan.password; uci delete network.wan.auth
uci commit network; ifup wan; ls /etc/mu300/apn-auth-set.sim0; logread -e mu300cell | tail -3
# refusals: chmod 644 /etc/config/network is put right by the dial (600 again); a user name without an APN
#   gives "set without an APN" in the log and no address
# a wrong password on an APN that checks it: the dial fails at the network (no address), nothing in the log
# Ubuntu: the same three as MU300_APN_USER, MU300_APN_PASSWORD, MU300_APN_AUTH in /etc/mu300/mobile-data.conf,
#   systemctl restart mu300-mobile-data; journalctl -u mu300-mobile-data -n 30; stat -c %a /etc/mu300/mobile-data.conf
#   then: mu300-power's suspend and resume (or  mobile-data down; mobile-data up  by hand): the APN and the
#   credentials are used again (AT+CGDCONT? shows the APN)
# the F50's internal SIM (sim_slot 1) once without credentials: it dials as before

70. adb to Linux on by default and open to every computer: the owner's decision, the exposure, and the state that decides it

The decision. On 2026-10-13 the owner of the project decided that adb to the Linux systems over USB is on by default and accepts every computer without key authorisation. The reason: a browser-based installer and manager (WebUSB) and a GUI are being built, and they must be able to talk to a device running Linux without the user first getting a key onto it; a browser makes its own adb key, which nobody could have authorised beforehand. Importing a key and confirming with a button on the device were offered as alternatives; the owner chose "accept everyone". It follows the project's standing rule: bootability and usability over lockdown, and the exposure written down instead.

The exposure. With the default, anyone who can plug a USB cable into the device gets a root shell without a password - also after passwords were set for ubuntu and root - and with it everything on the device: the hotspot key, the VPN profiles, the SMS pool, the SSH host keys, the modem. It is the cable only: adbd has no TCP or vsock listener in either mode (below), so nothing changes for the LAN, the hotspot's clients or the mobile network. Before this change physical access already gave the same to someone with time (the serial console asks for a password, but the boot image and the filesystem are not encrypted or verified); what changes is that it now takes a cable and a second. The two commands that close it are in the README, the wiki (Installation, FAQ, Home, Glossary), the release notes' body, the installers' question and summary, and in the output of mu300-usb adb on|auth|status: sudo mu300-usb adb auth keys (only authorised keys) and sudo mu300-usb adb off.

How adbd decides. mu300-adbd.patch set auth_required = true on Linux unconditionally (§43). AOSP's own switch is the property ro.adb.secure (0: handle_new_connection answers a CNXN with "authentication not required" and the transport is online at once; 1: it sends an AUTH token and waits for a signature of an authorised key). There are no Android properties on our systems, so the patch reads one environment variable instead: MU300_ADB_AUTH=open is ro.adb.secure=0, and a missing variable or any other value is ro.adb.secure=1. mu300-adbd run sets it when it starts adbd, from the state below. Nothing else in the patch assigns auth_required, and the listeners are untouched: adbd still returns before setup_adb on Linux, the tcpip: service (Android's service.adb.tcp.port) is inside #if defined(__ANDROID__) and restart_service.cpp is not in CMakeLists.txt. Checked on the binary built from this patch (2,493,480 bytes): strings finds MU300_ADB_AUTH and "authentication not required", and none of service.adb.tcp.port, ADBD_PORT, adbd listening on.

The state, and which reading wins. Two files in /etc/mu300, written by mu300-usb: adb (on/off) and adb_auth (open/keys). /etc/mu300 is part of the root filesystem, so there is no mount to wait for at boot, and mu300-update apply copies the directory whole into the new system (keep_list, cp -a: owner and modes stay), so a choice is not lost by an update; tests/test_update.py has off, keys and a key in the system that is replaced. The rules (mu300-adbd: adb_on, auth_read):

What is there adb Who is let in
nothing (a new installation; an update of a device that never touched adb) on every computer: the decision
adb = off off -
adb = on, no adb_auth (turned on under v2026.10.20-23, when on meant keys only) on keys
no adb_auth, a key in adb_keys or /root/.android/adb_keys (authorised then) as adb says keys
adb_auth = open, a regular file of root's that nobody else can write as adb says every computer
adb_auth = keys as adb says keys
adb_auth empty, cut short, unreadable, a symlink, writable by group or others, or any other word as adb says keys, and the log and adb status say why
adb there and neither on nor off (empty, cut short) off, and the log says why -
/etc/mu300 missing, not root's, or writable by group or others on keys, and the log says why
keys, and no key in either file on nobody (adbd has nothing a signature could match and no socket through which a key could be approved; measured in §43: unauthorized with the key file taken away)

So "open" has exactly two sources: no state at all, or the word open in a whole file that only root can write. A state that somebody set and that was damaged afterwards is never read as the default.

  • Existing installations. The old state file can tell "never set" (no file) from "set to off" (off), so a device where mu300-usb adb off was run stays off. A device that never touched adb turns on, and open, with the update: that is what the decision asks for, and the release notes must say it. A device where adb was turned on, or a key authorised, under v2026.10.20-23 chose keys-only adb, and keeps it: mu300-usb writes adb_auth with every adb on, off, key and auth since, so "no adb_auth, but on or a key" can only be such a device. It becomes open with sudo mu300-usb adb auth open.
  • Written whole. mu300-usb writes both files as a new file renamed over the old one (adb_write): a power cut leaves the old word or the new one. A new file that the filesystem did not get to fill would be empty, which reads as keys (or off). The rename also replaces a symlink instead of writing through it; the new file is created with noclobber, mode 644 (anyone may read whom adb lets in), and the key file stays 600.
  • Authorising a key does not close an open device: adb key writes the mode in force into adb_auth first.
  • The installers. The question is now "let in only this computer's adb key instead?" (default no). Yes writes keys into adb_auth, then on, then the key: keys-only from the first boot. The Magisk zip has no question; its systems start open. A build of one's own (install.sh --build) builds adbd always.

Where adb cannot be on. A mainline kernel from before v2026.10.20 (no CONFIG_USB_CONFIGFS_F_FS; a system updated without its kernel: mu300-update kernel brings one); an image without /opt/mu300/bin/adbd (built without tools/adbd/adbd, or older than v2026.10.20); the U30 Air while its port is a USB host (mu300-usb host: there is no gadget, mu300-adbd leaves it alone and binds again in the device role); and the seconds before the system's mu300-adbd service starts (boot/init makes the gadget without adb, so the fallback to Android and init's own recovery shell are as they were). In each case the network and the console are untouched and mu300-usb adb status says which it is. The vendor 5.4 kernel has FunctionFS (CONFIG_USB_CONFIGFS_F_FS=y in the stock config), so adb is expected to work there; it has not been tried (§43).

What the default-on changes for a computer, from what §43 measured and what it did not. Every boot now rebinds the gadget once, early (before the LAN's DHCP server): the computer sees a replug. The network function and the console keep their interface numbers and the VID:PID stays; bcdDevice goes from 0x0301 to 0x0303 (0x0302 to 0x0304 with RNDIS), which is what makes Windows ask for the MS OS descriptors again, and the MS OS descriptors are then on with NCM too. On macOS (measured in §43, F50-B, 7.2): NCM and the console came back after the rebind, adb worked next to them, and with RNDIS a Mac has no network but has adb. A Mac keeps the interface it knows (the MAC address does not change), which matters while its screen is locked. A host without adb sees one more vendor interface and ignores it. Not measured: any Windows host - whether Windows re-installs the drivers of the network and serial interfaces once for the new bcdDevice, whether the adb interface gets WinUSB by itself, and whether NCM is disturbed by the descriptors being on. Until that is measured, default-on is a change every Windows user meets at the first boot after the update, and sudo mu300-usb adb off is the way back to the gadget as boot/init makes it.

The installers meet a device in Linux in adb devices now. Its shell is root, so su -c 'id -u' says 0 there too: nothing but the installer's own check keeps it from being taken for a rooted Android (read from the code, not seen happen: it would wait two minutes for sys.boot_completed, ask "this does not look like an F50, continue?" and go on after a yes). Now (tools/linux-mode.sh, shared by install.sh, uninstall.sh and tools/reset-password.sh; the same in install.ps1 and uninstall.ps1): a serial that starts with MU300LINUX (boot/init) is a device in Linux; it is never on the list of devices to choose from, never the answer to "is an Android up", and ANDROID_SERIAL naming it is dropped. The installer says "The device is running MU300 Linux, not Android" and offers to reboot it into Android: over adb where the device lets the computer in (/opt/mu300/bin/mu300-next-boot android && sync && reboot, after checking that mu300-next-boot is there; no password, and it works where SSH does not, e.g. RNDIS on a Mac), else over SSH as before; with neither (keys-only adb, no USB network) it stops with the two commands to run on the device. After a device was selected, ls -d /opt/mu300/bin on it must print nothing, whatever its serial says. tools/backup-device.sh refuses a MU300LINUX serial. backup-full.sh, collect-logs.sh and boot/android-boot-linux.sh take the device adb gives them and were not changed: the first two only read, the third compares boot_b first and stops.

For tools: adb shell /opt/mu300/bin/mu300-device --json, one line with the device, the system, its release, the kernel, whether the caller is root and what adb does; the contract is docs/ADB-INTERFACE.md.

Tested (tests/test_adb.py, test_installer.py, test_device_scripts.py, test_android_install.py, test_update.py, installer.Tests.ps1; dash and bash here, busybox ash in CI): the patch's one switch and that nothing else assigns auth_required or reads the environment; every row of the table above; the state written whole and not through a symlink; the fake gadget joined with MU300_ADB_AUTH as the state says; the installers' device selection with a device in Linux alone, next to an F50 in Android, next to a tablet, in keys mode, with and without SSH, with a reboot that does not happen, and a Linux behind an Android-looking serial; the JSON line parsed, with values that try to break out of their quotes. The patched adbd was built (tools/adbd/build.sh, Alpine 3.20, arm64) and its strings checked; it was not run, because it needs FunctionFS.

Not measured on a device (all test boards were in use; this is the checklist, to be run before a release carries the change). S is the device's serial in adb devices, the computer a Mac unless it says Windows:

  1. Fresh boot, each of Ubuntu 24.04 and OpenWrt (openwrt-luci) on 5.4, 6.18 and 7.2, with no /etc/mu300/adb* files: adb devices shows MU300LINUX-... device within a minute of power-on. On the device mu300-usb adb status prints adb: on, auth: open (...), gadget: adb is in it (25100000.dwc3); cat /sys/kernel/config/usb_gadget/linux/bcdDevice is 0x0303; journalctl -u mu300-adbd (OpenWrt: logread -e mu300-adbd) has auth open: every computer on the USB cable gets a root shell and gadget bound on ... with adb. On 5.4 this is the first run of adbd on that kernel at all: if adb devices stays empty, the status line adbd: cannot run: ... or the log says why, and the network must be up regardless.
  2. A root shell from a Mac whose key was never on the device (mv ~/.android ~/.android.bak; adb kill-server first): adb -s S shell id -u prints 0; adb -s S shell /opt/mu300/bin/mu300-device --json prints one line such as {"mu300":1,"device":"f50","system":"ubuntu","version_id":"24.04","release":"v...","kernel":"7.2.10","root":true,"adb":"open"}; adb -s S push and pull of a 20 MB file, checksums equal.
  3. No network listener: on the device ss -ltnp | grep -c adbd (OpenWrt: netstat -ltnp | grep -c adbd) prints 0; from the computer adb connect 192.168.77.1:5555 says Connection refused; adb -s S tcpip 5555 does not make it listen (the same 0 afterwards).
  4. Keys: sudo mu300-usb adb auth keys (prints no key is authorised yet on a device without keys); after the replug adb devices shows S unauthorized and adb -s S shell id says device unauthorized, for as long as one waits. adb auth keys with /etc/mu300/adb_keys deleted: the same. Then scp ~/.android/adbkey.pub to the device, sudo mu300-usb adb key adbkey.pub: adb -s S shell id -u prints 0 without a replug (after adb kill-server at most). A second computer, or the first with a new key (rm ~/.android/adbkey*; adb kill-server): unauthorized. sudo mu300-usb adb auth open: both get in.
  5. Damaged state: : > /etc/mu300/adb_auth; reboot - mu300-usb adb status says auth: keys (...; ... is empty, unreadable or says neither open nor keys) and the computer sees unauthorized. chmod 666 /etc/mu300/adb_auth with open in it: keys as well. : > /etc/mu300/adb; reboot: no adb device, adb: off (... says neither on nor off).
  6. Off: sudo mu300-usb adb off - the device leaves adb devices, bcdDevice is 0x0301 again, SSH and the console come back. Still off after reboot, and after mu300-update apply and the reboot into the new system (cat /etc/mu300/adb prints off). The same for adb auth keys with a key: after an update, still keys, the key still gets in, another computer does not.
  7. An existing installation: a device on v2026.10.23 that never touched adb, mu300-update apply, reboot: as 1. A device where mu300-usb adb on was run with a key under v2026.10.23, updated: auth: keys (...; adb was turned on when it took keys only ...), the key gets in, another computer sees unauthorized.
  8. The USB network next to it, macOS: with adb in the gadget, ifconfig shows the device's interface with an address in 192.168.77.0/24 (U30 Air: .78), ping 192.168.77.1 and ssh work, ls /dev/cu.usbmodem* has the console; the same when the Mac's screen was locked during the device's boot; the same after ten adb shell true in a row (each ends a connection: FunctionFS unbinds the gadget and the loop binds it again after 5 s - the network is away for 6-8 s each time, §43; count them).
  9. The USB network next to it, Windows 10 and 11, NCM (the default) and RNDIS (MU300_USBNET): after the first boot with adb, Device Manager shows the network adapter and the COM port working, and "ADB Interface" under WinUSB devices without a driver having been installed by hand; ping 192.168.77.1; adb devices lists the device. Note whether Windows shows "setting up a device" for the network or the COM port again (the new bcdDevice), and whether it does so at every boot or once.
  10. The U30 Air's host role: sudo mu300-usb host with adb on, a flash drive on an OTG adapter mounts; sudo mu300-usb device: network, console and adb are back within ten seconds.
  11. The boot fallback: a trial boot image that does not reach mu300-boot-ok falls back to Android as before (adb plays no part before the system's service starts).
  12. The installers: with the device in Linux and adb open, ./install.sh --check says "The device is running MU300 Linux, not Android", asks, prints asking it over adb (MU300LINUX-...), and goes on once Android is up; the same with install.ps1 -Check on Windows. With adb auth keys and no key of that computer: over SSH as before.

81. An update that brought another mu300-update ended with "another mu300-update is running"

Found on the first device update to the v2026.10.24 pre-release (F50, Ubuntu 24.04, v2026.10.23 installed):

$ sudo mu300-update apply
another mu300-update is running (pid 33187)

and nothing was updated. No other run existed, and 33187 was the run itself. apply takes the release's own mu300-update when it differs from the installed one, replaces the installed file and execs the new one: the same process, which then takes the lock again (exec 9>>lock; flock -n 9). The descriptor it replaces was the lock's holder, so that should succeed - but the dispatch starts the keep-alive after lock_take, a background loop of ping and sleep 3 that inherits descriptor 9, and keepalive_stop ends the loop's shell, not the ping or sleep it is waiting for. For up to three seconds one of them still holds the lock, and the continued run's flock -n fails with its own process id in the message. It is a race: an update whose release has the same updater never execs (v2026.10.22 to v2026.10.23 on the same device went through), and one that does can win it. A second mu300-update apply always works, because the installed updater is the release's by then.

The updater that leaves the stragglers behind is the installed one, which no release can change; the one that meets them is the release's. So the fix is in what meets them: when flock fails in a run that was continued (MU300_SELF_UPDATED) and the lock file names this process, the lock is this run's; it waits up to ten seconds for the descriptor to come free and goes on either way. Any other holder is refused as before. And the keep-alive now runs without the lock's descriptor (9>&-), so no later updater leaves this behind. Measured: the tests reproduce the failure with the old lock code under dash, bash and busybox sh on Linux (macOS has no flock; the pid-directory lock always knew a continued run by its pid). Devices that took the v2026.10.24 pre-release's updater are not affected by it again: their next update meets the fixed one.

82. adb on by default, and no OpenWrt had it after a boot

The v2026.10.24 pre-release on an F50, openwrt-luci, kernel 7.2.10: mu300-usb adb status said adb: on, auth: open, and gadget: without adb; no adbd ran, and the computer saw no adb device. /etc/init.d/mu300-adbd start by hand brought it up at once. On Ubuntu, same device and kernel, adb was there after every boot (section 70).

The service's own trace at boot (its command wrapped in sh -x into a file, because the log ring had already turned over): it ran 13 s after power-on (S19), FunctionFS was not in /proc/filesystems, not built in, and mkdir functions/ffs.adb failed - which the script takes for "this kernel has no FunctionFS", logs, and exits 0. procd does not start a service again that ended by itself. Some seconds later the same mkdir works (the module is loaded on demand then; what is not ready at second 13 was not looked into). Under systemd the unit starts later and never met this. Until adb was on by default nobody saw it: mu300-usb adb on starts the service long after the boot, and the 5.4 kernel has FunctionFS built in.

mu300-adbd run now asks again once a second for a minute (MU300_ADB_WAIT) before it believes the no and logs it. Measured after the change: adb in adb devices 38 s after power-on, mu300-device --json answering over it, mobile data up. Not measured: OpenWrt on 6.18 and on 5.4, the U30 Air.

86. Updating from the panel: System > Update, an update from a file, and release signatures

A third party's panel plugin for a fork has a "System > F50 system upgrade" page: upload a signed update file, see the target version and the space it needs, "keep configuration" ticked, a progress bar, a reboot, and afterwards "roll back to the previous version". This is the same thing in the project's own panel (openwrt-luci, System > Update), over the project's own updater. It was designed while both test devices were in use; what follows is the design, what the tests on a computer show, the protocol for the device, and what the protocol showed on a U30 Air (2026-10-15, at the end of the section).

One updater. The page is not a second update engine. Every action is one mu300-update command, and the command's own lock decides whether it may run. What was added to mu300-update is one marked block ("for a panel") and the few lines that call it; apply, apply_one, the keep lists, the accounts, the packages and the boot image are untouched, so the work on what an update keeps (the lossless-update branch) merges beside it:

command what it gives
mu300-update status [--sizes] one JSON object, no network: the systems and their releases, the copy kept for a rollback (its release; its size only with --sizes, adding up a system takes seconds), the kernel (running, the choice, which choices are refused and why), the boot image and the kept one, the default boot and the number of failed boots before Android, free space and the room apply wants, who holds the lock, the note of a newer release, whether this system has a release key
mu300-update releases one JSON object: the newest release and - only when one is newer than it - the newest pre-release, each with what this device would download (the root filesystem of every system that is not that release yet, the kernel of its choice, the installed extras, the updater), the sizes, and whether the release is signed
mu300-update inspect FILE|DIR one JSON object about an offline source: its SHA-256, the release, system and kernel it says it is, whether its files match their checksums, whether it is for this device, how its signature checks. Changes nothing
mu300-update apply --from FILE|DIR [--unsigned] [--downgrade] the same update from a file instead of GitHub

Every string of that JSON goes through jv, which lets letters, digits and ._+:,()@ /- through and nothing else: a version file with a quote, a backslash or $(...) in it cannot break the object, so nothing needs escaping and no JSON tool is needed (Ubuntu has none). GitHub's list of releases is read the same way, line by line, after every ," and {" is given a line of its own - which the escaped quotes inside a release's notes never are, so notes that contain "tag_name": "v2099.01.01" change nothing (tested with GitHub's pretty and compact forms).

The functions of the block, by name, because a merge will ask: jv, jstr, jnum, mtime, tag_ok, tag_key, newer (§125), space_needed, source_conf, key_state, sig_raw, sig_state, stage_private, tag_sha, sums_trusted, sums_verdict, apply_targets, downgrade_ok, boot_downgrade_ok, zip_p, man_val, from_open, from_read, payload_is, from_close, from_member, from_fits, from_installed, apply_options, from_begin, from_verified, from_handover, inspect_json, lock_holder, size_kb, status_json, release_json, releases_json, progress (a test holds the list to the code). The lines outside it: fetch_verified (five: the file being fetched, the offline source, stage_private, the signature twice), latest_release and the download address (a mirror, below), apply (five: from_begin, downgrade_ok, payload_is, a zip's one system, from_handover before it continues with the release's own updater), kernel_cmd and the boot command (boot_downgrade_ok), check's last line (it names --downgrade), the dispatch (apply_options, the three commands, source_conf) and the help text. space_needed is apply's own rule (1 GB, and 1 GB for every system to update) written a second time so that the page can show it: when the free-space check changes, the two must change together.

The task. An update takes minutes, rpcd ends a call after 30 s and the page may be closed, so the adapter (/usr/libexec/unisoc-modem/update, behind mu300dash's update_get, update_job, update_act) starts the command with setsid as a task of its own, as the SMS send and the VPN pages do (§46: "sms_send - killed"). Its files are in the runtime directory (/var/run/unisoc-modem/update-job: kind, arguments, pid, log, exit status), which only root can enter. It therefore outlives the request, the page, the session and a restart of rpcd, and any browser that opens the page sees it. It does not outlive a reboot (the directory is in RAM); after one the page shows what is installed, and "restart needed" while the running system is the kept copy. One task at a time; and before anything that takes the updater's lock the adapter asks status who holds it and names that process and its pid. That look never tries the lock itself (lock_holder reads the pid the holder wrote and checks that it is a mu300-update that changes things): a probe that held the lock for an instant could turn a real run away. The lock stays the authority: a run that loses the race ends with the updater's own "another mu300-update is running", in the task's log.

What the page shows of a running task: the step, from the last ==> ... line of the output (a line it does not know is shown as it is, so new steps need no change here); for a download, the file fetch_verified named (MU300_PROGRESS, one file NAME line a file) with its size on the partition against the size GitHub gave; the log, collapsed. A finished task says whether the device wants a restart by comparing each system's release, the boot image and the kernel choice with what they were before it started.

Online. "Check" runs releases as a task (two requests to GitHub's API, which answers 60 an hour to one address without a login; behind a carrier's NAT that may be used up by others, and the page then says what it says when the device has no internet: GitHub could not be reached, update from a file). "Update" takes the tag the page showed and only a tag the last check offered - the newest release or the pre-release - so what is installed is what was shown, whatever became the newest meanwhile. The pre-release is offered only behind a tick that is off.

From a file. The format is the release's own Magisk zip (mu300-magisk-TAG-SYSTEM-kKERNEL.zip, tools/make-magisk-zips.sh): it is already published for every release, it is one file, and it holds exactly what an update of one system needs - payload/ with the root filesystem and the kernel bundle of one system and one kernel, mu300/manifest naming them with their hashes, and the updater. apply --from ZIP reads the manifest (each field must be one of the values a release makes, and the two file names must be the ones those values give - a manifest cannot name a path), then lets apply run as it always does with fetch_verified reading from the zip: each member is read to a pipe by a name this code made (unzip -p), never unpacked to a path the zip names. apply --from DIR takes a directory with a release's files and their SHA256SUMS, for a memory stick or scp; the page offers only the zip. What a zip does not have, the update leaves as it is: the language pack (the installed one stays, as with a release that has none), the VPN module (the installed one stays; mu300-update's own offline route for it is unchanged), the other systems of the device. It is refused, before anything is changed, when its system is not installed, when it is the other Ubuntu release, when its kernel does not run on this model (./devices of the bundle), when its kernel is not the one the device uses (a system and the boot image of two releases is what this updater otherwise only has for one reboot), when it is older than what is installed (unless said: --downgrade), and when a payload does not match its checksum. A release's updater continues the run only when it knows what a file is (from_handover): an older one would go to GitHub for the release.

The upload goes through LuCI's own endpoint (cgi-io, with the session and the ACL's one path, /mnt/mu300-disk/.mu300-upload/update.zip), into a directory on the Linux partition that the adapter makes with mode 700 and refuses when it is a link, someone else's or writable by others. Before the upload the adapter is told the size and checks the room: the partition must hold the file beside what apply wants, and /tmp must hold the file too, because cgi-io keeps an upload in /tmp until it is complete and only then moves it to its path (read from its source, not measured here: the largest zip, Ubuntu's, is a few hundred MB of RAM for the minute the upload takes). After the upload the file is renamed to a name the ACL does not let the panel write, and only that file is looked at and used; a link at the upload's path is removed, not followed. It is deleted when the update has run, however it went, and by "Remove the file".

Whom an uploaded file is trusted by. A release from GitHub is trusted because it came over TLS from the project's repository and every file matches the SHA256SUMS that came the same way. An uploaded file has no such origin: its manifest and its checksums are its own, and say only that it is whole. So the page shows the file's SHA-256 and what it says it is before anything, and installing it takes a tick with these words: nothing proves that it comes from the project. The real answer is a signature:

  • The release workflow signs SHA256SUMS (tools/sign-release.sh, from make-release.sh) with the key in the repository secret MU300_RELEASE_KEY and publishes SHA256SUMS.sig. The format is that of OpenWrt's usign and OpenBSD's signify (Ed25519). The signer uses openssl, so the runner needs no usign; what it writes was compared with what usign -S writes for the same key and file in the 25.12.5 image: the same bytes, and usign -V accepts it.
  • The public key is part of the system: /opt/mu300/lib/release.pub, from rootfs/overlay/ like the updater itself, so both systems get it. Not /etc/mu300/release.pub, as first planned: an update carries /etc/mu300 over from the old system as a whole, so a device would never receive the key, nor a later one.
  • mu300-update checks the signature where the system has the key: with usign on OpenWrt (it is in the image, 20 KB, no new package) and with openssl on Ubuntu (sig_state; openssl 3 is in both Ubuntu releases). Without the key file nothing is checked and everything is as it was.
  • The Magisk zips carry the release's SHA256SUMS and, for a signed release, SHA256SUMS.sig (from the release that brings this on): the signature covers the checksums, the checksums the two files of the payload. The zips of v2026.10.25 and older have neither and can never be more than "not signed".
the source signature what happens
any does not match the key refused, always; no option takes it
any the key file is not root's own regular file (a link, writable by others, empty) refused, always: that is not "no key"
any the checksums name another release than the one asked for, or are signed and name none refused, always
GitHub or a mirror valid used
GitHub or a mirror, the system has no key - used, as before signing: there is nothing to check with
GitHub or a mirror, the system has a key none, or nothing here can check one refused, newer or older; MU300_ALLOW_UNSIGNED=1 (apply --unsigned) takes it
a file or a directory valid used; the page asks for no extra tick
a file or a directory none, or the system has no key or no tool refused without --unsigned; the page's tick is that option

The rule, after the security review of this change (it found two ways in: an update applied although no signature had positively checked, and an old signed release accepted as it came). Only "valid" says the files are the project's. Everything short of it is one of two things: a system that has no key and takes a release from GitHub or a mirror, which is exactly what every system did before signing and cannot be made better without a key; or a refusal that only the owner's word lifts, given per run and by name. A first version of this let a system with a key take an unsigned release silently when it was older than the installed one ("from before signing"): that made taking the signature away a way to put an old release back, and is gone. What was checked, point by point:

  • Missing signature, key or tool. No signature and no tool are "not signed" and need the word; a key file that is not root's own is refused outright (key_state: a link, a file others can write or an empty one would otherwise have read as "no key" and let everything through).
  • usign's verdict. Its exit status is tested directly (if usign -V ...), not through a pipe; the openssl path says "valid" only when pkeyutl -verify succeeded on a key and a signature of the right sizes and the same key number.
  • Check, then use. The checksums are judged once and pinned by their SHA-256 (SUMS_PIN, FROM_PIN): every later look at them is at those bytes or the run stops, so other checksums put in their place after the check - with a payload that matches them - are not taken (tested for a download and for a file). The staging directory is made root's own with mode 700, and refused when it is a link or someone else's, before anything is put into it or checked in it (stage_private): the verified file is the one unpacked minutes later. A file is taken only after from_begin judged it; from_verified gives nothing otherwise.
  • Where the key comes from. One path, the installed system's /opt/mu300/lib/release.pub; the code names release.pub in that one place (a test counts). A zip that brings a key and is signed with it is judged by the system's key, or is "no key" on a system without one. The review asked for /etc/mu300/release.pub; it stays where it is for the reason above (an update carries /etc/mu300 over, so the key would be the old system's for ever) - what matters is that it is the image's file, root's, not writable by others and not a link, and that is checked.
  • The release's own updater. apply continues with it only after the release it came with passed all of the above (fetch_verified judges the checksums before it hands out any file, the updater included), and after the downgrade rule below. An unsigned file taken on the owner's word brings its updater with it: that is what the word means, and the page says so.
  • What the panel can switch off. Nothing by the environment: the adapter clears every variable that names a key, a source or a waiver before it runs the updater. --unsigned and --downgrade come only from the flags of update_act (a fixed set of words, in the write grant), only for apply_file, and only when the file that was shown is unsigned or older.

Old releases. A release older than what is installed is taken only when asked for by name (apply --downgrade, MU300_ALLOW_DOWNGRADE=1), from every source: GitHub, a mirror (MU300_RELEASE, MU300_RELEASE_URL, the update-source file), a file. downgrade_ok runs before the release's own updater is fetched, so an old updater cannot skip it; boot and kernel have the same rule for a kernel taken alone (boot_downgrade_ok). rollback is not a downgrade in this sense: it puts back the copy the device itself kept. This changes mu300-update: until now MU300_RELEASE=<older> mu300-update apply went back without a word. And the tag that is compared is inside what is signed: make-release.sh publishes mu300-release (the tag and a newline) and lists it in SHA256SUMS, so the signature covers which release the checksums are of. The updater needs no download for that - it compares the listed hash with the hash of the tag it was asked for (tag_sha). A signed SHA256SUMS of v2026.10.01 handed out as v2026.11.02, by a mirror or in a zip whose manifest says the newer tag, is refused; signed checksums that name no release are not taken as signed.

A second review (three findings; all three were in this change's own lines) and what it led to:

  • The gate judged one value and the action used another. Three places. (a) Every gate - signature, downgrade rule, what the page showed - judged a name: the tag asked for, or the tag an unsigned zip's manifest gives itself. What is installed is the files, and nothing compared the two, so an unsigned zip calling itself v2026.12.24 with the system of v2026.09.01 passed the downgrade rule by its name. Now the root filesystem staged for each system must say in its own etc/mu300/image-version that it is the release that was judged (payload_is, before anything is changed, for every source); with signed checksums the name was bound already. (b) The downgrade rule looked at the systems, and the update also writes the kernel and the boot image: after a rollback of a system, a release between the two would have taken the boot image back without a word. The rule now includes the boot image's release. (c) The page's yes was for the file inspect had hashed, and the updater was handed a path: the adapter now passes that hash (apply --from FILE --sha256=HASH) and the updater takes the file only if it still has it.
  • Files more open than they need be. Nothing was opened for the page - it reads through the adapter, as root - but several files were made with whatever umask the caller had: the adapter's task files, the kept answers of releases and inspect, and what the updater writes of an offline source into the staging directory. The adapter now runs with umask 077 (and starts the updater under 022, which it needs: it makes the directories of the new system), the upload is 600, and what from_open and from_verified write is 600 under any umask. The staging directory was 755 before this change and is 700 now; one found writable by others is emptied before use, since a name in it could be a link someone left.
  • Anything else loosened. Read again for that: MU300_FROM_SHA and the two waivers are this run's own words (reset when the options are read, cleared by the adapter), no lock, link check or refusal of the old code was removed, and the commands that take no lock (status, releases, inspect) write nothing but inspect's own temporary directory.

The row that refuses unsigned releases is the one that can lock devices out, so the release side guards it: when the tree has the public key and the build has no secret key, make-release.sh refuses to publish; and sign-release.sh checks its own signature against the tree's public key and refuses to sign with a key that is not that one.

What the owner does to switch signing on (nothing in this PR makes or holds a key): on any OpenWrt system, or in the image's container,

usign -G -c 'mu300-linux release key' -s release.sec -p release.pub
gh secret set MU300_RELEASE_KEY -R dikeckaan/mu300-linux < release.sec     # then keep release.sec offline, or delete it
cp release.pub rootfs/overlay/opt/mu300/lib/release.pub                    # commit this file

(signify-openbsd -G -n -c ... -s release.sec -p release.pub on Debian or Ubuntu makes the same two files.) From the next release on, the release is signed and its images check. The secret alone signs releases that no device checks yet; the committed key alone stops the next release from being published. A device starts checking with the first system that has the key, so the update to that system is the last one trusted the old way.

What the signature does not cover: the VPN module (its own repository and SHA256SUMS); SHA256SUMS-magisk, the checksums of the zips themselves, which is why the page shows a zip's SHA-256 only as something to compare by hand and relies on the signed checksums inside it; Magisk, which installs a zip without knowing any of this; and a device where someone already is root (the key is a file of the system).

Another source. /etc/mu300/update-source (root's own file, not writable by others, not a link) can name a mirror: MU300_API_URL= in place of https://api.github.com/repos/dikeckaan/mu300-linux and MU300_DOWNLOAD_URL= in place of https://github.com/dikeckaan/mu300-linux/releases/download, plain http(s) URLs only; the command and the panel read the same file. It exists for the device test below and for places where GitHub cannot be reached. Without a release key a mirror is trusted as much as whoever runs it; with one it cannot change a file. The file is in /etc/mu300, so it survives updates: whoever could write it was root. (Since the panel's Update page gained the same setting - a Mirror (release files) field, written through one mu300-update source command - an account that may use that page's write access can change the source as well, and its read access is what shows the address in force.)

When the mirror is not there. A run whose mirror cannot be reached says so once and takes the rest of that run from github.com - but only for a mirror that is really absent: curl's connect-class failures (6 7 35 52), or a stall (28, 56) before a single byte arrived. A transfer that delivered bytes and then stalled is a working mirror on a bad line, and the run resumes from it with -C -, because the people who set a mirror are often the ones who cannot reach GitHub. The fallback happens by itself only for an https mirror on a public name: a plain-http mirror or a private address / LAN-only name is almost always a copy on the LAN, kept so the release does not come over a metered SIM, and there the update stops and says why. MU300_MIRROR_FALLBACK=0|1 in the same file decides it for every mirror (the file only, never the environment). A self-update handover passes the state on (MU300_MIRROR_FELL_BACK=1 in the environment of the release's own updater, which then does not wait for the same mirror again); the panel's adapter clears that variable like every other source variable. With the mirror field, curl joined the OpenWrt image so the exit codes exist there too: every OpenWrt update download moved from uclient-fetch to curl, mirror or not.

The mirror on devices, 2026-10-17 (test builds of this branch with the other open PRs). F50-B (Ubuntu, no internet): mu300-update source http://<Mac>:8791 wrote /etc/mu300/update-source 0600 and source / status named it (file); MU300_RELEASE=<tag> mu300-update apply took every file from that mirror and updated. The same mirror made unreachable: the run stopped - but said only cannot download SHA256SUMS, and with MU300_MIRROR_FALLBACK=1 it went to github.com without a word. Apply's first fetch is its self-update check, run with 2>/dev/null; the said-once line was said there. It goes to fd 7 now, the run's own stderr (say_run), and both runs say their line once (a test runs the two fetches as apply does). F50-C (plain OpenWrt, curl in the image, internet): a public https mirror that does not resolve (https://mirror.invalid/dl): mirror unreachable: the rest comes from github.com, and the checksums, signature and files of v2026.10.17.1 came from GitHub and verified. A fresh download also printed sh: can't open ...: no such file (busybox ash: wc -c < FILE 2>/dev/null redirects stderr only after the input); fixed. The panel's field (luci-app-mu300's files copied onto F50-C for the test): the page shows Mirror (release files) with the GitHub placeholder, Save wrote the file (mu300-update source says (file)), and the page shows the saved address. Not run: a self-update across the change, a resumed download.

What a browser may ask for. Reading (update_get, update_job) is in the ACL's read grant, every change (update_act) in the write grant, and the upload path is the one file path added. Nothing starts by a GET: LuCI's ubus endpoint takes POSTs with a session. Every parameter is a fixed word, a release tag (v[0-9]{4}\.[0-9]{2}\.[0-9]{2}, and since §125 vYYYY.MM.DD.N too), one of the three systems, one of the three kernels, a size or a SHA-256; mu300dash refuses anything else before the adapter runs, and the adapter checks again. Everything that changes the device also wants the word of its operation (confirm), so a stray call does nothing; on the page each of those is a dialog that says what will happen, and going back or deleting the kept version takes a tick first. The log and the update report are shown redacted: every URL reduced to its scheme (a mirror's address can hold a token), what follows a password, key, token or secret word, numbers of 15 to 20 digits (IMSI, ICCID, IMEI) and phone numbers (+ and digits, or ten to fourteen digits after a 0). Sizes, dates and checksums stay.

For Ubuntu's page. Cockpit's MU300 page (rootfs/panel, out of scope here) can be given the same section with the same four commands: status, releases and inspect are plain JSON on stdout, and apply --from takes a path. What it would need of its own is the task (there systemd-run in place of setsid and the runtime directory) and the upload (Cockpit writes files through its own channel, as root, with no /tmp in between).

Tested (no device): tests/test_update_page.py - the updater's additions under dash, bash and busybox sh (status and releases as JSON whatever the files hold; a zip and a directory as sources, what is refused and why, a whole apply --from on a fake partition with the network stubbed to fail; signatures with a key made in the test, a signature made by real usign, a mirror that changes a file with and without its signature; a key file that is a link or writable by others; a zip that brings its own key; checksums swapped after the check; an old release from each source; a signed release under another's name; the release signer and the zip builder end to end), the adapter against a stand-in updater (what each operation needs before it starts anything, the task's states, the lock, the staging directory with links and wrong modes and no room, the redaction), and the page under Node with a small DOM (what it shows for a state, what each button sends, that no backend text is markup). tests/test_mu300dash_security.py has the three methods in every table (hostile values in every field, the arguments as the adapter gets them, the ACL).

Run in the image, not on a device (the openwrt-luci root filesystem of v2026.10.18 as a container on a computer, so its busybox ash, busybox awk, uclient-fetch, usign and the static busybox, but no rpcd, no eMMC and another kernel): mu300-update status --sizes; releases against a static mirror laid out as in the protocol below (uclient-fetch follows the server's redirect for releases?per_page=10, busybox awk reads the list); inspect of three small zips - unsigned, signed with a throwaway key, and signed with another key - which the static busybox's unzip -p read and the image's own usign judged valid and bad as they should be.

Not measured on a device (before the U30 Air run below): that a task started by rpcd's child with setsid outlives a restart of rpcd on this image (the SMS job is started by the same call, §46); cgi-io's use of /tmp for a zip of real size and what the device does when it does not fit; unzip -p on a 100 to 400 MB stored member, and how long inspect then takes (it hashes the whole zip and both payloads; it is a task for that reason); GitHub's real answer and its rate limit from a carrier's address; the download progress against uclient-fetch's real behaviour (it writes the file as it goes, which is all the page reads); a whole apply, online or from a file, with a real boot image; the page in a real browser with the Aurora theme; the texts in 29 languages, which are machine translations like the rest of those catalogs. Still not measured: the F50, Ubuntu, a carrier's rate limit, the 29 machine-translated catalogs, and "Start Android at the next restart" (a U30 Air in Android cannot be brought back without hands).

The device protocol (an F50 or U30 Air on openwrt-luci, with a previous release installed; PC is the computer's address as the device sees it, DEV the device's):

# 0. the build under test, onto the device (or an image built from the branch)
A=openwrt/luci-app-mu300
scp rootfs/overlay/opt/mu300/bin/mu300-update root@$DEV:/opt/mu300/bin/mu300-update
scp $A/root/usr/libexec/unisoc-modem/update $A/root/usr/libexec/unisoc-modem/dashboard-info root@$DEV:/usr/libexec/unisoc-modem/
scp $A/root/usr/libexec/rpcd/mu300dash root@$DEV:/usr/libexec/rpcd/
scp $A/root/usr/share/rpcd/acl.d/luci-app-mu300.json root@$DEV:/usr/share/rpcd/acl.d/
scp $A/root/usr/share/luci/menu.d/luci-app-mu300.json root@$DEV:/usr/share/luci/menu.d/
scp $A/htdocs/luci-static/resources/view/mu300/update.js $A/htdocs/luci-static/resources/view/mu300/home.js root@$DEV:/www/luci-static/resources/view/mu300/
scp $A/htdocs/luci-static/resources/mu300/common.js root@$DEV:/www/luci-static/resources/mu300/
ssh root@$DEV 'chmod 755 /usr/libexec/unisoc-modem/update; rm -f /tmp/luci-indexcache*; /etc/init.d/rpcd restart'
ssh root@$DEV 'mu300-update status --sizes; mu300-update releases'        # both one line of JSON

# 1. a mirror with two real releases (OLD installed on the device, NEW the one to update to)
OLD=v2026.10.24 NEW=v2026.10.25 R=dikeckaan/mu300-linux
mkdir -p mirror/api/releases
for t in $OLD $NEW; do gh release download $t -R $R -D mirror/download/$t -p SHA256SUMS -p 'mu300-*.tar.gz' -p mu300-update; done
gh api "repos/$R/releases?per_page=10" > mirror/api/releases/index.html     # /api/releases?per_page=10 is served this
gh api "repos/$R/releases/tags/$NEW" > mirror/api/releases/latest
python3 -m http.server 8000 -d mirror &
ssh root@$DEV "printf 'MU300_API_URL=http://$PC:8000/api\nMU300_DOWNLOAD_URL=http://$PC:8000/download\n' > /etc/mu300/update-source; chmod 600 /etc/mu300/update-source"

# 2. online: System > Update > Check (NEW is offered, with the download size and the room), Update, confirm.
#    While it downloads: close the browser, open the page from a phone - the task is there, with the file and
#    its percentage. During the unpacking: ssh root@$DEV /etc/init.d/rpcd restart - the task goes on, the page
#    finds it again. At the end: "Restart now"; after the restart the page shows NEW and the previous version.
ssh root@$DEV 'mu300-update status' ; ssh root@$DEV 'cat /var/run/unisoc-modem/update-job/log | tail -5'

# 3. one at a time: start an update on the page and, while it runs,
ssh root@$DEV 'mu300-update clean'            # "another mu300-update is running (pid N)"
#    and the other way round: start "mu300-update apply" in ssh, open the page - it names that run and its
#    pid, and every button is off.

# 4. going back and cleaning: "Back to the previous version" (tick, confirm), restart, the page shows OLD;
#    update again; "Back to the previous boot image"; then "Remove the previous version" and
ssh root@$DEV 'ls /mnt/mu300-disk; df -h /mnt/mu300-disk'

# 5. the pre-release: the mirror says OLD is the newest and NEW is a pre-release
gh api "repos/$R/releases/tags/$OLD" > mirror/api/releases/latest
gh api "repos/$R/releases?per_page=10" | jq --arg t $NEW 'map(if .tag_name == $t then .prerelease = true else . end)' > mirror/api/releases/index.html
#    with OLD installed: Check says "Up to date" and offers "Also offer the pre-release NEW" behind a tick

# 6. no internet: stop the mirror (kill %1), Check - the page says GitHub could not be reached, in words,
#    within a minute; then with mobile data off and no update-source file the same against GitHub itself
ssh root@$DEV 'rm -f /etc/mu300/update-source'

# 7. from a file, the real Magisk zip of NEW for this system and kernel, with OLD installed
gh release download $NEW -R $R -p "mu300-magisk-$NEW-openwrt-luci-k5.4.zip" -p SHA256SUMS-magisk
#    upload it on the page; watch /tmp and the partition meanwhile
ssh root@$DEV 'while :; do df -k /tmp /mnt/mu300-disk | tail -2; ls -la /mnt/mu300-disk/.mu300-upload /tmp/luci-upload* 2>/dev/null; sleep 2; done'
#    the page shows the SHA-256 (the one in SHA256SUMS-magisk), NEW, the system, the kernel, "not signed";
#    tick, update, restart. Then: the zip of another kernel (refused: kernel), of Ubuntu on a device without it
#    (refused: system), a zip with one byte changed in the payload (refused: damaged), OLD's zip with NEW
#    installed (the downgrade tick), and from the command line
ssh root@$DEV 'mu300-update inspect /root/x.zip; mu300-update apply --from /root/x.zip --unsigned'

# 8. a full partition: fill it until less than 2 GB are free, then Check/Update online (apply stops at "not
#    enough free space", the page shows the failed task and "Nothing was changed") and an upload (refused
#    before it starts); the same with /tmp nearly full (refused: memory)
ssh root@$DEV 'dd if=/dev/zero of=/mnt/mu300-disk/fill bs=1M count=4000; df -h /mnt/mu300-disk'
ssh root@$DEV 'rm -f /mnt/mu300-disk/fill'

# 9. the kernel: change to 6.18 on the page (confirm), restart, uname -r; back to 5.4; "Start Android at the
#    next restart", restart, and back with the Magisk module's Action button
ssh root@$DEV 'uname -r; mu300-update kernel'

# 10. signatures, with a throwaway key (never the project's): sign the mirror's SHA256SUMS, give the device
#     the public key, update online (the log says "signed with the project's release key"); remove the .sig
#     from the mirror (refused); change one byte of a tarball and its line in SHA256SUMS (refused)
#     (a release from before this change does not name itself in its SHA256SUMS: add the line a new one has)
usign -G -s lab.sec -p lab.pub
printf '%s  mu300-release\n' "$(printf '%s\n' $NEW | sha256sum | cut -d' ' -f1)" >> mirror/download/$NEW/SHA256SUMS
MU300_RELEASE_KEY_FILE=lab.sec sh tools/sign-release.sh mirror/download/$NEW/SHA256SUMS lab.pub
scp lab.pub root@$DEV:/opt/mu300/lib/release.pub
#     then: the signed SHA256SUMS and .sig of NEW copied to mirror/download/v2099.01.01/ with NEW's files, and
#     "latest" edited to that tag (refused: the checksums of another release); chmod 666 on the device's key
#     (refused: not root's own); OLD from the mirror with NEW installed (refused without --downgrade):
ssh root@$DEV "MU300_RELEASE=$OLD mu300-update apply; MU300_RELEASE=$OLD mu300-update apply --downgrade"
#     afterwards: ssh root@$DEV 'rm -f /etc/mu300/update-source', and the image's own release.pub back (the
#     project's key is part of the image since it was committed; an update puts it back as well)

Measured on a U30 Air (2026-10-15, openwrt-luci, kernel 6.18 and 7.2, the owner's sing-box VPN with its kill switch on throughout; test releases built from this branch: v2026.10.28 and v2026.10.30 signed with the project's key by make-release.sh through MU300_RELEASE_KEY_FILE, v2026.10.29 unsigned, v2026.10.31 unsigned - made from v2026.10.30 with its root filesystems relabelled, because docker's disk was full; served by a mirror on the computer through /etc/mu300/update-source, throttled to 300-700 kB/s so a download could be watched):

  • Signed, end to end, from the page: v2026.10.28 to v2026.10.30 online - Check, "Update to", confirm, the release's own updater taking over ("continuing with the mu300-update of v2026.10.30", "signed with the project's release key" before each download), Restart now from the page, up on v2026.10.30 after about 40 s.
  • The task outlives the page and rpcd: the page closed during the download; /etc/init.d/rpcd restart during "keeping your settings" - the apply went on (its pid unchanged), and the page opened afresh (a new login: the restart ends LuCI's sessions) showed the finished task with its log and Restart now.
  • One at a time, both ways: with the page's update running, mu300-update clean in ssh said "another mu300-update is running (pid N)"; with mu300-update apply --downgrade started in ssh, the page said "Another update is running on the device: sh .../mu300-update apply (pid N)", every button off, and update_act answered busy.
  • Unsigned: online, v2026.10.29 and v2026.10.31 on a system with the key are not offered (the page says why, in words; mu300-update apply refuses with "nothing was changed"). From a file, the page shows "not signed", the SHA-256 (the one in SHA256SUMS-magisk) and the tick with its words; Update from this file without the tick is refused on the page ("Tick the confirmations above first") and by the adapter ("This file is not signed: that needs confirmation"); with it, v2026.10.30 to v2026.10.31 installed and started.
  • Downgrade: a signed v2026.10.28 zip over v2026.10.29 and a signed v2026.10.30 zip over v2026.10.31, each with the page's tick, installed and started (the second one also wrote a boot image, read back and booted); online MU300_RELEASE=<older> mu300-update apply refused without --downgrade and went through with it.
  • Refused files: a zip cut at 20 MB ("not a release file of this project"), one byte changed in the payload ("damaged: its contents do not match their checksums"), the zip for kernel 7.2 on 6.18 ("another kernel ... take the zip for kernel 6.18"), the Ubuntu 24.04 zip ("its system is not installed"). A 112 MB zip reached the partition in about 3 s over USB; inspect of a 42 MB zip took about 10 s.
  • Full /tmp and partition: /tmp with 34 MB free: "Upload failed: Not enough memory for this upload" before anything was sent. The partition with 1.4 GB free: the upload is refused ("Not enough free space on the Linux partition") and apply stops at "not enough free space" before any download.
  • Rollback, rollback-boot, clean from the page, each with its tick and dialog, each restart came up on what the page said (rollback v2026.10.30 to v2026.10.31; the boot image back to the installer's; the kept system deleted, and the copy a rollback leaves with it).
  • Kernel: 6.18 to 7.2 from the page (the kernel of the newest release, signed), restart, 7.2.10 with USB, the VPN and its kill switch; back to 6.18 with mu300-update kernel 6.18, restart, 6.18.56. With an unsigned newest release the kernel change is refused and the choice stays.
  • No internet: the mirror refusing connections: the page said "GitHub could not be reached" after 14 s; an address that never answers: releases says offline after 32 s. GitHub itself (no update-source, through the VPN) answered in 3 s.
  • Signatures with the project's key on the device: release.pub made writable by others: "not a file of root's own: nothing is trusted with it, and nothing is updated"; v2026.10.30's signed checksums under the tag v2026.11.01: "these are the checksums of another release than v2026.11.01: not used".

Found and fixed on the way (each with a test):

  • apply --unsigned and --downgrade did not reach the release's own updater: apply hands over with the options taken out, and the two words were shell variables that were not exported - the next updater refused what the owner had allowed ("not signed ... not used" after "continuing with the mu300-update of ..."). They are exported.
  • The page offered an online update it could only fail (an unsigned release on a system with the key, the task then ending with a hint at mobile data): it says why instead, and fetch_verified tells a refused release (3) from a download to continue, so apply no longer suggests a network fault.
  • After every update that did not change the kernel the boot image kept the older release's name, so check said "the boot image may not be" and the page offered the release just installed again: an image found up to date is now named after the release that found it.
  • After a rollback, before the restart, the page named the running system "openwrt" on an openwrt-luci device and showed no pending restart: running_os did not know <os>.broken.
  • The note "compare the SHA-256 ... the only proof of where an unsigned file comes from" showed for a signed file; the reinstall tick showed without an Update button; offline took two rounds of retries (24 s and 64 s before).
  • /dev/mmcblk0p38 a plain file. After one boot the U30 Air's boot_b node was a 50 MB regular file in RAM: OpenWrt's procd mounts a new, empty tmpfs on /dev once preinit is over (procd_coldplug) and fills it from the kernel's events, and the early recorder - started in preinit, writing for 420 s - ran its dd in that moment and created the file; the node was never made again. boot_update refused it only because the file had no header ("boot_b does not hold a boot image header v4"); rollback-boot would have written into RAM, read it back as written and reported success. The recorder now writes only to a block device and replaces a plain file with the node (mknod from sysfs); boot_update and rollback_boot take only a block device (boot_dev). It happened in one boot, the one before this run; in the ten boots of the run the node stayed a block device.
  • Not changed: a rollback leaves <os>.broken (271 MB) until the next apply or clean, and the page offers Remove the previous version only when there is a <os>.old; the log of a GitHub download shows the signed redirect URL of the asset (it expires within the hour; the page's log redaction reduces URLs to their scheme).

The web installer

72. The web installer: adb over WebUSB, how the release files reach the device, WebUSB per platform, and what a closed tab leaves

site/web-installer/ installs, manages and removes Linux from Chrome or Edge over USB, with nothing on the computer but the browser. The design is in docs/web-installer.md; this section is what was measured for it. On 2026-10-13 it was run from start to finish on an F50 (64 GB, Android 13 F50_FLYMODEM_ZYV1.0.0B09, Magisk 30.6, release v2026.10.25) from a Mac: the page's own modules from Node over the usb package's WebUSB object, and the real page in Chrome 155 (headless, a throwaway profile). The table of what ran is in that document; what the run found is here, marked measured on the F50. Not measured: Windows, Linux as the computer's system, a U30 Air, an SD card as the target, KernelSU/APatch, an Android that is not rooted, a download over a carrier's network.

1. The adb client: our own, about 900 lines, no dependency. The candidate was ya-webadb / Tango (@yume-chan/adb 2.6.4 with adb-daemon-webusb, MIT, maintained). It is TypeScript in a dozen packages with bare imports (@yume-chan/async, event, struct, no-data-view, stream-extra; 609 kB unpacked for adb alone), so the site would need a bundler in CI or a vendored bundle to keep in step by hand, on a page that writes to boot partitions. What we need of adb is small and fixed: the handshake with RSA authentication, shell v2 with exit codes, sync push, pull and stat, reboot. site/assets/web-installer/adb/ is that, as plain ES modules the browser and Node load as they are. Two things were taken from reading ya-webadb's WebUSB backend and AOSP's usb_linux.cpp (facts, no code): adbd sends a packet as two USB transfers, so the header is read with a request of one endpoint packet and the payload with a request of exactly its length; and a write whose length is a whole number of endpoint packets must be followed by a zero-length packet.

  • The signature. adb signs the device's 20-byte token as if it were a SHA-1 digest (PKCS#1 v1.5). WebCrypto's sign() always hashes first and cannot make that signature, so the key is generated with WebCrypto, exported, and the private operation is a BigInt modPow (about 10 ms for RSA-2048 in Node 26). The key therefore lives as numbers in IndexedDB, not as a non-extractable CryptoKey; it is not constant time. Checked: the public key line our code derives from a key made by adb keygen (platform-tools 37) is byte for byte the adbkey.pub adb wrote for it, and Node's OpenSSL accepts the signature as adbd would (tests/web/adb.test.mjs).
  • Against a real adbd over TCP. Ubuntu 26.04's adbd package (AOSP 34.0.5) in a container: handshake and features, shell v2, stdin, timeouts, push/pull/stat of 0 to 5 MB with equal SHA-256, refused files, an aborted push (tests/web/interop.test.mjs, run by hand: MU300_ADBD_TCP=host:port). Stock adbd gives a pushed file the owner's mode bits for group and others too (0644 arrived as 0666, on the F50 as well): the page never relies on the mode of a pushed file, and a password does not travel in a file (below).
  • Over USB, measured on the F50. The transport, framing and sync work as written: connected in 2 to 100 ms, the device scripts staged in 60 ms, a 41 MiB zip pushed at 20 to 27 MiB/s and a 112 MiB one at 20 MiB/s (including the device's SHA-256), a 78 MiB backup read back in 14 s (as base64 through the shell, 5.5 MiB/s; 9 MiB/s with adb's file service, which root's directory rules out, below) with every file's checksum equal to the device's.
  • Android's adbd on the F50 asks for no key. ro.adb.secure is 1 and /data/misc/adb is empty, yet a key the device had never seen got CNXN at once: no AUTH packet, no question (there is no screen to ask on). So a browser's own key needs nothing there. The adbd of MU300 Linux does authenticate when it is set to keys: after an installation with "only this browser" the page's key was accepted by its signature (AUTH once, then CNXN), and the Mac's own adb was unauthorized.
  • The first packet of a session can be lost, and the device then waits for a host that waits for the device. Seen from Chrome after a session that ended without a goodbye (the browser quit, a tab closed or reloaded): the next connection sent CNXN and heard nothing, for as long as it waited, and every later attempt the same. A probe at the transfer level showed why: when the two ends of the bulk IN endpoint are out of step, exactly one transfer is dropped - the 24-byte header of the device's answer - and its 303-byte payload arrives alone. clearHalt() on the endpoints, which adb's own client does on macOS, makes this happen every time on this device (the host's side goes back to its first packet, the device's does not: header lost on 3 of 3 tries, 0 of 6 without), so the page does not call it. The client now takes a payload-without-header during the handshake, followed by 0.7 s of nothing, as "the header was lost" and sends CNXN once more (adbd answers a second CNXN like the first); what an earlier session left in the pipe looks the same for a moment but is followed by the real answer, and then nothing is asked twice (a second CNXN to a device with keys makes it issue a new challenge every time). On top of that the page tries a handshake up to three times and gives a silent device six seconds. After the change: 18 of 18 connections after a quit browser, a closed tab and a reload (6 each); before it the page hung at "Opening the device" with no message.
  • Just after a start Android sets its USB functions up a second time, and a connection made in those seconds is cut (LIBUSB_TRANSFER_ERROR in Node, "the connection to the device ended" in the page). The page waits 2.5 s before it reconnects to a device that came back, and says "connect again" otherwise.

2. How the release files reach the device: the device downloads; or the browser, from a mirror; or the user. A page cannot read a release asset. Measured with curl -H 'Origin: https://kaandikec.com', again on 2026-10-13:

request answer CORS
github.com/.../releases/download/<tag>/<file> 302 to release-assets.githubusercontent.com no Access-Control-Allow-Origin on the 302
the redirect target 200 (206 for a range), application/octet-stream none
api.github.com/repos/.../releases 200 Access-Control-Allow-Origin: * (60 requests an hour without an account)
api.github.com/repos/.../releases/assets/ID with Accept: application/octet-stream 302 with Access-Control-Allow-Origin: * the target it redirects to has none, so fetch() fails at the second hop
raw.githubusercontent.com/<owner>/<repo>/<ref>/<file> 200, 206 for a range Access-Control-Allow-Origin: *; a preflight (OPTIONS) is answered 403, so only requests that need none: a plain GET without a Range header
a GitHub Pages site 200 * (and this site is the page's own origin)
api.github.com/repos/.../git/blobs/SHA or /contents/PATH with Accept: application/vnd.github.raw 200 *, but every request counts against the 60 an hour, and 100 MB per blob
media.githubusercontent.com (LFS) - *, but LFS has a bandwidth quota (1 GB a month free)
codeload.github.com (archives) 200 Access-Control-Allow-Origin: https://render.githubusercontent.com only
ghcr.io (the token endpoint, /v2/) 403 / 401 none

So fetch() gets the release list and nothing of the files, and the list is enough for integrity: the API gives every asset a digest (sha256:...). The files themselves can only come to a page from a repository (raw.githubusercontent.com, at most 100 MB a file) or a Pages site (1 GB a site); one release's 11 zips are 890 MB, 39 to 124 MB each.

  • First: the device downloads the zip itself (android-web.sh net, run fetch NAME SIZE), from an address the script builds from the zip's name (this project's release of the tag in the name; the page cannot name another). Measured on the F50: Android has no curl, no openssl and no wget of its own (toybox has nc only); the root manager's busybox (1.36.1; every Magisk zip carries a busybox too) has wget with TLS and follows GitHub's 302 to the object store - and prints wget: note: TLS certificate validation not implemented. It took self-signed.badssl.com and wrong.host.badssl.com without a word. There is no verifying downloader on these devices and the project builds none, so the download is not trusted for what it is: the file must have exactly the size the release names; it is used only with the SHA-256 that the browser read from GitHub's API over its own verified TLS, computed on the device over the file only root can change; and since wget follows redirects by itself, what it prints is watched (Connecting to HOST (ADDRESS:PORT)): a connection to anything but github.com or *.githubusercontent.com on port 443 ends the download and nothing is kept. A man in the middle can make a download fail and can see which public file is asked for; he cannot get a file installed. Accepted by the owner (2026-10-13): the device downloads over a transport that cannot verify certificates, because integrity is by the pinned digest, not by the transport - the SHA-256 comes from api.github.com over the browser's verified TLS and is checked on the device, over the file only root can change, before anything is used, with the size and host limits above. wget -c continues a broken download: cut after 15 MB of 41.4, the second run fetched the other 28.5 MB and the checksum was the release's. A try that brings nothing ends with "no connection" (exit status 10 of the job; 11 another host, 12 failed, 13 not the release's size); a try that brought something is continued up to five times, and the start of a file is kept for the next run.
    • The uplink, measured on the F50: this unit's Android had none. Its SIM was registered (LTE, in service) with mobile data on, but no data bearer (mDataConnectionState=-1, "Active default network: none"), and Android on an F50 has no Wi-Fi client (it is the hotspot). wget there says bad address 'github.com', the probe answers {"ok":0,"why":"no-network"} in under a second, and the page says so and proposes the next way. To measure the downloader all the same, the device's name lookups were pointed at the test computer, where a relay read only the server name of each TLS hello and connected to that host (TLS end to end between busybox and GitHub): 41 MiB in about 4 s and 112 MiB in about 8 s, which is the cable's and the relay's speed, not a carrier's. Not measured: a real bearer - its speed, what a carrier's proxy or sign-in page does, and the words dumpsys connectivity uses for an active network (the script reads CELLULAR/WIFI/ETHERNET from the line of the default network, as Android 13 prints it; on this unit there was no such line to read).
    • A defect this found: the script took the tag out of the zip's name with a sed whose basic expression used \|. Busybox built for Android uses bionic's regex, which has no \| there, so on a device every release zip was "not the name of a release zip" (bad-name), while the tests, under a computer's busybox, passed. The name is now taken apart with the shell's own patterns. And a directory in/ that root made for the download in the adb user's directory refused the page's next push ("couldn't create file: Permission denied"): the download now goes to root's own directory.
  • Second: the browser downloads the zip from a mirror (mirror.js; on since 2026-10-13, the repository is dikeckaan/mu300-linux-mirror): a branch <tag> of that repository with every zip in parts of at most 45 MiB and a manifest (tools/make-release-mirror.sh; the last step of magisk.yml pushes it with a deploy key of the mirror repository, over ssh to GitHub's published host keys, no token), read from raw.githubusercontent.com with plain GETs (redirect: "error", no credentials). A part must have the manifest's size and SHA-256, the parts must add up to the size the release names, and the whole must have the release's checksum - the mirror's word counts for nothing. Measured on the F50, in Chrome, against a stand-in server for that host: a device without internet was told apart and this way proposed; a part cut after 5 MB gave "the download broke off", and the second try downloaded 41 MiB, pushed it and got the device's plan. Measured against the real host on 2026-10-15 (the page's modules from Node, F50-B in Android with no internet, the Mac on a home connection): the device's own probe said no-network ("bad address 'github.com'"), so the page proposes the mirror; the manifest of branch v2026.10.27 of dikeckaan/mu300-linux-mirror came in 370 ms with 11 zips, the one for Ubuntu 24.04 on 7.2 with the release's size and SHA-256; its 3 parts (119,429,644 bytes) came in 32.4 s (3.5 MiB/s), each and the whole checked; the push and the device's own check took 7 s; the plan (dry_run=1, format=0 update=1 over the installed Ubuntu) ended with status 3, nothing written, the device's files cleaned up. Not measured: GitHub's limits on such use (no throttling was seen in that one download), and a mirror branch that is missing or incomplete for a release on the real host (the stand-in server's cases above).
  • Last: the user downloads the zip (an ordinary download, which no CORS rule stops) and picks it; the page reads the zip's directory and mu300/manifest in the browser and refuses a wrong one before anything is sent.
  • The Magisk zip is the unit, not the separate assets: it holds the installer of its own release, and its payload is stored uncompressed, so nothing is unpacked twice. Two systems are two zips, one after the other, as in the Magisk app (measured: Ubuntu 24.04 and OpenWrt with the panel, two downloads and two runs, 92 s).

3. WebUSB per platform. Chromium only (Chrome, Edge, Opera, Brave; not Firefox, not Safari), on https or localhost. The page runs under its Content-Security-Policy with no violation; fetch() to another host than api.github.com is refused by that policy (checked).

  • Any system: one program at a time can claim the adb interface. A running adb server has it, and so has a second browser window or tab with the page connected - during the run the owner's own Chrome had the page open, and every other client failed. claimInterface fails (NetworkError in Chrome, LIBUSB_ERROR_ACCESS in Node), which the page reports as "another program is using the device's adb interface: an adb server, or another browser window" within 0.3 s (measured in Chrome with an adb server running).
  • macOS: nothing to install (measured: Chrome 155). Chrome's device chooser cannot be driven by a script: the DevTools protocol's DeviceAccess domain raised no event for navigator.usb.requestDevice, headful or headless. A permission a profile holds is in its Preferences (usb_chooser_data) and can be written there for a test; navigator.usb.getDevices() then returns the device, and the page offers it as "Connect to F50" without a chooser - the same way a user's second visit goes. The chooser lists the unit as "F50" in Android (19d2:1353) and as "MU300 Linux USB Ethernet" in Linux (0525:a4a1): two devices to the browser, each allowed once.
  • Windows: WebUSB needs the interface bound to WinUSB. AOSP's adbd carries the Microsoft OS descriptor that asks for it (compatible ID WINUSB in its FunctionFS descriptors), and our Linux adbd announces the same (§43), so a stock Windows 10/11 should bind it without a driver. Unknown: whether ZTE's firmware leaves OS descriptors on in its gadget, and whether a ZTE driver package claims the interface first; no Windows host was used. Google's USB driver is WinUSB and works with WebUSB; Zadig can bind WinUSB to the one interface. open() then fails with SecurityError/NetworkError, which the page explains per platform.
  • Linux: the device node is root's unless a udev rule says otherwise (distributions' android-udev rules cover known vendor ids, not necessarily this one). The page shows a rule that matches the adb interface by class (ff/42) with uaccess. A snap or flatpak browser may need its own USB permission. Not measured.
  • Android Chrome has WebUSB as well, so a phone with an OTG adapter could run the page. Not built for and not tried: the phone would have to power a battery-less F50 for the whole installation.
  • The bootloader's word, measured on the F50: ro.boot.verifiedbootstate=orange, ro.boot.flash.locked=0, ro.boot.vbmeta.device_state=unlocked: the page shows "unlocked". Whether a U30 Air sets them is not known: the page shows "not reported" when none is set. A locked bootloader is not an obstacle (the owner's correction, 2026-10-13): a device with a patched TrustOS starts the modified image with the bootloader locked. The page showed "locked" in red; it now shows it in the warning colour with the question "Did you patch TrustOS?" (with it Linux boots; without it the device goes back to Android by itself after the install), beside the device's facts and beside the plan, and blocks nothing. Not measured: a locked device (the test unit is unlocked).
  • Root on a device without a screen, measured on the F50: with Magisk's grant for "Shell" (uid 2000) in place, su -c 'id -u' answers in 50 ms. With the grant taken away, Magisk asks on a screen nobody sees, waits 10 s and says "Permission denied"; the page then shows "not granted" and how to allow Shell (the Magisk app through scrcpy, which needs adb, so adb kill-server afterwards). Magisk keeps its last answer for a uid for about three seconds from the last request: asking again every 3 s got the old "no" for a minute after the grant was back, so the page says to wait a few seconds before "Try again". Not rooted at all (no su): reasoned from the code only.

4. What a closed tab or a pulled cable leaves. The installation is not the page's: it is the Magisk zip's own installer (mu300/install.sh), started by tools/android-web.sh as a job in a session of its own (setsid, output to a file, HUP ignored). The page only watches (follow), and a watcher that goes away - tab closed, cable pulled on a U30 Air, computer asleep - changes nothing; a new connection reads the same log from its start. Measured on the F50, under Magisk's su: the Node client ended (nothing closed) 4 s into "systems" of an OpenWrt installation, and 5 s into it for Ubuntu; in Chrome the tab was closed during "Collecting the Wi-Fi and modem files". Each time the job went on: a new connection found it running at step 6 and followed it to the end, or found it done with status 0, and the log was there from its first line (MU300-INSTALL-OK, "Writing and verifying boot_b"). The device then started the installed Linux. On an F50 a pulled cable is a power cut, as it is for the installer for computers. What is left, by stage (the installer prints the stage, MU300-STEP n/9 name, and the page shows this sentence beside it):

stage written so far the device then
check, unpack, plan, vendor, image nothing on the eMMC or the card (files in /data/adb only) boots Android; clean removes the files
systems the Linux filesystem, unfinished boots Android: boot partitions and misc untouched. Run it again
boot the Linux slot's boot partition, never Android's boots Android: the image is written, read back from the medium (boot_readback, §50) and only then is misc armed
arm 32 bytes of misc, read back; the old block is written back when they do not verify Android's block or the trial block
done Linux armed for a trial a Linux that does not finish starting falls back to Android (§17)

The order and the checks are the Magisk installer's, unchanged; the page adds no write of its own to a block device (it composes no dd: tests/test_web_installer.py). Cancelling is offered only before "systems". The uninstaller (android-web.sh, in uninstall.sh's order: misc, then the boot partition, then the erase) is safe to cut anywhere for the same reason (measured: a quick uninstall, 7 steps in 5 s, boot_b a copy of boot_a).

  • Two systems and a closed tab. The second zip is the page's to send, so a page closed during the first run leaves one system installed, completely. The first run is started with more, and a page that finds the job says "the second system was not installed" instead of only "Linux is installed".
  • A finished run nobody watched is shown once at the next connection (its log, then "Linux is installed" with the restart button), and its files (the zip in zips/, 39 to 124 MB, with x/ and job/) are removed then.
  • Not measured: the stall guards of §50 through this path, a cable pulled from a U30 Air, a power cut.

Where root writes on Android, and how much. android-web.sh runs as root and is handed files by the adb user, in /data/local/tmp/mu300-web. The first version wrote there as root too: the download (wget -O), the copies of a backup (out/, made readable for adb's file service), rm -rf of both, a chown. Whoever can write a directory can put a link at any name in it, and root then writes, truncates, chmods or deletes the link's target. Now root touches nothing there. A pushed file is moved into /data/adb/mu300-web (mode 700, root's; a rename takes the name as it is and follows no link) and judged there, where nobody else can change it: a regular file, not a link, not larger than its kind can be, with the checksum that was asked for. The download, the backup's copies, the answers, logs and the job's state live in root's directory only; the page reads a copy of the backup as base64 from android-web.sh cat NAME and removes what it pushed itself, unprivileged. The uninstaller, which tidies /data/local/tmp after the installer for computers, removes single names (a link goes as a link) and walks no tree. Measured on the F50 after the change: a backup (ten files, checksums equal), a plan from a pushed zip and one from a zip the device downloaded, and nothing owned by root in the adb user's directory afterwards. What stays: the device scripts are run from that directory (the page checks them against the site's checksums before it pushes them); the adb user is the one who asks su for root, so this is its own power.

  • Bounds. /data is Android's own; a full /data can stop Android from starting. The first version checked a download's size after wget had ended, so a server that sent more, or never stopped, filled the storage first. Now: nothing starts unless the rest of the file leaves 512 MiB free (the reserve the Magisk installer insists on); the downloader runs under a file size limit of the release's size (ulimit -f: the kernel refuses the write that would cross it) and a watch that ends it when the file is larger; it ends after an hour whatever the other end does, and the question "can you reach GitHub" after 30 s; a pushed zip may have 300 MiB, an extra 100, the answers 64 KiB; a zip is unpacked only when the files it is asked for say they hold at most 64 MiB and leave the reserve; a job's log stops growing at 8 MiB while the job goes on. Tested with a downloader that writes 5 MB for a file of 100 000 bytes (the file stopped at that size rounded up to a block), one that never ends, one that stalls, and a full storage (tests/test_android_web.py, Bounds; the links: Links).

The device side, for a caller that is not Magisk (in every zip from v2026.10.24 on): MU300_ANSWERS=FILE (the settings of the run from that file alone, which must be root's), MU300_PROGRESS=1 (MU300-STEP, MU300-PLAN key=value), mu300/extras/ (the VPN module), MU300_ADB_KEY (trusted only). Zips of v2026.10.23 and older do not have them, and the page refuses those releases. Measured on the F50: a password given on the stdin of su -c '... android-web.sh password' arrived (the plan said password=given, root's entry in the installed OpenWrt's shadow held a hash) and was in no line of the log; without one, Ubuntu has ubuntu and OpenWrt's root none. For Linux the page needs no key since §70 (adb on and open by default); it reads mu300-device --json (docs/ADB-INTERFACE.md) and offers "only this browser" as a choice, off by default, which sets the installed system to authorised keys with the browser's key (per system: a second system added without the choice was open).

  • "Restart into Android" is mu300-next-boot android, which makes Android the default boot from then on, not for one start. The page said "the next system to start"; it now says what it does and has "Make Linux the default again" (mu300-next-boot linux) in its Linux view, and the wizard proposes Linux as the default every time instead of taking over an "Android" that only the way to the wizard had set.

Privacy. The page reads ten named properties and never a serial number property; serials come from the USB descriptor and are shown masked. Every line a device prints is masked where it enters the page (device.js, privacy.js: serials, 14-20 digit numbers, phone numbers, MAC addresses, values named password/PSK/SSID/IMEI, password hashes, keys), on screen and in the saved log. Measured on the F50: 508 lines of kernel and system log read through the page had no MAC address and no 14-20 digit number left; the page's log of an installation (160 to 290 lines) had the serial masked. The backup takes the Linux slot's boot image and boot chain, misc and the partition table (measured: ten files, none of them an NV, calibration or identity partition; partitions.txt holds their names only); android-web.sh refuses those partitions by name. A password goes to the device on the stdin of a root command, never in a command line or a file the adb user can read. The page's policy (CSP) allows connections to this site and api.github.com only (and raw.githubusercontent.com once a mirror is configured), and it loads no web fonts. The device's own download goes from the device to GitHub.

  • Tested (no device): tests/web/*.test.mjs (the adb client against a scripted adbd with garbled packets, refused files, a pulled cable and a lost header; the wizard's rules; the device classes with a device that prints serials, IMEIs and passwords, and with hostile names; the mirror with changed, short and missing parts, a hostile manifest and a redirect), tests/test_android_web.py (android-web.sh on the fake device under busybox: the download with a wget that breaks, is sent elsewhere, brings another size or has no network; and the page's code end to end through a scripted adbd), tests/test_magisk_installer.py (WebCaller), tests/test_web_installer.py (strings in three languages, the pages' policy and the mirror's switch, the staged site, the mirror tool and the page's reader on the same files). In a browser without a device: the three pages and the whole wizard with made-up answers (?demo=android, installed, small, linux).

74. The U30 Air's second SIM: what two units showed, and the selector built on it (PR #73/#166, issue #194)

PR #73 (Snrat) brought a cold start of either card and a live switch between them, worked out on one U30 Air with two cards (OpenWrt 25.12.5, Linux 7.2.9; its SIM1 without data service, its SIM2 working). #166 is that work with the review's fixes, merged with #72's shared selector. On 2026-10-13 it ran on the maintainer's U30 Air (OpenWrt 25.12.5, v2026.10.23, Linux 7.2.10), which turned out to have a second card too, the other way round: SIM1 with data, and in position 2 a card that registers for emergency service only. docs/U30AIR-SIM2.md is the user's page; this section is what was measured and what was decided from it. Not run on kernel 5.4, on an F50 or on an M3.

What the modem does

maintainer's unit (7.2.10) contributor's unit (7.2.9)
channels slot 0: nr0 (URCs) / nr1 (commands) / nr2 (data), bearer sipa_eth0; slot 1: nr3 / nr4 / nr5, sipa_eth8; nr6/nr7 belong to slot 0's panel pool the same
the second group's ttys exist before they work: spipe_open gives ENODEV until /dev/sipc_sbuf (the driver's seqfile) shows sbuf_5_006, state: 1,. All four owners wait for that line, inside their procd instances found there
AT+CPIN? on nr4 at a cold boot +CME ERROR: 10, at every boot, for ten seconds of asking. One second after AT+SPACTCARD=1;+SFUN=2 (the card's SIM power): +CPIN: READY, a CCID of its own, an IMSI. With SIM1's data up meanwhile: SIM1 noticed nothing (+CFUN: 1, both contexts active). AT+SPACTCARD=1;+SFUN=3 puts the position back to +CME ERROR: 10 READY at once
what +CME ERROR: 10 therefore means "no card, or SIM power off". The modem seems to power at boot the cards Android had in use; this unit only ever used SIM1 (after SFUN=5/3 an inserted card says the same there)
AT+SPACTCARD AT+SPACTCARD? answers the channel's own card: 0 on nr1/nr2, 1 on nr4/nr5. AT+SPACTCARD=<n>;+<command> addresses the command of that line. A line with AT+SPACTCARD=0 or =1 alone changes nothing: the answer to ? stays, and so does the card the channel reads (compared by CCID, never printed) sent AT+SPACTCARD=0 alone "to reset the channel"
work modes +SPTESTMODE: 134,134,0,19,3,1 (mode of slot 0, of slot 1, primary). The Locks page writes the first assumed 134,134
the data route AT+SPSWDATA on a card's data channel gives it the packet-data route, AT+SPSWDATA? answers +SPSWDATA: 0 or 1. After a SIM2 boot (route 1) and a Linux restart into SIM1 it read 0 again: this firmware does not keep it over a restart not read
cold start of SIM2 16.2 s AT+SMMSWAP=0, 20.8 s SIM power, 22.3 s AT+SPTESTMODEM=134,134, 23.3 s AT+SPSWDATA (read back: SIM2), 23.6 s AT+SFUN=4, 24.2 s +CFUN: 1. Then +CEREG: 2,8 (emergency service only), +CGATT: 0, no bearer CFUN=1 at about 21 s, WAN on sipa_eth8
cold start of SIM1 through the same path (live switching on) +CFUN: 1 at 21.2 s, data at 26.5 s at about 22 s
live switch, the target's radio on first (the factory's order, the PR's first sequence) does not work: AT+SPACTCARD=1;+SFUN=2 OK, then AT+SFUN=4 on nr4 never answered (8, 12 and 30 s waited), SIM1 lost its radio meanwhile (+CFUN: 0 on nr1), and after the way back nr4 did not read +CFUN: 0, so the result could not be verified worked in both directions
live switch, the card in use off first works, both directions, every command answered within a second: AT+SPACTCARD=0;+SFUN=5, ;+SFUN=3 (SIM1 off, 1 s), AT+SPACTCARD=1;+SFUN=2, AT+SPSWDATA on nr5, AT+SFUN=4 on nr5 (SIM2 +CFUN: 1 3 s after the start); the same back, SIM1 registered 5 s later, ifup wan up in 2 s not tried

What was decided

  • One model: one card's radio on at a time. kanoqwq's fork (clean-tf-7.2 25f8d0ce: mu300-dual-radio, mu300-data-sim) powers both stacks at boot and moves only the data route (AT+SPSWDATA, about 1.4 s, no restart). Its boot step fails when the second card is absent or locked, and then neither card gets a radio; its own test unit's SIM2 was unpaid, so data over sipa_eth8 that way is unproven; here the second radio would not even come on beside the first. Taken from it: the read-back of AT+SPSWDATA? as the verification of the route, the work modes read and written back instead of invented, a card named in every command (AT+SPACTCARD=<n>;+...), and the three commands kept out of the panel's AT terminal (below).
  • The live switch is "the card in use off, then the other one on". It is the cold start's situation, one card coming on while the other is off, which both units have shown; the factory's order needs something this unit does not have. On the contributor's unit the new order has not been run.
  • +CME ERROR: 10 is not believed before the SIM power has been on. The cold start and the live switch both switch it on to ask (AT+SPACTCARD=<n>;+SFUN=2), and off again (;+SFUN=3) when no card answers or it is locked. The live switch asks before it touches the connection in use: an empty or locked target is refused in a second, the WAN never down.
  • The work modes are the modem's own, read (AT+SPTESTMODE?) and written back as they are (AT+SPTESTMODEM=<m0>,<m1>): a network mode locked on the Locks page is not replaced by a start. 134,134 only when the modem does not say.
  • Every failure ends on SIM1 with AT, by itself. The table below. Two of the ways out are a restart of the device, because nothing else brings the data back: a radio that was told to start the other card and did not, and a radio left in an unknown state. A restart lands on the saved boot default, which no failure ever leaves on the card that failed. network.wan.sim_restart '0' turns the restarts off (the state then says "reboot required").
  • A second card has to show data once. The first time SIM2 is the boot's card it gets network.wan.sim_data_wait seconds (300; 0: no check) from the radio coming on to have an address on sipa_eth8. With data it is written to /etc/mu300/sim-data-seen and never checked again: an outage is not the card's failure. Without, the settings go back to SIM1 (reason no-data) and the device restarts. Whether SIM1 has data is not asked. The reason: a card chosen over the device's own mobile data (ours is reached through a VPN over it) that registers and gets no data would keep the device off the network until somebody walked up to it; and a user whose SIM1 has no data either is at the device, reads the reason on the page, and loses a restart. No verdict on a card nobody was dialling: the wan taken down by hand, switched off in the settings, or suspended by the power profile. "Taken down" is netifd's word (autostart: false), not mobile-data's marker /run/mu300-mobile-data-down: every failed dial goes through a teardown that leaves that marker for a moment, and a check that looked in that moment kept a card without data (measured, on the second of two identical boots).
  • Issue #194's unit (two built-in cards, SIM1 China Telecom registered without a data plan, SIM2 China Mobile working, kernel 5.4). "SIM1 is there" is never taken for "SIM1 is usable": a boot with SIM2 chosen does not touch SIM1's stack at all, a SIM2 that gets data is remembered and from then on kept through any outage, and nothing ever moves the device to SIM1 because SIM2 "has no data right now". In the live switch the same distinction is made at the moment of switching: a target without data sends the radio back only when the card in use had data; when it had none either, the target stays (no_data_kept), netifd keeps dialling it, and the boot default is not saved on a card that showed no data. Our unit is that unit mirrored, and both branches ran on it.
  • A dial that waits for a card the radio is leaving ends at once (wait_registered looks at the switch marker). Measured before: it held the bring-up lock for its 60 s, and the card the radio went back to stayed without data for 32 s after the switch was over. And netifd's first dial of a dual-SIM boot waits for the cold start instead of failing and coming back 20 s later (data 39 s into the boot before, 26.5 s after).

Failures, and where the device ends (U: measured on the maintainer's unit; T: unit tests only)

what goes wrong reason on the page where it ends
the settings cannot be read, the marker cannot be written, bash is missing invalid-*, not-startable a SIM1 boot, at once: init.d/mu300-atd never returns without AT owners T
the readiness line never appears (another kernel's seqfile) brokers-missing this boot: gives up at 104 s, the AT service starts over as SIM1's, radio on at 127 s, data at 132 s U (the line's text changed by hand)
no card answers with its SIM power on; a PIN; a card that is not the recorded one no-sim, sim-pin, wrong-card this boot: SIM1's ordinary warm-up through the owner of nr1 that is already there (10 s later than a plain boot) T; U with the earlier rule, which took the unpowered card for none
the radio was told to start SIM2 and does not come on no-radio, data-route, modem-refused restart into SIM1 (not before 120 s of uptime, so that the boot was marked good) T
the cold start dies, the device loses power in it unconfirmed the next boot is SIM1's (the pending marker) T
SIM2's radio is on, no data within the time, never had any no-data restart into SIM1: with 150 s set, 174 s into the boot (with 60 s: decided at 86 s, restarted at 120 s); SIM1's data 31.4 to 31.8 s into the next one, the VPN's exit address back U, twice
the same, but the connection was off (taken down, suspended, disabled) - nothing: no verdict on a card nobody was dialling T; netifd's flag read by hand on the unit
live: the target has no data, the card in use had result no_data back on the card in use: 3.5 s to switch, 60 s of waiting, 4 s back, WAN up 2 s later; default unchanged U
live: no data on either no_data_kept stays on the target; its data came 6 s later by itself; default unchanged until switch is asked again U
live: a command is refused half way rolled_back back on the card in use T
live: the channel or the radio lock is busy failed nothing was sent; WAN up again T
live: the way back cannot be verified, the modem is silent, the deadline (300 s) restarting restart into the saved default, 20 s later: data back about 75 s after the failed switch U (with the first sequence)
live: the controller is killed (SIGKILL) restarting its guard declares the radio unknown within 5 s; restart; data 26.5 s into the next boot U

Who else talks to the modem meanwhile. The switch holds a kernel flock on /run/mu300/sim-control.lock (gone with its holder: no stale lock; a second request answers "SIM control is busy" at once), runs its commands under mobile-data's radio lock (the dial's radio-on, the watchdog, the Locks page's SFUN restart), and while they run mu300-at tells every other client "busy" in the words they already handle (SMS, USSD, the panel's terminal and collectors): /run/mu300/sim-sequence, believed only while the lock is held, so a killed switch closes nothing (measured: AT answered 5 s after the kill). Lock writes, the modem reset and suspend are refused in a dual-SIM boot. Nothing from a caller reaches an AT command: the arguments are one of six fixed pairs, and every command is built from the two slot numbers; the work modes read from the modem go back out only as two numbers of at most three digits.

The panel's AT terminal refuses AT+SPACTCARD=, AT+SMMSWAP= and AT+SPSWDATA (its ? forms pass), on every device and in any spelling, as kanoqwq's does: they move the data route under a connection that then answers CONNECT and loses every packet. AT+SPTESTMODEM= asks for confirmation like AT+SPTESTMODE=.

What is written into the modem. Nothing else is sent.

command what it changes kept by the modem put back
AT+SMMSWAP=0 (nr1) the RIL handshake the same command every boot sends on the SIM1 path nothing to put back
AT+SPTESTMODEM=<m0>,<m1> (the card's data channel, cold start only) the two work modes: the values just read, so nothing; 134,134 only when they cannot be read yes (NV) not needed; with unreadable modes the earlier ones are not known
AT+SPSWDATA (the card's data channel) which card carries packet data not over a restart (measured) by the cold start or switch for SIM1; and a plain SIM1 dial asks AT+SPSWDATA? and takes it back while /etc/mu300/sim-data-route-2 exists (left when the route was given to SIM2). Without that mark nothing is asked
AT+SPACTCARD=<n>;+SFUN=2 / 3 / 5, AT+SFUN=4 SIM power and radio of one card no by the next boot; the switch and the cold start switch off what they switched on and could not use

Nothing writes a PIN, an IMSI, a band or a cell lock. A dual-SIM boot does not replay the Locks page's settings (they stay in the modem's NV; only the replay's own restart is left out).

Nobody who does not use it. init.d/mu300-atd reads the settings on a U30 Air only; with the default (slot 0, live switching off) it starts the same three instances as before, and a boot with the branch's files had the handshake at 24.6 s and data at 31.7 s (24.1 and 31.2 before). mu300-sim active, which every AT client asks before every command, answers a pinned 0 from one file read again (2.8 ms; with the library and the device's name read first it was 6.7 ms). mobile-data asks the modem for the data route only where the mark is. mu300-at's gate is one file test. The WAN's teardown now takes the bearer's name from netifd (ifdown/ifup on SIM1: address gone, up again in 5 s).

Privacy. The cold start reads the CCID to compare it with /etc/mu300/sim2-iccid (a file only the owner creates) and never prints it; the logs (/run/mu300/sim2-cold-start.log, sim-switch.log, mode 600) hold the commands sent and no answer; status, the page and the fallback reason carry words from a fixed list. /etc/mu300/sim-data-seen holds slot numbers.

Not verified. Data on sipa_eth8 under this tree's dial on our hardware (our second card has no service; the contributor saw it on his unit with the earlier revision). The new switch order on a unit with two working cards. Kernel 5.4, which issue #194's unit runs: whether its /dev/sipc_sbuf reads the same line (the same vendor driver; if not, the brokers-missing row above is what happens). A truly empty position and a PIN-locked card with the current rule, on hardware. The restart after no-radio (the no-data restart, which is the same code, ran). The F50: unit tests, and the default path on the U30 Air. An M3.

85. An update keeps everything the user made

The owner's requirement: people must be able to update to a new release without losing any data, in any way - by mu300-update apply, by the computer installers' update, and by a Magisk zip installed over what is there. Until v2026.10.27 an update kept a list of places (keep_list: /etc/mu300, /etc/ssh, home directories, /usr/local, OpenWrt's /etc/config, a few more), the accounts, and the packages added on the device (installed again at the first boot, §32c); the image replaced everything else. Measured in containers only: no device was free for this work. The protocol for a device is docs/update-device-test.md.

What was lost, measured. tests/update-experiment installs a published image into an ext4 filesystem, plants user state in it (67 kinds on Ubuntu, 52 on OpenWrt: files in every place, odd names, owners, extended attributes, hard links, a sparse file, image files changed, deleted and of another kind, accounts, a package), updates it by the real code - the installed system's own mu300-update apply run inside that system (chroot), which fetches the new release's updater from a local server as on a device, and the install loop of tools/android-install.sh under mksh with toybox's commands and the one true awk first on PATH, as on Android - and compares every attribute. The two columns "before" are v2026.10.23 updated to v2026.10.25, both as published; the two columns "after" are the same old system updated with this change (what the new release is there: see "After the change" below). A row is lost when what the user had is nowhere in the new system, changed when it is there with another attribute or is back after a deletion, set aside when it is not in its place but saved. Ubuntu 24.04:

item before: mu300-update apply before: installer, Magisk zip after: mu300-update apply after: installer, Magisk zip
files with odd names (space, newline, leading dash, UTF-8, backslash, glob characters, 250 characters, quotes, $(...), tab) kept kept kept kept
modes and owners: 0000, setuid 4755, a sticky 1777 directory, a 0700 directory of uid 1000, a file of an id no account has (4242:4343) kept kept kept kept
extended attributes: user.*, a file capability (cap_net_bind_service), a POSIX ACL on a directory, trusted.overlay.opaque on a directory (a container layer) kept changed: extended attributes gone kept kept
three names of one file (hard links), two of them in one directory kept changed: hard link broken kept kept
a sparse file (256 MiB long, one block of data) kept changed: no longer sparse kept kept
symbolic links: relative, absolute, dangling, to a directory; one with its own date kept kept kept kept
a FIFO and a character device node kept kept kept kept
a socket file (a program makes it again when it starts) kept kept not carried, by design not carried, by design
modification times: a file (with nanoseconds) and its directory, from 2001 kept kept kept kept
2000 small files in 20 directories kept kept kept kept
read-only files (a git object, mode 0444) kept kept kept kept
a swap file (/swapfile, 8 MiB, mode 0600) lost: gone lost: gone kept kept
/tmp and /var/tmp not carried, by design not carried, by design not carried, by design not carried, by design
the mount point of another filesystem (/mnt/usb): the directory lost: gone lost: gone kept kept
what is on that other filesystem (it stays there) not carried, by design - not carried, by design -
/etc/mu300: hotspot and VPN settings kept kept kept kept
/etc/hosts with a line added (an image file, modified) lost: the image's file instead lost: the image's file instead kept kept
one of the project's own programs, edited (/opt/mu300/bin/mu300-wifi): the new release's must win, the edited one must not be thrown away lost: gone lost: gone kept kept
/etc/netplan/60-user.yaml lost: gone lost: gone kept kept
/etc/wireguard/wg0.conf (0600, in a 0700 directory) lost: gone lost: gone kept kept
a hand-written systemd unit, enabled lost: gone lost: gone kept kept
a drop-in for an image unit (/etc/systemd/system/ssh.service.d/override.conf) lost: gone lost: gone kept kept
a masked unit (a link to /dev/null in /etc/systemd/system) lost: gone lost: gone kept kept
an image service the user disabled (mu300-telnetd) changed: back changed: back kept kept
an apt source and its key (/etc/apt/sources.list.d, /etc/apt/keyrings) kept kept kept kept
a user's crontab (/var/spool/cron/crontabs/ubuntu, 0600) lost: gone lost: gone kept kept
/etc/cron.d/backup lost: gone lost: gone kept kept
a service's data directory (/var/lib/docker: a layer, a volume, a database file) lost: gone lost: gone kept kept
/var/www/html/index.html lost: gone lost: gone kept kept
software in /opt (/opt/myapp, a program and its data) lost: gone lost: gone kept kept
/etc/ssh/sshd_config with a line changed kept kept kept kept
/etc/ssh/sshd_config.d/10-user.conf kept kept kept kept
SSH host keys kept kept kept kept
~/.ssh/authorized_keys (0600, in a 0700 directory) kept kept kept kept
shell history (~/.bash_history of ubuntu and of root) kept kept kept kept
~/.bashrc with a line added (an image file, modified) kept kept kept kept
/etc/sysctl.d/99-user.conf lost: gone lost: gone kept kept
/etc/sysctl.conf with a line added (an image file, modified) lost: the image's file instead lost: the image's file instead kept kept
/etc/update-motd.d/10-help-text deleted (an image file the user removed) changed: back changed: back kept kept
/etc/issue.net made a directory (the image has a file) lost: gone, the image's kind of file instead lost: gone, the image's kind of file instead kept kept
/etc/resolv.conf made a file (the image has a symbolic link) lost: the image's kind of file instead lost: the image's kind of file instead kept kept
/etc/skel made a symbolic link (the image has a directory) lost: the image's kind of file instead lost: the image's kind of file instead kept kept
/var/log/myapp/app.log lost: gone lost: gone kept kept
/var/log/wtmp and dpkg.log with entries (image files that grew) lost: the image's file instead lost: the image's file instead kept kept
the journal (/var/log/journal//system.journal) lost: gone lost: gone kept kept
/etc/machine-id (written at the first boot; the image has an empty file) lost: the image's file instead lost: the image's file instead kept kept
/usr/local/bin/mytool and /usr/local/lib kept kept kept kept
/usr/lib/systemd/system/ssh.service edited in place (an image file outside /etc: the release's must win, the edit must not be thrown away) lost: the image's file instead lost: the image's file instead set aside: in /etc/mu300/update-kept, in the report set aside: in /etc/mu300/update-kept, in the report
a file added under /usr (/usr/share/myfonts/x.ttf) lost: gone lost: gone kept kept
/etc/fstab with a line added kept kept kept kept
/etc/hostname kept kept kept kept
/var/lib/bluetooth (paired devices) kept kept kept kept
/etc/sudoers.d/90-kaan (0440) lost: gone lost: gone kept kept
/etc/environment modified, /etc/profile.d/my.sh, /etc/rc.local lost: gone, the image's file instead lost: gone, the image's file instead kept kept
/etc/systemd/network/50-user.network and /etc/systemd/resolved.conf.d/dns.conf lost: gone lost: gone kept kept
a private key (/etc/ssl/private/my.key, 0640) and a CA of the user (/usr/local/share/ca-certificates) lost: gone lost: gone kept kept
/etc/docker/daemon.json lost: gone lost: gone kept kept
root's files (/root/.config/app/settings, /root/notes.txt) kept kept kept kept
/srv/files/document.pdf kept kept kept kept
data of the user's own service (/var/lib/myapp/db.sqlite, owned by a system account the user added) lost: gone lost: gone kept kept
ubuntu's password changed kept kept kept kept
a user added on the device (kaan, uid 1001) with a password and a home directory kept kept kept kept
a system account added on the device (myapp, uid 777: its data is owned by it) lost: the account is gone lost: the account is gone kept kept
/var/cache (downloaded packages) not carried, by design not carried, by design not carried, by design not carried, by design
a package installed on the device: its program and files (/usr/bin/userpkg, /usr/share/userpkg): installed again at the first boot installed again at the first boot installed again at the first boot installed again at the first boot installed again at the first boot
that package's configuration, changed by the user (/etc/userpkg/userpkg.conf) lost: gone lost: gone kept kept
that package's data (/var/lib/userpkg/state.db) lost: gone lost: gone kept kept
  • before, mu300-update apply: 3 by design, 2 changed, 27 kept, 34 lost, 1 reinstall
  • before, installer, Magisk zip: 2 by design, 5 changed, 24 kept, 34 lost, 1 not planted, 1 reinstall
  • after, mu300-update apply: 4 by design, 1 held, 61 kept, 1 reinstall
  • after, installer, Magisk zip: 3 by design, 1 held, 61 kept, 1 not planted, 1 reinstall

OpenWrt:

item before: mu300-update apply before: installer, Magisk zip after: mu300-update apply after: installer, Magisk zip
files with odd names (space, newline, leading dash, UTF-8, backslash, glob characters, 250 characters, quotes, $(...), tab) changed: time to the second only kept kept kept
modes and owners: 0000, setuid 4755, a sticky 1777 directory, a 0700 directory of uid 1000, a file of an id no account has (4242:4343) changed: time to the second only kept kept kept
extended attributes: user.*, a file capability (cap_net_bind_service), a POSIX ACL on a directory, trusted.overlay.opaque on a directory (a container layer) changed: time to the second only, extended attributes gone changed: extended attributes gone kept kept
three names of one file (hard links), two of them in one directory changed: time to the second only changed: hard link broken kept kept
a sparse file (256 MiB long, one block of data) changed: time to the second only, no longer sparse changed: no longer sparse kept kept
symbolic links: relative, absolute, dangling, to a directory; one with its own date changed: time kept kept kept
a FIFO and a character device node changed: time to the second only kept kept kept
a socket file (a program makes it again when it starts) kept kept not carried, by design not carried, by design
modification times: a file (with nanoseconds) and its directory, from 2001 changed: time to the second only kept kept kept
2000 small files in 20 directories changed: time to the second only kept kept kept
read-only files (a git object, mode 0444) changed: time to the second only kept kept kept
a swap file (/swapfile, 8 MiB, mode 0600) lost: gone lost: gone kept kept
/tmp and /var/tmp not carried, by design not carried, by design not carried, by design not carried, by design
the mount point of another filesystem (/mnt/usb): the directory lost: gone lost: gone kept kept
what is on that other filesystem (it stays there) not carried, by design - not carried, by design -
/etc/mu300: hotspot and VPN settings changed: time to the second only kept kept kept
/etc/hosts with a line added (an image file, modified) lost: the image's file instead lost: the image's file instead kept kept
one of the project's own programs, edited (/opt/mu300/bin/mu300-wifi): the new release's must win, the edited one must not be thrown away lost: gone lost: gone kept kept
/etc/config/network changed changed: time to the second only kept kept kept
/etc/config/custom (a UCI file of the user) changed: time to the second only kept kept kept
/www/mysite/index.html lost: gone lost: gone kept kept
/www/index.html edited (an image file outside /etc: the release's must win, the edit must not be thrown away) lost: the image's file instead lost: the image's file instead set aside: in /etc/mu300/update-kept, in the report set aside: in /etc/mu300/update-kept, in the report
/etc/crontabs/root lost: gone lost: gone kept kept
/etc/hotplug.d/iface/99-user lost: gone lost: gone kept kept
/etc/sysctl.conf with a line added (an image file, modified) lost: the image's file instead lost: the image's file instead kept kept
/etc/sysctl.d/99-user.conf lost: gone lost: gone kept kept
/usr/share/myapp/data (added under /usr/share) lost: gone lost: gone kept kept
an init script of the user's own, enabled (/etc/init.d/myservice, /etc/rc.d/S99myservice) lost: gone lost: gone kept kept
SSH host key and authorized_keys (/etc/dropbear) changed: time to the second only kept kept kept
root's files (/root/.ash_history, /root/notes.txt, /root/.ssh/id_ed25519) changed: time to the second only kept kept kept
/etc/rc.local changed changed: time to the second only kept kept kept
/etc/firewall.user and /etc/nftables.d/10-user.nft lost: gone lost: gone kept kept
/etc/dnsmasq.conf with a line added, /etc/ethers lost: the image's file instead lost: the image's file instead kept kept
/etc/openvpn/client.ovpn (0600) lost: gone lost: gone kept kept
software in /opt (/opt/user/tool) lost: gone lost: gone kept kept
/etc/uci-defaults/99-user, /etc/profile.d/x.sh lost: gone lost: gone kept kept
/etc/sysupgrade.conf with a line added lost: the image's file instead lost: the image's file instead kept kept
the panel's saved locks (/etc/unisoc-modem/lock-state.d) changed: time to the second only kept kept kept
/etc/banner deleted (an image file the user removed) changed: back changed: back kept kept
/etc/banner.failsafe made a directory (the image has a file) lost: gone, the image's kind of file instead lost: gone, the image's kind of file instead kept kept
/etc/TZ made a file (the image has a symbolic link) lost: the image's kind of file instead lost: the image's kind of file instead kept kept
/usr/lib/lua/user.lua (added in a directory of packages) lost: gone lost: gone kept kept
/etc/apk/repositories.d/customfeeds.list changed, a key added to /etc/apk/keys lost: gone, the image's file instead lost: gone, the image's file instead kept kept
a kernel module built by hand (/lib/modules/6.99.0/hand.ko) and firmware (/lib/firmware/user.bin) changed: time to the second only lost: gone kept kept
/etc/ssl/certs/user.crt lost: gone lost: gone kept kept
an image service the user disabled (/etc/rc.d/S50cron removed) changed: back changed: back kept kept
a user added on the device (kaan, uid 1001) with a password and a home directory lost: gone lost: gone kept kept
root's password changed kept kept kept kept
a package installed on the device: its program and init script (/usr/bin/userpkg, /etc/init.d/userpkg): installed again at the first boot installed again at the first boot installed again at the first boot installed again at the first boot installed again at the first boot
that package's UCI settings (/etc/config/userpkg): set aside until the package is back, so that they cannot act without it set aside: in /etc/mu300/orphaned-config set aside: in /etc/mu300/orphaned-config set aside: in /etc/mu300/orphaned-config, in the report set aside: in /etc/mu300/orphaned-config, in the report
that package's other settings, changed by the user (/etc/userpkg/settings.yaml) lost: gone lost: gone kept kept
that package's data (/etc/userpkg/cache/rules.db, /usr/share/userpkg-data/geo.dat: made at run time, in no package) lost: gone lost: gone kept kept
  • before, mu300-update apply: 2 by design, 20 changed, 1 held, 2 kept, 26 lost, 1 reinstall
  • before, installer, Magisk zip: 1 by design, 5 changed, 1 held, 16 kept, 27 lost, 1 not planted, 1 reinstall
  • after, mu300-update apply: 3 by design, 2 held, 46 kept, 1 reinstall
  • after, installer, Magisk zip: 2 by design, 2 held, 46 kept, 1 not planted, 1 reinstall

Besides the lost files, the copies themselves were not faithful where cp -a was not GNU's. Measured in the container (the images' static busybox 1.36.1, Ubuntu 24.04's coreutils 9.4, Ubuntu's toybox 0.8.9 - not Android's own build of toybox, which was not at hand):

cp -a of a sparse file (64 MiB, 8 blocks) two names of one file user.* attribute, file capability time, fraction of the second time of a symbolic link
GNU coreutils sparse one file kept kept kept
busybox 1.36.1 dense: 131080 blocks one file (within one run) both gone cut to the second not kept
toybox 0.8.9 dense two files both gone (--preserve=all: the user.* one kept, the capability gone) kept kept

So on OpenWrt (busybox) every kept file lost the fraction of its second and its attributes, and a sparse file was written out in full; from Android hard links were broken as well. And the installers' update did not keep the system it replaced at all: rm -rf of the old one, then the rename of the new - a run that died in between left the kept files only in <os>.new, which the next run deletes first.

The change: the question is asked the other way round. Not "which places are the user's" but "which files came with the image". Every image now carries the manifest of its own files, etc/mu300/image-manifest.gz: one line per file, TYPE MODE UID GID SIZE SHA256 PATH (the hash of a link is that of its target; tools/image-manifest.py has the format). With the manifest of the old image, everything in the old system that is not on it was made by the user (or by software they installed), and what is on it with other content was changed by them. The new system is the new image, plus all of that, by these rules (mu300-update, the block between # --- carry begin and end):

in the old system goes
not the image's to its place. Where the new image has a file of that name: under /etc /var /home /root /srv /usr/local /opt /mnt /media the user's is used and the release's is set aside; elsewhere, and where the release has a directory, the release's is used and the user's set aside
the image's, changed, under those directories the user's is used. When the new release changed that file too (a three-way conflict), the release's version is set aside for comparison. Under /var (logs, state) silently
the image's, changed, elsewhere (/usr /bin /lib /www: programs) the release's is used, the user's set aside. The same for the project's own programs wherever they are (opt/mu300, usr/libexec/unisoc-modem, the mu300-* units and init scripts, the commands linked into /usr/local/bin), for a package's script in /etc/init.d or /etc/hotplug.d, for /etc/pam.d/common-* (pam-auth-update writes them for the packages that are there: a line for a module of a package not installed yet would lock every login out) and for the image's own apt sources
the image's, only owner or mode changed given to the new image's file under the user's directories; elsewhere a mode the user narrowed is kept, and anything else is a line of the report
the image's, deleted under /etc /home /root /srv /usr/local /opt /mnt /media it stays deleted, and so does a service's enable link (rc.d, *.wants). Back, with a line of the report: the project's own programs, a script in /etc/init.d or /etc/hotplug.d, a file whose package the old system no longer lists (it went with a package upgrade), the files of a package that was removed and is part of the image. Never touched: /etc/uci-defaults (the scripts remove themselves when they ran, and must run again)
the package manager's: its databases, /etc/alternatives, the files of packages never file by file. Packages added on the device are installed again at the first boot, as before; a package's configuration file is carried as the user's, and its data, which is in no package, like everything else - nothing waits for the package but OpenWrt's UCI file, which is set aside as before so that it cannot act without its program (#116). A file that differs from the manifest because a package upgrade replaced it (dpkg's md5sums, apk's Z: sums say so) is not the user's and is not set aside
below /proc /sys /dev /run /tmp /var/tmp /var/cache, sockets, Ubuntu's kernel modules, /etc/ld.so.cache, Python's caches under /usr not carried
on another filesystem not carried: mu300-carry never leaves the filesystem of the system (by device number), and the mount point is carried as the directory it is. Through /mnt/mu300-disk/<os>, where the updater reads the system, nothing is mounted anyway
accounts and owners merge_accounts as before (users from 1000 on, passwords, groups), and the rule below

Never less protected than the user left it. Putting the release's file in place of the user's must not open what the user closed. The settings that protect the device are all in the user's directories and stay the user's: adb (/etc/mu300/adb, adb_auth, adb_keys: off or keys cannot become open), sshd_config and the project's own drop-in beside it, dropbear, host keys and authorized_keys, the firewall (/etc/config/firewall, /etc/mu300/firewall.nft, nftables.d), vpn.conf with its kill switch, mobile-data.conf, sudoers, sysctl, the panel's rpcd and uhttpd settings - with their modes (0600 stays 0600: mu300-carry copies the mode). Beyond that:

  • a service the user turned off stays off. An enable link that is gone stays gone (*.wants, rc.d), for the project's own services too; a mask (a link to /dev/null in /etc/systemd/system) is the user's even over the project's own unit; and a package the user removed, which is back because the image has it, comes back with its services not enabled;
  • a mode the user narrowed is put on the new image's file also where the release's content is the one in use (a program edited and made 0700, a script made non-executable);
  • an account of the new image that the old system did not have - the user deleted it, or the release added it - is locked, so that it cannot come with the image's well-known password; merge_accounts keeps a locked account locked, as before;
  • where the release's version does end up in use (a program file, a project unit, an init script, pam.d/common-*), the report names the file. Without a manifest (below) the same holds, by deciding for the tighter side what cannot be told: besides the places of keep_list, /etc/config, sudoers, sysctl, nftables, pam.d, modprobe.d, /etc/ssl/private, the units and links in /etc/systemd/system and /etc/rc.d, crontabs and rc.local are the old system's; an enable link of the new image for a service the old system had and did not enable is removed, and so is a file in /etc/sudoers.d that the old system did not have - each with a line of the report. tests/test_carry.py (NeverLessProtected) plants each of these and looks at the new system, with a manifest and without. Found by a review of this change: an earlier draft counted every file the project's overlay puts under /etc as the project's own, which would have put the release's sshd_config.d/10-mu300.conf over one the user had tightened.

A file belongs to an account, not to a number. The numbers differ between images (Ubuntu 24.04 and 26.04 number messagebus, sshd, bluetooth, crontab and others differently), and a wrong owner is a security fault: a service's private file in a login user's hands, a set-user-id program under another owner. So (carry_accounts_plan, before the plan and before a file is carried):

  • an owner the old system has a name for is carried by that name, under the number the name has in the new system: the new image's when it has the account; else the old number when the new system does not use it; else a free one (a system account added on the device: the highest below 1000; a user merge_accounts brings: the lowest from 1000 on, with its group). Two accounts never end up with one number;
  • a number the old system has no name for stays the number - unless an account of the new system has that number: the file would become that account's, so it is not put in place but set aside under update-kept/.../user/ (root's alone), with a line of the report. It never falls to root or to "whoever has the number now";
  • what gives a file the rights of its owner does not go to another number: the set-user-id and set-group-id bits and a file capability are taken off a file whose owner's number changes, and the report names the file. With the same number everything stays (bits, capabilities, ACLs);
  • names of one file and directories are treated the same; by link (--no-rollback, the installers) a file whose owner's number changes is copied, so the old system's file is not touched;
  • after the accounts are written, every account of the old system is held against the plan the files were carried for; a difference fails the update with nothing put in place. tests/test_carry.py (Owners): a system account the new image numbers differently, the same number, an account added on the device whose number the new image took (user and system), a number without a name that an account of the new image has, one that is free, and a passwd that does not match the plan. A third review asked for exactly this: the first draft mapped the accounts both images have and the system accounts added on the device, but let a user from 1000 on share a number the new image had given away, let a number without a name become the new account's, and kept set-id bits across the change.

What is set aside goes to /etc/mu300/update-kept/<old release>/user/<path> (the user's version) or .../image/<path> (the release's), mode 700 - not beside the file as name.mu300-new: OpenWrt runs every file in /etc/hotplug.d and /etc/uci-defaults, whatever it is called. Every such decision is a line of /etc/mu300/update-report, which the update prints, mu300-update report shows again and a line at the next login points to (once; Ubuntu's motd, OpenWrt's /etc/profile.d); earlier reports stay below the new one.

Files are carried by a helper, not by cp. tools/carry/mu300-carry.c (static, in every image as opt/mu300/bin/mu300-carry): scan (one line per entry, never leaving the filesystem), sum (sha256), manifest, and copy/link, which make a path in the new system what it is in the old one - content with its holes, owner, mode, every extended attribute, times to the nanosecond, names of one file as one file - and never write through a symbolic link of the new system (each directory on the way is opened without following links). The rules are shell and awk; hashing is done only where it decides something: a file of the manifest with the same size is hashed, one with another size is changed without it, and nothing is ever taken for the image's on its size or time alone.

One implementation for the three paths: the new image brings it. mu300-update apply and tools/android-install.sh both run busybox sh NEW/opt/mu300/bin/mu300-update carry OLD NEW OS MODE - the new image's own carry block, by the new image's static busybox (the same binary in all four images: usr/bin/busybox on Ubuntu, opt/mu300/bin/busybox on OpenWrt; it prefers its own applets, so the commands are the same on Ubuntu, OpenWrt and Android) and its mu300-carry. Nothing of it is copied into android-install.sh, and none of Android's tools take part: what is needed there is a shell that can start a static program on the Linux filesystem. The run must end by leaving NEW/.mu300-carried; a run that ends without it failed, whatever its status (found by a test: with MU300_LIB in the environment the script defined its functions, left with status 0, and the caller took that for done). An image that does not bring these parts (built by hand without the helper) is updated the old way, with a line that says so; MU300_UPDATE_KEEP=list asks for the old way (kept for one release: mu300-update's environment, the zip's /data/adb/mu300-install.conf, the environment of android-install.sh).

The old image's manifest. A system from the first release with a four-field tag on has its own (taken only when its first line names the release the system says it is). For the releases before that, the new image has them: opt/mu300/lib/image-manifests/<image>.gz, made from the published images of v2026.09.21 to v2026.10.27 (36 releases; tools/image-manifest.py legacy and union). Two releases of one image differ in a few dozen lines, so each file holds every distinct line once, with the releases that have it in front: 97 kB (openwrt), 101 kB (openwrt-luci), 480 kB (ubuntu-24.04), 599 kB (ubuntu-26.04), where the manifests one by one are 30 MB. An image has those of its own system (Ubuntu: both releases, for MU300_UBUNTU). They are part of the image, so they are checked with it (the release's SHA256SUMS, the zip's manifest), an update needs no download for them, and a zip works offline. Nothing has to be published for the old releases; for the record their manifests can be attached to them (commands below). The repacked images are larger by 0.6 MB (OpenWrt) to 2.0 MB (Ubuntu): the helper (0.7 MB, static), the image's own manifest (73 to 561 kB), the older ones. What is checked is what is used: the release the old system says it is is read once and picks the manifest; the file is copied once into the working directory and only that copy is checked and read; a manifest whose first line names another image or release, that is a link, or that has one line which is no manifest line (a path with ..) is refused whole, and the update goes on as without one. A second review of this change found the first draft reading the old system's manifest three times (check, header, use), and three things more open than they should be, all closed: the working directory with the lists of the user's files (now 0700), the update report (0600 from the moment it exists; it names files under /root and /home), update-kept (0700 and root's, also when it came along from an earlier update with another mode; a file in it keeps its own mode and owner), and the installers' copy of the block's output, which was written to /data/local/tmp - the shell user's directory, where a planted link would have made root write through it - and is now on the Linux filesystem. The releases v2026.09.17 to v2026.09.20 have no etc/mu300/image-version, so a system installed from them does not say what it is.

Without a manifest (those four releases, an image built by hand, a test build): everything the new image does not have is carried (but the files of packages, and the project's own, which are set aside), the places of keep_list and what protects the device (above) are the user's, and every other file that differs from the new image's is set aside under update-kept/.../user/ - the old release's own files and the user's changes alike, they cannot be told apart (on OpenWrt v2026.10.23 that was 27 files of the old release beside the planted ones). When there is no room for them the update goes on without, and the report says they are in the previous system. A deletion cannot be told either: what the user deleted of the image is back (but services and sudo rules, above).

Room, and the previous system. (Since §131 the new image is not unpacked whole: its unchanged binaries and the device's own files are second names of the old system's, and every way to update counts the room first.) apply keeps the old system whole as <os>.old for rollback, so the user's files are copied, and there must be room: what is to be written plus 5 % and 32 MB against df. When there is not, it says how much is needed and how much is free, removes <os>.new and changes nothing; apply --no-rollback then carries by link - the files become second names of the old system's, no data is copied, 8 MB of margin - and the old system goes aside as <os>.broken, which rollback does not offer and the next apply or clean removes once it is not the running system. Never is anything of the user's deleted to make room. The installers' update has never kept the old system; it now carries by link (no room needed) and swaps safely: old to <os>.broken, new into place, then the removal, and a run that finds <os>.broken without <os> puts it back first. rollback is unchanged and returns the old system exactly (below). apply does not go to an older release by itself (apply --downgrade, the rule of the panel's update, §86; the zip: MU300_DOWNGRADE=yes from /data/adb only): the update is done by the release it installs, and one from before the first release with a four-field tag keeps the list only.

The Magisk zip. Update was its default already (MU300_MODE=update when it finds a filesystem). Its plan now says what that means - update: <os> <old> -> <new>: everything you added to it or changed in it is kept ..., not touched: <the other systems> and the extras - and the example settings file says what wipe erases. The zip carries one system and one kernel: the other systems and extra/ are not touched (measured in the installers' runs: every file of another system, of extra/vpn and of .mu300 with its attributes before and after), the password stays the device's (tests, as before), an older zip over a newer system is refused, and nothing is downloaded.

After the change, the same experiment; the new release is v2026.10.25's images repacked as v2026.10.26 with this branch's updater, helper and manifests (tests/update-experiment/repack.sh: no release was built - what a release build changes beyond that is not in these runs). The columns "after" of the two tables above: no row is lost, and none is changed. What is set aside is the program file edited in place (the rule) and, on OpenWrt, the package's UCI file (the rule of §32c); each is in the report. Ubuntu 26.04 and OpenWrt with the panel were run the same way and gave the same rows as these two (in the run without a manifest the one changed row is the deleted image file, which is back). In every mu300-update apply run the system kept for a rollback (<os>.old) was compared too: every planted item exactly as planted.

The updates that are not the plain one (tests/update-experiment/scenarios.sh):

the update the planted items
apply --no-rollback (OpenWrt): by link, the old system left as openwrt.broken 46 kept, 2 set aside, 1 installed again, 3 not carried by design
Ubuntu 24.04 moved to 26.04 (MU300_UBUNTU=26.04): owners follow the accounts' new numbers 61 kept, 1 set aside, 1 installed again, 4 not carried by design
an old system no manifest is known of (it says dev), mu300-update apply 38 kept, 9 set aside, 1 installed again, 3 not carried by design, 1 changed
the same, the installers' update (Ubuntu) 52 kept, 9 set aside, 1 installed again, 3 not carried by design, 1 changed
2.5 GB of the user's where a copy does not fit: stopped, nothing changed (the old system verified) 52 kept
the same with --no-rollback 46 kept, 2 set aside, 1 installed again, 3 not carried by design
updated twice (to v2026.10.26, "rebooted", to v2026.10.27): the second update reads the first one's own manifest 46 kept, 2 set aside, 1 installed again, 3 not carried by design
MU300_UPDATE_KEEP=list: the update as it was 27 kept, 1 installed again, 3 not carried by design, 2 changed, 34 lost

On the devices (2026-10-16, docs/update-device-test.md). Two releases built from this branch and never published, v2026.10.40 (T1) and v2026.10.41 (T2): tools/make-release.sh with the mainline kernels built at the branch's commit, signed with the project's key (SHA256SUMS.sig), the Magisk zips of T2 by make-magisk-zips.sh. The mirror was on each device (busybox uhttpd on 127.0.0.1 on the U30 Air, file:// on the F50: no server on the computer), with the API files of §86 for the page's Check. A U30 Air (openwrt-luci, kernel 6.18.56, the owner's VPN with its kill switch over SIM1) and an F50 (Ubuntu 24.04, kernel 7.2.10; its carrier passed no traffic without a VPN that day, so python3, hello and tree came from files: a standalone CPython in the test directory, the two .deb by dpkg -i), both on v2026.10.27, experiment.py plant / KIND sys.json --live (63 items on Ubuntu, 46 on OpenWrt).

step U30 Air (openwrt-luci) F50 (Ubuntu)
2. v2026.10.27 -> T1, terminal "continuing with the mu300-update of T1", no "no list of the files"; carried 3456 files, 257 MB in 36 s (the whole apply); set aside: /www/index.html (held), /etc/banner.failsafe (image's in use), /etc/banner deleted again; python3 listed for the first boot. The boot image was not written: /dev/mmcblk0p38 was a regular file of 50 MB in that boot (something had written to the path before this test; a restart makes /dev anew), and the updater refused to write to it and said so 2588 files, 225 MB in 31 s; /usr/lib/systemd/system/ssh.service held, /etc/issue.net and /etc/skel (the user's in use), hello and tree listed; boot image T1
2. verify the copy for the rollback: every item kept; the new system before the restart: 42 kept, 1 held, 3 by design 58 kept, 1 held, 4 by design
2. after the restart 41 kept; /etc/uci-defaults/99-user gone (OpenWrt runs and deletes it at boot: by design); the VPN up on the same exit address; extras changed (below) 55 kept; 3 "lost" that the booted system rewrote itself: /etc/resolv.conf (a link again), /var/log/wtmp, the planted journal file (journald set it aside as corrupt) - not the update's
3. T1 -> T2 through the panel's backend (ubus call mu300dash update_get/update_act/update_job, what the page calls): Check offered T2 with "Free space needed" 2308456 KB (planted: 257 MB), the update "signed with the project's release key", 3460 files carried, the report on the page (report_new 1, then 0 after mu300-update report); again from a file (the zip put where upload_begin said, upload_done inspected it: T2, openwrt-luci, k6.18, signature valid, the SHA-256 of SHA256SUMS-magisk) inspect of the zip (signature valid, fits), apply --from the zip with mobile data stopped: "signed with the project's release key", no download, 2593 files, 233 MB in 51 s
3. first boot python3 was not installed again (below, fixed) hello and tree wait for the internet (state offline: this F50 had none)
4. rollback + rollback-boot T1 again, everything kept but the uci-defaults script T1 again, as in part 2
5. older release T1 with T2 installed: refused (also with MU300_DOWNGRADE=1), nothing downloaded; --downgrade: through, everything kept the same
6. no room, --no-rollback - a 27 GB file in /srv: refused before any download ("30722 MB needed, 2559 MB free", naming clean and --no-rollback); --no-rollback: through, ubuntu.broken, rollback "no previous version kept"; after the restart the file is there, verify as before, clean removed ubuntu.broken
end v2026.10.27 by apply --downgrade --unsigned (refused without each flag), then the system as it was before the plant the same

Found and fixed on this branch:

  • One dead feed kept every package from coming back on OpenWrt. The planted customfeeds.list names example.invalid; apk update then fails as a whole ("1 unavailable", exit 1) although every other feed answered, mu300-user-packages took that for "offline", waited 300 s between tries and would give up after five boots: python3 never came back on the U30 Air. Ubuntu had apt_sources_check for the same case; apk now counts as online when fewer feeds were unavailable than are configured (apk_update; offline every feed is unavailable). With it, python3 was installed again at once (test_a_dead_feed_of_the_users_is_not_offline).
  • experiment.py --live replaced what the device needs: the VPN's and the hotspot's settings (ENABLE=0: the owner's VPN off after the restart), the SSH host keys and PasswordAuthentication no, root's crontab (a daily reboot), the panel's saved band locks (applied at the next boot), and disabled cron or sysctl. With --live a file the device has gets a line of the user's, host keys and saved locks are written down as they are, and no image service is disabled.

Seen, not changed here:

  • The VPN module is brought to "latest" even when the installed one is newer: v2.0.3 (a pre-release, installed by hand) became v2.0.1 at the first update (module_download compares hashes, not versions; v2026.10.27's updater does the same). Put back by hand afterwards.
  • The report's time on OpenWrt is UTC (22:19 for 01:19 local); on Ubuntu it is local.
  • When T1's and T2's boot images are the same bytes the second update says "boot: already up to date (T2)", and rollback-boot then goes back to the image before T1.
  • Deleted again on the F50 listed /etc/rc[2-5].d/S01ssh: a real change on that unit (an earlier test had disabled ssh.service), not a false line.

Part 7: the Magisk zip from Android and the computer installer (2026-10-16, a third F50). Two more releases built from this branch and never published, v2026.10.16.90 (T1) and v2026.10.16.91 (T2; four-field tags of the day, #249), the same way (mainline kernels built at the branch's commit, signed, the Magisk zips of both). The F50 had a plain OpenWrt v2026.10.27 on kernel 6.18 in its internal region (804 MiB, 613 MiB free; installed by the make-room resume the day before), the carrier's data working without a VPN, no SD card. Planted with experiment.py plant / openwrt sys.json --live (45 items; python3 from Alpine, musl, run by its own loader from the test directory, so nothing of it is a package of the system) after apk add nano (a package the update has to install again).

step how result
v2026.10.27 -> T1 T1's mu300-magisk-...-openwrt-k6.18.zip by magisk --install-module from Android (first MU300_DRY_RUN=1: the plan said "update: openwrt v2026.10.27 -> T1: everything you added ... is kept") "carrying everything of yours ... over", 2515 files, 44 MB, by link (no copy kept: 438 MiB free after); set aside /www/index.html, /etc/banner.failsafe, /etc/banner deleted again, nano listed. After the restart: T1, kernel 6.18.56, verify 32 kept, 1 held, 3 by design, 1 lost (/etc/uci-defaults/99-user, run and deleted by OpenWrt at boot), 8 changed (below); nano installed again at the first boot ("1 of 1 ... are back")
T1 -> T2 install.sh of T2's unpacked zip (MU300_PACKAGE, answers mode, MU300_ANS_EXISTING=update) 2082 files, 16 MB; the same verify; both reports in mu300-update report
T2 -> T1, the zip T1's zip over T2 refused: "The installed openwrt is T2, and this zip is T1, an older release", nothing written
T2 -> T1, the computer T1's package by install.sh went through without a word (below, fixed); with the fix: refused on the device before anything was written, "boot_b and misc were not changed"; with MU300_DOWNGRADE=yes: through, everything carried

Every way kept the planted state as mu300-update apply does (part 2), with two differences that come from Android, not from the carry block:

  • The 8 "changed" items are directories, symbolic links and a FIFO the carry makes anew (only files go by link): made from Android, each gets security.selinux = u:object_r:unlabeled:s0 from Android's kernel. Nothing of the user's is lost or altered (the ACL, the capability, the user attribute are all there); every file the installers ever unpacked from Android carries the same label, and OpenWrt and Ubuntu here do not use SELinux.
  • The password. The zip does not keep a well-known one (default_hash, since issue #167): root's ubuntu, set by the computer installer, became the image's own, none ("root's password is the images' own again: none, until one is set"; the plan says so before). mu300-update keeps the hash, and install.sh sets the one it asks for. By decision, not changed here; a zip update over a device with ubuntu leaves root without a password.

Found and fixed on this branch:

  • install.sh (and install.ps1) took an older release. android-install.sh had no downgrade check: only mu300-update and the Magisk installer had one, so the computer's installers put T1 over T2 without asking. It now reads each image's etc/mu300/image-version from its tarball (Android's toybox tar -xzOf, measured) and refuses an older release than the installed system (the release-tag order) before it writes anything; MU300_DOWNGRADE=yes in front of install.sh / install.ps1 allows it, and the Magisk installer passes on its own decision (DOWNGRADE in the env file). Tests: test_android_install.Downgrade.
  • The update texts of install.sh, install.ps1 and the window still said "settings and data (/etc/mu300, users and home directories, SSH host keys, UCI)"; they now say that everything added or changed is kept (en, tr, zh).

Seen, not changed: run seconds after Android had booted, with ANDROID_SERIAL naming it, install.sh once found no Android answering and, because two other boards on the computer were in Linux, offered to reboot "the device" out of Linux (answers mode stopped at that question; a minute later the same run found Android). Answered yes it would have stopped too: linux-mode.sh reboots nothing over SSH while more than one board is in Linux.

Not run: the page in a browser (its backend was driven), the 5.4 kernel, an SD card, Ubuntu through the zip or the computer installer.

Not measured, or not on a device.

  • Before 2026-10-16 nothing of this ran on an F50 or a U30 Air: not the helper on the devices' kernels (5.4 vendor, mainline) and under Android (a static aarch64 program started from the Linux filesystem by Magisk's root), not the time the scan and the hashing take on the eMMC or an SD card, not a boot of an updated system. In the containers the updated systems were only asked what can be asked without booting (dpkg --audit empty, sshd -t, visudo -c, no unit that does not load, the accounts; OpenWrt: uci show without an error, every enabled service has its script). The carry step of an Ubuntu system with 22 000 files and 1.3 GB of the user's took 13 s by copy and 7 s by link in the container (an Apple M-series host, measured before the last two reviews' changes); the scan of the old system alone 0.04 s, hashing a whole image 15 s. On the device's storage it will be slower, by how much is not known.
  • A system that has run differs from its image in ways an unpacked image does not: files the system writes or removes by itself. Known and handled: uci-defaults, the package databases, ld.so.cache, pam.d/common-*, accounts. Others would show as lines of the report nobody caused (Back, though you had deleted them, Yours is in use where the new release has another version); the device test looks for them.
  • No release was built. rootfs/assemble.sh and openwrt/build-rootfs.sh were run as tools/make-release.sh runs them, for Ubuntu 24.04 and OpenWrt, with the kernel outputs of the main checkout: both images came out with the helper, their manifest (the same as tools/image-manifest.py makes from the tarball) and the older manifests of their own system, and v2026.10.23 updated to these two built images gave the rows of the tables above by both paths. make-release.sh itself (its audit, the manifests as assets, SHA256SUMS), the 26.04 and panel images and install.sh's source build did not run.
  • What an update still does not keep, by decision: a package that cannot be installed again (not in a feed) - its files stay in <os>.old, mu300-user-packages status says so, as before; choices in /etc/alternatives; a kernel module built by hand on Ubuntu (OpenWrt's lib/modules is kept as before); what the running system changes between apply and the reboot stays in the previous system (apply says: reboot soon).
  • Android's own toybox was not measured (Ubuntu's 0.8.9 was); it is not used for carrying any more.

With the panel's update (§86). Both changes rewrote apply; they are one now. Every source - GitHub, a mirror, apply --from a Magisk zip or a release directory, a downgrade - ends in apply_one, which runs the new image's carry block, so what is said here holds for each (measured below for online and --from). One word for an older release: §86's downgrade_ok and --downgrade (MU300_ALLOW_DOWNGRADE); this change's own MU300_DOWNGRADE variable of mu300-update is gone before it was ever released (the zip's MU300_DOWNGRADE=yes setting stays the zip's), and the refusal now says why it matters: the older release's updater may not carry everything over. One rule for room: space_needed N [CARRY_KB] is what apply refuses with before it downloads and what the page shows (status --sizes, releases); carry_need adds the copy of the user's files kept for a rollback - the old system less its image's files as its manifest has them, with the carry's margin - and nothing for --no-rollback or for a system whose image's manifest is not there before the new image is (every release up to v2026.10.27: the first update to a release with this is counted only by the carry block's exact check after the unpack, which changes nothing when it fails - measured below). The report on the page: System > Update shows /etc/mu300/update-report as the carry block writes it, the newest update on top, cut at 6000 bytes with where the rest is, open while it is new. The manifests of v2026.10.26 and v2026.10.27, published while this waited, were added (36 releases of each image); one published before this is merged needs the same (tools/image-manifest.py legacy, union).

On a release build (2026-10-15: tools/make-release.sh from the branch under a three-field test tag after v2026.10.27, not published, signed with the project's key; 5.4 and the mainline kernels of v2026.10.27; the Magisk zips by tools/make-magisk-zips.sh). The experiment from v2026.10.27 as published, now with a third path - the old system offline, given the new updater as a user of a release before apply --from does it, then mu300-update apply --from the release's zip of its system (--unsigned: v2026.10.27 has no key to check with) - tests/update-experiment/results/built-*.md:

image mu300-update apply installer, Magisk zip apply --from the zip
Ubuntu 24.04 61 kept, 1 set aside, 1 installed again, 4 by design, 0 lost 61, 1, 1, 3, 0 lost 61, 1, 1, 4, 0 lost
Ubuntu 26.04 61, 1, 1, 4, 0 lost 61, 1, 1, 3, 0 lost 61, 1, 1, 4, 0 lost
OpenWrt 46 kept, 2 set aside, 1 installed again, 3 by design, 0 lost 46, 2, 1, 2, 0 lost 46, 2, 1, 3, 0 lost
OpenWrt with the panel 46, 2, 1, 3, 0 lost 46, 2, 1, 2, 0 lost 46, 2, 1, 3, 0 lost

Nothing changed; the copy kept for a rollback (<os>.old) was the old system in every planted item, by both device paths; the other system and the extras beside it untouched. On OpenWrt, --no-rollback the same; 2.5 GB of the user's with 2.3 GB free: "not enough room to carry your files over beside the previous system: 2673 MB needed, 2214 MB free", nothing changed, and through with --no-rollback; MU300_UPDATE_KEEP=list loses what it always did (34 of 67 on Ubuntu), as it says.

A test that failed now and then (test_magisk_installer...test_payload_replaced_after_verification_is_not_installed, "checksum mismatch", about 1 run in 20 on this branch): the test made a zip, then the corrupt one, and the fake release's tar_gz put the time into the gzip header - when a second boundary fell between the two, the manifest the installer read was the second zip's and the payload the first's. No race in the installer (it checks a copy of the payload and uses only that copy). Made deterministic: 2 failures in 100 runs before, 0 in 200 after.

Manifests of the old releases, for the record (optional: no updater reads them from there). For each tag from v2026.09.21 to v2026.10.27, with the tag's four images in release/<tag> as published:

python3 tools/image-manifest.py assets release/<tag> manifests/<tag>
gh release upload <tag> -R dikeckaan/mu300-linux manifests/<tag>/*.manifest.gz

rootfs/overlay/opt/mu300/lib/image-manifests/ was made from the same manifests (tools/image-manifest.py legacy, then union), each image downloaded and checked against its release's SHA256SUMS first.

71. A graphical installer that drives the text installers: an answers mode, a progress stream, a window; a beta question; where a Python with a usable Tk is found

Written against an adb that is a Python program (tests/fakeadb.py) and a fake installer; then run against an F50 (F50-B) from one Mac on 2026-10-15 - what that showed, and what it found, is under "What a device showed" at the end. On Windows only what CI runs.

Why. A user showed a third party's Windows program for this project: a form with a device list, six buttons and a few tabs, which carries its own copy of what the installer does. A copy drifts: the installer has gained the slot rule, the boot chain sync, the read-back of the boot image and the bounded SD stages (§33a, §50, #86) since any such copy could have been made. So the window here has no install logic at all. It asks the questions, hands the answers to install.sh / install.ps1, and shows what they report.

The answers mode (tools/answers.sh, tools/answers.ps1; docs/INSTALLER-AUTOMATION.md is the reference). Each question has one variable, the last argument of its ask. Four rules carry the safety:

  • A question whose variable is not set stops the run and names the variable. It is never defaulted and nothing is read from standard input in its place. Tested for every question up to the first pull, under dash, bash and busybox ash, and for install.ps1 under Windows PowerShell 5.1 and PowerShell 7.
  • A variable set to nothing takes the default, and no default is the destructive answer: INSTALL, ERASE, overwrite, internal and UNINSTALL have to be given.
  • A question that comes back stops. The kernel question and the make-room size repeat until they like the answer; the same variable would answer for ever. The second time is an error ("the answer in MU300_ANS_KERNEL was not accepted: 5.4").
  • @stdin as a value puts the question on the stream and reads one line. That is what lets the window show the installer's own summary - made after the download and the build, from what is really there - before INSTALL is sent. A window that composed a summary of its own from the choices would be showing a guess.

The progress stream is lines @@mu300 {json} next to the text for people: stages with a percentage, questions and answers, the facts of the device, a download's bytes once a second, the sha256 results, errors. The last event of a run is done or error whatever ends it (an EXIT trap in the shell scripts, a trap in PowerShell): a reader must never wait for more. The facts of --check are what the window draws the device from, so the window and the text check cannot disagree about a device; among them are things the text does not print - the bootloader's lock and verified-boot state, read with plain getprop before the check for root, so a device without root still says what it is.

What went wrong on the way, and is fixed:

  • PowerShell does not tell $Ans from $ans. tools/answers.ps1 is dot-sourced, so its script variables share install.ps1's scope. The dictionary of answers was $script:Ans; install.ps1's own $ans = Ask ... (the storage question) replaced it with a string, and the first whole run on Windows stopped with "[System.String] does not contain a method named 'ContainsKey'". -NonInteractive was lost the same way: the file set a variable of the parameter's name to $false after the parameter had been bound. Every variable of the file has the prefix Mu now, and tests/test_answers.py checks that the installers use none of those names. Found by CI's first run of tests/answers.Tests.ps1, not by reading.
  • A secret given in the environment was inherited by everything. MU300_ANS_PASSWORD from an answers file was never exported, but one given in the environment stayed there for adb, curl and python to inherit; an answers file was accepted whatever its permissions; a malformed line of it was echoed. Now: one table of secrets, whose values are never printed, never in an event and never in an error; a secret in the environment is taken out of it before anything is started (and put back for the one restart after a self-update); the file must be the user's alone (no link, owned by the user, no permission for group or others - install.sh, uninstall.sh; Windows has no such check); a bad line is reported by its number. The fake adb records the answer variables it was started with, and the tests look for the password in every output stream, in adb's environment, in the fake's log and in the work directory.
  • The parts of a parallel download count twice for a moment. While they are joined both the parts and the whole file exist; the byte count on the stream is capped at the length.
  • install.ps1 waited two minutes on a device without root before it said so: it asked for sys.boot_completed through su. It asks through plain adb now, as install.sh does.
  • A boot image that could not be pulled was a PowerShell exception (Get-Item on a file that is not there), not the installer's message.

The beta question. The installers took releases/latest. They now read the list of releases and offer a prerelease only when it was published after the newest full release (tools/release_pick.py, one file for both installers and the window). No token; when the list does not come - offline, the API's rate limit, a proxy's page - the newest release is looked up as before and nothing is asked. The release is resolved before the questions now, so a GitHub that does not answer stops the run before the password, not after the pulls. install.ps1 -Answers (one answer per line, in order) never gets the question: it would shift every answer behind it.

Where a Python that can draw the window is found. Measured on this Mac, the one fact of this section that came from a real machine:

  • macOS's own Python - /usr/bin/python3, the Command Line Tools' 3.9.6 - has tkinter with Tk 8.5. On macOS 26.6 its window opens and stays black: no widget is ever drawn. Homebrew's Python 3.13 on the same machine had no tkinter at all; brew install python-tk@3.13 brought Tk 9.1, and with it the window draws.
  • So a Python counts only when its Tk is 8.6 or newer, an older one is named as such ("its Tk is older than 8.6"), and among the Pythons without a usable tkinter the one a fix is known for is the one offered (brew install python-tk@X.Y), not the first found. The window itself refuses an older Tk with exit status 3, on which the installers go on in text.
  • /usr/bin/python3 without the Command Line Tools is a stub whose only effect is the dialog that offers to install them. It is run only when xcode-select -p succeeds (tested with a stub that records being run).
  • On Windows the Microsoft Store's alias is a python.exe that prints nothing and fails; every candidate is run with a real argument, so it is never taken for a Python and the Store is never opened. A Python installed a moment ago by winget is not on the process's PATH; the installation directories find it.
  • Not measured: any Linux desktop, any Windows machine with a person at it.

The window (gui/, tkinter and the standard library only). Model, runner and controller have no window in them and are tested without a display; the widgets are built once per page from the controller's state.

  • The device, root and the bootloader are shown separately. Only a missing root blocks an installation.
  • A locked bootloader is a warning, never a refusal - the owner's decision of 2026-10-13. The bootloader does not have to be unlocked: a device with a patched TrustOS boots a modified boot image with the bootloader locked, and that is enough. No property says whether TrustOS is patched, so nothing can be decided from the lock. Both text installers (in the checks and again in the plan before INSTALL) and the window (in the warning colour on the device page and above the summary, never red) say: "The bootloader is locked. Did you patch TrustOS? With a patched TrustOS Linux boots on a locked bootloader; without it the device goes back to Android by itself after the install." There is no extra confirmation. Issue #156 asked for an early refusal on a locked bootloader; this supersedes it. Locked is ro.boot.flash.locked=1 or ro.boot.vbmeta.device_state=locked, unlocked is 0 or unlocked, anything else is "not reported"; the verified-boot colour is shown and not interpreted. What an F50 or a U30 Air really reports in these properties - unlocked, locked, locked with a patched TrustOS - is still not measured: the rule is written from the properties' meaning in Android, not from a device. The window does not root, unlock or patch anything and links to no guide for it.
  • Stop is offered while nothing has been written to the device (up to and including the copy to /data/local/tmp) and not from android-install.sh on; closing the window is refused there too. Closing the summary dialog answers no.
  • The make-room path (§9b, §57) is there with its figures and wants ERASE typed into the window, which is then the installer's own MU300_ANS_ERASE_ANDROID. It has never been run from the window against a device.
  • "Back up now" is install.sh --backup: Android's boot image and the first block of misc, compared with the device by sha256. The NV and calibration partitions are not read by it, by the installers or by the window; the full backup of those stays tools/backup-device.sh, which the window names and does not run.
  • A device in our Linux is recognised by its serial number (MU300LINUX-..., §70) and asked with mu300-device --json; update, kernel switch, restart and back to Android then go over adb as the project's own commands. Without adb to it the window shows the commands and opens an SSH session in the system's terminal.
  • Every line of a run is masked when it comes in: the serial numbers of the attached devices, 15-digit numbers standing alone (IMEI, IMSI), ICCIDs, passwords and their hashes, Wi-Fi passphrases, adb keys, MAC addresses, the home directory's name. Nothing unmasked is kept, so the log on the screen, the copied and the saved log and the diagnostics report cannot differ in that. The masking is by pattern: a secret in a shape nobody thought of is not caught, which is why the report says to read it before posting.

What a device showed (2026-10-15; F50-B: 64 GB, Android 13 F50_FLYMODEM_ZYV1.0.0B09, Magisk 30.6, bootloader unlocked; a Mac with macOS 26.6 and Homebrew's Python 3.13 / Tk 9.1; release v2026.10.27; next to it a U30 Air in Linux on the same adb, and for part of the day a Pixel 7. Every run with MU300_PROGRESS=1, each stream checked: every @@mu300 line JSON with string values at the start of a line, the steps in order, the last event done or error.)

  • --check from a device in Linux, named by ANDROID_SERIAL=MU300LINUX-...: asked over adb, rebooted, came back as Android, 35 events, done ok. The facts are install.sh's text: eMMC 122159104 sectors, partitions ending at 54218752, the region at 27762098176 with 34779168768 bytes, existing, slots a/b, the boot chain identical.
  • The bootloader's properties on this unlocked unit: ro.boot.flash.locked=0, ro.boot.vbmeta.device_state=unlocked, ro.boot.verifiedbootstate=orange, so bootloader.state=unlocked and no warning. Seen once by accident on a Pixel 7 with a locked bootloader (see the first fault below): 1 / locked / green. A locked F50 or U30 Air, with or without a patched TrustOS, is still not measured.
  • --backup: boot_a.img (64 MiB) and misc-head.bin (4 KiB), the sha256 of the boot image the same as the device's, nothing written.
  • Installations in answers mode, the summary on @stdin and INSTALL sent when it waited: Ubuntu 24.04 on 7.2 over the existing filesystem (update, 14 questions, /etc/mu300/lan.conf kept); OpenWrt with the panel on 7.2 with the filesystem wiped; a fresh Ubuntu after a quick uninstall, where the region still held data and MU300_ANS_OVERWRITE=overwrite was asked for. Each done ok with the release, kernel and system, and the device booted Linux. The sha256 results were ok for downloaded files and cached for kept ones.
  • The beta question: asked ("A beta is out: v2026.10.27 ... Install the beta v2026.10.27 instead of v2026.10.25?") while v2026.10.27 was a prerelease newer than the release v2026.10.25, and answered yes from the file; not asked once v2026.10.27 had become the release (v2026.10.26, an older prerelease, does not count), and a MU300_ANS_BETA in the file then stays unused.
  • Uninstallations in answers mode: quick from a device in Linux (named by its Linux serial, rebooted over adb), and keep from the window; both done ok, boot_b a copy of boot_a, the Magisk module marked for removal.
  • The window (driven from its own Tk thread, the screen locked part of the time, so screenshots only from the morning's runs): the device page in Android, in Linux and with two boards to choose from; the storage bar against the real table; Choose; an installation from the window (update, Ubuntu on 7.2) through the installer's own summary to the Finish page; the uninstaller from the window with keep; Manage on a device in Linux: mu300-device --json, the update check, back to Android; the kernel box showing the running kernel.
  • The question "Use the graphical installer?" at a terminal (a pty): the default yes (macOS, no SSH), no went on in text, yes started the window with /opt/homebrew/bin/python3.13. The search found /usr/bin/python3 (3.9, Tk 8.5: too old) and Homebrew's 3.13 with Tk 9.1, and took the second.
  • The web installer's mirror (FINDINGS 72) was run on the same day with the same unit.

Faults the device found, all fixed with tests:

  • While the F50 rebooted, a Pixel next to it was the only adb device, and install.sh --check went on with the Pixel ("su: inaccessible or not found"; nothing written). Waiting for Android now takes only the board that was rebooted (our Linux's serial is MU300LINUX-<Android's serial>-<eMMC id>), or the one F50/U30 Air, never another device. install.ps1 / uninstall.ps1 had the same wait and have the same fix.
  • Two boards in Linux on adb (the F50 named by ANDROID_SERIAL, a U30 Air): the named board was dropped, none of the two was rebooted over adb, and the SSH fallback went to 192.168.77.1/.78.1 - where the U30 Air answered. Now the named board is the one rebooted, and without adb to it no address is guessed while another board in Linux is on adb (unless MU300_IP names it). Measured afterwards: only the F50 was rebooted. Also in the PowerShell scripts.
  • The window went on with the other board. While the F50 restarted after an installation from the window, the U30 Air in Linux was the only adb device left and the window took it (and asked it for mu300-device --json); its Manage page would have restarted or updated that board. The window now follows the board it worked on through a restart, in whichever system it comes back, and takes none while it is away. Measured afterwards: during the restart into Android nothing was selected, then the F50 in Android, checked by itself.
  • The kernel box of Manage said 6.18 on a device running 7.2.10; it shows the running kernel now.
  • An answers file with mode 644 stopped install.sh before the stream existed, with no event at all; a program that asked for the stream now gets the error event (the text, never the file's content).
  • The uninstaller's clean-up said "rm: /data/local/tmp/mu300-web: Is a directory": the web installer's directory matched mu300-*. Only files are removed now (uninstall.sh, uninstall.ps1).

Seen and left as they are:

  • The first check after Android came back failed once with "could not read the partition table": about 8 s after it first showed up the F50 left adb for 2 s and came back (Android's USB set-up after the boot). The window checks again when the device comes back, and that check passed. A text run started in that moment can fail the same way; starting it again is the remedy.
  • A password that is also a word of the installer's output is masked there too: with ubuntu as the password the window's log and summary say "systems: (Ubuntu 24.04)". That is the masking working, and it tells a reader of the log that the password is ubuntu; a password that is no such word avoids both.
  • The end of an installation names 192.168.77.1 for SSH whatever /etc/mu300/lan.conf on the device says (an update keeps that file).

What is still to be shown:

  1. .\install.ps1 -Check, any run of the PowerShell scripts against a device, and the window on Windows (CI runs them against the fake adb only); by hand the question and the search for Python on a machine with only the Store alias, and [Console]::OutputEncoding under a window with no console (the Turkish and Chinese text).
  2. A U30 Air, and what bootloader.locked / bootloader.verified say on a locked F50 or U30 Air, with and without a patched TrustOS.
  3. The window on a Linux desktop; from the window: a device that is unauthorised, Stop during the download, the SSH button.
  4. The make-room path from the window, last, on a unit that may lose its Android data.

83. An update dropped the jobs of OpenWrt's System > Scheduled Tasks (/etc/crontabs)

LuCI's System > Scheduled Tasks page writes /etc/crontabs/root, and busybox crond runs it (init.d/cron, START 50). etc/crontabs was in neither copy of the keep list - keep_list in mu300-update nor the one in tools/android-install.sh - so an update built the new system from the release's image and left the jobs behind in <os>.old. Two things follow, and the second is worse than the lost line: the page comes up empty after the reboot, and the image's own /etc/crontabs is an empty directory, while OpenWrt's init.d/cron begins with

[ -z "$(ls /etc/crontabs/)" ] && return 1

so crond does not run at all in the updated system: every job, present or added later by hand, is dead until somebody notices.

Reported by a user (U30 Air, openwrt-luci): the Scheduled Tasks page was empty after an update. The symptom is the report's; the cause is read from the code and from the release image (mu300-openwrt-luci-rootfs.tar.gz carries an empty ./etc/crontabs/), not reproduced on a board here. OpenWrt's own sysupgrade keeps the directory - it is what this list means to mirror - and the two lists are kept equal by a test, which is why both changed together.

Fixed: etc/crontabs added to the OpenWrt branch of both lists. Not touched: the Ubuntu branch, whose images carry no cron package (scheduled work there is systemd timers, and a user's own unit files in /etc/systemd/system are still dropped by an update - a separate gap, and a design decision about which of *.service, *.timer and *.d/ drop-ins to carry).

Unit tests only (tests/test_update.py: keep_list openwrt-luci names it, the two lists are equal, and apply_one on a fake disk carries etc/crontabs/root over an image whose own directory is empty). To check on a device with openwrt-luci:

# before the update: a job saved in System > Scheduled Tasks
cat /etc/crontabs/root; ps | grep crond
mu300-update apply && reboot
# after: the same job, and crond running
cat /etc/crontabs/root; ps | grep crond

80. WPA3 on the U30 Air's access point: the SC2355 firmware does SAE itself (PR #74, Snrat)

Status: disabled (2026-10-17, §175). The owner switched the mode off in every layer because it cannot be shown safe: the PMK record hostapd imported comes in the same EVT_NEW_STATION element list as the client's own association-request elements, with no boundary, so a client could append a forged record and finish the 4-way handshake without the passphrase whenever the firmware does not append its own (the provenance points below). The recipe, the patch and the guard named below are gone from the tree (last in commit 2e5cf929); the measurements stay as the record of what the firmware does. docs/U30AIR-SAE.md says why and what revisiting would need.

The AP side of 14b's station finding. What the hardware showed, on one U30 Air (OpenWrt 25.12.5, Linux 7.2.9):

  • Stock hostapd cannot do SAE on this driver. The SME is in the firmware (iw phy: connect, no authenticate), so hostapd never sees the SAE frames: a WPA3-only BSS comes up, a client finishes SAE with the firmware and then fails association or the 4-way handshake (macOS: -3912).
  • Two vendor interfaces make it work. hostapd hands the passphrase to the firmware with vendor command OUI 0x001374, subcommand 43, nested attributes 8 (passphrase), 6 (group, 19) and 7 (ACT, 0xffffffff); the firmware answers each association with the derived PMK and PMKID as a trailing vendor element in the NEW_STATION IE buffer: EID 221, length 52, prefix 40:45:da:04, then 32 + 16 bytes. Hunting-and-pecking, group 19 only; H2E-only clients and other groups untested.
  • Only the passphrase reaches the firmware. vendor_set_sae_password (sc2355/vendor.c) stores the group and never increments group_count, so vendor_softap_convert_para writes no group TLV; and it writes the ACT TLV only when setting->act != -1, which 0xffffffff is not. CMD_SET_SAE_PARAM therefore carries the entry, the passphrase and the end marker: group 19 and the anti-clogging threshold are the firmware's defaults, and hostapd's sae_groups and sae_anti_clogging_threshold do nothing in this mode. Left as it is: sending a group list the firmware has never been given is a change nobody has measured.
  • The gate is the option and a firmware capability, not the device. The driver answers the vendor command with -ENOTSUPP unless the firmware reports SPRD_EXTEND_SOATAP_WPA3. The F50 has the same chip and driver; what its firmware reports is not known. The command exists in the 5.4 vendor driver as well as in the mainline port; only 7.2.9 has run it.
  • The PMK arrives in a client-controlled buffer. The driver passes evt_new_station.ie straight through as assoc_req_ies (sc2355/cmdevt.c -> common/report.c), the same bytes that carry the station's own IEs. The parser accepts exactly one trailing element and rejects any second marker, which only holds if the firmware always appends its own; nothing proves it refuses an association without a completed SAE exchange. Open.
  • Why it stays open (2026-10-16, PR #237, mixed WPA2-PSK/WPA3-SAE). Traced through the driver: the only carrier is EVT_NEW_STATION, struct evt_new_station { is_connect; mac[6]; __le16 ie_len; ie[] } (sc2355/cmdevt.h). One length, one byte array: the station's association request IEs - bytes a client chose and sent over the air - and the firmware's dd 34 40:45:da:04 <PMK 32> <PMKID 16> record sit in the same element list, with no field, count, flag or MAC that says where the client's part ends. cmdevt_report_new_station_evt -> sprd_report_softap (common/report.c) hands that list to cfg80211_new_sta as assoc_req_ies unchanged, and hostapd sees it as the request IEs (nl80211: Assoc Req IEs). A client can put a record of the same shape as the last element of its own association request, with a PMK it picked and that PMK's PMKID in its RSN element (the PMKID check compares two values the same client supplied). It then finishes the 4-way handshake with a key it knows - without the passphrase - in every case where the firmware forwards such an association without appending a record of its own: an association with the SAE AKM after open authentication, a PMKSA-caching or reassociation path that skips SAE, a firmware build that only appends on some paths. "Exactly one terminal record" defends only the case where the firmware always appends after the client's bytes; the driver cannot tell either way, and neither can hostapd (it never sees the SAE commit/confirm, so it cannot recompute the PMK). PR #237 does not change this transport (its station-event rewrite adds bounds and logging, the same buffer still goes up whole). Closing it needs one of: (a) a firmware-originated transport - a separate event, or a firmware-given boundary/length inside EVT_NEW_STATION the driver uses to split the client's IEs from the result and pass the result out of band (and to drop any record of that OUI/type found in the client's part); or (b) evidence from the air: a malicious-client probe (for example a modified wpa_supplicant or injected frames) that associates with the SAE AKM, MFP and a forged trailing record (1) after open authentication with no SAE at all, (2) after a failed SAE (wrong password), (3) with a PMKID for a PMKSA the AP never had, on each firmware the opt-in allows - and shows the firmware refuses (1)-(3) or always appends its own record after the client's. Until then the opt-in (the merged pure-SAE path) carries this exposure, and a mixed-mode variant is not taken. Two driver robustness fixes from #237 that do not depend on it (a NULL channel in mgmt_tx, the station event's bounds) were taken on their own.
  • The stock driver printed secrets at L_DBG: the SAE passphrase (pwd is :%s, vendor.c), a station PSK (cfg80211.c, %s on a buffer that is not NUL-terminated), every TX command and up to 400 bytes of every RX message on PCIe (pcie.c, sdio.c), the NEW_STATION event (cmdevt.c). The default level is L_INFO and this kernel exposes no debugfs node for it, so none leaked by default; the removals are unconditional now. Confirmed on the device with the rebuilt 7.2.9 module: dmesg and logread through a boot, a WPA2 association and a package swap hold none of the patterns (the only EVENT: matches are reorder_wlan_delba_event).
  • Option off is the stock path. With the patched wpad-basic-openssl r8 installed and the WPA2-PSK hotspot untouched, the generated hostapd-phy0.conf has no sae/u30_sae key, a WPA2 client is back 32 s after the package swap, the VPN stays up. The mode needs pure SAE, ieee80211w=2, sae_pwe=0 and PMKSA caching, and a BSS with the option and any other mode fails closed (Failed to set beacon parameters, AP-DISABLED). In the patch every new path starts from u30_sae_offload (the configuration check, the firmware request, the key import); the one line that is not behind it replaces hostapd's debug hex dump of the association IEs with their length. OpenWrt's wifi-scripts turn the documented UCI settings into wpa_key_mgmt=SAE, ieee80211w=2, sae_pwe=0, u30_sae_offload=1 and wpa_passphrase (no sae_password, which the patch refuses), checked with the 25.12.5 scripts in a container.
  • A second BSS with the option, added live, took the radio down (2026-10-12). wifi reload with a new wifi-iface (encryption sae, ieee80211w 2, sae_pwe 0, u30_sae_offload=1) next to the WPA2 hotspot: both SSIDs disappeared and did not come back within ten minutes. The device could only be reached over that hotspot, so the cause is not known yet (hostapd gives the whole phy up when one BSS fails to set up; the earlier maintainer test used a separate BSS with r6 and a full wifi down/up). Enable the option on a device you can reach another way, and with a full wifi down; wifi up, never wifi reload. Snrat's r9 refuses a second BSS when the configuration is loaded (U30 SAE: supports a single BSS only); on his device, with logread -f over USB, the refusal still took the running WPA2 BSS down with it through netifd's reload. The cause of the r8 outage itself was never captured.
  • A hotspot that could not start stayed down at every boot; now it goes back to WPA2 (2026-10-13). Three roads to it: mu300-update keeps /etc/config and replaces the packages, and the stock wpad refuses a configuration with a key it does not know; the firmware refuses the vendor command; the patch rejects the mode. openwrt-wifi-sae-guard (does nothing without the option) looks before the first wifi up whether the installed hostapd has the option, and about two minutes after boot whether the access point is ENABLED; if not, the BSS becomes psk2 with the same passphrase, the file as it was is kept in /etc/mu300/wireless.sae-offload, and mu300-wifi logs one error line. WPA2 because hostapd's own SAE cannot work on this driver (first point).
  • Measured on the U30 Air, 2026-10-13 (OpenWrt 25.12.5, 7.2.10, r9 built with the helper, this branch's sprd_wlan_combo.ko; no Wi-Fi client at hand, so no association with SAE was tried):
    • Without the option the guard changes nothing: AP-ENABLED at 40.1 / 41.5 / 43.3 / 43.4 s before, 41.2 / 41.3 / 43.3 s with it; silent, the configuration byte-identical, a WPA2 client back by itself.
    • netifd starts the radio once before mu300-hw does (15 to 23 s after power-on; AP-DISABLED under the world regulatory domain). So the stock hostapd does see the option once and logs unknown configuration item; the guard acts before mu300-hw's wifi down; wifi up at about 37 s, and the hotspot was up as WPA2 at 39.9 s, the configuration byte-identical to the one before the opt-in, the saved file mode 600.
    • A mode r9 refuses (sae-mixed; a second BSS): fallback 136 s after power-on, AP-ENABLED at 139.5 and 139.7 s. Off on purpose (the key's marker, interface or radio disabled): untouched.
    • The log loses the guard's line. 128 KiB, about 1300 lines, and one Wi-Fi restart writes hundreds: 135 s after the fallback the line was gone. It is now also in /etc/mu300/wireless.sae-offload.why, with its time.
    • r9 with the option: U30 SAE: firmware runtime parameters configured, vendor_set_sae_password type : 8/6/7, no firmware not support softap wpa3, AP-ENABLED 5 s after wifi up, 41.6 s after power-on; the generated file has wpa_key_mgmt=SAE, ieee80211w=2, sae_pwe=0, u30_sae_offload=1. A synthetic passphrase, as text and as hex: 0 lines in dmesg and logread; none of the removed prints. Option off again: WPA-PSK, no line.
    • The module with the removals booted and ran every step above (its wcn_bsp is section-identical to the installed one; sprd_wlan_combo 352 bytes of code shorter). The module in v2026.10.25 prints the passphrase with pr_info, not at L_DBG as the point above says: it holds the four format strings. It was not run with the option, so that print was not seen in a log.
    • apk add of the r9 pair next to wpad-basic-mbedtls is refused (conflict): apk del the stock one first. This iw prints no "Supported commands", and iw dev wlan0 station dump on this driver prints no station fields, so neither can serve as a check.
    • Not measured: any client (WPA3 join, WPA2 refused on the SAE BSS, wrong passphrase, throughput, the PMK probe), kernel 5.4, the F50. After the SAE steps and the original WPA2 configuration back, the WPA2 client that had rejoined earlier did not come back within 4 minutes, nor after the device was all stock again: it had most likely left, and a WPA2 join after SAE in one boot is not shown.
  • Built, 2026-10-13: sprd_wlan_combo with these removals for 7.2.10 and 6.18.56 (with wcn_bsp; the five touched files warn only where the vendor's code always did, none of the removed format strings is in the module); for 5.4 the twelve wlan_combo-*.patch apply in the build's order on the pristine vendor driver and all 69 objects compile (the module was not linked: ThinLTO wants to write next to the kernel's objects). The hostapd patch applies with GNU patch after OpenWrt 25.12.5's own patches on ca266cc2 (BSD patch rejects the ap_config.c hunk, which has no leading context: build in the SDK, not on macOS).

ZTE V50 (MU3351)

95. The ZTE V50 (MU3351), experimental: how it is told apart, and what kano measured on his

Status: experimental. Nothing in this section was measured by this project: nobody here has a V50. What follows separates what kano (kanoqwq) says he read and measured on his V50, in his line of this project (branch clean-tf-7.2, MIT like this one), from what was checked here. The owner's word (2026-10-15): "if kano did V50 support, bring it over". Nothing of his tree was run here and no binary of it was taken; the code below is ported into this tree's structure.

kano's commits about the V50. f6b0668d (2026-10-14, "add desktop deployment and isolate F50/V50 profiles"): the identity, the device-tree test, the AW9523B LED driver, the LED mapping, dual SIM, NFC, CPU voltage, his notes (docs/V50-MU3351-20261014.zh-CN.md). 0438ab01 (2026-10-14): the shared eMMC policy that replaced his V50-only one, and a changelog. Later ones mention the V50 in passing: 2d3b6f3f (the F50 and the V50 have no battery: their fuel gauge is not one), e114999d and 8d3d29e6 (updates and installs on his V50 with his desktop installer), 0e19fe32 and 53ef7b1a (his GUI and docs); cd4fb28b (2026-10-01) took a boot-time change from "V50 boot speed research".

What kano says he read or measured (his notes, 2026-10-14; not repeated here).

  • Identity: ro.product.model V50, ro.product.device MU3351, platform ums9620, board ums9620_2h10_feimao, T760: the F50's kernel platform; the same CPU frequency tables, the SC2355 Wi-Fi on PCIe, the same A/B partition names. ZTE's support page calls the V50 MU3351 (not the Blade V50 phone). Android 13, file-based encryption on his unit.
  • Its LEDs: an AW9523B at 0x5b on I2C3 (/soc/ap-ahb/i2c@2270000/aw9523b_led@5b), not in the F50's device tree. The DT idx values are GPIO pins, not DIM registers (from aw9523b_brightness_work in ZTE's Android driver); the current limit is the low two bits of default_imax (aw9523b_set_led_imax); three lamps, NET1, NET2 and Wi-Fi, each with two white emitters and blue and red ones (from groupcolor_store, and lit one group at a time on the unit). The PMIC's sc27xx:* LEDs exist there as well, and older scripts picked those.
  • No battery (his power-supply code treats the F50 and the V50 alike: their fuel gauge is synthetic).
  • NFC: I2C2 0x57, reset on AP GPIO189 (the U30 Air's is 190); the tag read and written back.
  • Dual SIM: with only SIM 2 in, CPIN READY, CFUN=1 and both stacks up; registration answered CEREG=8 (the card was out of credit). Two cards at once: not measured, in his words.
  • eMMC: under mainline ext4 reported deleted inode referenced after normal reboots, again after an offline fsck. With the eMMC host's runtime PM forbidden at probe (kernel 7.2.8 "#17") a marker, the configuration and scripts survived a sync and a reboot with their SHA-256, errors_count 0: "an improvement, not proof that runtime PM alone caused it". Writing power/control "on" from the initramfs hung the boot before the mount. He later replaced it with a policy for every board (FUA emulated with flushes, ordered MMIO in sdhci-sprd, the eMMC never powered off at system suspend), which he says was not yet measured on the V50.
  • His V50 booted Linux from slot b with misc's boot control (32 bytes), his boot chain check read the five images alike on both slots, and it ran OpenWrt with the 6.18.54/7.2.8 kernels he built with his AW9523B driver. His installers refuse kernel 5.4 on the V50.

What was checked here (2026-10-15).

  • The F50's stock device tree (vendor_boot, the live FDT and dtbo of an F50, read with dtc): no AW9523B, no charger_policy_service; its i2c@2270000 is sprd,sc9860-i2c, disabled and empty. The U30 Air's vendor_boot (a backup of 2026-09-27): no AW9523B; charger_policy_service present. So the node tells the V50 from both.
  • Both mainline kernels (6.18.56, 7.2.10) build with the driver and patch 0017; no warning from either file.
  • Unit tests for every decision below, on dash, bash and busybox sh.

What was ported, and how a V50 is told apart.

  • mu300-device and boot/init (one rule, the same code; a test holds them to it): the label (/etc/mu300-device, /run/mu300/device) as before, except that f50 on a device tree with the AW9523B node and without the charger policy service is a v50 (an older installer took a V50 for an F50 when the user said yes), and v50 on a device tree without that node is what the tree says (u30air with the charger policy service, else f50). The F50 and the U30 Air: no node, so the answer is the one of before in every case (test_mu300_device_three_boards, tests/test_boot_init.py Device).
  • Installers (install.sh, install.ps1, the Magisk zip, tools/android-web.sh for the web installer, the boot chain scripts): exactly V50 / MU3351 on ums9620 is a v50, with one line saying it is experimental; a model V50 with another device, or a device MU3351 under another model, or another platform is refused, never offered as an F50; MU300_DEVICE cannot make a V50 another device (f50/u30air only, as before). Kernel: mainline only (install.sh --build, the 5.4 choice, a zip whose kernel does not name the V50 and the web installer's 5.4 are refused with the way out).
  • Kernel bundles: a mainline bundle names v50 in devices only when its kernel has CONFIG_LEDS_AW9523B=y; the 5.4 bundle never does, so mu300-update never puts 5.4 or an older kernel on a V50.
  • leds-aw9523b (kano's driver, upstream/port/drivers/leds/, built in): binds only awinic,aw9523b with ZTE's binding (led_enable 1, gpio_enable 0), checks the whole binding and the chip ID 0x23 before it touches the chip; registers the DT groups, each wired pin (aw9523b:pinN) and, for exactly the V50's binding, the lamps (v50:net1:white ...). mu300-led: NET1 is the network lamp (blue 4G, white 5G, red no service), the Wi-Fi lamp white on 5 GHz and blue on 2.4 GHz, NET2 dark; the PMIC's LEDs are never written on a V50.
  • Patch 0017 (sdhci-sprd): the eMMC host's runtime PM forbidden at probe where the AW9523B node is, his measured fix, not the later shared policy (that one changes every board, and nothing measured it on the V50 either). On the F50 and the U30 Air it is a lookup that finds nothing.
  • No battery: mu300-power, the dashboard's power tile and the USB role setter take the V50 as an F50.
  • The charger at 0x1a (patch 0016, issue #225): bound only with /charger_policy_service; the V50 has none (kano's init tests for that node before the AW9523B and still took his unit for a v50; and he says it has no battery), so nothing is bound there, as on the F50.
  • USB network 192.168.79.1 (kano kept the F50's 192.168.77.1, which collides with an F50 on one computer).

What does not work yet. The second SIM (the dual-SIM code is the U30 Air's, §74, and kano's evidence is one card in SIM 2 that did not register); NFC (mu300-nfc says so; another reset line than the U30 Air's); SIM selection; kernel 5.4; kano's CPU voltage whitelist entry for the V50's SML (this tree has no such list); his NET2/Wi-Fi LuCI LED page and his OpenWrt LED events for two SIMs.

Risks. A V50 that does not boot falls back to Android after the usual attempts (misc's trial). The LED driver and patch 0017 do nothing without the node. A V50 installed earlier as an F50 becomes a v50 with the next update: its address moves to 192.168.79.1 (Ubuntu without lan.conf; OpenWrt keeps the LAN it was set up with) and its kernel is updated only to a mainline one that names it (mu300-update kernel 6.18). The eMMC trouble kano saw may have another cause than runtime PM.

Checklist for a V50 owner (report in an issue).

  1. Android: getprop ro.product.model, ro.product.device, ro.board.platform say V50, MU3351, ums9620.
  2. Install with kernel 6.18 (or 7.2) of a release that names the V50; the installer says "ZTE V50: EXPERIMENTAL".
  3. In Linux: mu300-device says v50; ssh to 192.168.79.1 works; dmesg | grep -i -e aw9523b -e 'kept awake' shows "4 LED groups, pin mask 0xffff" and "MU300: ZTE V50, eMMC host kept awake".
  4. ls /sys/class/leds has v50:net1:*, v50:wifi:*; sudo mu300-led test lights each lamp in turn.
  5. Mobile data on SIM 1, the hotspot on 5 GHz and 2.4 GHz (the Wi-Fi lamp white, then blue).
  6. Several reboots, then sudo dumpe2fs -h of the Linux filesystem: FS Error count absent or 0, files kept.

The device manager

110. The web installer as a device manager: one checked entry point on the device (mu300-api), the page over it

What was asked. The owner, 2026-10-15: the web installer should also manage a device that runs our Linux - the Wi-Fi name, the VPN and so on, everything about the device - over the same WebUSB connection. Until then it had a small view (status, update check, kernel, restart, back to Android, logs) made of single shell commands.

The design. The page composes no command and reimplements nothing. The device has one entry point, /opt/mu300/bin/mu300-api METHOD, with a fixed list of methods and the request as one JSON object on stdin; it answers one JSON object. Its interface is documented as stable in docs/ADB-INTERFACE.md (field api, now 1).

  • Reading the request without jq (Ubuntu has it, OpenWrt does not) or jsonfilter (the reverse): lib/json.awk, one program for busybox awk, mawk and gawk. A request is a flat object of strings, numbers, booleans and null, keys [a-z][a-z0-9_]{0,31}; a nested value, a key twice, a raw control character, \u0000 (or any control character other than tab, newline and CR, escaped or not), a lone surrogate, trailing text or more than 64 KiB is bad-request before any method runs. The same program re-serialises a tool's JSON answer (mode=check) before it is put into a reply, so a tool cannot break the reply it is part of; a tool's answer that is not JSON is null or failed, never pasted in.
  • Every field by its own rule, an unknown field refused: fixed words, numbers in ranges, an SSID by hostapd's and wifi-client's rule (1-32 bytes, no control character, no space first or last), a WPA2 passphrase (8-63 printable ASCII), an APN by 3GPP's characters and credentials by mobile-data.conf's own rule (FINDINGS 65: printable ASCII, no quote or backslash, at most 64), a channel from lib/wifi-channels.sh for the band and the country (never DFS, FINDINGS 42), a LAN address private and at .1, a host name by RFC 1123, a time zone that exists in the zoneinfo, a VPN link by the scheme list mu300vpn uses, an https:// URL, an adb public key by its shape.
  • Values reach a tool as one argument that a pattern has already kept from starting with -, or on its stdin. The secrets only ever on stdin or in the file they belong in: the hotspot password into hotspot.conf (0600) or UCI through uci batch on stdin, the APN password into mobile-data.conf (0600) or UCI the same way, a VPN link or config on mu300-vpn profile import -'s stdin (a here-document: the variable is expanded once and never read again), a VPN URL and a Wi-Fi password into a 0600 file of the root-only job directory that the job opens as its stdin and removes before the command runs, the login password on chpasswd's stdin (Ubuntu) or the static busybox's chpasswd -c sha512 (OpenWrt, whose own busybox has none). Nothing secret is read back: password_set says whether there is one.
  • Shared code paths. The CLIs of /opt/mu300/bin are the shared layer: mu300-wifi-band for a band change on OpenWrt, wifi-client, mu300-sim, mu300-traffic, sms, mu300-usb, mu300-next-boot, mu300-os, mu300-update, mu300-extra, and the VPN module's mu300-vpn (the same machine-readable CLI the LuCI pages reach through mu300vpn and Cockpit calls directly). Mobile data on and off is mu300-traffic's own way (ifup/ifdown wan, systemctl start/stop mu300-mobile-data.service). What only the OpenWrt control panel has - band and cell locks, the SMS pool, SMS forwarding - is delegated on openwrt-luci to its backend, called as rpcd calls it (/usr/libexec/rpcd/mu300dash call METHOD with the request on stdin: no ubus call with a secret in its argv), with the same field rules applied first; elsewhere those methods are unsupported. The overview's radio, battery and temperature readings are those of mu300-panel info (Cockpit's page); the panel extra keeps its own copy for systems that have no mu300-api - a release-independent extra cannot rely on it yet.
  • Long work is the job: update.check, update.apply, kernel.set, extra.install/remove, vpn.install, vpn.engine_install, vpn.add_url, vpn.sub_add, vpn.sub_refresh, wificlient.join/leave. One at a time (flock, and the state), started with setsid so that adbd's SIGHUP at the end of the shell, a closed tab or a pulled cable does not reach it; its output in /run/mu300-api/job/log, its status in rc. job.status {from: N} gives the lines from N (whole lines while it runs, at most 400, each cut at 400 bytes, an address's path and query replaced by ...). hello names the job, so a page that connects later follows it from the start. An update, a kernel or an extra's removal cannot be cancelled half way.
  • WPA3 (FINDINGS 80) is never switched on. (Until 2026-10-17 a hotspot set to SAE by hand was shown as such and kept; since §175 the mode is disabled, and a save on such a hotspot makes it psk2+ccmp with its password, or is refused without one.) An open hotspot gets psk2 with its first password.
  • Hidden SSID on Ubuntu is new in hotspot-start (HIDDEN=1 -> ignore_broadcast_ssid=1).
  • adb's keys mode (FINDINGS 70) is only switched on together with the page's own key (adb.auth {mode: keys, key}: the key goes to mu300-usb adb key - first; a key that is refused leaves the mode alone), and every change of adb, the USB role, the LAN, the hotspot, mobile data and a restart runs two seconds after the answer (setsid), so the answer reaches the page first.

The page. manager.js: tabs Overview, Wi-Fi, Mobile data, VPN, SMS, USB and LAN, System. Every action whose consequence reaches the page's own connection or the device's uplink asks first, saying what happens and how to get back (the USB host role and adb's mode end the connection; a restart; mobile data off when it is the only uplink; a kill switch; the LAN address, which does not touch adb). Secret fields start empty ("unchanged"), are shown only while "show" is ticked, are emptied once saved and are added to the page's masker. The overview, the job and the log are masked as everything else on the page; the diagnostics file leaves out SSIDs, user names, addresses and message texts. A release without mu300-api (hello prints the marker) gets the earlier small view with a note to update.

Tested: tests/test_api.py (every method's validation and its calls into stub tools, hostile values, the secrets in no argv, reply or file but their own, the job; dash, bash and busybox sh, busybox's awk where there is busybox), tests/web/manager.test.mjs (the page's adapter and the Manager against a fake adbd whose shell runs the real mu300-api), the strings test across en/tr/zh.

On the devices (2026-10-16). The protocol of docs/web-installer.md ran with the page's own modules from Node over WebUSB (the usb package; device.js LinuxDevice, manager.js Manager, the device picked by its full serial; no browser) on a U30 Air (openwrt-luci, OpenWrt 25.12.5, v2026.10.27, kernel 6.18.56, the owner's VPN up with its kill switch) and an F50 (Ubuntu 24.04, v2026.10.27, kernel 7.2.10), with this branch's mu300-api, json.awk, path-commands and hotspot-start copied over the release (and #248's data roaming files, which data.get reads). Every setting changed was set back afterwards from a copy taken first.

# U30 Air (openwrt-luci) F50 (Ubuntu)
1-2 hello, every tab read; the overview, locks, VPN (the owner's profile, kill switch, engine), SMS pool and forwarding summary as LuCI has them every tab read; locks unsupported (as designed)
3 SSID Test "1" $(x) it's and a password with a quote, a double quote, $( ), a backtick, a semicolon, a pipe, an ampersand and a backslash: two defects (below), fixed; then uci and hostapd byte for byte as sent, encryption psk2 kept; 2.4 GHz ch 11 (a defect, fixed), 5 GHz back on 36/VHT80, ch 44 and back the same values byte for byte in hotspot.conf (0600) and hostapd.conf; 2.4 ch 11, 5 back (iw dev); "off" for 20 s after each change (fixed)
4 hidden: ignore_broadcast_ssid=1, back to 0 the same (HIDDEN=1; hostapd.conf rewritten about 7 s after the answer)
5 wireless.radio0.disabled=1, no interface; on again mu300-hotspot disabled and stopped; enabled and running again
6 - scan refused in AP mode by wifi-client (this driver): the reason was its last hint line, now the whole message (fixed); no join (no network whose password was at hand)
7 ifdown/ifup wan (autostart false/true), the VPN back on the same exit address the service stopped (no address) and started (address back)
8 APN internet, PAP, a user and a password with $, a backtick, a semicolon, a pipe, an ampersand and spaces: uci byte for byte (after the fix), the page shows the user, never the password; cleared again (apn empty deletes the option) the same in mobile-data.conf (0600), the dial restarted with it; credentials cleared; bad APN/user/password values refused
9-10 sim.get; lock.get; lock.set LTE 1,3 (the owner's own setting, set again: queued and applied) - the bands were not changed sim.get; lock.get unsupported
12 a made-up VLESS link beside the owner's profile: added, renamed (quotes), listed, removed; the owner's profile active throughout the module installed by the job (v2.0.1 with vpn-xray), a made-up link added, renamed, removed; a link with -o and an http:// one refused; the extras removed again
13 7000 KALAN through the panel's pool: sent, the carrier's answer arrived the same through sms; the answer deleted by id
14 192.168.90.1 and back: the page lost the device (below) 192.168.90.1 and back: the old address stayed on br-lan (fixed); the Mac kept its old lease (no new address without reconnecting)
15 keys only with the page's key: the connection dropped, came back signed with it, auth: keys, one key; open again (the key file removed by hand) the same
16 not run: the host role would take the USB connection away, and this unit must not be reached any other way -
17 hostname and back; a time zone is refused as unsupported ("zoneinfo for ...", even the current one: OpenWrt has no zoneinfo, as designed); the same password set again and SSH login with it; SSH off (refused) and on hostname, time zone Europe/Berlin and back; the same password again, SSH login; SSH off (refused) and on; /etc/shadow restored afterwards
18 update.check: "Up to date." the same
19 not run (this unit must not fall back to Android) 6.18 by the job and a restart: 6.18.56; 7.2 by the job failed with the job's "could not reach GitHub" (the carrier passed no traffic without the VPN by then) and was put back from the release's files by hand
20 lang installed and removed by the job not run (the panel extra installs Cockpit from the archive)
21 logs read logs read; the page's log never had a password
22 Android as the default and Linux again (no restart: this unit must stay in Linux) the same (no restart)

Defects found and fixed on this branch:

  • busybox awk (OpenWrt 25.12, busybox 1.37) and gsub: json.awk's gsub(/\\/, "\\\\") gave one backslash there, so a string's quote came out unescaped and a backslash was lost. On the U30 Air every answer with an SSID holding a quote was no JSON (wifi.get: bad-answer), \n in a tool's text became n, and a request's backslash vanished on the way to uci (a hotspot password stored without it). json.awk now replaces literally (rep); a static test keeps backslashes out of every gsub replacement in json.awk and mu300-api (the unit tests use busybox only where the machine has one, and an older one at that).
  • A band with a channel on OpenWrt: the channel was dropped (mu300-wifi-band puts a new band on auto): "2.4 GHz, channel 11" came up on 6. The channel is set after the band now.
  • Ubuntu's hotspot "off" right after a change: systemctl is-active says activating for about 20 s (its ExecStartPost checks); activating counts as on.
  • lan-start kept the old LAN address on br-lan (ip addr replace adds): both until the next boot. The old one is removed now. Clients keep their lease until they reconnect: the page's note says so now.
  • OpenWrt re-enumerates the USB gadget on every LAN ifup (hotplug.d/iface/10-mu300-usb, for macOS's DHCP), so a LAN change ends the page's connection there: the page asks with its own text for OpenWrt and expects to lose the device (leaves), as for adb's mode.
  • A tool's refusal was its last line only; it is the last message with its indented lines now.

Seen and left: the job box shows curl's progress meter as lines (mu300-extra, mu300-update); wificlient.status's text named the old SSID on OpenWrt after a change (wifi-client's own reading). Not run: a Wi-Fi join (6), the SIM switch (9: the U30's second card registers for emergency only, the F50's needs a restart), the USB host role (16), Update now (18: the update itself is #224's test), the restart into Android (22), the real page in Chrome (the chooser and the folder picker are browser UI), plain OpenWrt and a V50.

Data roaming

120. Data roaming: a switch of our own in the dial and its watchdog, the network's word for roaming, and a test hook

What was missing. Mobile data dialled whatever network the card registered on. Data roaming was always on and no front end could turn it off; the panels showed "Registered (roaming)" and nothing else. Android has "allow data roaming" per SIM; this is that.

How "roaming" is known. From the card's registration, which the modem reports on the card's own AT channels (§74: the dial's channel, nr2 for slot 0 and nr5 for the U30 Air's SIM2 or the F50's internal card, answers for its card alone, so no AT+SPACTCARD=<n>; prefix is needed and none is sent; the panel's terminal refuses that form anyway). <stat> of AT+CEREG? (query form +CEREG: <n>,<stat>[,...]), and of AT+C5GREG? only when LTE's says neither home nor roaming (5G SA). 3GPP TS 27.007: 1 registered home, 5 registered roaming, 9 and 10 the same two for "CSFB not preferred" (EPS); 6/7 (SMS only) and 8 (emergency only) are not counted as either. The dashboard's table shows 10 as "Registered" (it is roaming): left as it is, the data decision does not use that table. No AT+CREG?/AT+CGREG?: the modem's data registration on LTE and NR is CEREG/C5GREG, and those are the ones measured answering on this modem (the dial waits on CEREG since the beginning, the panel's collector reads both every 1.5 s).

"Roaming" at home. Stat 5 is the network's word. An MVNO on a host operator's network, or national roaming, reports 5 in its own country. So the setting is the user's answer, never a guess of ours, and every front end says "some SIMs report roaming at home (an MVNO, national roaming)".

A switch of the modem's own: none known. Looked for and not found: the repository has no RIL binaries (android-vendor/ holds the extraction lists; the extracted vendor subsets on the build host carry the GPU and modem-control files, no libril*), no Unisoc AT reference names one, the AT commands seen from this modem (AT+SP* in every log and script here) have none, and a web search for SPDATAROAM/SPROAM/Unisoc RIL data roaming found nothing. On Android the decision is the framework's (its data network controller checks the service state's data roaming flag against the user's setting before it asks the RIL for a data call); the RIL only gets the call, with the APN's roaming protocol. So nothing new is sent to the modem: the switch is the policy of mobile-data's dial and its watchdog.

The default: allowed. Every release so far used data while roaming; an update must not take anybody's data away (think of an MVNO SIM at home). Turning it off is one switch.

Where it is stored. OpenWrt: network.wan.roaming for slot 0 (the external card / SIM1), network.wan. roaming_internal for slot 1 (the F50's internal card, the U30 Air's SIM2): per card, as the APN is (apn, apn_internal), since the second card is often the travel SIM that is meant to roam. Ubuntu: MU300_DATA_ROAMING in /etc/mu300/mobile-data.conf, one for both cards, as Ubuntu has one APN. Values 1/on/yes/true and 0/off/no/false; unset or anything else is allowed (mobile-data roaming says when a stored value is neither). The file is read as KEY=VALUE lines, never executed. The value is read again at every decision: a front end writes it, nothing is restarted, and the dial or the watchdog acts on it within half a minute (the watchdog's interval). The one writer is mobile-data roaming on|off [--slot 0|1]: on Ubuntu the file is rewritten with its other lines kept, root's alone (it may hold the APN password), a new file renamed over the old one; on OpenWrt uci set and uci commit network (no reload: netifd is not restarted by it).

Enforcement.

  • The dial (up), after the registration and before anything of a data context (the IPA delegate, AT+CGDCONT, AT+CGACT): with data roaming off it asks the registration once. Roaming: no context; $ROAM_HELD (/run/mu300/data-roaming-held, its line the slot) is written, one line goes to radio.log, syslog and stderr - only when the hold begins - and the "down on purpose" marker (/run/mu300-mobile-data-down) is set, so the data cap's count of "data is up" stays right. Under netifd it exits 4: mu300cell reports DATA_ROAMING and netifd tries again after 60 s (MU300_ROAM_RETRY), which is how data comes back at home; a held try costs the radio-on check, AT+CAVIMS=1 and two registration reads, and activates nothing. On Ubuntu it returns 0 (the service is not "failed" and systemd does not restart it every 30 s), and the watchdog brings data back. Home, or allowed: the hold ends (one line) and the dial goes on. The registration unreadable with data roaming off: a failed dial ("could not tell"), retried like any other, and no hold.
  • The watchdog, while held: no reconnect and no "mobile data lost". OpenWrt: nothing is dialled (netifd's retries own it); a wan somebody took down (netifd's autostart false: ifdown, the panel's button, the data cap) ends the hold. Ubuntu: one AT+CEREG? a round; home or allowed ends the hold and dials once. mobile-data down (the service stopped by hand, from Cockpit, by the data cap) ends the hold first, so data that somebody turned off is not brought back. While mu300-power holds the modem down (suspend) the round does nothing.
  • The watchdog, a live connection: with data roaming off it asks the registration once a round (one more AT command; with the default nothing more is asked than before). Roaming: the hold begins and the data goes down once
    • OpenWrt ifup wan (netifd's own teardown, then its dial holds), Ubuntu the down path (AT+CGACT=0, routes, NAT). The next rounds see the hold: no loop.
  • The U30 Air's first-data check for SIM2 (§74, sim_data_wait) gives no verdict while data is held for roaming (registered, no data on purpose), so a roaming SIM2 is not sent back to SIM1 with a restart.
  • Not touched: the radio, the registration, AT+CAVIMS=1 (IMS, sent before the gate), SMS, USSD, calls, emergency.

Status. mobile-data roaming: the setting, the network (home, roaming, unknown; asks the modem) and "mobile data held back: roaming, and data roaming is off". mobile-data roaming --json: {"allowed","held","slot","per_sim", "slots":[slot 0, slot 1]}, files only. mobile-data status adds "roaming: yes, data not allowed while roaming".

Front ends. OpenWrt panel: the dashboard's Data roaming row (Allowed / Off / "Off: data held back while roaming"), a Data roaming button in Quick controls (the card in use; mu300dash act roaming on|off, nothing else accepted, which runs mobile-data roaming), and LuCI's wan page (one flag per card next to its APN). Ubuntu: Cockpit's MU300 page (Mobile data card: the row and a button, mobile-data roaming on|off through Cockpit's administrative access, argument by argument). Both: mu300-toolkit -> Network -> Mobile data: data roaming. The web device manager (PR #244) reads and writes the same command.

Test hook (device tests only). A regular file /run/mu300/roaming-test, owned by the user mobile-data runs as (root), not a link, whose line is home-as-roaming, makes stat 1 and 9 count as roaming. /run is RAM, so it is gone at the next boot. No front end writes it and nothing a front end sends reaches the name.

Device checklist (items 1-5 run on 2026-10-15, below; item 6 not yet):

  1. A home SIM, nothing set: sudo mobile-data roaming says "data roaming allowed", "network home"; data as before.
  2. sudo mobile-data roaming off: with the home SIM the data stays up (the watchdog asks CEREG and finds 1); the dashboard says Off.
  3. Force the roaming branch: echo home-as-roaming | sudo tee /run/mu300/roaming-test. Within 30 s: one line "registered on a roaming network and data roaming is off" in /run/mu300/radio.log and the log, data down (OpenWrt: the wan shows DATA_ROAMING and retries each minute; Ubuntu: systemctl is-active mu300-mobile-data still active), the dashboard "Off: data held back while roaming", SMS still send and arrive. No second line in five minutes.
  4. sudo mobile-data roaming on (or remove the hook file): data back within a minute, one line "mobile data comes back". Then off again with the hook and sudo rm /run/mu300/roaming-test: data back at "home" the same way.
  5. While held: ifdown wan / systemctl stop mu300-mobile-data, then remove the hook: data stays down (somebody turned it off). U30 Air: the same on SIM2, with roaming_internal.
  6. Abroad, or with a SIM that really roams: the network row says roaming; off holds, on dials.

On the devices (2026-10-15). The branch's mobile-data, mu300cell.sh, mu300dash, the dashboard's action/dashboard-info, mu300cell.js, mu300-sim2-warmup and mu300-toolkit copied over v2026.10.27 on a U30 Air (OpenWrt 25.12.5, kernel 6.18.56, SIM1 in use with data, the VPN up over it) and the Ubuntu files on an F50 (Ubuntu 24.04, kernel 7.2.10, its card with data); the watchdog restarted on each.

item U30 Air (OpenWrt) F50 (Ubuntu)
1. nothing set "data roaming allowed", "network home"; --json per_sim: true, slots [true,true]; data and the VPN as before the same, per_sim: false; no mobile-data.conf was there
2. off network.wan.roaming='0'; the wan stays up (45 s, the watchdog's rounds asking CEREG); the dashboard's wan.roaming {"allowed":0,"held":0}; the exit IP through the VPN unchanged from the Mac the file MU300_DATA_ROAMING=0, mode 600; data stays up
3. the hook the line in radio.log and syslog 6 s after the hook; the wan DATA_ROAMING, pending, set up again every 60 s by netifd; the dashboard {"allowed":0,"held":1}; mu300-sms send 7000 KALAN sent and the carrier's answer arrived while held; one line in 4.5 min (5 netifd retries) the line 6 s after the hook; no default route, no address; mu300-mobile-data still active, 0 restarts; mobile-data status "roaming: yes, data not allowed..."; no second hold in 7 min
4. on; off + hook, then the hook removed wan up 21 s after on ("allowed, mobile data comes back"); with off down in 15 s; the hook removed: up in 64 s ("on the home network, mobile data comes back"), VPN exit IP back up 28 s after on; down 36 s after off; up 33 s after the hook went ("on the home network")
5. taken down while held ifdown wan, hook removed: 100 s later still down, autostart: false, the hold file gone, no "comes back"; ifup wan brought it back systemctl stop mu300-mobile-data, hook removed: 100 s later no default route, the service inactive, the down marker there

The panel's action through ubus: act roaming off / on wrote network.wan.roaming, act roaming bogus was refused ("Invalid argument for this op"). mobile-data roaming off|on --slot 1 wrote roaming_internal alone and --json showed it per slot. Everything set was unset again afterwards (uci delete, the F50's file removed).

One defect, fixed: on Ubuntu the hold's line was twice in the journal (logger's, and the same line on stderr of the watchdog, whose stderr is the journal). stderr now gets it only when JOURNAL_STREAM is not set (a dial by hand); test_the_hold_is_said_once_in_the_journal.

Not verified. Item 6: no SIM that really roams was at hand, so whether this modem reports 5 for national roaming or an MVNO at home is not known; the roaming branch was reached only through the test hook (stat 1 read as 5). The U30 Air's SIM2: its card in this unit registers for emergency service only (stat 8, §74) and never gets data, so the hold on SIM2 and sim_data_wait's "no verdict while held" were not run (a switch to it goes back to SIM1 by design); only its setting (roaming_internal) was. Cockpit's MU300 page (the panel extra was not installed on the F50) and LuCI's wan page were not opened; the panel's backend was driven through ubus.

A Magisk zip on a computer

111. One zip, two ways in: Magisk on the device, or unpacked on a computer as the computer's installer

Status: current; unit and integration tests only - no device was used (other work had the devices). The owner asked for kano's two-entry package for this project's zips: kano (kanoqwq, branch clean-tf-7.2, MIT) ships one ZIP that Magisk installs and that, unpacked, is a desktop installer (f6b0668d "add desktop deployment", 53ef7b1a, 1f8f03fb, 0e19fe32). His was read, none of it run, no binary of it taken.

What a zip is now. Everything it held stays where it was, byte for byte, with the same zip modes (checked: the 11 zips of v2026.10.27 built with tools/make-magisk-zips.sh of main and of this change differ in the new entries and in mu300/i18n/*.tsv, which gained this change's translations, and in nothing else). Added at the top: START-HERE.md (the zip's system, kernel and release written in; English, Turkish, Chinese), start.sh/start.cmd, start-gui.sh/start-gui.cmd, uninstall-linux.sh/.cmd, and computer/: the project's installers for a computer (android/magisk/computer/files.txt: install.sh, install.ps1, the uninstallers, their tools/, boot/init and build-boot-image.py, the vendor extractors, i18n/, gui/, the switch module) with computer/.mu300-package. 68 files, 0.99 MB unpacked, 0.33 MB more per zip (v2026.10.27: 331 412 to 331 422 bytes). The payload is in a zip once: the computer's installer reads payload/ where it is.

Why Magisk cannot see it. customize.sh sets SKIPUNZIP=1 and unpacks exactly mu300/*, module.prop, action.sh, switch.sh, bootchain.sh and system/*; nothing added is under those names. A test runs customize.sh in a fake Magisk environment on a zip built with the computer's side and on the same zip without it - a dry run and a whole installation on the fake device - and compares the output, boot_a, misc, what boot_b holds and the module: equal (tests/test_magisk_zip.py, MagiskPathUnchanged). The release's real zips, both builds, also pass ReleaseZips (each zip's own installer, a dry run). The web installer's zip.js reads the central directory only for mu300/manifest and mu300/install.sh: a test reads the 11 built zips with it.

How the computer's side installs that zip's system and kernel. tools/package.sh (and the same in install.ps1, and gui/mu300gui/package.py for the window): the package is MU300_PACKAGE, --package DIR / -Package DIR, or the folder above computer/ when .mu300-package is there (the launchers set MU300_PACKAGE to their own folder and put platform-tools/ on the PATH when it is there). Its mu300/manifest is read as the zip's own installer reads it (only its nine keys, never sourced, every value exactly one a release has - they become file names; Ubuntu 26.04 with 5.4 refused). Then: no self-update (the installer that came with the files is the one that knows them), the release is the manifest's tag, and the questions of the system, Ubuntu, kernel, release, beta and web panel are not put. At the download step both payload files must have the checksum the manifest names and the one the release's mu300/SHA256SUMS names (verify events; a mismatch or a missing file stops the run before anything is written). The VPN module stays a download when it is asked for; the web panel is a release file, not a zip's. A V50 with a 5.4 zip is refused at the choices, with the zip to take.

The boot image without the 5.4 bundle. install.sh always unpacked mu300-kernel.tar.gz for the first ramdisk segment's busybox, logdw and 5.4 modules, even with a mainline kernel - and a 6.18 or 7.2 zip has no 5.4 bundle (it would add 27 MB to 8 zips). Under a mainline kernel those three are dead weight: the kernel's generic segment is unpacked after the first and brings its own bin/busybox, bin/logdw, etc/module-order, modules and init (this checkout's init goes behind both, as before). The zip's own Magisk installer never put them in (its device segment plus the bundle's generic one). So build-boot-image.py now takes --busybox, --logdw and --modules as optional only with --append-ramdisk, and then decompresses that segment and refuses when it lacks any of bin/busybox, bin/logdw, etc/module-order, init. A package with a mainline kernel builds the image that way; everything else (every copy of the project, a 5.4 package) builds it exactly as before. Checked with the real 7.2 bundle of v2026.10.27: built, 1 879 018 bytes of ramdisk, no 5.4 module in it.

adb: not bundled. Google's platform-tools come under the Android Software Development Kit License Agreement (https://developer.android.com/studio/terms), section 3.4: "you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK", except "to the extent required by applicable third party licenses"; 3.5 leaves the open-source components to their own licences. adb's source is Apache-2.0, but the prebuilt binaries and the Windows USB DLLs are Google's SDK distribution - not clearly allowed, so not bundled. kano's GUI release does bundle adb.exe and its two DLLs with an ADB-NOTICE.txt (installer/platform-tools.json pins platform-tools r37.0.1). Here START-HERE.md says where to download them and to unpack them into the zip's folder; find_adb / FindAdb and the launchers find platform-tools/adb there.

kano's and this one. His package moves the original Magisk files into payload/ and wraps them with a path-switching customize.sh; his desktop installer (desktop/installer.py, an EXE when built) is a deployment of its own - TF card, a userdata image, a GPT partition, offline shrink in a desktop initramfs, reset and resume, SSH updates - for OpenWrt only, with a filtered copy of the rootfs prepared on the computer. Here the Magisk files stay where they are, and the computer's side is this project's installers, which already handle every system, the SD card, the free region, the boot chain and the GUI, pointed at the zip's payload: nothing of the install logic is duplicated. Not taken: his EXE, his own deployment modes, the bundled adb (above); his reset-and-resume flow is §112's subject.

Tests. tests/test_magisk_zip.py (the computer's side: files, CRLF launchers, exec bits, START-HERE.md, no platform-tools, the list covers every file the installers name; MagiskPathUnchanged), tests/test_package.py (tools/package.sh; computer/install.sh of real built zips against the fake adb, as far as the first pull: no question about the system or kernel, the facts, a V50 and a 5.4 zip, a damaged manifest, --build, start.sh; the window's choices and answers), tests/test_boot_image.py (the image without the 5.4 bundle, and the refusals), tests/web/logic.test.mjs and tests/test_web_installer.py (zip.js), tests/installer.Tests.ps1 and tests/answers.Tests.ps1 (the PowerShell side).

Not measured. An install from an unpacked zip on a device, on any platform; Windows Explorer's unpacking (the launchers are CRLF and need no exec bit there; macOS and Linux keep the bits, and sh start.sh needs none).

Making room on an encrypted Android

112. Making room by a reset, and the installation that resumes afterwards (EXPERIMENTAL; kano's flow, ported)

Status: experimental. Run end to end once, on one F50 (2026-10-15/16, below): prepare, reset, resume, boot. kano has not run its reset part (below). The owner asked for kano's reset-and-resume flow (kanoqwq, branch clean-tf-7.2, MIT; commits f6b0668d 2026-10-14 "add desktop deployment", which brought desktop/installer.py's transaction, validate_resume, resume_payload_id and desktop/boot/part-prepare.sh, and 0e19fe32 2026-10-15, which added the GUI's journal around it). The owner's word (2026-10-15): "if kano did it, we don't need to test it, take it." kano's code was read; none of it was run here and no binary of it was taken.

Why the make-room path changed. It used to shrink userdata from the running Android, then zero the first 32 MiB of it so that Android would "format /data cleanly on the next boot" (§9b, §57). These devices keep /data with file-based and metadata encryption (§9: dm-default-key, the key in /metadata). A raw filesystem zeroed from outside then decrypts to noise under the old key, so Android cannot mount it. It reboots into recovery with --prompt_and_wipe_data, and that prompt waits for a person at a screen. The F50, U30 Air and V50 have no screen. kano's answer is to ask recovery itself for the reset. That is AOSP's bootloader message in the first 2 KiB of misc: boot-recovery at 0 and recovery\n--wipe_data\n at 0x40. Recovery formats userdata at its new size and resets the encryption with it. His part-prepare.sh says "the vendor flashing tool's erase-userdata writes the same block, zeroed in full". That is the one piece of device evidence he gives for the mechanism.

What his flow does, and what this port does.

kano (desktop/installer.py, part-prepare.sh) here (tools/resume.sh, tools/resume.py, install.ps1)
backup on the computer in ~/mu300-backups/<date>-<cid>: both GPT copies, misc, boot and the boot chain of both slots, SHA256SUMS the same, each file checked against sha256sum on the device; the NV and calibration partitions are never read
transaction.json saved before the first write (prepared-request); serial, slot, storage (CID, node, start, size, disk), target, need, token, payload identity the same fields, written atomically by resume.py new; prepared once everything is written
stage one in a desktop initramfs on the Linux slot: checks the request against the device, carves userdata and a mu300root GPT partition, writes the token to its first sector, writes the BCB and Android's slot to misc, reboots from the running Android, as this project's make-room path always did: the new table (the backup copy first, both read back, resize-last-partition.py checks both and every CRC), the token in the first 4 KiB of the region behind userdata (read back), the BCB (read back, and the A/B block behind it unchanged). No GPT partition: this project's Linux region stays unpartitioned (§9)
recovery formats the smaller userdata; Android starts as new; the user sets it up, enables USB debugging and restores root the same; the installer says so, and that Magisk's app and grants were in the erased data
resume-internal-install: the newest transaction under ~/mu300-backups, or --transaction found by itself on the next run (newest waiting for this serial and CID), or --resume / --transaction FILE; --no-resume ignores it
validate_resume: CID, node, start, slot, serial; userdata size equal to the target; root geometry; the marker MU300-PART-PREPARED-V2 <token> unless the record says installed the same, plus the table read back (both copies, every CRC; its first, end and usable end), the region by FreeRegion/region_probe's arithmetic, and the BCB: a reset that has not run yet (misc still asks for it) is said as such, before anything else
resume_payload_id: the checksums of his boot image, rootfs, filesystem tools and kernel family, not of prompts or paths the checksums of the tools that decide what a resumed install writes where: resize-last-partition.py, storage.sh, android-install.sh, android-mount-mu300root.sh, boot/init (and, from an unpacked zip, its two payload files: §111). The installer does not update itself while a transaction waits
state installed after the boot image is written the same, after write_linux_boot
encrypted(): encrypted state or type, or /data on dm, is encrypted; unencrypted with an F2FS/ext4 magic is not; anything else raises the same rule (resume.py encrypted); an unknown state stops the make-room path, nothing changed

What kano has that is not ported: the preserving offline shrink for an unencrypted userdata. This project's make-room path always erases. Also not ported: his desktop initramfs and its tools, the free-GPT-gap install into a new partition, and the userdata image. Where this differs on purpose: the token. kano writes it offline, with nothing mounted. Here it is written while Android still has the old, larger userdata mounted. f2fs may write into its old tail until the restart and overwrite the token. That is unlikely (the token is one 4 KiB block at a 2 MiB boundary, written right before the restart), and if it happens the resume refuses with "token mismatch" and writes nothing. --no-resume then installs into the region as into any space that holds data (overwrite typed). It is the same failure his flow stops on, without its cause.

What survives the reset, and where the transaction lives. The reset formats userdata, and with FBE its keys in /metadata. /sdcard (/data/media) and /data/local/tmp are in it. So nothing the installer could put in Android's storage survives, and the transaction lives on the computer, as with kano. On the device, the reset leaves what lies outside userdata: the new partition table, the token at the start of the region (outside every partition from then on), boot_a/boot_b (Magisk's patched boot included), the boot chain and the A/B block in misc. Recovery clears the BCB once it has run.

What kano says he measured (his notes, docs/DESKTOP-INSTALLER-PORT.zh-CN.md and desktop/README.md of f6b0668d, installer/VERIFICATION.md of 0e19fe32; translated from Chinese where marked):

  • 2026-10-13: "MU300 实机缩容、原厂 recovery 重置/续装、完整部署后的重启和更新仍待验证" (translated: shrinking on a real MU300, the stock-recovery reset and resume, and the reboot and update after a full deployment still need verification).
  • 2026-10-14, on a V50: "新版 EXE 对旧记录进行只读续装预检,通过 8.00 GiB 分区、身份、令牌及载荷校验。没有再次缩容或 写独立分区" (translated: the new EXE ran a read-only resume pre-check against the old record and passed the 8.00 GiB partition, identity, token and payload checks; no second shrink, no write to the independent partition). The same notes say a first stage existed on that V50 ("现有 8 GiB 分区可继续续装", translated: the existing 8 GiB partition can still be resumed into). They do not say how the reset went there.
  • desktop/README.md: "Hardware installation, especially stock-recovery reset/resume, still needs real MU300 validation before a release."
  • 2026-10-15: "No connected-device installation, formatting, GPT mutation, userdata reset/shrink, boot-chain synchronization, misc write, live SSH upgrade or Magisk flash was performed."

Tests. tests/test_resume.py:

  • the transaction: kano's wrong-device/geometry/marker cases, plus this project's own checks; the identity; find; the BCB and the marker; kano's encryption rule.
  • install.sh as a whole against tests/fakeadb.py in its new emmc mode, real storage in a directory (tests/fakeemmc.py). The prepare is checked on what it wrote: only userdata's end moved, then the token, the BCB with the A/B block unchanged, the order of the writes, the backup, and that no NV partition was read.
  • the run before the reset (refused: "reset not run yet"), the reset (the kernel's view, recovery's format), the resumed run (no storage or overwrite question, the region as prepared), --check, --no-resume, --resume without a record, and a slot, token, geometry or identity that changed (each refused, nothing written).
  • tests/installer.Tests.ps1: install.ps1's OfferRepartition with the same writes on its own fake.
  • tests/test_gui.py: the window's texts.

Before this is used on a device.

  1. The vendor's recovery honours --wipe_data from the BCB without a prompt (kano's evidence is the vendor tool's block, not a run).
  2. The bootloader starts recovery from the BCB on a plain reboot.
  3. Android starts after the reset with userdata at its new size.
  4. Magisk's root can be brought back on a screenless unit (the Magisk app over adb, the Shell grant through scrcpy).
  5. The token is still there after the restart.

Until then the path stays EXPERIMENTAL, and an SD card remains the way that erases nothing.

A first device run, 2026-10-15 (an F50 the owner gave up for it): not done, the unit has room. Read only, from the SD card's Linux on it: the eMMC is 122159104 sectors (58.2 GiB), userdata (mmcblk0p75, the last partition) runs from 12275712 for 41943040 sectors (20 GiB, ends at 54218751), and 32.4 GiB behind it belong to no partition, the 64 GB layout of section 9. The region starts at 54222848 and already holds a mu300root ext4. The make-room path only starts below 700 MiB of free region and without an SD card chosen, so it cannot run here without making a 32 GB layout by hand, which was not done. None of the five checks above was done; they still need a 32 GB unit (or one whose layout is changed on purpose). What the unit did show, for the checks:

  • No recovery partition; boot_a is a version 4 boot image with a ramdisk (Magisk's patch is there), init_boot_a is empty. So recovery is the vendor_boot ramdisk's, reached through the patched boot ramdisk (check 1 and 2 run through Magisk's init on this unit).
  • misc begins with a leftover bootloader message, bootonce-bootloader, and the unit boots normally with it on every start: this bootloader does not act on at least that command (check 2 stays open; boot-recovery may still be read). resume.py's prepare replaces the first 2 KiB whole, and its "reset not run yet" test looks for its own message only, so the leftover changes nothing for it.
  • Over USB, in Linux, the unit is MU300LINUX-324950664950-2128e853 on the computer's adb list; a second F50 cloned from the same unit shows MU300LINUX-324950664950-203d8329, and in Android both would be 324950664950. A resume on one computer with both in Android cannot tell them apart by serial; the eMMC CID in the transaction does.

The same F50, the same day: the layout made by hand, the prepare, and the reset (checks 1 and 2). The owner decided to make the 32 GB situation on this unit: a full image of the eMMC first (kept on his computer only, the sha256 taken on the device and matched against the file's; 58.25 GiB read in 698 s over SSH, 16.2 GB as zstd -1), then userdata grown to the end of the usable area with tools/resize-last-partition.py --fill, as a vendor flash leaves it (§57, issue #32): 12275712..122155007 (52.39 GiB), written from the SD card's Linux, the backup copy first, both read back. Android started on it without a word: /data stayed a 20 GiB f2fs on a 52.39 GiB partition (its fstab has no resize), ro.crypto.state=encrypted, ro.crypto.type=file, FBE v2 with metadata encryption (fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized, keydirectory=/metadata/vold/metadata_encryption, formattable), /data on dm-39; Magisk 30.7; bootloader locked, verified boot green; build F50_FLYMODEM_ZYV1.0.0B09.

Then install.sh in answers mode (MU300_STORAGE=internal, the card's word internal, MU300_ANS_MAKE_ROOM=yes, MU300_ANS_LINUX_GIB=0.79, ERASE, MU300_ANS_REBOOT=no): 27 seconds from start to done with repartitioned=yes, resume=pending. The makeroom.crypto facts said yes encrypted file; the plan said that Android's own recovery resets Android (a factory reset). The backup in ~/mu300-backups/<date>-<cid tail> (the table, the misc header and both slots' boot, uboot, sml, teecfg, trustos, vbmeta, each checked), the transaction saved before the first write, userdata 12275712..120500223 (51.61 GiB), the region 120504320..122150912 (804 MiB), the token at its start and the bootloader message in misc, all read back by hand afterwards as well: boot-recovery at 0, recovery\n--wipe_data\n --reason=mu300-make-room\n at 0x40, the A/B block at 2048 as it was.

The reset, seen from the computer (USB location of the unit, once a second, after adb reboot):

after on USB
0 s F50 19d2:1353 (Android, adb)
15 s nothing
28 s Unisoc Phone 1782:4021, 13 s
41 s nothing
58 s F50 1782:4024
81 s F50 19d2:1353, ECM and MTP, no adb interface; the stock web page at 192.168.0.1 answers

Nobody touched the unit. So check 2 holds (the bootloader went to recovery from the message in misc on a plain reboot: the 13 seconds as Unisoc Phone are recovery's; the leftover bootonce-bootloader above was not honoured, boot-recovery is), and check 1 holds as far as a screenless unit shows it: recovery did not wait for a person, it restarted into Android by itself within a minute and a half, and Android came up without USB debugging, which is what a cleared /data (its persistent properties) looks like. Checks 3 to 5 (the new size of /data, root back, the token) need USB debugging and Magisk back, by hand; the resumed run then reads them.

What the run showed in the installer (fixed with tests in the same change as this text):

  • "userdata now" printed userdata's sectors as bytes ("0.1 GiB" for 52.4 GiB).
  • "Android's data" printed ./install.sh: command substitution: line 490: syntax error and the raw text: a case inside $(...), which macOS's /bin/bash 3.2 cuts at the first ).
  • The region came out smaller than the answer: userdata ended lin sectors before the usable end, and the region the installers find behind it starts one 2 MiB block after userdata and stops one block short of the disk's end. 0.79 GiB gave 804 MiB here (enough for OpenWrt's 800), but the smallest answer the question took, 0.78125, would have left 796 MiB, and the resumed run would have refused OpenWrt after Android was already reset; 1.6 for Ubuntu the same. Now userdata ends where that region is exactly the answer, and an answer whose region is below 800 MiB is refused before anything is written (install.sh, install.ps1).
  • --check with a usable SD card in the slot ends at "the installer will offer the SD card" and never shows the make-room figures; a real run with MU300_STORAGE=internal goes on to them. Not changed.

Two things of the unit on the way, not of this path: the SD card left its slot for a moment while Linux ran from it (the kernel log: mmc1: card aaaa removed, EXT4-fs (mmcblk1p1): shut down requested), after which nothing could be started (every exec I/O error, even the SSH password check). A reboot through adb's sync service (b to /proc/sysrq-trigger) brought it back, but on that boot the eMMC did not come up (mmc_select_hs400es failed, error -84, Failed to initialize a non-removable card); a normal reboot after it did. And while Linux runs from the card, boot_b and the two runtimenv partitions are written now and then (the boot log, the modem's NV server), so an image taken from a running Linux is consistent everywhere but there.

The same F50, 2026-10-16: checks 3 to 5, the resumed run and the first boot (the installer of 70a21b24, the commit that prepared it). The owner turned USB debugging on again and gave the shell Magisk's root by hand (check 4: it can be done; how, on a screenless unit, is his). Then, read from Android as root:

  • Check 3 holds. mmcblk0p75 starts at 12275712 and is 108224512 sectors (ends at 120500223, the prepared end), /data is a new f2fs on dm-39 of 51.6 GiB (13527552 blocks of 4 KiB; it was a 20 GiB f2fs on the grown partition the day before), ro.crypto.state=encrypted, ro.crypto.type=file, sys.boot_completed=1, the eMMC CID the transaction's.
  • Check 5 holds. The 4 KiB at sector 120504320 are MU300-PREPARED-V1 <the transaction's token> and zeros.
  • misc: recovery cleared the first 2 KiB in full (zeros; the leftover bootonce-bootloader went with them), and the A/B block at 2048 is byte for byte the one of the prepare's backup (sha256 of 2048..4095 the same).

install.sh --check (ANDROID_SERIAL, the SD card still in): "A prepared installation is waiting", resume.check RESUME-OK, region 61698211840 (sector 120504320), 843055104 bytes, verdict.code resume, nothing written.

The resumed run (answers: OpenWrt plain, kernel 6.18, Android by default, the confirmation @stdin to read the summary first). It found the transaction by serial and CID by itself, asked no storage or overwrite question, said "this device has 0.8 GiB: only OpenWrt fits" and took release v2026.10.27. The first try stopped at "Building the boot image": TypeError: object of type 'PosixPath' has no len() in boot/build-boot-image.py. That is not of this path: the boot image's manifest (edb57d80, 2026-10-15) counts len(order), and the U30 Air's --device-modules loop reuses order for its order file's path, so every install from a computer since that commit stopped there (install.sh and install.ps1 pass --device-modules whenever the 5.4 bundle has modules-u30air, and the release's always does). Nothing had been written; the transaction stayed prepared. Fixed with a test (tests/test_boot_image.py), the fix put on the 70a21b24 checkout (the file is not one the transaction is bound to), and the run again: the summary said writes: Linux region at offset 61698211840, boot_b, 32 bytes of misc (boot_a, GPT and userdata are not touched); then mke2fs of an 804 MiB mu300root, OpenWrt with the hotspot's name imported, MU300-INSTALL-OK, boot_b written and read back (the sha256 the image's), slot b armed for one boot, the Magisk switch, done result ok, the transaction installed. The events in order: hello (prebuilt), preflight, storage, resume.transaction, resume.check RESUME-OK, storage internal, verdict.code resume, release, choices and the questions, pull, the downloads and verify ok x3, vendor, bootimage, confirm (waiting, then INSTALL), copy, device, boot, switch, done. The ext4 superblock now covers the token (it is gone, as it should be after the install).

The first boot. The installer's reboot, with the card still in: boot_b's new image (6.18.56) started and took the SD card's OpenWrt as root (stage=sd-root dev=/dev/mmcblk1p1), as it prefers the card; misc went back to Android's slot. The owner then took the card out, and from Android su -c mu300-linux: 22 s later the unit was MU300LINUX-324950664950-2128e853 on USB, 192.168.77.1 answered, /etc/mu300/image-version v2026.10.27, OpenWrt 25.12.5, kernel 6.18.56, /run/mu300-root-dev mmcblk0@61698211840, / on loop0 (775 MiB, 18 % used), no mmcblk1, SSH as root with the password of the answers. mu300-next-boot android and reboot: Android back, adb 324950664950, root.

What the copies of the transaction showed (--transaction on copies, the real file and the copies unchanged afterwards, sha256 before and after):

  • the CID changed: refused, "the device or its slot differs from the saved transaction (cid)";
  • the slot changed, a real run: refused, the error event, stopped after storage: nothing written;
  • target 2048 sectors smaller, a real run: "the prepared partition geometry differs (userdata is 108224512 sectors, the transaction made it 108222464)";
  • the state put back to prepared, a real run: "preparation token mismatch; refusing to overwrite the region" (the ext4 has the token's place): a resume cannot run twice;
  • a prepared copy in MU300_BACKUP_DIR: --check finds it and refuses it (token), --check --no-resume ignores it and says "a MU300 Linux installation is already present";
  • an installed copy, unchanged: RESUME-OK (kano's rule: an installed record is not asked for its token), and the same copy with the installer of current main: "this installer's tools or the package differ from the ones that prepared the installation", because tools/android-install.sh changed since (the release-tag block). That is the design: a transaction is resumed with the installer that prepared it, and the installer does not update itself while one waits; one prepared before an update of these tools has to be finished with the old checkout.

One more defect, of every installer, found on the way. During one --check --no-resume another session restarted adb's server; every read of the region came back empty, and the installer said "existing mu300root filesystem: no", "data check: of 16 samples", [: : integer expression expected, and "OK: free and empty" for a region that held the Linux just installed. A real run would have skipped the update-or-wipe question and the overwrite one. region_find_existing and region_dirty (and install.ps1's copy) now take no answer for no answer and stop ("no answer from the device"), with a test. tools/storage.sh is one of the files a transaction is bound to, so this fix, too, refuses a transaction prepared before it.

Not changed, noted: --check reports a refused transaction and goes on to the ordinary verdict (exit 0); only a real run stops on it. The systems question offers "3" as its default where only OpenWrt fits.

90. The data watchdog took a modem that did not answer for a lost bearer, and redialled a working connection

mobile-data watch asks AT+CGACT? every 30 s and reconnects after two rounds without our context active. Before this change the test was at "AT+CGACT?" | grep -q "+CGACT:1,1", so a round in which the modem gave no final result code within 4 s, the client lock was busy, or the answer was ERROR counted exactly like a context the network had taken down: two such rounds and the watchdog ran up (Ubuntu) or ifup wan (OpenWrt), which tears down the bearer that was still carrying traffic. Nothing measured shows it happening on our boards; the case is read from the code. It is the situation kanoqwq describes for a device on the move in clean-tf-7.2 3cbf37fc ("fix: improve cellular mobility"): AT owners can be busy while the modem moves between cells, and a timeout is not a detach.

Taken from 3cbf37fc: the distinction itself - only an answer is evidence. Changed:

  • His watchdog never escalates a silent modem and also treats "OK with no line for the context" as unknown. Ours keeps both of the old repairs: "OK" with <cid>,0 or with no line for the context at all (what a firmware reset leaves, the reason the watchdog exists) is inactive and reconnects in two rounds as before; and a modem that stays silent for MU300_WATCH_UNKNOWN_ROUNDS rounds (4: about two minutes when every command fails at once, about 4.5 minutes when the daemon hangs, measured below) goes the old way (radio check, then a reconnect a round later), so a channel that only a radio-on would wake up is still woken. An answer in between starts the count over.
  • Not taken: his switch of the radio only on an explicit +CFUN: 0 (radio_on reads AT+CFUN? itself and does nothing to a radio that is on, so the old check costs a handshake, not a connection), and his ubus ... renew for an active context whose address changed: here only the relay monitor (mu300cell-v6.sh, relay mode) acts on a renew; in every other mode nothing would, so a changed address keeps the measured reconnect.

watch_context returns active, inactive or unknown; +CGACT: 1,1 with a space and a CR are read too, and +CGACT:11,1 or 1,10 are not taken for context 1. Unit tests: tests/test_device_scripts.py (MobileData.test_watch_context_states, ..._leaves_the_bearer_alone_while_the_modem_does_not_answer, ..._still_reconnects_a_modem_that_stays_silent, ..._an_answer_between_silent_rounds_starts_the_count_over, ..._an_answered_lost_context_still_reconnects_in_two_rounds).

Measured on the U30 Air (openwrt-luci v2026.10.27, kernel 6.18.56, SIM1, relay mode, the owner's VPN with its kill switch on; 2026-10-15), with this branch's mobile-data in place of the release's:

  • No log on OpenWrt at all. procd kept none of the watchdog's stderr (mu300-post's cellwatch instance had no procd_set_param stderr 1, which every other long-running instance of ours has), so "mobile data lost ... reconnecting" never reached logread - not with this change, not before it. The device run below used a watchdog started by hand with its stderr in a file; the instance now sets stderr 1 (MobileData.test_the_openwrt_watchdog_logs).
  • A silent channel. The nr2 daemon (MU300_AT_DIR=/run/mu300-at2) stopped with SIGSTOP for 80, 85, 165 and 200 s: no reconnect, the bearer's address unchanged, nothing in the log. One unanswered command takes about 35 s, not the 4 s asked for: mu300-at -t 4 waits for a daemon that does not take the command off its fifo (measured: "no answer from the daemon" after 35 s, an answered AT+CGACT? in under 1 s). So a round of a silent channel is about 65 s, and the four rounds before the old repair take about 4.5 minutes, not two. Stopped for 290 s: no answer about the data context for 4 rounds, then the radio check (radio was off, switching it on: the silent channel did not answer AT+CFUN? either), and the next round, answered again, started the count over - no redial.
  • A lost context (AT+CGACT=0,1 on the panel's channel nr6): mobile data lost (modem reset or detached), reconnecting 58 s later, ifup wan, the same address back, data through the tunnel again.
  • Airplane (AT+CFUN=0 on nr6): radio was off, switching it on, then reconnects - but on this U30 Air (dual SIM managed, FINDINGS 74) +CFUN: 1 came back with the SIM's power off (AT+CPIN? +CME ERROR: 10, +CEREG: 2,8, emergency only), and every attach failed ("not registered on the network") until AT+SPACTCARD=0;+SFUN=2 and AT+SFUN=4 by hand. radio_on returns early when /run/mu300/sim-managed exists, so the watchdog's repair cannot power a card back on there. Unchanged code (radio_on is the release's); left for the dual-SIM work.
  • Not this change, seen on the way: on Ubuntu (F50), stopping the watchdog logs wlock: unbound variable (the EXIT/TERM trap names a local of watch()); on OpenWrt a TERM is caught by that trap and the watchdog runs on without its lock. Both are the release's.

Device checklist (either board, either system):

# 1. normal: data up, then watch the log for five minutes - no "reconnecting"
logread -f | grep mobile-data     # OpenWrt (with stderr 1);  journalctl -fu mu300-mobile-data-watch  on Ubuntu
# 2. a silent channel: kill -STOP the nr2 daemon (MU300_AT_DIR=/run/mu300-at2 in its environment), kill -CONT it
#    after under 4 min - no reconnect, the address unchanged; after 5 min the radio check, as above
# 3. a lost context: AT+CGACT=0,1 on the panel's AT terminal - "mobile data lost ... reconnecting" within ~60 s,
#    data back as before
# 4. airplane: AT+CFUN=0 - "radio was off, switching it on" and data back, as before

91. The relay monitor read SIM1's bearer in a dual-SIM boot on SIM2, believed any +CGCONTRDP, and dropped the hint after a burst

mu300cell-v6.sh is relay mode's event monitor (openwrt-luci, option ipv6 'relay'): it reports the RA's IPv6 to netifd and, on a +CGEV, reads AT+CGCONTRDP=1 once and moves the bearer's IPv4 address and DNS in place, without a redial. kanoqwq reworked his copy for mobility in clean-tf-7.2 3cbf37fc; comparing it with ours showed one defect his commit does not name and three he does. All four are read from the code; none was seen on a device.

  • The wrong card (ours alone). The monitor read the bearer on /run/mu300-at6, at7, at and the URCs from /run/mu300-at/urc/stty_nr<slot*3>.log, whatever the card. In a dual-SIM boot on SIM2 (/run/mu300-radio-freeze, FINDINGS 74) /run/mu300-at is SIM1's nr1 and SIM2's owner is /run/mu300-at4, whose URC log is /run/mu300-at4/urc/stty_nr3.log. So the monitor asked SIM1 (radio off: no bearer, "keeping the last state") and waited for a log that never appears: on SIM2, an address change was never followed, and the watchdog's reconnect was the only repair. It now picks the channels and the log the way mobile-data and the panel's collector do: SIM1 nr6/nr7/nr1 and stty_nr0.log; SIM2 pinned at boot /run/mu300-at (its nr4 then) and stty_nr3.log there; SIM2 in a dual-SIM boot /run/mu300-at4. A slot mu300-sim cannot name ends the monitor. No AT+SPACTCARD= prefix is added: each of these channels already belongs to the card it is used for.
  • What is believed (from 3cbf37fc). The address must be four 0-255 parts without leading zeros and not 0.0.0.0, the mask contiguous (the old mask2prefix turned anything unknown into /32), CR and blanks are removed, and a DNS of 0.0.0.0 (no second server) or one that is not an address is left out. Nothing else of the answer reaches ip or netifd.
  • A failed install keeps the old snapshot (from 3cbf37fc). The new address and the route go in first; when one fails, the previous address/DNS stay the monitor's state, nothing is reported, and the next hint or renew tries again (before, the new values were taken as current and the next read said "unchanged"). The old address goes only after the new one holds, and then the new one is put in once more (the old primary takes a secondary of its subnet with it: no promote_secondaries, as in mu300cell.sh's setup). An unchanged bearer whose address the kernel lost is put back.
  • Hints (from 3cbf37fc). +CGEV ACT/DEACT (the short NW ACT forms) and DETACH and Unisoc's +SPPCODATA now ask for a read besides PDN and MODIFY. A hint in the 2 s after a read used to be dropped - possibly the last of a burst, the one after which the new address is readable; it now waits out the rest of the 2 s. One queued read covers a burst: the producer sends a hint only when it creates /run/mu300cell-<config>.events.pdp (a directory: mkdir is atomic and never follows a symlink), the reader removes it just before its AT read.

Not taken from 3cbf37fc: the monitor for an IPv4-only context (relay mode is dual-stack only here; an IPv4-only bearer keeps the watchdog's measured reconnect), the exit to netifd after three readings of an inactive context (the watchdog owns that repair: FINDINGS 90), proto_set_keep 0, and his watchdog's ubus ... renew.

Unit tests: tests/test_mu300cell.py class RelayMonitorBearer (the monitor sourced with MU300CELL_V6_LIB=1): the channels and log per slot and dual-SIM state, mask2prefix, valid_ipv4, read_bearer, add-before-delete, failure and retry, the lost kernel address, the hint patterns. Under dash and bash locally, busybox sh in CI.

Measured on the U30 Air (openwrt-luci v2026.10.27, kernel 6.18.56, SIM1, option ipv6 'relay', 2026-10-15), this branch's monitor in place of the release's and ifup wan to start it:

  • The monitor tails /run/mu300-at/urc/stty_nr0.log. ubus call network.interface.wan renew: manual-renew: bearer unchanged. ip -4 addr flush dev sipa_eth0 scope global and a renew: manual-renew: bearer updated to <the same address>/8, the address and the default route back, no ifdown, no redial.
  • The checklist's AT+CGACT cycle on the panel's terminal does not reach the monitor, on this branch or the release's: the +CGEV: ME PDN DEACT/ACT of a command sent on nr6 are answered on nr6 only (they came back with the command's own reply) and never reach nr0's URC log, which only has what the modem announces there. So the hint path was driven by appending lines to that log: six hints at once (NW PDN DEACT, NW DETACH, NW PDN ACT, +SPPCODATA, NW MODIFY, ME PDN ACT 1,0) gave one read (cgev: bearer unchanged); a hint and another 2 s later gave two reads, 2 and 5 s after the first (the release's monitor drops the second); lines that are not hints, none.
  • SIM2 not run as a boot: this unit's second card registers for emergency service only (§74), so a boot on it has no bearer, mu300cell never connects and the monitor never starts. The choice of channels and log was run under the device's own busybox sh instead (a copy of the monitor, mu300-sim stubbed, the freeze flag a file): slot 0 /run/mu300-at6 /run/mu300-at7 /run/mu300-at + stty_nr0.log with or without the flag; slot 1 without it /run/mu300-at + stty_nr3.log; slot 1 with it /run/mu300-at4 + /run/mu300-at4/urc/stty_nr3.log.
  • Seen on the way, not this change: after the WAN was redialled several times by these tests, the VPN's sing-box logged network: missing default interface and stayed without an exit until /etc/init.d/mu300-vpn restart.

Device checklist (openwrt-luci, relay mode):

# 1. F50 or U30 Air on SIM1: the monitor runs and follows a change
ps w | grep [m]u300cell-v6; logread -f | grep mu300cell-renew
#    a network-side change (or URC lines appended to /run/mu300-at/urc/stty_nr0.log): one "bearer updated"/
#    "unchanged" line per burst, no ifdown. AT+CGACT on the panel's terminal (nr6) is answered on nr6 only.
ubus call network.interface.wan renew        # "manual-renew: bearer unchanged"
# 2. U30 Air, a dual-SIM boot on SIM2: the monitor's tail is on /run/mu300-at4/urc/stty_nr3.log and its reads
#    go to /run/mu300-at4 (ps w | grep 'tail -n 0 -F'); the same AT+CGACT cycle on SIM2
# 3. a lost address: ip -4 addr flush dev sipa_eth0 scope global; ubus call network.interface.wan renew
#    - the address is back without a redial

92. Three Wi-Fi TX log lines written once per frame; the AP multicast "endian fix" not taken

kanoqwq's clean-tf-7.2 3cbf37fc brought two Wi-Fi changes from his T551M work to the SC2355 driver. Both were compared with our upstream/modules/sprd_wlan_combo (the mainline kernels' module) and with what our bridge does.

Taken: per-frame logs bounded. In AP mode the TX path wrote, for every frame, pr_info("... group lut_index=...") when a group-addressed frame found its LUT entry (every broadcast and multicast frame sent), and pr_err("... sta disconn, no data tx!") for each frame still queued for a client that has left; every frame sprd_send_data refused was netdev_err(... drop msg due to TX Err) on top. The first two are now pr_debug_ratelimited (as the module's other per-frame lines already are, pcie.c free_num, tx.c "no credit"), the third is under net_ratelimit(). Nothing else changes: the frame is still refused with -EPERM, still freed with its message (dev_kfree_skb, sprd_chip_free_msg), the same return values. Both pcie.c and sdio.c (only the PCIe path runs on the F50 and the U30 Air). Not measured: how much of the kernel log these lines filled on our boards (no report of it); kanoqwq's concern is the CPU a burst of them costs when a busy client drops off. The 5.4 driver (kernel/patches/wlan_combo-*) is not changed here: his 5.4 patch was written against the realme source, which is not in this repository to check that it applies, and a hunk that fails stops the release build.

Not taken: the AP/GO multicast "endian fix". In sc2355/rx.c the AP's receive path compares eth->h_proto (big endian) with ETH_P_IP/ETH_P_IPV6 (host order), so on this CPU the "not IP" test is always true and every group frame a client sends is copied back to the BSS by the driver and handed to the stack. His fix (htons()) makes IP multicast go to the stack only. That is a behaviour change, not a bug fix, for us: a Linux bridge never sends a frame back out of the port it came from unless that port has hairpin mode, and nothing in this tree sets hairpin on wlan0. Without the driver's copy, mDNS, SSDP, LLMNR, IPv4 broadcasts and IPv6 ND multicast from one Wi-Fi client would no longer reach the other clients of the same radio (a phone casting to a TV on the same hotspot). Where hairpin is on (OpenWrt's netifd turns it on for a wireless port with multicast_to_unicast), the present code gives a duplicate, which is harmless for these protocols. A comment at the branch says so, so it is not "fixed" blindly. Measure before changing it:

cat /sys/class/net/wlan0/brport/hairpin_mode /sys/class/net/wlan0/brport/multicast_to_unicast 2>/dev/null
# two phones on the same band: mDNS between them (e.g. a Chromecast/AirPlay target, or `avahi-browse -a`),
# tcpdump -ni wlan0 udp port 5353 on the device: one copy or two per query

Device checklist for the taken part (either board, 6.18 or 7.2):

dmesg -C; # a busy client (a download) on Wi-Fi, then switch its Wi-Fi off
dmesg | grep -c 'sta disconn'              # 0 (debug only) - before: one line per queued frame
dmesg | grep -c 'group lut_index'          # 0 - before: one line per broadcast/multicast frame
echo 'module sprd_wlan_combo +p' > /sys/kernel/debug/dynamic_debug/control   # the lines are there, bounded
# the hotspot keeps working: a second client, ping and a download

Measured (2026-10-15) on a test kernel with §92, §93, §102 and §103 together (main of that day plus the four branches): the F50 on Ubuntu 24.04 with 7.2.10, the U30 Air on openwrt-luci with 6.18.56, a MacBook on the 5 GHz hotspot (802.11ac, 80 MHz) as the client; against the release kernels of v2026.10.27 on the same devices. The device sent to the Mac (bash /dev/tcp) and the Mac's Wi-Fi was switched off 4 s into it; the log then:

release kernel test kernel
F50, sta disconn, no data tx! 13 (error level, one per frame) 0
F50, drop msg due to TX Err 13 12, with net_ratelimit: 1 callbacks suppressed
U30 Air, the same two 10 and 10 0 and 12 (rate limited)
group lut_index 0 0

group lut_index never appeared in any run on either kernel, so the first of the three lines is not one our boards write in these tests. The hotspot carried on as before: TX to the Mac 300-590 Mbit/s on the F50 and 210-500 on the U30 Air on both kernels (two clusters, about 320 and 570, on both: the Mac, not the kernel), 6 GiB in one stream at 594 Mbit/s on the F50, IPv6 multicast (ping ff02::1) answered by the Mac over Wi-Fi. The hairpin measurement above needs two Wi-Fi clients and was not made.

93. sdhci-sprd started ADMA transfers with relaxed MMIO: the descriptors were not ordered before the command

Mainline drivers/mmc/host/sdhci-sprd.c (both of our mainline kernels; the eMMC and the SD card slot) overrides the SDHCI register accessors to handle its reserved registers - SDHCI_MAX_CURRENT, the read-only SDHCI_BLOCK_COUNT, the interrupt mask, the hardware-reset bit - and then does the access with readl_relaxed, writel_relaxed, writew_relaxed, writeb_relaxed. The SDHCI core relies on its accessors being the ordered ones: it writes the ADMA descriptor table into DMA memory and then starts the transfer with a register write (SDHCI_COMMAND, through writew). A relaxed MMIO write is not ordered after earlier stores to memory (Linux's "device-io" rules; on arm64 writel is __iowmb() and then the store), so the controller can be told to fetch a descriptor whose last store is not yet visible to it - a transfer from or to the wrong place. The vendor's 5.4 driver is not changed here (its source is fetched at build time and has not been read for this).

kanoqwq found this in clean-tf-7.2 0438ab01 while chasing ext4 corruption on other Unisoc boards, and his evidence is from there, not from ours: on an E5 (his other project), a directory block held the complete content of an inode-table block, and file writes logged mmc0: ADMA error: 0x02000002 with no CRC errors; after the change, 896 MiB written and read back with O_DIRECT, 3584 metadata updates and two offline e2fsck -fn were clean, at HS400 with runtime PM on. He says himself that it is not proven to be the only cause. We have no report of corruption on an F50 or a U30 Air (FINDINGS has none), so this is taken as the correct ordering by the kernel's own rules, not as the fix of a symptom of ours.

Taken: the four accessors' final access becomes readl/writel/writew/writeb; every special case stays (the reset bit's read in writeb keeps its relaxed read: it orders nothing against DMA memory, and the write after it is the ordered one). Changed: his edit lives in his emmc.py; here it is upstream/port/sdhci_order.py, called from install.py next to the other sdhci-sprd edits, idempotent, and the port stops (port: ...) when the four lines are not exactly where they were - a kernel that changes them must be looked at again, as with the other anchors. Not taken: his 5.4 patch (kernel/patches/sdhci-sprd-dma-ordering.patch), his eMMC power and reliable-write changes (V50-specific, unproven by his own account), his CI C check.

Cost: one barrier (dmb oshst / dmb oshld) per register access of these two hosts; a transfer takes a handful. Not measured.

Unit tests: tests/test_sdhci_order.py against a copy of mainline's accessor block (the edit, the kept special cases, idempotence, a changed driver stops the port). The real tree is checked by the Mainline kernel build workflow, dispatched on the branch. Not run on a device. Hold the merge for a soak on each board:

# on the new kernel (both boards; 6.18 and 7.2)
dmesg | grep -iE 'mmc[01]|ADMA|EXT4-fs (error|warning)'      # nothing new; HS400 as before:
cat /sys/kernel/debug/mmc0/ios                                # timing spec: mmc HS400 enhanced strobe
# throughput, before and after (same board, same free space): within noise
dd if=/dev/zero of=/var/tmp/t bs=1M count=512 oflag=direct; dd if=/var/tmp/t of=/dev/null bs=1M iflag=direct
# a soak: write/verify a few GiB, reboot ten times, e2fsck -fn on the root from Android or the initramfs
# the SD card slot (FINDINGS 31j-31l): a card is seen, mounted, read and written; hot-plug still detected

Measured (2026-10-15) on a test kernel with §92, §93, §102 and §103 together (main of that day plus the four branches), against the release kernels of v2026.10.27 on the same devices:

  • F50, Ubuntu 24.04, 7.2.10. mmc0 HS400 enhanced strobe at 200 MHz, as before. 3 GiB of random data in twelve files on the root filesystem (a loop over mmcblk0 at the Linux region's offset, so every write goes to the eMMC), checksums, read back uncached: all right after writing and after each of five boots of the test kernel and one of the release kernel. dumpe2fs: clean. Then from Android, e2fsck -fn of the region through a read-only loop: no error (12318 files). No ADMA error, no EXT4-fs error, no I/O error in any boot.
  • U30 Air, openwrt-luci, 6.18.56. HS400 enhanced strobe. The same 3 GiB soak on the Linux disk, checked after writing, after each of three boots of the test kernel and after the release kernel's boot: all right; errors_count 0.
  • Throughput (256 MiB dd with oflag=direct/iflag=direct on the F50, three runs each; 1 GiB on the U30 Air in whole seconds): F50 file writes 179-195 MB/s on the test kernel and 189-217 on the release (the same spread on both when repeated), file reads 272-302 and 269-317, the raw mmcblk0 read 264-267 and 203-264; U30 Air 1 GiB raw read 3-4 s, write with fsync 4 s, read back 3-4 s on both. No difference beyond the spread of runs.
  • The empty SD slot (mmc1, F50): in one of the seven boots of the test kernel the probe's one rescan logged Got command interrupt 0x00000001 even though no command operation was in progress with a register dump (Cmd 0x371a, CMD55; §31j has the cause); none in the four boots of the release kernel this session. Too few boots to tell a difference, and it is the slot without a card, not a transfer.
  • Not tested: a card in the slot and hot-plug (none here; the U30 Air has no slot).

100. mu300-next-boot: the default boot written before misc was, and a re-arm that could undo a switch

From kanoqwq's clean-tf-7.2 1f8f03fb ("misc-only trial boot, protect switch flow"): his desktop installer's "Boot OpenWrt once" changes the 32-byte bootloader_control block in misc and nothing else, and says so. Our Magisk switch (mu300-linux, switch.sh) already works that way: it never mounts the Linux disk and never touches its default-boot. The Linux side did not, which an earlier review of ours had flagged:

  • The file before misc. mu300-next-boot android|linux|lock wrote /etc/mu300/default-boot first and misc second. The initramfs reads that file (§ default boot, boot/init): linux makes it skip restoring Android's slot. A misc write that failed (or read back wrong) left the file saying what misc did not.
  • No lock. mu300-boot-ok.service runs --rearm at every boot: it reads the file, then writes the Linux slot's block. A mu300-next-boot android (the panel's Switch to Android, a shell) between the read and the write was overwritten by the re-arm: the next boot went to Linux again, with the file saying android (the initramfs then restores Android's slot, so the boot after that one was Android: one boot late, never stranded).

Changed (ours; nothing of his code, his change was to his desktop installer only):

  • The file is written only after misc has been written and read back (write_bc; PENDING_CONF names the word that goes with the block). A failed dd now says writing misc failed instead of ending silently under set -e. The degraded arm of §32 (the initramfs' one-shot block, exit 1) still records linux, as before: misc was written.
  • The file is written whole and never through a symlink: a new file next to it (umask 022, set -C), renamed over it.
  • Every command but status holds flock on /run/mu300/next-boot.lock (fd 9) from its first read to its last write, waiting up to 60 s (MU300_NEXT_BOOT_WAIT) and then failing without writing anything. Without flock(1) (or without /run/mu300), or where the lock file is a symlink, nothing is serialised, as before. Ubuntu has util-linux's, OpenWrt busybox's applet.

Bootability. Every failure path leaves misc as LK last saw it or as it was verified, and the file as it was: a failed android leaves Linux armed (the countdown or the next re-arm as before); a failed linux leaves the trial mode, whose fallback is Android. A file that cannot be written after misc was is reported (exit 1): for android misc already points at Android; for linux the initramfs keeps restoring Android's slot (one-shot trial). A lock that is never released (a hung mu300-next-boot) costs one boot's re-arm; the slot still has its remaining tries.

Unit tests (tests/test_device_scripts.py NextBoot): misc unwritable or the Android block missing, the file untouched; the file through a symlink; the degraded arm; a stub flock that stays busy (refused after the wait, misc and the file untouched; status never waits; a symlinked lock file not opened); and the real flock(1) holding off a second writer (Linux only; run in the mu300-unit container).

Measured on both boards (2026-10-15), this branch's mu300-next-boot in place of the release's: the F50 on Ubuntu 24.04 (util-linux flock), the U30 Air on openwrt-luci (busybox flock), both v2026.10.27, and boots of the release and of a test kernel:

  • android, then linux: the file says android/linux after each, misc ...9f001e... (Android's block) and ...9e006f... (slot b, tries 6) read back; no .default-boot.* left; /run/mu300/next-boot.lock there, root's.
  • The lock. flock /run/mu300/next-boot.lock sleep 10 held, then android: went through after 9 s. Held for 100 s with MU300_NEXT_BOOT_WAIT=5: another mu300-next-boot is still running, exit 1 after 4 s, misc and the file as they were (android); status did not wait. The same on both boards.
  • The re-arm at boot (F50: mu300-boot-ok, after its 30 s): with the lock held from 20 s into the boot until 45 s, the service finished at 48 s with slot b armed: 5 failed boot(s) (tries back to 6). On the U30 Air (mu300-post's bootok) the re-arm left boots since the last good one: 0 and tries 6 after each of three boots; the F50 came back to Linux at each of its nine boots under this script.
  • mu300-update kernel (which runs --trial) under this script on both boards, then the boot of that kernel: armed and re-armed as before.
  • F50: mu300-next-boot android and a reboot: Android; the Magisk switch back: Linux (android in the file, the initramfs restored Android's block: the one-shot trial); mu300-next-boot linux made Linux the default again.
  • Small things: the wait is MU300_NEXT_BOOT_WAIT minus one seconds (59 by default, 4 for 5); the renamed file loses the SELinux label the old one carried on the F50 (ls -l showed -rw-r--r--. before, no dot after), which nothing reads on Linux.

Device checklist (before merge; F50 or U30 Air, Ubuntu and OpenWrt, any kernel):

sudo mu300-next-boot status                       # note the misc block
sudo mu300-next-boot android; cat /etc/mu300/default-boot   # android; status shows Android's block
sudo mu300-next-boot linux;   cat /etc/mu300/default-boot   # linux; slot armed (tries N+1)
ls -l /etc/mu300/default-boot /run/mu300/next-boot.lock     # a regular file, root's; the lock file exists
# the race: hold the lock and switch; the switch waits, then goes through
sudo flock /run/mu300/next-boot.lock sleep 10 & sleep 1; time sudo mu300-next-boot android   # ~9 s
sudo mu300-next-boot linux; sudo reboot           # comes back to Linux; systemctl status mu300-boot-ok: success
# OpenWrt: the panel's Switch to Android, then reboot: Android; mu300-linux from Android: Linux again

101. The Magisk switch built its misc block under a fixed name in the adb shell user's directory

Found while comparing our switch with kanoqwq's clean-tf-7.2 1f8f03fb (his one-time boot changes misc only; ours does too, §100), and narrowed by a security review of the first version of this fix. mu300-linux (android/magisk/mu300-linux-switch/switch.sh, run as root) wrote the 32-byte block to ${TMPDIR:-/data/local/tmp}/mu300-bc.bin, checked its size, then dd'd it into misc. /data/local/tmp belongs to the adb shell user (2000, mode 0771, no sticky bit): that user, without root, could plant mu300-bc.bin as a symlink (root's printf > follows it and overwrites the target) or replace the file between the size check and dd (and so choose the bytes that go into misc; the read-back then fails, with misc already changed). A private mktemp -d directory there (the first version) is not enough: without the sticky bit the shell user can rename it away and put a directory of their own in its place between mktemp and the write. Apps cannot write there; the user at the adb shell can, and on a device where Magisk grants root only to chosen apps that is less than root.

Changed:

  • No file on the way. The 64 hex digits are checked (hex only), the bytes printf makes are counted (32), and printf goes straight into dd ... bs=1 count=32 conv=notrunc. Nothing is created in any directory.
  • misc resolved once. by-name/misc is followed once (readlink -f); the result has to be a block device under /dev/block whose sysfs entry (/sys/class/block/<name>/uevent, written by nobody but the kernel) says PARTNAME=misc. That one path is read (the live block), written and read back. A link that leads anywhere else (another partition, a file) is refused before anything is written. (MU300_SYSFS, tests only, stands for /sys and lets a regular file stand for the device.)

Bootability: unchanged when misc is what by-name says: the same block, written and read back as before; every refusal exits before dd, and misc stays as it was (Android boots).

Unit tests: tests/test_magisk_switch.py (real, non-dry runs against files standing in for the partitions): a symlink planted at the old name (it and its target untouched, nothing new in TMPDIR, the block in misc, 4096 bytes still); by-name/misc a link to a partition sysfs calls boot_a, then one with no sysfs entry (refused, the target unchanged), then one sysfs calls misc (written there, through the link resolved once); without the test switch, a regular file is refused (outside /dev/block). test_android_web.BootLinux gives its fake device the sysfs entry. Run in the mu300-unit container (busybox, as root).

Device checklist (before merge; Android with Magisk, Linux installed):

su -c 'readlink -f /dev/block/by-name/misc; grep PARTNAME /sys/class/block/$(basename $(readlink -f /dev/block/by-name/misc))/uevent'
# PARTNAME=misc - if not, this change refuses to switch on that device: report it
su -c 'mu300-linux --dry-run'        # the block; nothing written
# the Action button or su -c mu300-linux: reboots into Linux; ls /data/local/tmp has nothing new
# the web installer's "Boot Linux" (android-web.sh boot-linux) the same

Measured on the F50 (Android with Magisk, the module of v2026.10.27 with this branch's switch.sh, 2026-10-15):

  • by-name/misc -> /dev/block/mmcblk0p3, whose uevent says PARTNAME=misc. The U30 Air was not taken to Android (it cannot be brought back from there without a hand on it); under Linux its mmcblk0p3 is misc too (/sys/class/block/mmcblk0p3/uevent, the same GPT), as on the F50 under Linux.
  • --dry-run under Android's sh (the Magisk path) and under Magisk's busybox with ASH_STANDALONE=1 (the web installer's): the same block (...9e002f..., slot b with one try), nothing written. The web installer's own entry, android-web.sh boot-linux dry with this switch.sh in its stage: the same.
  • With MU300_BY_NAME pointing at a directory of links: misc -> the boot_a partition: refused (/dev/block/ mmcblk0p37 is not the misc partition (sysfs PARTNAME)); misc -> a regular file: refused (misc resolves outside /dev/block); misc -> /dev/block/by-name/misc (a second link): taken.
  • The real switch, su -c mu300-linux: slot b armed for one boot, rebooted into Linux; no mu300-bc.bin in /data/local/tmp. The initramfs then restored Android's block, as for every one-shot trial.

102. Mobile data TX: a full IPA FIFO pushed another Ethernet header at every retry

From kanoqwq's clean-tf-7.2 149c9d2a ("preserve TX retries"), checked against our upstream/modules/sprd_modem/ sipa_v3 (mainline kernels' modem stack; the 5.4 build uses the vendor tree and is not changed). Three defects in sipa_eth_start_xmit(), the transmit function of the sipa_eth interfaces that carry mobile data:

  • Every retry one more header. The device is raw IP: a packet arrives with mac_header == network_header, and the function skb_pushes 14 bytes for the IPA's Ethernet framing. When the IPA's send FIFO is full, sipa_nic_tx() returns -EAGAIN and keeps nothing (sipa_skb_sender_send_data() unmaps and returns without taking the skb), and the function returns NETDEV_TX_BUSY: the qdisc sends the same skb again later. The push does not move mac_header, so the test is true again and every retry pushed another 14 bytes in front of the packet: what finally went out was the packet behind 14·(retries+1) bytes of stale header. For a CHECKSUM_PARTIAL TCP/UDP packet the checksum field (the pseudo-header seed) had also been zeroed for the IPA, and stayed zero for the retry.
  • The IRQ flags in one static variable. spin_lock_irqsave(&queue_lock, queue_lock_flags) with a file-scope queue_lock_flags, shared by the TX path and the flow-control wake-up on every CPU: a second CPU taking the lock overwrites the holder's saved interrupt state, and the holder then restores the other CPU's.
  • A freed skb reported as not sent. When skb_linearize() fails the skb is freed and the function returned the -ENOMEM as its netdev_tx_t, which the stack does not take as "consumed".

Changed (ours, the same three fixes as his): the push is undone and the seed put back before NETDEV_TX_BUSY; the flags are a local of each function; a failed linearize returns NETDEV_TX_OK. The "fail to send" line is rate limited (it fires on every retry under backpressure). Not taken from the same commit here: his Wi-Fi changes (§103), and nothing about sipa overflow ... err=2, which his own notes leave unexplained.

When it bites: whenever sipa_nic_tx() says busy. Read from the code this was a full IPA FIFO only, but on the devices it is above all the IPA's resume: the resource manager answers -EINPROGRESS (sipa_nic_rm_res_ request(), before anything is sent: the skb is not taken either) for the first packet after the IPA went to sleep. Measured on the F50 (7.2.10): after 25 s without traffic, every first packet met it (sipa_eth: fail to send, ret -115, six rounds out of six, on the release kernel and on this one); the U30 Air (6.18.56) logged the same at boot. A packet retried this way was sent behind the stale header on the release kernel.

Measured: built for 7.2.10 and 6.18.56 (sipa_eth.ko, no new warnings; built from a copy against the mu300-mainline volume's trees). tests/test_sipa_eth_xmit.py compiles the function from the source with stand-ins for the kernel calls (ASan/UBSan where the compiler has them): 1, 3 and 50 busy answers in a row, then the packet goes out with exactly one header (54 bytes for 40), unchanged between retries, the seed back, the lock released; a failed linearize says NETDEV_TX_OK with the skb freed. The previous source does not compile in the harness (the static flags), so the test is no negative control of the retry itself. Nothing run on a device.

Device checklist (before merge; F50 or U30 Air, 6.18 or 7.2, mobile data up):

iperf3 -c <server> -t 60 -P 8                    # uplink as hard as the link goes (or a large upload)
dmesg | grep -c 'fail to send'                   # retries happened (rate-limited lines) - the case under test
# TCP throughput is not worse than before; ping -s 1400 and a download keep working; no oops in dmesg;
# ip -s link show sipa_eth0: tx_errors counts the busy answers, no climbing tx_dropped

Measured (2026-10-15) on a test kernel with §92, §93, §102 and §103 together (main of that day plus the four branches): the F50 (Ubuntu 24.04, 7.2.10) and the U30 Air (openwrt-luci, 6.18.56, the owner's VPN over it), against the v2026.10.27 kernels:

  • The first packet after an idle period: six rounds of 25 s without traffic, then one ping -I sipa_eth0 1.1.1.1: every round one busy answer (ret -115, the IPA resuming) and the ping answered, 6/6 on this kernel and 6/6 on the release kernel. So the device did not show the stale header doing harm: either the retried packet survives it somewhere between the IPA and the network, or the busy answer met another packet than the ping. The fix stays what the netdev contract asks (a NETDEV_TX_BUSY skb comes back unchanged); no measurement here proves a user-visible effect of the old behaviour.
  • Uplink under load: eight parallel uploads (12 MiB each) over the F50's mobile data: tx_errors +1 (one busy answer, fail to send logged once), no tx_dropped, no oops; ping -s 1400 and a download worked after it. The SIM was throttled to about 1.9 Mbit/s in both directions by then, so throughput says little: an A/B in the same conditions (the release's sipa_eth.ko loaded into the test kernel, then this one) gave the same speeds and retransmissions. Unloading and loading sipa_eth a second time restarted the F50 (the vendor module is not made to be reloaded; its first reload had already logged probe ... failed with error -17): not a test to repeat.
  • The U30 Air carried its VPN over this kernel for three boots; the F50 had mobile data in all of its seven.

103. Wi-Fi TX on the SC2355 (mainline): a freed skb used on, AP IPv6 multicast refused in bursts, a full EDMA ring counted as failure

From kanoqwq's clean-tf-7.2 149c9d2a. His notes (docs/WIFI-TX-RETRY-20261015.zh-CN.md there) are measurements on an F50 with OpenWrt 25.12.5 and 7.2.8, with kprobes on the command path; our upstream/modules/sprd_wlan_combo and wcn_bsp have the same code at each point. Ported in our own words; his tests, docs and his 5.4 patches not taken (the 5.4 driver is built from kernel/patches/wlan_combo-*, against a vendor tree, as in §92).

  • A freed skb used on (both transports). sc2355_pcie_hif_fill_msdu_dscr() / sc2355_hif_fill_msdu_dscr(), when the headroom was short, replaced the skb with skb_realloc_headroom() and kfree_skb()'d the original - but only their own copy of the pointer changed: sc2355_send_data() and sprd_xmit_data2cmd_wq() then filled the message from, or copied and freed, the freed skb (and on an allocation failure freed it a second time). The descriptor was also written into a header shared with clones (a bridge flooding a frame to several ports clones it). Now skb_cow_head() (also when skb_header_cloned()), sized with the offset the push adds; the skb stays the caller's, a failure returns -ENOMEM and the caller frees as before; ethhdr is read again afterwards (the checksum-offload branch uses it). How often the short-headroom case happens on our boards is not known.
  • The group TID never set on PCIe. sprd_xmit_data2cmd_wq() sends a frame as a firmware command and, for an AP's group frames, sets the BK TID "to avoid FW hang". It read the descriptor at skb->data; on PCIe that is the 5-byte address prefix the fill puts in front, so the "LUT index" it tested was the descriptor's offset byte (11) and the branch never ran (kanoqwq's probe: off=11, lut=4, tid=0). The descriptor is now taken behind the prefix, before SDIO's flag is pushed (as his E5 SDIO driver does); the per-frame pr_info is a rate-limited debug line.
  • AP IPv6 multicast through the command path. tx_mc_pkt() sent every IPv6 multicast frame of the access point (neighbour discovery, router advertisements, mDNS) as CMD_TX_DATA. kanoqwq replayed bursts of eight 12-byte mDNS queries (ff02::fb, one burst a second, six bursts) from the USB side of an F50: in each burst the first six were answered OK and the last two SPRD_CMD_STATUS_ERROR (-6), twelve in all, identical bytes succeeding and failing; the command worker had already given the frame up. On PCIe these frames now take the data queue, as IPv4 multicast always has (firmware credits, EDMA backpressure, the group LUT entry); tx_filter_ip_pkt() after it still sends DHCPv6, DNS and VoWiFi by command, EAPOL never comes here. His check after the change: 112 replayed frames all on the data path, no command error, a phone's IPv6 neighbour entry learnt again over multicast ND and its IPv6 ping answered. SDIO (no board of ours) keeps the vendor's path. This is the TX side. §92 (the AP RX "endian fix", not taken) is about frames from a client being copied back to the BSS; nothing here changes that, and mDNS/ND between clients keeps working the way §92 describes.
  • A full EDMA pending ring. The PCIe TX data channel queues at most three submissions behind the running one (edma_pending_q_buffer, four slots); a fourth was refused with ERROR (-1), counted by the WLAN side like a hard push failure (pushfail_count: more than 100 in a row flushed the frames waiting; failcount: more than 50), and nothing woke the TX thread when room came back. Now the ring returns -EAGAIN (nothing was taken; every other user of mchn_push_link - Bluetooth, the RX refill - only tests for non-zero), the WLAN side keeps the frames without counting, and both TX data channels register a tx_complete callback that wakes the TX thread when the bus finishes a transfer; the wait flag is armed before the submission, since the completion can come before the push returns. His F50 run afterwards: 128 refusals in 30 min, all -EAGAIN, TX kept growing (up to 40.8 Mbit/s in 5 s samples), no tx return err, no flush, no firmware assert.

wcn_bsp and sprd_wlan_combo change together (the new return value): the release builds both from this tree.

Measured here: built for 7.2.10 and 6.18.56 (wcn_bsp, sprd_wlan_combo) against the mu300-mainline volume's trees, compared with the same build of main: no new warning. tests/test_wifi_tx_path.py reads the source for each point. Nothing run on a device (both test devices were in use); his measurements above are on his F50.

Device checklist (before merge; F50 and U30 Air, 6.18 and 7.2, the hotspot on 5 GHz):

# before/after: dmesg -C; a phone on the hotspot
ping6 -c3 ff02::1%br-lan            # (OpenWrt; Ubuntu: the hotspot bridge) every client answers
# from a computer on USB, a burst of mDNS: for i in $(seq 8); do avahi-resolve -n x$i.local & done
dmesg | grep -i 'CMD_TX_DATA' | grep -ci err      # 0 after (before: errors in bursts)
dmesg | grep -c 'push link fail'                         # may be > 0 (rate limited); no 'tx return err'
# a long download and upload on the phone (iperf3 -R and normal), 10 min: no 'tx return err', no flush,
# no firmware assert, throughput not lower than before; IPv4 and IPv6 browsing, AirPlay/Chromecast between
# two phones still found (mDNS between clients, §92); a second client joins and gets DHCPv4 and an IPv6 address

Measured on both boards (2026-10-15) on a test kernel with §92, §93, §102 and §103 together (main of that day plus the four branches): the F50 (Ubuntu 24.04, 7.2.10) and the U30 Air (openwrt-luci, 6.18.56), a MacBook on the 5 GHz hotspot (802.11ac, 80 MHz) as the one Wi-Fi client and on the USB side as the sender of the replay; against the v2026.10.27 kernels on the same devices.

  • kanoqwq's replay: six bursts of eight 12-byte mDNS queries to ff02::fb, one burst a second, sent by the Mac on its USB link to the device, which bridges them to the Wi-Fi client:

    release kernel test kernel
    F50: CMD_TX_DATA ... SPRD_CMD_STATUS_ERROR 8 0
    F50: wlan0 tx_packets during the replay +13 +50
    U30 Air: CMD_TX_DATA ... SPRD_CMD_STATUS_ERROR 12 (two per burst of eight, as he saw) 0
    U30 Air: wlan0 tx_packets during the replay +3 +59

    (On the release kernel the command path does not count in tx_packets; on this one the 48 frames are data.)

  • ping ff02::1 on the bridge: the Mac's Wi-Fi address answered (4 of 5; its USB address the same, the first one lost to neighbour discovery) on both boards.

  • A full EDMA ring: under 300 MiB transfers to the Mac, edma_pending_q_buffer(10) full with push link fail: -11 (rate limited) 140-170 times on the F50 and 80 on the U30 Air; tx return err 0 (the U30 Air's release kernel had logged 8738 of them in its two hours before the test), no flush of queued frames (the only flush lines are a client leaving), no firmware assert, no oops. TX to the Mac 300-590 Mbit/s on the F50 and 210-500 on the U30 Air, the same spread as on the release kernels; 6 GiB in one stream at 594 Mbit/s on the F50.

  • The client leaving during a transfer: no oops, no use-after-free report (the kernel has no KASAN), the hotspot took the Mac back (§92 has the log lines).

  • Not covered: two Wi-Fi clients (mDNS between them, a second client's DHCPv6), an SDIO board, and the skb short-headroom path, which no log line shows; nothing here proves the use-after-free case was reached.

2026-10-23, the log pair (#339, cyjx007): on the v2026.10.19.3 kernel (7.2.11, U30 Air, 1 h 45 m) the pair edma_pending_q_buffer(10) full / push link fail: -11, chn: 10 was 2874 of 7835 lines in the kernel log, with wlan0 at 0 errors and 0 drops. Both lines are the same backpressure: channel 10 (PCIE_TX_ADDR_DATA_PORT, the TX data and the RX address-list refill) has a pending ring of 4 (pcie.c's INIT_INTF_SC2355, three usable), and every caller of -EAGAIN keeps its frames and retries. pr_*_ratelimited is per call site at 10 per 5 s, so two sites gave up to 20 lines in 5 s whatever the level. Now sc2355_pcie_push_link logs only other errors, and the full ring says full, backpressure at info level at most once a minute. His second point, also fixed: edma_push_link_async sets the channel's status before the direct push and only a TX completion's flush clears it; a direct push that failed brought no completion and left the channel refusing every later submission. With nothing queued behind it, status is now cleared at once. Submissions queued meanwhile are not popped there: their callers were told OK, and one whose push failed would be lost with its buffers (the completion's own flush already drops one that way, vendor code). Not done: that case, and a timeout for a completion that never comes. tests/test_wifi_tx_path.py reads both. Device test before merge: an hour on the hotspot under load as above; dmesg | grep -c 'push link fail: -11' 0, grep -c 'full, backpressure' at most one a minute, throughput and wlan0 errors as before.

125. Release names: the day of the release and its number (vYYYY.MM.DD.N)

Status: current (unit tests in sh, Python, JavaScript and PowerShell against one table; the old clients' behaviour read from their code at the tags v2026.10.25, v2026.10.26 and v2026.10.27; nothing run on a device).

What was wrong. The release tags were vYYYY.MM.DD, but the "day" was used as a counter: v2026.10.27 was published on 2026-10-15 (UTC), twelve days ahead of the calendar. The owner's decision (2026-10-15): the tag says the real day of the release, then a number for the releases of that day.

The scheme. A new release is vYYYY.MM.DD.N: YYYY.MM.DD the UTC date it is built, N = 1, 2, 3, ... for the releases of that day. N has no leading zero and is at most 99 (Magisk's versionCode below); the month is 01..12, the day 01..31. tools/make-release.sh --next-tag prints the next one: today's date and one more than the highest N of today's tags among GitHub's releases (gh release list, drafts and prereleases included) and the tags (local and git ls-remote origin); without GitHub's answer it prints nothing and fails rather than guess. make-release.sh TAG takes only the four-field form for a new release and refuses a TAG whose date is not today unless --any-date is given. The Release workflow takes the tag input empty (then --next-tag) or checks a given one (--check-tag) at its start, and passes --any-date to the build hours later, which may end on the next day.

The order (the transition rule). Every four-field tag is newer than every three-field tag, whatever the dates: v2026.10.16.1 > v2026.10.27. Four-field tags compare by the date, then by N, as numbers: v2026.10.16.2 > v2026.10.16.1, v2026.10.16.10 > v2026.10.16.9, v2026.10.17.1 > v2026.10.16.99. Three-field tags keep their old order among themselves. Anything else - test-issue-102, v2026.10.16.0, v2026.10.16.01, v2026.13.01.1, v2026.10.27-fix1, a trailing newline or space, digits of another script - is no release tag: neither newer nor older than anything. As a key: 1YYYYMMDD00 for vYYYY.MM.DD, 2YYYYMMDDNN for vYYYY.MM.DD.N.

One comparer per language, one table. tests/fixtures/release-tags.tsv lists the tags that are release tags, the ones that are not, and 31 pairs with their order; every implementation is tested against it:

language where used by
sh the release-tag block (tag_ok, tag_key, newer) of tools/releases.sh, word for word also in mu300-update and tools/android-install.sh (a test compares the three) install.sh (the slot-a check), make-release.sh, make-magisk-zips.sh (versionCode), mu300-update (notice, check, downgrade_ok, boot_downgrade_ok, --from, releases, a module's requires), android-install.sh (for an update's downgrade check)
Python tools/release_pick.py: tag_key, tag_ok, newer the installers' release and beta decision (install.sh, install.ps1, the graphical installer)
JavaScript site/assets/web-installer/version.js: releaseKey, newerTag, word for word also in the panel's update.js the web installer (loadReleases, releaseSupportsWeb), System > Update
PowerShell install.ps1: TagKey, TagNewer (tested in tests/installer.Tests.ps1) install.ps1's slot-a check

The sh block uses only the shell's own patterns (no grep, no locale) and compares the key in two parts (the era and the date, nine digits; then N without its leading zero): an 11-digit number would overflow a shell with 32-bit integers, and 08 must not be read as octal. .NET's \d takes any script's digits and its $ lets a final newline through, so the PowerShell expressions use [0-9] and \z. The device programs that only check a tag (the panel's rpcd update_act, the update adapter, dashboard-info's note of a newer release) use one extended regular expression, v[0-9]{4}\.[0-9]{2}\.[0-9]{2}|v[0-9]{4}\.(0[1-9]|1[0-2])\.(0[1-9]|[12][0-9]|3[01])\.[1-9][0-9]?, which a test holds to the table too. The installers' beta is now also newer by its tag than the release when both are release tags (published later alone is not enough), as mu300-update releases decided already. Magisk's versionCode of a four-field release is YYYYMMDDNN (2026101602: ten digits, above every three-field release's eight, below 2^31 until the year 2147). What only checks the form v[0-9] and plain characters (the zips' manifest, the mirror, the workflows' startsWith(tag, 'v'), the Telegram announcement) takes the new tags as they are.

What the clients released before this do with a four-field release (read from their code at v2026.10.25-27; the three have the same logic in these places):

  • mu300-update apply: no tag is validated or compared. It reads releases/latest, fetches that release's mu300-update (checked against its SHA256SUMS), and when it differs execs it with MU300_RELEASE=<tag> before it changes anything; the new updater then runs downgrade_ok with the new rule (v2026.10.16.1 is not older than v2026.10.27) and does the update. An update works; no bridge release is needed for it.
  • mu300-update notice (the login note, mu300-toolkit) and check compare with sort as text. Against a three-field installed tag, a four-field one sorts after it only when its date is 2026.10.27 or later (v2026.10.27.1 > v2026.10.27 as text: the shorter one is a prefix). For releases dated 2026-10-15 to 2026-10-26 a device on v2026.10.25, .26 or .27 shows no note, and check says "This is newer than the newest release (a test release); mu300-update apply would go back to vYYYY.MM.DD.N" - wrong in its words, while apply goes forward. From the first release dated 2026-10-27 or later their text order agrees with the rule again (a date's digits sort as text). Making the note right before then would take a three-field release after v2026.10.27 (it would have to be v2026.10.28, carrying the new updater), which the new scheme rules out: the gap is documented instead (wiki Updating, "Release names", and the site's update page).
  • mu300-update's module check (version_ok): the VPN module needs mu300-linux v2026.10.16, compared with the old text order against the three-field tag of the old system - unchanged. After an update the new updater compares.
  • The control panel of those releases has no update page and no note of a newer release (they came after v2026.10.27).
  • install.sh and install.ps1 of those releases take releases/latest (GitHub's "latest", any tag); their slot-a check (v2026.10.10 or newer) compares as text and lets every four-field tag through, which is right.
  • Their Magisk zips check only their own manifest's tag (v[0-9] and plain characters) and look at no release list.
  • The web installer is not in users' hands: the site serves main's. Before this change its releaseSupportsWeb compared the first eleven characters with v2026.10.23, so v2026.10.16.1 counted as "too old for the web installer": this change must be on the site before the first four-field release. Its choice of the newest release went by the time of publishing and was right.
  • The graphical installer and the installers' beta question are newer than v2026.10.27 (tools/release_pick.py is not in those tags); they go by the time of publishing too, now with the tag order on top.

126. An update's password: kept, and checked when the user asks (the Magisk zip and the computer's installers)

What happened. The v2026.10.16.1 smoke test on an F50 (F50-C: Android, internal OpenWrt, kernel 6.18) updated OpenWrt with that release's Magisk zip, and root's password was empty afterwards, while the plan had said the accounts and passwords are kept. Two rules met. The zip carries no password (issue #167: a system it installs gets the images' well-known one, Ubuntu's ubuntu/ubuntu, OpenWrt's root with none). And to decide whether a system "has accounts of its own" it compared the installed hash with the image's and with a SHA-crypt hash of ubuntu (default_hash): a root whose password was ubuntu - what the computer's installer sets when asked for it, and what the project's tests use - counted as "the images' own", so the update put the images' own back, which for OpenWrt is none. An empty root counted the same. The computer's installers had the opposite gap: an update always asked a new password and wrote it over the old one; mu300-update apply on the device keeps passwords.

The owner's rule (2026-10-16). On an update, ask whether to keep the password. Yes: keep it, after the user types the current one and it checks against the installed system's hash (an empty one is confirmed by an empty entry). No: a new one, typed twice. Fresh installs as before.

Checking a password against an installed system (tools/android-pwcheck.sh, run as root on Android over a mount of the Linux filesystem; it prints one word - MATCH, NOMATCH, LOCKED, NOUSER, UNVERIFIABLE - and never the password or the hash; the password comes on standard input, the hash never leaves the device):

  • What the images hold, measured: Ubuntu 24.04's passwd and chpasswd write yescrypt ($y$j9T$...); OpenWrt 25.12's passwd (busybox) and so LuCI write SHA-256-crypt ($5$, seen on F50-C); the installers write SHA-512-crypt ($6$); OpenWrt's image has root empty.
  • Nothing of the Linux system is run. The first version of this check ran the system's own perl (Ubuntu) or openssl (OpenWrt) in a chroot. That is Android's root executing programs, libraries and a loader that the Linux system controls - a Linux system that has been tampered with would get Android's root during the update (review of the pushed branch). So the hash is computed only by the project's own tools, and what is read from the Linux filesystem is data: the shadow line, read with sed, its hash handed to the checker on standard input (a busybox salt only as an argument's value, and only of crypt's alphabet); ROOT, ROOT/etc and ROOT/etc/shadow must not be links (a link is resolved on Android's side). A test runs the check against a system whose perl, openssl, busybox, sh and chroot all answer MATCH and leave a mark: none may run.
  • mu300-pwcheck (tools/pwcheck/mu300-pwcheck.c): a few lines around libxcrypt's crypt_r(), linked statically, built with the other helper binaries in tools/make-release.sh (mu300-kbuild, Ubuntu 20.04's libxcrypt 4.4.10, which has yescrypt; the build checks a real Ubuntu yescrypt hash and stops if it fails) and put into the 5.4 kernel bundle beside busybox. The zips take it from there as mu300/mu300-pwcheck; the computer's installers take it from the package, or from the release's kernel bundle, which they now fetch (and check against SHA256SUMS) before the question instead of after it, and push it. It knows every method of libxcrypt: yescrypt, SHA-crypt with or without rounds=, MD5-crypt, bcrypt. Measured on F50-C's Android (5.4 kernel): a yescrypt hash of Ubuntu 24.04 MATCH and NOMATCH as it should.
  • The bundle's busybox (mkpasswd: des, md5, sha256, sha512 - asked for yescrypt it silently makes an MD5 hash) checks MD5- and SHA-crypt without rounds= when there is no mu300-pwcheck: the releases up to v2026.10.16.1 have none, so their zips (and the computer's installers with such a release) check OpenWrt's passwords but answer UNVERIFIABLE for Ubuntu's yescrypt: the installer then stops, and the way out is to answer no (or, in a zip, to remove MU300_KEEP_PASSWORD, which keeps the password without a check).
  • An empty entry matches only an empty field (passwd -d and LuCI never store a hash of the empty password).
  • A journal not replayed. The installers look at an installed system through a read-only mount without journal replay (ro,noload), so a dry run writes nothing. On F50-C the region's superblock had needs_recovery set (incompat flags 0x46) after OpenWrt sessions: OpenWrt's reboot does not unmount the root filesystem, and what was committed last is then only in the journal, which a noload view does not show - an /etc/shadow from before the last passwd would be checked. So the password check mounts with the journal replayed first (MU300_RO=recover of android-mount-mu300root.sh, a plain ro mount: what Linux itself does at its next boot, and what the update does anyway); the zip does this only when a check was asked for (MU300_KEEP_PASSWORD=yes), the computer's installers for the check, not for the first look at which systems have a password. A stale shadow was not caught in the act; the other noload reads (which systems and releases are there, the VPN probe) are older than this and were left.

The computer's installers (install.sh, install.ps1, the window, and an unpacked zip's computer/, which is the same install.sh): an update first looks at the systems it replaces (pw_states, a read-only mount) and, when one has a login password of its own (set, empty or locked), asks Keep the current password? (yes/no), default yes. Yes asks the current password of each such system once, without echo, sends it to the device in a file of the user's alone (pushed, read by the check on standard input, removed in the same command) and stops after three wrong tries: nothing is changed and the message says to run again and answer no. Stopping was chosen over falling back to "set a new password": the user asked to keep it, a run that turns that into a new password is a surprise, and nothing is written before the question, so stopping costs nothing. LOCKED and UNVERIFIABLE stop the same way. No asks a new password typed twice (the old question). A system the update installs new still gets the new password; the device's android-install.sh leaves the accounts of KEEP_PW_OSES exactly as they were whatever PWHASH says. Answers mode: MU300_ANS_KEEP_PASSWORD, MU300_ANS_CURRENT_PASSWORD (or ..._UBUNTU, ..._OPENWRT, ..._OPENWRT_LUCI), secrets like MU300_ANS_PASSWORD, one try; the verdict is an info event password.<system>.

The Magisk zip. Nothing can be typed while Magisk installs a zip (and the devices have no keys a module could read), so its answers are a mu300-install.conf, and for the password of an update only one inside the zip: at its top (zip mu300-magisk-...zip mu300-install.conf; customize.sh unpacks it and hands it over as MU300_ZIP_CONF, and it wins over every other file), in its mu300/, or MU300_ANSWERS of a caller. Without one an update keeps the accounts and passwords as they are - every password, the images' own and none included, as mu300-update does - and the plan and the end say "kept, not checked". MU300_KEEP_PASSWORD=yes with MU300_CURRENT_PASSWORD keeps it once it checks (no such line: the empty password); anything else stops before anything is written, with the way out in the message. MU300_KEEP_PASSWORD=no with MU300_PASSWORD sets a new one (a file is not typed, so it is given once); no alone or MU300_PASSWORD_RESET=yes puts the images' own back. An update no longer takes MU300_PASSWORD or MU300_PASSWORD_RESET from /data/adb/mu300-install.conf (a line left there would reset the password at every later update); a new system still does. MU300_KEEP_PASSWORD and MU300_CURRENT_PASSWORD from any other file are reported and ignored. The machine plan gains password_checked.

On the device (F50-C, 2026-10-16, a zip of this branch built with tools/make-magisk-zips.sh from the v2026.10.16.1 assets, OpenWrt k6.18, Android locale Chinese; root's password set to ubuntu with passwd first): the zip without a file: "kept, not checked", root still ubuntu (the next run's check confirmed it); with MU300_KEEP_PASSWORD=yes, MU300_CURRENT_PASSWORD=ubuntu: checked, kept, ssh with ubuntu works and a wrong one is refused; with a wrong current password: refused before anything was written (exit 1, the module not installed); with MU300_KEEP_PASSWORD=no, MU300_PASSWORD=...: the new one logs in over ssh, ubuntu no longer does. Then the same zip unpacked on a Mac, its computer/install.sh in answers mode against F50-C: a wrong current password stopped it at the question ("not confirmed. Nothing was changed"); the right one passed the check, the update installed (kept the accounts and passwords of the previous openwrt) and root/ubuntu logged in afterwards, the hash still the $5$ one passwd had written. install.ps1 and the window were run against the fake adb only. (These runs were of the first version, whose check ran OpenWrt's openssl in a chroot: its verdicts are the ones the busybox and mu300-pwcheck give for the same hashes, see the unit tests.) The second version's mu300-pwcheck, built in mu300-kbuild as make-release.sh does, on F50-C's Android through android-pwcheck.sh: Ubuntu 24.04's yescrypt hash MATCH with the right password, NOMATCH with another, UNVERIFIABLE without the checker. Then, once another session that had used F50-C in between was done, the second version's zips (built from the v2026.10.16.1 assets, with that mu300-pwcheck added as mu300/mu300-pwcheck as a release with it in its bundle carries it), over the published v2026.10.16.1 OpenWrt with root's password ubuntu ($5$): no file - "kept, not checked"; MU300_KEEP_PASSWORD=yes with the right one - checked (journal replayed, mu300-pwcheck), kept; with a wrong one - refused before anything was written; after these two ubuntu logged in over ssh and a wrong password was refused. MU300_KEEP_PASSWORD=no with MU300_PASSWORD - the new one logged in, ubuntu no longer. The zip's computer/install.sh (answers mode, keep, the right password): pushed the zip's mu300-pwcheck and busybox, confirmed, updated, and ubuntu logged in afterwards.

131. An update writes only what changed: the unchanged binaries of the new image are the installed ones

Status: current (unit tests; the zip, mu300-update apply and the computer installer on F50-C, plain OpenWrt with Docker in the image, kernel 6.18, in its 804 MiB region, 2026-10-16, with six signed test releases that were never published; Ubuntu measured in containers).

What was wrong. Every way to update - mu300-update apply, the Magisk zip, the computer installers (tools/android-install.sh) - unpacked the whole new image as <os>.new beside the running system, then carried the user's files over (§85) and swapped: room for a second copy of the system. With Docker in the image (§130) plain OpenWrt is 472 MiB of the F50's 775 (the device's own files included), and a zip update stopped at tar: No space left on device; Ubuntu with Docker would need about 1.63 GiB in a region of 1.6. A run that failed or was cut off left <os>.new behind (F50-C: the disk at 98 % until it was removed by hand). And mu300-update apply wanted 1 GB plus 1 GB per system free before it downloaded anything, which an 804 MiB region never has.

The change. A file of the new image that the installed system has byte for byte - the same type, mode, owner, size and content, and no extended attribute but Android's SELinux label - is not written again: it becomes a second name (a hard link) of the installed file. Only what changed takes room (mu300-update, the delta block).

  • The new image's manifest (etc/mu300/image-manifest.gz; for mu300-update before the download the release's mu300-*-rootfs.manifest.gz) says what its files are; mu300-carry same OLD hashes the installed files that could match (same path, mode, owner and size) and says which are equal, and whether each is a binary or text.
  • mu300-carry tarfilter OLD LIST LOG sits between gzip -dc and tar -x: it passes the tar stream on without the listed files and compares each with the installed file byte for byte as the stream passes - a file that changed after it was looked at is written after all (what had passed already is sent again from the installed file, which it equalled). A hard link of the archive to a file left out is left out too. GNU long names, pax headers and plain ustar are read; a member with extended attributes in the archive, or a name with .., is never left out. mu300-carry tarlink OLD NEW < LOG then makes the links, gives the directories back the times tar gave them, and refuses unless the log ends with tarfilter's end of the archive.
  • The new image's own parts do it: its mu300-update, mu300-carry and static busybox are taken out of the tarball first (a pass over it that writes 3 MB into a directory of the Linux filesystem only root can enter); the system's or Android's tar still unpacks. Old updaters hand over to the release's own before anything (apply's self-update, §86), and the zip and the computer installers are the release's own: no older release has to know about this. An image without these parts, a release without manifests, or MU300_DELTA=0: the whole image, as before.

What is linked, and what never is. Two names of one file are one file: what is done to it through one name - written into, truncated, given another mode - happens to the other system's too. Package managers never do that (dpkg and apk unpack beside a file and rename it over; so do depmod, ldconfig, Python's byte-compiler and the VPN module's link hook), but an editor does (nano and busybox vi write into the file; vim does for a file with two names), and so do cp FILE EXISTING, >> and chmod. So:

linked never linked
binaries (a NUL byte in the file) under usr (not usr/local), bin, sbin, lib*, opt/mu300 text anywhere: scripts, units, Python and Perl modules, the project's own scripts - whatever an editor opens
the binaries of the device's own files the installers pack (mu300-vendor-OS.tar.gz: firmware, Android's userspace) etc, var, root, home, srv, www, usr/local, opt/<other>: what the user and the system change
in the carry step, mu300-update apply too: the device's own files of the old system (V lines of the plan, second names in every mode, never a copy: 181 MiB on F50-C) lib/apk, usr/lib/opkg (package databases), usr/lib/locale/locale-archive (localedef adds to it in place)

The update itself never writes into such a file afterwards: the carry block replaces whole files (mu300-carry unlinks what is in the way), accounts and the report are renamed into place, and the one place that copied over a file of a system - modules.builtin and modules.builtin.modinfo into Ubuntu's lib/modules - now removes it first. rollback, clean and the swaps only rename and unlink. What remains: a user who cps over a program of the image or chmods one while the previous version is kept for a rollback changes that version's too; apply says so ("shares N MB of programs and libraries ... replace such a file, never write into it"). The price of never linking text: on Ubuntu 24.04 76 MiB (Python, Perl, scripts) are written at every update, on OpenWrt 2.5 MiB.

Room, before anything is written.

  • The installers (android-install.sh: the zip and install.sh alike) count every system they install before the first write: the files of the new image that are not linked (4 KiB blocks), a block per directory and per long symbolic link, 2 % and 16 MB for directories and the journal, the device's files that are not linked (a pass of tarfilter over their pack), 8 MB for the carry by link. Too little: "not enough room on the Linux partition: N MB needed ..., M MB free", "nothing was changed", and the run ends before the boot chain or anything else is touched. With MU300_DELTA=0 the room of the whole image is counted and checked the same way.
  • mu300-update apply counts before it downloads (update_need): the download (the size in GitHub's list of the release's files, what a mirror answers to a HEAD request, or the file of --from), what unpacking writes (the release's manifest against the installed system, hashed by the running system's helper: exact with one that has same, else every file there byte for byte counts, text too), the copy of the user's files for the rollback (carry_need, which no longer counts the device's own files: they are links), the kernel, extras and VPN module. After the download apply_one counts again with the new image's own helper, exactly, and stops with nothing changed (the downloads removed) when it does not fit. A release without manifests: the old rule.

Nothing left behind. apply removes what an update that was cut off left (<os>.new, the work directories) before it counts, and its EXIT trap removes the system it was making when it ends before the switch (an error, ^C, a kill). The installers do the same at their start ("removed openwrt.new, left by an installation that did not finish") and remove the half-made system when unpacking fails.

The switch module of the computer installer. tools/install-magisk-module.sh installed the module's generic module.prop (v1.0) over the zip's module of the release (seen on F50-C). It now writes android/magisk/installer/module.prop.in with the release, versionCode, system and kernel as make-magisk-zips.sh does (install.sh passes them, install.ps1 the same); a build of the checkout keeps the generic one.

Measured in containers (the image unpacked, the plan and the unpack of the delta block, du of both systems together; "whole image" is what every update wrote before):

update whole image written now linked text kept out
OpenWrt v2026.10.16.1 -> .80 (the same packages, this updater) 58.3 MiB 8.0 MiB 50.4 MiB 2.4 MiB
OpenWrt .80 -> .81 (a few files changed) 60.3 MiB 9.3 MiB 51.0 MiB 2.7 MiB
OpenWrt v2026.10.16.1 -> .82 (Docker added: 190 MiB new) 250.5 MiB 207.5 MiB 43.0 MiB 2.4 MiB
OpenWrt with Docker .82 -> .83 (a few files changed) 252.5 MiB 10.0 MiB 242.5 MiB 2.7 MiB
Ubuntu 24.04 v2026.10.16.1 -> .80 349.2 MiB 99.4 MiB 249.8 MiB 74.5 MiB
Ubuntu 24.04 .80 -> .81 351.2 MiB 101.3 MiB 249.8 MiB 74.7 MiB

The plan's count was within 0.6 MiB of what du measured each time. Ubuntu with Docker (§130) was not built here: Docker's 260 MiB are binaries and are linked whenever they did not change, so such an update writes about the same 100 MiB as Ubuntu without Docker, instead of 608 MiB of image and the device's 205: well within the 1.6 GiB the installers ask for, and NEED_UBUNTU is left as it is.

On F50-C (Android 12, the internal region of 804 MiB at offset 61698211840, plain OpenWrt, kernel 6.18). The test releases were made from the published v2026.10.16.1 by repacking its images with this branch's updater and helper (each "changed" one with a new text file, a new 2 MiB binary and bytes appended to /usr/sbin/xl2tpd), signed with the project's key, their zips by make-magisk-zips.sh: v2026.10.16.80 and .81 (OpenWrt and Ubuntu 24.04), .82 (plain OpenWrt with Docker, built by openwrt/build-rootfs.sh with MU300_DOCKER=1 from this branch with docker-in-images merged for the build only), .83, .84 and .85 (.82 with a few files changed each). Free space from Android (read only, the journal replayed) or df on the device:

step how free before result free after
v2026.10.16.1 -> .82 (Docker) the .82 zip from Android 506 MiB "43 MB ... not written again; 208 MB are written" 314 MiB
.82 -> .83 as before the .83 zip with MU300_DELTA=0 (the whole image) 310 MiB refused before anything was written: "464 MB needed ..., 310 MB free", "nothing was changed" 310 MiB
.82 -> .83 the .83 zip 310 MiB "243 MB ... not written again; 10 MB are written"; booted, docker info 29.6.1, its data beside the systems 288 MiB
.83 -> .84 mu300-update apply from a mirror on the computer, the previous version kept 287 MiB first refused, wrongly: the count (532 MB) took the device's files as a copy and guessed the download - fixed (carry_need, HEAD). Then "242 MB ... not written again; 10 MB are written", the kernel and boot image updated 185 MiB (openwrt.old, and the previous boot image and its modules)
the kept previous version openwrt.old against a manifest of the running .83 taken before apply (every file's type, mode, owner, hash) the same but /opt/mu300/bin/mu300-update, which apply replaces with the release's updater before it starts (§86); the same again after .84 had booted and run dockerd
rollback mu300-update rollback, reboot .83 again, its manifest the one taken before the update (but that updater)
.83 -> .85 the .85 zip's computer/install.sh, answers mode, update 223 MiB "243 MB ... not written again; 11 MB are written"; the Magisk module afterwards v2026.10.16.85 (before this change: the generic v1.0); booted, Docker ran 223 MiB
a cut-off run a 150 MiB openwrt.new planted, then the .80 zip (MU300_DOWNGRADE=yes) 73 MiB "removed openwrt.new, left by an installation that did not finish", "44 MB ... not written again; 16 MB are written" 442 MiB

The computer installer's "keep the password" could not check OpenWrt's $5$ hash with the v2026.10.16.1 kernel bundle the test releases carry (it has no mu300-pwcheck: "UNVERIFIABLE", §126); answered no, with the same password. At the end v2026.10.16.1's own zip (MU300_DOWNGRADE=yes and MU300_PASSWORD=ubuntu in /data/adb/mu300-install.conf, which it removes), the Docker zone and network that .82's first boot had added removed with uci, the test's boot and temporary files removed: F50-C in Android, v2026.10.16.1, root's password ubuntu.

On F50-B (Ubuntu 24.04, kernel 7.2.10, 32 GB region, no internet; 2026-10-17), mu300-update apply --from a release directory on the device, each time with a manifest of the running system taken first: v2026.10.16.1 -> .80 "249 MB ... not written again; 99 MB are written" (528 files of the user's, 32 MB, copied for the rollback; used +163 MiB with ubuntu.old kept and the kernel's modules); booted, is-system-running "running", no failed unit. .80 -> .81 "249 MB ... not written again; 101 MB are written"; booted, the changed ethtool ran. Both times ubuntu.old was the manifest taken before apply but for the updater apply replaces first and what the running system itself wrote meanwhile and at its shutdown (the journal, wtmp, random-seed, systemd's private tmp directories: all under /var and /tmp, never linked); after .81 had booted nothing more had changed in it. rollback and a reboot: .80 again, equal to its manifest but for the updater and a pstore file the boot writes. Back to v2026.10.16.1 by apply --from ... --downgrade (its own updater: the whole image, and 217 MB "carried", the device's files copied as before), clean, the test's files removed. The computer installer on Ubuntu was not run: F50-B's Android has the same adb serial as F50-C, which was in Android.

Not changed. The panel's "Free space needed" (space_needed in status and releases) is still the old rule of 1 GB and 1 GB per system: shown, never enforced, and no longer what apply checks when the release has manifests. mu300-update apply copies a kernel bundle's modules into the new system and keeps the previous set with the previous boot image (about 60 MB on F50-C with 6.18), as before.

132. Every OpenWrt release shipped its web server's TLS key: one private key for all devices of an image

Status: current (unit tests; the shipped keys' fingerprints taken from every published release; the field fix run on the U30 Air, by hand and at boot, 2026-10-16).

What was wrong. The uhttpd package makes its key pair (/etc/uhttpd.key, /etc/uhttpd.crt) when apk installs it, and since v2026.10.13 apk installs it in the image build: the pair was in the published rootfs tarball, so every device that installed one image had the same private key for LuCI over HTTPS, and anyone who downloads the release has it (a man in the middle on the LAN, or anyone the device's HTTPS is reachable to, could pose as the device's LuCI and read the password typed into it). uhttpd only makes a pair when there is none, so a device kept the shipped one for good. Found while working on Docker in the images (PR #258), on F50-C: its key was v2026.10.16.1's plain OpenWrt one.

Which releases. gh release list, then each published mu300-openwrt-rootfs.tar.gz and mu300-openwrt-luci-rootfs.tar.gz (60 tarballs, 41 releases) streamed through tar for etc/uhttpd.key and hashed, nothing kept: the 28 tarballs from v2026.09.17 to v2026.10.12 have no key (the listing checked: uhttpd, no key file); the 32 of v2026.10.13 to v2026.10.27 and v2026.10.16.1 each have one, all different (one key per image build, the same for every device of that image). Assets that were replaced on a release before this was looked at, and images built by hand, are not on the list.

The build. openwrt/build-rootfs.sh removes the pair from the image and fails if a key is still there; the audit of tools/make-release.sh refuses a tarball with etc/uhttpd.key (the same hunk as PR #258's). uhttpd makes the device its own pair at its first start: px5g (px5g-mbedtls, in both images; openssl is there too) with the key_type ec of /etc/config/uhttpd, an EC P-256 key and a self-signed certificate valid for 397 days.

The devices. /etc/uci-defaults/92-mu300-uhttpd-key (both images) holds the 32 fingerprints (sha256 of the key file; never a key) and removes /etc/uhttpd.key and /etc/uhttpd.crt, and the pair of any uhttpd section whose key points elsewhere, when the key file is byte for byte one of them; a key not on the list (made on the device, or the user's own) is never touched, nor an empty file. uci-defaults run at boot before uhttpd (START 50), so uhttpd starts with no pair and makes one. Every update brings the file again (it removed itself when it ran, and mu300-update does not carry that removal over), so it runs on the first boot of every image, whatever way it came: mu300-update with the old image's manifest already leaves the image's key behind (it is the old image's file, not the user's), but without the manifest, and the Magisk zip and computer installer paths that carry /etc, would keep it. A device on an old release keeps the shipped key until it updates; by hand, the same script then /etc/init.d/uhttpd restart, or rm /etc/uhttpd.key /etc/uhttpd.crt; /etc/init.d/uhttpd restart. The browser warns once about the new self-signed certificate (or about a changed one, where it had an exception for the old); LuCI over plain HTTP is not affected.

Measured on the U30 Air (openwrt-luci v2026.10.16.1, VPN profile cengiz-abi, sing-box, kill switch on). Its key was v2026.10.16.1's openwrt-luci one (0523f54e...). After a root-only backup of /etc/uhttpd.* and the VPN settings: the script by hand removed the pair and logged it; uhttpd restart made an EC P-256 pair (px5g, "Generating EC private key"), not on the list; HTTPS answered with the new certificate (SHA-256 69:88:5C... before, B2:05:9C... after) and the LuCI login page, as did HTTP; a second run kept the new key. Then the boot path: the shipped pair put back, the script in /etc/uci-defaults, a reboot: the script ran and was gone, uhttpd had made another new pair (EC:94:0E...), LuCI answered over both. Through all of it the VPN stayed up with the same exit IP, and the sha256 of every file of /etc/config and /etc/mu300/vpn* was the same as before.

104. The U30 Air's live SIM switch turned mobile data back on that the user had switched off

From kanoqwq's clean-tf-7.2 2d3b6f3f ("complete U30 Air support"), where he took our dual-SIM controller (mu300-sim-u30, §74) into his tree and changed it: "when the user has switched the WAN off, it stays off after the switch; an explicit choice is saved as the boot default". Ours did not do that. Read in his code, rewritten here; none of it run on a device.

What ours did. A live switch (mu300-sim switch 1|2, the Dual SIM page's buttons) takes the wan down, moves the radio, and then brings the wan up on the target with ifup wan (and on the way back after a failure, and after a busy channel). It also removed /run/mu300-mobile-data-down, the marker that mobile-data down leaves so that its watchdog does not dial again. So with mobile data switched off - the panel's button, ifdown wan, the data cap, all of which leave netifd's autostart off (sim_wan_held_down, §74) - a switch turned it back on: the ifup dialled the new card at once, and even without it the watchdog, its marker gone, would have found no context and run ifup wan itself ("mobile data lost, reconnecting"). For a user who turned data off for the cost (a card without a plan, abroad: the roaming hold of §120 is a separate thing and is not affected) that is data they did not ask for. The switch then also waited a minute for a bearer and, when none came because data was off, treated the target as a card without data: back to the previous card, or no_data_kept.

Changed. The switch reads sim_wan_held_down before it touches anything. When the wan was held down:

  • no ifup anywhere (wan_back), and the watchdog's marker stays: data stays off on whichever card is in use, after a switch, a rollback (rolled_back) or a busy channel (nothing changed);
  • after the radio sequence the target is published, saved as the boot default and reported switched, with no wait for a bearer there cannot be (his choice, taken: the user chose the card; a second card with its connection off is kept by the boot check as well, mu300-sim2-warmup). It is not added to sim-data-seen: no data was seen on it;
  • switch <the card in use> saves it as the default without asking for data.

With mobile data on, nothing changes: the marker goes, ifup, the minute's wait, the way back without data.

Not taken from the same change. His wait_wan_down (after ifdown, up to 15 s until netifd's status says "up": false and not pending) before the radio sequence. netifd sets the interface to its teardown state inside the down call itself, and its status reports a tearing-down interface as "up": false, "pending": false already: the check passes at once and does not wait for the protocol's teardown. What it was for, the old card's teardown (mobile-data down, AT commands) running into the switch, is covered here by mu300-at's gate: while the switch holds its lock every AT client but the switch is told "busy" (§74). His per-SIM early lock replay after a switch and his unisoc_modem.main.data_sim storage belong to his per-SIM locks and his configuration layout; not taken.

Unit tests (tests/test_sim_hot.py, the netifd stub reporting "autostart": false until an ifup): a switch both ways with data off (no ifup, the marker kept, the default saved, nothing in sim-data-seen); a failed switch and a busy channel with data off (no ifup, the marker kept); the card in use saved without data; with data on the marker still goes and the target is dialled. The first three fail on the previous script.

Device checklist (before merge; U30 Air, openwrt-luci, live switching on and both cards in):

# data off: the panel's mobile data switch, or ifdown wan
ubus call network.interface.wan status | grep -E '"(up|autostart)"'   # false, false
ls /run/mu300-mobile-data-down                                   # there
mu300-sim switch 2; ubus call network.interface.wan status | grep -E '"(up|autostart)"'   # still false, false
ls /run/mu300-mobile-data-down; uci get network.wan.sim_slot     # still there; 1 (the boot default: SIM2)
sleep 70; ifconfig sipa_eth8 | grep inet                         # nothing: the watchdog did not dial
mu300-sim switch 1                                               # the same, back
# data on again (the panel or ifup wan): a switch dials the target and saves it once it has data, as before
mu300-sim switch 2; mu300-sim status                             # switched, wan up on sipa_eth8

Device test (2026-10-17, U30 Air, openwrt-luci v2026.10.16.1 with this mu300-sim-u30, live switching on, SIM1 with data, SIM2 registered emergency-only). Data off with ifdown wan: up false, autostart false, the marker there. switch 2: switched, active/default 2, wan still down, marker kept, sim_slot 1; 70 s later no address on either bearer and no redial in the log. switch 1: the same back (sim_slot 0), still nothing after 70 s. switch 1 with SIM1 in use and data off: switched, no bearer wait. Data on (ifup wan), switch 2: SIM2 has no data, so no_data, rolled back to SIM1, wan up again on SIM1 with a new address (unchanged behaviour). The case "data on, switch 2 dials SIM2" could not be run: SIM2 has no service here.

105. The U30 Air's battery capacity kept at a power-off, and the fuel gauge's user area always written

From kanoqwq's clean-tf-7.2 2af101f8 ("complete U30 Air power, LED and PD dock support"), his patch 0017 ("retain live soc before reset"), on top of the same 0006/0010/0011 as ours (his copies are byte for byte ours). Rewritten here as upstream/patches/0018-power-sc27xx-fuel-gauge-UMP9620-capacity-kept-at-power-off.patch; his code read, not run.

What it is about. The capacity a U30 Air boots with, under Linux or Android, is the one in the FGU's always-on user area (§33d). Since 0011 the driver writes it there whenever somebody reads the capacity and its whole percent has changed. Two gaps:

  • Nobody has to read it before a power-off. Here mu300-power reads it every 10 s (its loop), so the gap is at most a loop; without that daemon (stopped, or a power-off right after a change, which is when the low-battery power-off runs) the next boot starts from an older value. A .shutdown callback now reads the capacity once more under the driver's lock, writes it (0-100) and the boot mode "normal power-on" with it. Only on UMP9620 with a battery present: the F50 and the V50 have none (their FGU reports made-up values), SC2731 keeps mainline's behaviour, and a probe that never finished (no driver data) is skipped. A failure is a dev_warn, never a stop: a power-off must go on.
  • The user-area writes could be skipped. The area is written in three steps: CLEAR (the mask), SET (the value), CLEAR back to 0. regmap_update_bits() reads a register first and does not write when the bits already read back as wanted. What these two registers read back is not documented; kano found that a skipped step loses the value ("retained SET/CLEAR registers require unconditional writes even when their readback is unchanged"). The six writes of save_boot_mode() and save_last_cap() are now regmap_write_bits(), which always writes. The values are the same; each write was already followed by the datasheet's 200 us wait. Whether a skip ever happened on our boards is not known: nothing here measured the read-back.

Built for 7.2.10 in a copy of the mu300-mainline volume's tree (all of our patches, then this one; CONFIG_FUEL_GAUGE_SC27XX=y, W=1): no warning. The file is the same in our 6.18.56 tree, so the patch applies there too. Unit tests: tests/test_fgu_shutdown.py compiles the callback as the patch adds it against stubs of the driver's helpers: the capacity kept and clamped, the boot mode with it, nothing written after a failed read or a failed capacity write, the lock released on every path, nothing on SC2731, without a battery or without driver data; tests/test_static.py checks the patch's lines.

Device checklist (before merge; U30 Air, either system on a mainline kernel with this patch; an F50 for the negative):

cat /sys/class/power_supply/sc27xx-fgu/capacity          # note it, e.g. 63
dmesg | grep -i 'boot capacity'                          # this boot's start
# run on battery until the capacity has dropped a few percent, stop mu300-power (systemctl stop mu300-power /
# /etc/init.d/mu300-power stop), let it drop one more percent without reading it, then poweroff
# power on: dmesg 'boot capacity N % (saved 0x...)' with N the last value, not the one of the last read
reboot; dmesg | grep -i 'battery capacity not kept'     # nothing
# Android after Linux: the battery percentage matches what Linux last showed (within a percent)
# F50: poweroff and reboot as usual, nothing new in dmesg (no battery: the callback does nothing)

Superseded in part (181): the U30 Air's stock module writes the user area with regmap_update_bits(), as mainline does; kano retracted the report above, and 0018 no longer makes them regmap_write_bits().

Device test (2026-10-17; 0018 on #256's 6.18.57 and 7.2.11 trees, Image rebuilt, the rest of the bundle as built). U30 Air, openwrt-luci, 6.18.57 + 0018: two boots and two reboots out of it, each reboot completed (the callback runs at a reboot too: .shutdown is called by device_shutdown() on both paths), boot capacity 80 % (saved 0x050) every boot, the same as the capacity read before each reboot, no warning or oops. The battery stayed at 80 % (Not charging on USB), so a capacity that changed without being read was not produced, and poweroff was not run: the U30 Air has a battery, so nothing here can switch it on again without a button. The low-battery power-off of mu300-power was not reached (not drained); it ends in the same poweroff path. F50-B (Ubuntu, no battery), 7.2.11 + 0018: boots, the fuel gauge's messages are the same as without 0018 (it reads boot capacity from the user area as before), the reboot completed with nothing new in the log. Android after Linux was not checked.

106. Wi-Fi (SC2355): a command the driver never sent returned success, and get_station handed on stack bytes

From kanoqwq's clean-tf-7.2 0e19fe32 ("fix Unisoc WPA3 hotspots"): among his firmware-SAE changes to sc2355/cmdevt.c are three return values in sc2355_send_cmd_recv_rsp(), which our driver (mainline module and the 5.4 vendor driver, the same code at this point) has as he found them. Taken in our words; his SAE part is not (below).

What it was. sc2355_send_cmd_recv_rsp() returned 0 without sending anything in three cases:

  • cmdevt_lock_cmd() refused the command lock: the driver is going away (SPRD_CMD_EXIT_VAL added to the count) or, with DRV_RESET_SELF, the CP has asserted. ret was still the API check's 0.
  • block_cmd_after_close: between the CLOSE of the last interface and the WCN power-off, every command but CLOSE.
  • change_iface_block_cmd: during an interface type change with one mode open, every command but CLOSE and OPEN.

The last two also left *rlen as the caller had set it (the size of its reply buffer), so the caller took its own buffer for the firmware's answer. sc2355_get_station() copies the reply into the station's signal, rates and failures whatever the return value, and sprd_cfg80211_get_station() reports them when the return is 0: the bytes of an uninitialised stack structure went to nl80211, whose GET_STATION any local user may ask (iw dev wlan0 link). A small leak of kernel stack in a narrow window (the hotspot stopping or changing mode, or the module unloading), but one. And every setting sent in those windows "succeeded" with the firmware never seeing it.

Changed (mainline upstream/modules/sprd_wlan_combo/sc2355/cmdevt.c, and the same as kernel/patches/wlan_combo-unsent-cmd-error.patch for 5.4): the refused lock returns -EIO, the two blocked windows -EBUSY with *rlen 0 (the API-check failure keeps its own value and message); get_station's reply structure starts zeroed, which also covers a reply shorter than the structure. Callers that only test for non-zero now see the failure: a userspace setting tried in those windows gets EBUSY instead of a silent no-op.

Not taken from 0e19fe32. The firmware-SAE bridge (driver: sae.h, SAE_OFFLOAD_AP, max_num_akm_suites = 3, a CMD_SET_SAE_PARAM status check; hostapd: unisoc_sae_import(), his patched wpad packages in every image). It imports the PMK from a vendor element (dd 34 40 45 da 04) at the end of the association IEs of NEW_STATION, which is the same design as our opt-in SAE work (docs/U30AIR-SAE.md, open PR #237) and has the same open question that docs/U30AIR-SAE-HANDOFF.md describes: that buffer carries client-controlled association IEs, and nothing shows that the element came from the firmware. His guard (one such element, at the end, or a cached PMKSA) is syntax, not provenance; a client that does PMKSA caching without a fresh firmware element and brings its own is the case to rule out. His build also turns the bridge on for every sae/psk-sae BSS on this driver, while ours is an opt-in. Left to that work; nothing of it here. Also not taken: his wpad replacement, the graphical installer (Tauri) and his desktop installer changes.

Built (2026-10-16, compared with the same build of main): the mainline module for 7.2.10 against the mu300-mainline volume's tree, 92 warnings before and after, none in the changed lines; the 5.4 driver: the thirteen wlan_combo-*.patch apply in the build's order on the pristine vendor driver, and every object compiles (the final ThinLTO link was not run: it needs a writable kernel output tree). Unit tests: tests/test_wifi_tx_path.py (WifiCommandNotSent) reads the source and the 5.4 patch.

Device checklist (before merge; F50 and U30 Air, 6.18, 7.2 and 5.4, the hotspot on):

dmesg -C
wifi down; wifi up   (OpenWrt)  /  systemctl restart mu300-hotspot  (Ubuntu)   # the hotspot comes back, clients rejoin
dmesg | grep -E 'need block cmd'               # the blocked commands, if any, as before
# while restarting the hotspot, ask for the station from another shell as a normal user:
while :; do iw dev wlan0 link; done            # no made-up signal/rates; errors are fine
# switch the Wi-Fi client mode on and off (the wifi-client command or LuCI), then the hotspot again: comes back
# the U30 Air's Wi-Fi key (2.4 <-> 5 GHz, off/on): every change takes effect
rmmod sprd_wlan_combo; modprobe sprd_wlan_combo (or reboot): Wi-Fi comes up, no oops

Device test (2026-10-17). The module of this branch, built against #256's 6.18.57 and 7.2.11 trees, and the 5.4 driver built by kernel/build-all.sh with the new patch (the build is reproducible: of its 187 modules only sprd_wlan_combo.ko differs from v2026.10.16.1's, so it went onto the released 5.4 as the only change). An unprivileged user (ubuntu; nobody on OpenWrt) ran iw dev wlan0 link and iw dev wlan0 station dump in a loop throughout.

F50-B Ubuntu 7.2.11 F50-B Ubuntu 5.4 U30 Air openwrt-luci 6.18.57
hotspot restarts systemctl restart mu300-hotspot x5: AP back in 21-22 s each (7.2.10 released: 21 s) x5: 8-9 s (released driver: 8-9 s) wifi down; wifi up x8: 3-6 s; band 2.4 -> 5 -> 2.4 -> 5 with mu300-wifi-band: takes effect (ch 6 / ch 36)
the user's loop 22902 rounds: Not connected. only 21872 rounds: the same 35965 rounds: the station's line, No such device while wlan0 was gone
module reload rmmod/modprobe under the loop: AP back the same rmmod, insmod of the released module, back to this one: the client rejoined each time
client mode scan mode on, reboot: station mode, scan lists networks; wifi-client disconnect: hotspot back - -
errors no need block cmd, no oops; iface_tx_timeout once per start, as with 7.2.10 iface_tx_timeout and its dev_watchdog WARNING, and the boot's add_uevent_var WARNING: both the same with the released module no oops, no warning

A station's figures on the U30 Air (one client): signal 0 dBm, tx bitrate (unknown), rx 650-780 MBit/s VHT with this module and with the released one alike (the access point side reports what the firmware gives; not this change). Not run: a station whose link the F50 reports in client mode (no network it may join here), iperf.

150. USB-C power delivery on the U30 Air: the UMP9620's port controller under TCPM (EXPERIMENTAL, off by default)

Status: experimental (built against 6.18.57 and 7.2.11, unit tests; not run on a device yet, see the PR's device checklist). Off unless sudo mu300-usb pd on.

What for. A PD dock with its own charger (USB-C charger in, USB-A ports and Ethernet out) is meant to charge the U30 Air and have it as its USB host at once; ZTE's Android does that. Mainline had no driver for the PMIC's Type-C and PD blocks: VBUS came from a GPIO, the source's Rp was read by the charger (§40, patch 0012), and mu300-usb host put the data role and the 5 V boost together, so a dock could either charge it or be its device, not both.

Where it comes from. kano (kanoqwq/mu300-linux, branch clean-tf-7.2, commit 2af101f8, "complete U30 Air power, LED and PD dock support") put Unisoc's sc27xx_pd.c register sequences under mainline's TCPM: a 654-line driver, a charger patch (his 0018) that makes the boost a regulator and lets a PD contract set the input current, and mu300-usb asking /sys/class/typec/port0/data_role. On his unit a computer gave device + sink, and a dock with its charger gave host + sink after a manual data role swap (an RTL8153 on the dock came up in the LAN); the dock's own switch to host did not happen, and his last receive fix was not run against the dock again. Unisoc's originals were read for this review from ZTE's U30 Air kernel (Enceka/android_kernel_zte_ums9620_mifi_u30air: drivers/usb/typec/tcpm/sc27xx_pd.c, drivers/usb/typec/sc27xx_typec.c, sprd_tcpm.c).

Review of kano's driver. What it does right: the Type-C block keeps its own state machine (attach, detach, the CC pin), which is how Unisoc uses it too; TCPM is registered last and unregistered first (its workers use the port); TX_OK and a received GoodCRC complete one transmission once; the RX FIFO is flushed after each frame (on the device it holds the CRC behind the frame, which was taken for the next header before); the VBUS GPIO's extcon covers VBUS changes without a CC event; and it binds only where the Type-C node has use_pdhub_c2c. What was changed:

kano's version now
on by default built in, bound at every boot a module, and probe returns at once unless enable=1 (mu300-usb pd on); Ubuntu's udev does not load it (modprobe.d blacklist)
boards use_pdhub_c2c that, the PD node enabled, and /charger_policy_service (the U30 Air only, as patch 0016); the F50's PD node is disabled, the V50 has no charger policy service
5 V out regulator_enable whenever TCPM asked the charger's otg-vbus regulator refuses while an outside supply is on VBUS (power good, VBUS_STAT not its own boost), after 100 ms for it to go (a power role swap)
a boost left on by a crash in host mode stayed on: mu300-usb boot skipped its check with the port controller there switched off by the charger at probe, before anything can use the port
VCONN the PMIC's VCONN switch on whenever TCPM asked, a cable's Ra reported never: ZTE's firmware does not source it (no vconn-supply on the PD node, so Unisoc's set_vconn fails) and which CC pin the switch drives is not known; Ra not reported
missing vbus-supply a dummy regulator (devm_regulator_get): "5 V on" with nothing on an error (devm_regulator_get_optional)
shutdown and unload PD clocks off; the Type-C block left in whatever mode TCPM last set the clocks stay on (the module enable covers the Type-C block LK and Android rely on); the Type-C block's mode and enable registers put back as the boot left them (the PMIC keeps them across a reboot: a block left source-only would not let a charger see a sink); boost off; device
calibration the Type-C trim written before the PD clocks were on clocks, then calibration, in Unisoc's order, in TCPM's init
message IDs not cleared at a new session, the TX ID not at a hard reset both FIFOs emptied and both IDs cleared at every new PD session and every hard reset, sent or received (Unisoc's sc27xx_pd_reset)
input current passed on after any received message, the Rp-based values TCPM reports included only for an explicit contract (the partner sent Source_Capabilities): in PD 3.0 a source's Rp only says whether the sink may talk (SinkTxOk is Rp 3 A whatever it offers), so §40's Rp current would be wrong under a contract; without one the charger's BC1.2/Rp choice stays
data role at unplug stayed host (TCPM never hands it back at a detach) device at once when the Type-C block says detached
locking set_cc, set_roles, set_pd_rx without the driver's lock every callback that touches the PD block holds it; TCPM is called with it held only where TCPM merely queues
receive errors enabled as an interrupt and ignored not enabled (Unisoc counts them and switches the interrupt off after 100 in two minutes)
PDOs source 5 V 500 mA, sink 5 V 2 A source 5 V 400 mA (ZTE's own, from the board's connector node), Rp default; sink 5 V 2 A (the charger's DCP current)

Still open, for the device (the PR's checklist): whether the Type-C block follows a mode change while attached (TCPM's Try.SNK and power role swaps write it; Unisoc's driver never did, it signals a swap through WC_REG), whether a hard reset we send raises TX_OK, whether a second frame can sit behind the first in the RX FIFO (the FIFO level is at debug level: echo 'module ump9620_tcpc +p' > /sys/kernel/debug/dynamic_debug/control), and why the dock did not swap to host by itself on kano's unit (TCPM accepts a partner's DR_Swap; it does not start one).

The pieces. upstream/patches/0019 (charger: the boost as the otg-vbus regulator, refused against an outside supply, a stale boost off at probe, a PD contract's input current kept across VBUS events and dropped with VBUS), 0020 (drivers/usb/typec/tcpm/ump9620-tcpc.c, one file); CONFIG_TYPEC, CONFIG_TYPEC_TCPM and CONFIG_TYPEC_UMP9620 as modules on both kernels. mu300-usb pd on|off|status loads the module with enable=1 (and at every boot while on, /etc/mu300/usb-pd) or unloads it; while it is bound host/device ask TCPM for a data role swap and write no charger register, device is refused while the port powers what is plugged in (an OTG adapter: unplugging it is the way back), and a partner without PD on outside power (a hub with a charger) still gets host written directly, with the boost off, as before. boot keeps switching a stale boost off, unless the port controller is bound (then the boost is its source role).

On the U30 Air (2026-10-17, OpenWrt, 6.18.57 with 0019/0020, a Mac on the cable). Off (the default): the module is not loaded, the charger probes as before (PMIC + Type-C: usb_type 3 ... input current 2000 mA, charging on), the otg-vbus regulator is registered, nothing else changes. Two fixes from that run: the build's device-tree check (check-dt-modules.py) stopped at ump9620_tcpc binds to sprd,ump9620-pd - it is listed in dt-modules-allowed.txt now, since its probe returns -ENODEV without enable=1 and Ubuntu's udev does not load it at all; and OpenWrt's modprobe (kmodloader) loads the dependencies but drops enable=1, so pd on saw the probe say "off" and reported that the port controller did not bind - mu300-usb loads it again by its path with insmod, which passes the option. Then pd on: bound, data role device, power role sink, the USB network to the Mac kept (three attach/detach flaps in the first two seconds, then steady); pd off unloads it and the port is a device as before. Not tried: an OTG adapter, a PD dock, a charger with PD (no such hardware at hand).

151. The U30 Air's battery LED shows the battery, as ZTE's firmware

Status: current (unit tests; ZTE's behaviour read from the stock firmware and ZTE's guide, 2026-10-16; not yet watched on a device, see the PR's checklist).

Before. The battery LED (the PMIC's RGB LED, sc27xx-bltc; its green channel is white) was lit white while Linux ran (mu300-led power on), blinked 1 s / 1 s in the charging boot, and timed out with the others after LED_TIMEOUT. Nothing showed the charge. kano's fork (kanoqwq/mu300-linux, branch clean-tf-7.2, commit 2af101f8) made it blue and breathing while charging, white when full, red blinking at 15 % and below, and kept every LED lit on outside power; the thresholds and colours were his choice.

What ZTE's firmware does. Read from a U30 Air's own backup (build U30Air_SSV1.0.0B14, the super partition's logical partitions taken apart offline, nothing run, no device booted into Android):

  • system/framework/services.jar, ZteBatteryService$ZteLed.updateLightsLocked(), the branch for the U30 ("IndicatingLed ufi with battery", gated by ro.vendor.feature.zte_leds_for_u30): white (0x007800: the green channel at 120) at 60 % and above, blue (0x0000c8: 200) from 10 %, red (0x960000: 150) below; not charging (Full included) setFlashing(colour, 1, 0, 0), steady; charging setFlashing(colour, 1, 800, 1200).
  • The lights HAL (vendor.sprd.hardware.lights-service, the battery handler): an on or off time under 125 ms is steady (trigger none, the brightness written); otherwise the pattern trigger with hw_pattern "b 2on/5 b 3on/5 b 2off/5 b 3off/5": for 800/1200 "b 320 b 480 b 480 b 720", the PMIC's own rise/high/fall/low curve, a 2 s breath.
  • NotificationManagerService: every LED goes dark 15 s after boot, a key press or an unplug, unless the device is charging or full on the charger; ZteBatteryService.turnOffUfiBatteryLight() leaves the battery LED on below 10 %, so the red does not time out.
  • Power-off charging (ztecharger) lights the same colours with another curve and 5 % for red; not used here (LK's charging boot comes to Linux, §36).

ZTE's guide for the U30 Air (国际漫游指南, https://oss.ztedevices.com/prod/cn/2024/12/20241213641.pdf, item 4, the battery light) agrees: 红色常亮:电池电量低。蓝色常亮:电池电量中等。白色常亮:电池电量高或满。红色、蓝色或白色闪烁:充电中 (steady red: low; steady blue: medium; steady white: high or full; red, blue or white blinking: charging).

Now. mu300-led draws the three channels from the battery (U30 Air only; the F50's same LED is its network light, the V50's PMIC LEDs are never written):

  • the fuel gauge's capacity and status (sc27xx-fgu on mainline, battery on 5.4) and outside power from the charger's online (bq256xx-charger; usb/ac on 5.4); the gauge's status alone only where no charger says anything, since it says Charging for a while after an unplug (kano saw it);
  • ZTE's colours, levels and thresholds; breathing on the pattern trigger with ZTE's curve (CONFIG_LEDS_TRIGGER_PATTERN, now in the mainline config; the port's leds-sc27xx-bltc has had pattern_set all along), a timer blink 800/1200 ms where there is no pattern trigger; the curve is written only when the state changes, so a tick does not restart the breath;
  • on outside power no LED times out; an unplug starts the timeout again from then (ZTE's 15 s; LED_TIMEOUT here, 60 s by default); below 10 % on the battery the red stays lit whatever the timeout; power off (shutdown) puts it out for good;
  • the heat alarm's siren goes over it (thermal-guard), and the battery LED is drawn again as the battery is then when the alarm ends; mu300-power's idle still darkens everything but the low-battery red.

The battery is read at every tick of mu300-buttons (every 5 s, mu300-led tick, which then lets the LEDs time out as sleep --if-due did), so a plug or a crossing of 60 % or 10 % shows within 5 s, with no new event wiring on Ubuntu or OpenWrt. mu300-led battery does it on demand. The charging boot (charge on) shows the charge the same way instead of the white blink.

152. The U30 Air's Wi-Fi LED: white on 5 GHz, blue on 2.4 GHz, as ZTE's firmware

Status: current (read from the stock firmware and ZTE's own guide, 2026-10-16; not yet looked at on a device).

What was wrong. §33f found which element is where (the Wi-Fi light's white is LDO VDDCAMA1, its blue LDO VDDCAMA2) but not what ZTE means by them, and mu300-led lit blue on 5 GHz and white on 2.4 GHz. kano's fork (kanoqwq/mu300-linux, branch clean-tf-7.2, commit 2af101f8, "complete U30 Air power, LED and PD dock support") has them the other way round, white on 5 GHz and blue on 2.4 GHz, as the V50's lamp is (§95).

What ZTE's firmware does. Read from a U30 Air's own backup (build U30Air_SSV1.0.0B14, slot a; the super partition's logical partitions taken apart offline, nothing run, no device booted into Android):

  • system/framework/services.jar, NotificationManagerService.updateLightsLocked(): the hotspot off gives mWifiLight.setFlashing(100, 2, 0, 0); on, a packed-switch on mWifiBand (from WifiManager.getSoftApConfiguration().getBand()) with the one key 1 (BAND_2GHZ) gives 102, every other band (BAND_5GHZ = 2, combinations) 101. mWifiLight is getLight(1), the keyboard light.
  • vendor/bin/hw/vendor.sprd.hardware.lights-service, the keyboard light's handler ("setLightKeyboard"): with flash mode 2, 100 writes 0 to both zte_ldo_leds/vddcama1_status and vddcama2_status, 101 lights vddcama1 alone, 102 vddcama2 alone. The path is gated by ro.vendor.feature.zte_leds_for_u30=true and zte_feature_ufi_light=true (vendor/build.prop, and the same in the unit's getprop).
  • So 5 GHz is VDDCAMA1, white; 2.4 GHz VDDCAMA2, blue; steady, never blinking.

ZTE's guide for the U30 Air (国际漫游指南, https://oss.ztedevices.com/prod/cn/2024/12/20241213641.pdf, item 5, the Wi-Fi light) says the same: 白色常亮:Wi-Fi 5 GHz 启用。蓝色常亮:Wi-Fi 2.4GHz 启用。灭:Wi-Fi 关闭、关机或待机模式 (steady white: 5 GHz on; steady blue: 2.4 GHz on; off: Wi-Fi off, powered off or standby).

The change. mu300-led maps the 5 GHz hotspot to zte-ldo1 and 2.4 GHz to zte-ldo2 (mainline's leds-zte-ldo, and vddcama1/2_status under 5.4). The README, the wiki's hardware notes and the website's feature pages (English, Turkish, Chinese) say white 5 GHz, blue 2.4 GHz.

Not changed here, for a look on the device. The same NotificationManagerService.setNetLight() picks the network light by the SIM in use, not by the access technology: 11 (VDDCAMA0, white) for SIM slot 0, 12 (net_blue) for slot 1, 13 (keyboard-backlight, red) without service; the variant that picks by 4G/5G (ZTE_FEATURE_UFI_LIGHT_V1) is not set on this unit. The guide says the same (blue: the built-in eSIM in use, white: the nano-SIM; blinking while the SIM is switched; white/blue with red flashing: no internet on that SIM). §33f's "blue on 4G, white on 5G" was sampled with the radio off and vddcama0 lit on 5G, which a nano-SIM in slot 0 would also explain. mu300-led still shows 4G/5G. Update: changed in §154.

153. A reinstall after an uninstall on a device that made room: "it asks to repartition again"

The report (a user, through the owner, 2026-10-16): a device whose userdata the installer had shrunk (the make-room path, the 32 GB variant), uninstalled and installed again; the installer asked to repartition again.

What can ask that. Only offer_repartition (install.sh) / OfferRepartition (install.ps1) makes room, and only when the region behind the last partition is under 700 MiB (install.sh, after region_probe; install.ps1 the same test after FreeRegion). The window offers it from the same facts (makeroom.*), the web installer and the Magisk zip never (the zip says "make room with the installer for computers" when the region is under 700 MiB or too small for its system). region_probe and resume_region are the same arithmetic, so the region a reinstall finds is exactly the one the make-room run reserved (F50-C: userdata ends at sector 120500223, the region starts at 120504320 and holds 804 MiB, both before and after the uninstall). A finished resumed installation is installed in its transaction, which resume.py find skips, so a reinstall is never taken for a resume (F50-C's transaction in ~/mu300-backups was installed). Android does not touch the GPT (a factory reset formats userdata in place).

So a reinstall asks to make room only where the space really went back to userdata - the uninstaller's own question: "Grow userdata back over the freed space? ... Say yes only if this installer shrank it." On exactly this device the installer did shrink it, so the text invited the yes; it did not say that a reinstall then has to make room again, with another reset of Android. uninstall.sh (and the window's checkbox, which drives it) is the only path that can grow it, and only after yes and ERASE; uninstall.ps1 has no such question. That is the likely cause of the report.

What a reinstall without the grow met (F50-C, plain OpenWrt v2026.10.16.1 k6.18 in the 804 MiB region).

  • uninstall.sh WIPE=quick, GROW=no; install.sh --check: "data check: 14 of 16 samples contain data", "WARNING: the unpartitioned space is not empty; it may be used by this firmware" - the quick erase zeroes 64 MiB, the old files stay. The install then wants the word overwrite. No make-room question; the reinstall (systems 2) went through.
  • uninstall.sh WIPE=secure: 0 of 16 samples, "OK: free and empty, but small: OpenWrt fits, Ubuntu does not".
  • Enter at "What should be installed?" chose 3 (both) on the 804 MiB region, asked which OpenWrt, and stopped: "that choice needs about 2400 MiB and this device has 804 MiB of free space". For someone who made room before, that reads as "make room again". install.ps1 had the same default.
  • The uninstaller said "overwrite the whole 0 GiB region" and "overwriting 0 GiB" (integer GiB of 804 MiB).

Changed.

  • install.sh systems_default / install.ps1 SystemsDefault: Enter chooses what fits - 3 where both fit, 1 where only one does (Ubuntu, as the window chooses after its check), 2 where only OpenWrt does. A choice that does not fit stops right after the question, before "which OpenWrt", and names the one that fits ("Choose 2 (OpenWrt) instead: it fits here."; a package of a system that does not fit: "An OpenWrt zip of this release fits here.").
  • uninstall.sh: the grow question says to answer no when Linux may be installed again, and that after yes a new installation has to make room again (another reset of Android); the window's checkbox the same. After a grow it says to restart before anything else: Android's kernel keeps the table it booted with, and an installer run before the restart reads the partition ends from sysfs - it would take the space just given to userdata for free space.
  • uninstall.sh / uninstall.ps1: the quick erase says that a later installation finds the space not empty and asks for overwrite; sizes in MiB.

Device run of the change (F50-C). After the secure uninstall: MU300_ANS_SYSTEMS=3 stops with the line above and "Choose 2 (OpenWrt) instead: it fits here." before anything is written; Enter shows Choice [2] and installs plain OpenWrt v2026.10.16.1 on 6.18 into the same region (MU300-INSTALL-OK, root's password checked on the device). userdata was never resized (sectors 12275712..120500223 throughout).

Open. install.sh does not compare the partition table on the disk with what the running kernel shows before it uses the region (offer_repartition does, for userdata); only the grow path of uninstall.sh can make them differ, and it now says to restart.

154. The U30 Air's network LED: the SIM in use, as ZTE's firmware (white slot 0, blue slot 1, red no service)

Status: current (read from the stock firmware and ZTE's guide, 2026-10-16; unit tests; not yet looked at on a device).

What was wrong. mu300-led lit the U30 Air's network light blue on 4G (net_blue) and white on 5G (LDO VDDCAMA0, zte-ldo0), as on the F50. §152 found that ZTE's firmware does not do that on this device: its NotificationManagerService.setNetLight() (U30 Air backup, build U30Air_SSV1.0.0B14, system/framework/services.jar) picks the colour by mSimSlotId, not by the access technology:

  • SIM ready and connected: mWifiLight.setFlashing(11, ...) for slot 0, 12 for slot 1 (dual SIM; a single-SIM build always 11). The lights HAL (vendor.sprd.hardware.lights-service, the keyboard light's handler) lights VDDCAMA0 for 11 (white) and net_blue for 12 (blue).
  • No SIM or not connected (!mSimReady || !mNetConnected), or mNetValue 1: 13, the red (keyboard-backlight); with FLASH_NONETWORK a runnable flashes it instead.
  • A SIM switch (zte.intent.action.sim_switch): mSwitching, the light first off (10), then switchSimRunnable until the new card is up.
  • The variant that picks by 4G/5G, ZTE_FEATURE_UFI_LIGHT_V1, is not set on this unit.

ZTE's guide for the U30 Air (https://oss.ztedevices.com/prod/cn/2024/12/20241213641.pdf, the network light) says the same: blue, the built-in eSIM in use; white, the nano-SIM; blinking while the SIM is switched; red, no service; white or blue with red flashing, no internet on that SIM. Slot 0 is the nano-SIM (mu300-sim select external), slot 1 the eSIM (internal). §33f's "blue on 4G, white on 5G" was sampled with the radio off and vddcama0 lit on 5G, which the nano-SIM in slot 0 explains as well.

The change (rootfs/overlay/opt/mu300/bin/mu300-led, one program for Ubuntu and OpenWrt):

  • U30 Air, data on and data 5g (mobile-data still says which; the F50 and the V50 keep 4G/5G): white (zte-ldo0, vddcama0_status under 5.4) for slot 0, blue (net_blue) for slot 1, the other colour and the red dark. data error is red alone and data off dark, as before.
  • The slot is this boot's pin, /run/mu300/sim-slot, which the AT daemons and mobile-data read too (the saved choice is never read: it is tomorrow's). mu300-led never creates the file (that would pin a slot before init.d/mu300-atd chose one); missing or anything but 1 is slot 0. A 1 counts only on OpenWrt, where mu300-sim supports slot 1 on the U30 Air; on Ubuntu mu300-sim active answers 0 for it, and so does the LED.
  • A live switch (mu300-sim-u30 switch, OpenWrt): once the old connection is taken down, mu300-led data switching <target> makes the target card's colour blink (the timer trigger, 0.5 s on, 0.5 s off; the 5.4 kernel's LDO switches have no trigger, so there it is steady). netifd's teardown of the old connection comes whenever it comes; its data off/data error leave the blink alone while /run/mu300/sim-switching is there and the switch was announced. The dial on the new card (led_up, refused while the switch marker exists) shows its colour steady; a rollback's dial the old card's. A switch that ends without a dial (no data on either card, a radio left unknown and a reboot) clears the marker, and the next off/error is shown as usual. The blink survives the LED timeout and idle like every other state (sleep puts it out, wake starts it again).
  • The call is cosmetic: mu300-sim-u30 ignores a missing or failing mu300-led (MU300_LED_CMD for tests).

Not done. ZTE's "white or blue with red flashing" for a SIM without internet: here a card registered but without data is dark (data off), as before; whether that should flash red as well is the owner's call.

Tests (tests/test_device_scripts.py, Led, every shell): both slots with on, 5g, on (no colour change with the technology), error and off; the slot sources (none: slot 0 and no file made; 1 on Ubuntu: slot 0; junk: slot 0; 1 on OpenWrt: blue); the switch blink (the timer trigger and its delays, held through off and error while switching, kept across sleep/wake, steady on the next on, released once the marker is gone, a bad slot refused, other devices unaffected); the 5.4 LDO switch steady. tests/test_sim_hot.py: the switch calls mu300-led data switching <slot> after ifdown wan with the marker set, and a failing or missing mu300-led changes nothing.

On a device (to do): a U30 Air on OpenWrt with both cards: the network light white on the nano-SIM, blue on the eSIM, whatever 4G or 5G; blinking during a live switch from the panel, steady in the new colour when data is up; red with no SIM; Ubuntu on the U30 Air white.

156. The release smoke test: tools/smoke.py

Status: current (unit tests with fakes, tests/test_smoke.py; not yet run against a device).

What it replaces. After a release the maintainers updated a few boards by hand - an F50 with Ubuntu, an F50 with OpenWrt, the U30 Air with OpenWrt and the control panel, sometimes the Magisk zip from Android - and looked at the version, the kernel, the services, the hotspot, mobile data and the VPN afterwards. tools/smoke.py does that from a local config of the boards (tools/smoke.json, ignored by git; tools/smoke.example.json) and prints one line per check and board. docs/RELEASING.md describes the fields, the checks and what stays manual.

Identity before anything. The address does not say which board answers: every F50 is 192.168.77.1 on its USB network and every U30 Air 192.168.78.1, and an F50-B and an F50-C on the bench look the same. So no command runs before every board of the run has been identified: the SSH host key from ssh-keyscan must have the config's SHA256 fingerprint (computed in Python from the key blob, the way ssh-keygen -lf does: SHA-256 of the decoded blob, base64 without padding), and only that key goes into a known_hosts file of the run, used with StrictHostKeyChecking=yes and no other known_hosts file. Then /proc/sys/kernel/hostname, mu300-device --json's device and system (docs/ADB-INTERFACE.md; a release without --json prints the device alone) and the adb serial when the config has one. One mismatch on any board and the run stops with exit status 2 before a single command that changes something: the boards that did match are not touched either. After the reboot the same checks run again.

Android only when the config says so. The Magisk path goes through Android (the zip installs from Magisk; a board in Linux is first sent there with mu300-next-boot android). A board takes that path only with "allow_android": true: the config validation refuses it otherwise, for the U30 Air and every other model, and the one function that sends a board to Android checks the setting again. The other paths reboot only when /etc/mu300/default-boot is linux, checked in the state before the update and again on the device in the reboot script itself: on a device whose default boot is Android a reboot goes to Android by itself (the U30 Air on 2026-10-12, see reboot_goes_to_android in mu300-update).

No secret leaves the device. The VPN's files under /etc/mu300/*vpn* hold keys and passwords. They are hashed on the device (find /etc/mu300 -path '*vpn*' -type f -exec sha256sum {} \;), and only the hashes come back; the report says unchanged (N files) or names the changed, gone and new files, never a hash. Of mu300-vpn status --json six fields are kept (enabled, running, the kill switch setting, the profile id, the engine, whether the tunnel is up): no address, no exit IP, no profile name.

Commands from validated values only. Every value of the config that reaches a command line - host, user, port, serials, the mirror URL, the device path, the zip's name, mu300-update's arguments, the tag (FINDINGS 125's two forms) - must match a strict pattern whole (letters, digits and a few of . _ - : / ~; no .. component), and the config is JSON with duplicate keys and unknown fields refused. The device side is four fixed scripts sent on sh -s's standard input, with no value of the config in them. Every subprocess has a timeout; the waits for the reboot are bounded (down, boot), and so are the update itself (apply, an hour) and the zip's install.

The update paths, read from mu300-update and the docs: online is MU300_RELEASE=TAG mu300-update apply; a mirror adds MU300_RELEASE_URL=<mirror>/TAG (as in docs/update-device-test.md; a file:// URL needs curl on the device, busybox wget has none); --from DIR takes a release directory on the device, which the harness can fill with scp from a local release directory; the Magisk zip is adb push and su -c 'magisk --install-module ...', as android/magisk/README.md installs a module from a computer, then adb reboot. A failed update is not followed by a reboot.

Tests. tests/test_smoke.py runs the harness against a fake transport (simulated boards answering the identity and state scripts, rebooting on a fake clock, an Android side on adb): hostile config values, every identity mismatch refused with no changing call made, Android never reached without allow_android, a default boot of Android never rebooted, the comparisons, a board that never comes back (the run ends at the timeout), the Magisk path's order, the dry run with a transport that fails on any call, the report's lines and exit codes, and the device scripts under each shell with sh -n. The fingerprint is compared with ssh-keygen -lf on a key made for the test.

Open. Not run against a device yet: the state script's commands (systemctl list-units, iw dev, ip -4 -o, /etc/init.d/* running) are each in use on the images, but the whole script has run only on a computer. A Magisk install on a device without Linux cannot be identified after its first boot (its SSH host key is new), so that path is for an update over an installed system.

161. Mainline kernel sources: two signatures, pinned keys, fail closed

Status: current (unit tests with throwaway keys; the real 6.18.56 and 7.2.10 releases and seven kinds of tampering checked in the build image, 2026-10-16).

What was there. upstream/build.sh - the one place that downloads a kernel.org tarball, for local builds, the Mainline kernel build workflow and the release workflow alike - fetched linux-$KV.tar.xz and piped sha256sums.asc through grep | sha256sum -c. That checks the download against a list fetched over the same connection from the same host, and never looks at the list's signature: whoever can change the tarball (a CDN node, a mirror, TLS interception on a build host) can change the list with it. And grep read the whole file, so a line put in front of the clearsigned block would have counted as well as a signed one.

What it does now. upstream/verify-kernel-src.sh DIR KV, run by build.sh before anything is unpacked:

  1. gpgv --keyring keys/kernel-autosigner.gpg --output SUMS sha256sums.asc: kernel.org's checksum list must carry a good signature of the autosigner (kernel.org's off-the-network signing system); only the signed text, as gpgv writes it out, is searched for the tarball's line, which must be there exactly once and match its SHA-256;
  2. xz -dc linux-KV.tar.xz | gpgv --keyring keys/kernel-releasers.gpg linux-KV.tar.sign -: the releaser's own signature over the uncompressed tar (Linus Torvalds for a mainline release, Greg Kroah-Hartman or Sasha Levin for a stable one). kernel.org's signature page says the autosigner's lists do "NOT" replace developer signatures, so both are required, from two different keyrings: a releaser's key cannot sign the list, nor the autosigner the tar.

For each, gpgv must exit 0 and report GOODSIG and no BADSIG/ERRSIG/EXPSIG/EXPKEYSIG/REVKEYSIG/NO_PUBKEY, and the primary fingerprint of VALIDSIG must be listed in the keyring's .fpr file. Any failure, and a missing gpgv, xz or file, stops the build; build.sh deletes the download. The tarball unpacks into /src/.download-KV/ and is moved to /src/linux-KV last, so an interrupted unpack never leaves a tree that the next run takes as fetched (it used to: the tree's existence was the only test). The check costs about 3 s per kernel (the second xz pass). The build image lists gpgv (Ubuntu's base image has it already, as apt's dependency).

The keys (upstream/keys/README.md): the autosigner B8868C80BA62A1FFFAF5FDA9632D3A06589DA6B1, Linus ABAF11C65A2970B130ABE3C479BE3E4300411886, Greg 647F28654894E3BD457199BE38DBBDC86092693E, Sasha E27E5D8A3403A2EF66873BBCDEA66FF797772CDC; none expires. Fetched from kernel.org's WKD and from the pgpkeys repository on git.kernel.org, which agreed; signature.html prints the three releasers' fingerprints (not the autosigner's). keys.openpgp.org serves them without user IDs, so it was no source. A source tree that is already in a build volume (/src/linux-KV, from before this change) is not checked again: docker volume rm mu300-mainline to fetch it anew. CI runners start with a new volume every run.

Checked in mu300-mainline-build (gpgv 2.4.8), with the files from cdn.kernel.org: 6.18.56 (Greg) and 7.2.10 pass; refused, each with its own message: a byte appended to the tarball (SHA-256 mismatch), a hash changed inside the signed list (BAD signature), a fake tarball with its hash in a line put before the clearsigned block (the signed line wins: mismatch), 7.2.10's tar.sign next to 6.18.56 (BAD signature), the releasers' keyring as the autosigner's (no public key), Greg not in kernel-releasers.fpr ("not pinned"), no gpgv on PATH. The fetch block of build.sh itself, run in a new volume for 7.2.10, verified and unpacked it. tests/test_kernel_src_signature.py repeats these against throwaway ed25519 keys (skipped where gpg is missing; GitHub's Ubuntu runners have it), and parses the committed keyrings' packets to pin their fingerprints to the .fpr files, the README and the test.

Not covered here: the OpenWrt rootfs download (openwrt/build-rootfs.sh) still checks sha256sums without OpenWrt's signature (sha256sums.asc/.sig); the vendor 5.4 sources are git checkouts pinned by commit hash (kernel/build-all.sh), which no tarball signature applies to.

104. The U30 Air's live SIM switch turned mobile data back on that the user had switched off

From kanoqwq's clean-tf-7.2 2d3b6f3f ("complete U30 Air support"), where he took our dual-SIM controller (mu300-sim-u30, §74) into his tree and changed it: "when the user has switched the WAN off, it stays off after the switch; an explicit choice is saved as the boot default". Ours did not do that. Read in his code, rewritten here; none of it run on a device.

What ours did. A live switch (mu300-sim switch 1|2, the Dual SIM page's buttons) takes the wan down, moves the radio, and then brings the wan up on the target with ifup wan (and on the way back after a failure, and after a busy channel). It also removed /run/mu300-mobile-data-down, the marker that mobile-data down leaves so that its watchdog does not dial again. So with mobile data switched off - the panel's button, ifdown wan, the data cap, all of which leave netifd's autostart off (sim_wan_held_down, §74) - a switch turned it back on: the ifup dialled the new card at once, and even without it the watchdog, its marker gone, would have found no context and run ifup wan itself ("mobile data lost, reconnecting"). For a user who turned data off for the cost (a card without a plan, abroad: the roaming hold of §120 is a separate thing and is not affected) that is data they did not ask for. The switch then also waited a minute for a bearer and, when none came because data was off, treated the target as a card without data: back to the previous card, or no_data_kept.

Changed. The switch reads sim_wan_held_down before it touches anything. When the wan was held down:

  • no ifup anywhere (wan_back), and the watchdog's marker stays: data stays off on whichever card is in use, after a switch, a rollback (rolled_back) or a busy channel (nothing changed);
  • after the radio sequence the target is published, saved as the boot default and reported switched, with no wait for a bearer there cannot be (his choice, taken: the user chose the card; a second card with its connection off is kept by the boot check as well, mu300-sim2-warmup). It is not added to sim-data-seen: no data was seen on it;
  • switch <the card in use> saves it as the default without asking for data.

With mobile data on, nothing changes: the marker goes, ifup, the minute's wait, the way back without data.

Not taken from the same change. His wait_wan_down (after ifdown, up to 15 s until netifd's status says "up": false and not pending) before the radio sequence. netifd sets the interface to its teardown state inside the down call itself, and its status reports a tearing-down interface as "up": false, "pending": false already: the check passes at once and does not wait for the protocol's teardown. What it was for, the old card's teardown (mobile-data down, AT commands) running into the switch, is covered here by mu300-at's gate: while the switch holds its lock every AT client but the switch is told "busy" (§74). His per-SIM early lock replay after a switch and his unisoc_modem.main.data_sim storage belong to his per-SIM locks and his configuration layout; not taken.

Unit tests (tests/test_sim_hot.py, the netifd stub reporting "autostart": false until an ifup): a switch both ways with data off (no ifup, the marker kept, the default saved, nothing in sim-data-seen); a failed switch and a busy channel with data off (no ifup, the marker kept); the card in use saved without data; with data on the marker still goes and the target is dialled. The first three fail on the previous script.

Device checklist (before merge; U30 Air, openwrt-luci, live switching on and both cards in):

# data off: the panel's mobile data switch, or ifdown wan
ubus call network.interface.wan status | grep -E '"(up|autostart)"'   # false, false
ls /run/mu300-mobile-data-down                                   # there
mu300-sim switch 2; ubus call network.interface.wan status | grep -E '"(up|autostart)"'   # still false, false
ls /run/mu300-mobile-data-down; uci get network.wan.sim_slot     # still there; 1 (the boot default: SIM2)
sleep 70; ifconfig sipa_eth8 | grep inet                         # nothing: the watchdog did not dial
mu300-sim switch 1                                               # the same, back
# data on again (the panel or ifup wan): a switch dials the target and saves it once it has data, as before
mu300-sim switch 2; mu300-sim status                             # switched, wan up on sipa_eth8

Device test (2026-10-17, U30 Air, openwrt-luci v2026.10.16.1 with this mu300-sim-u30, live switching on, SIM1 with data, SIM2 registered emergency-only). Data off with ifdown wan: up false, autostart false, the marker there. switch 2: switched, active/default 2, wan still down, marker kept, sim_slot 1; 70 s later no address on either bearer and no redial in the log. switch 1: the same back (sim_slot 0), still nothing after 70 s. switch 1 with SIM1 in use and data off: switched, no bearer wait. Data on (ifup wan), switch 2: SIM2 has no data, so no_data, rolled back to SIM1, wan up again on SIM1 with a new address (unchanged behaviour). The case "data on, switch 2 dials SIM2" could not be run: SIM2 has no service here.

105. The U30 Air's battery capacity kept at a power-off, and the fuel gauge's user area always written

From kanoqwq's clean-tf-7.2 2af101f8 ("complete U30 Air power, LED and PD dock support"), his patch 0017 ("retain live soc before reset"), on top of the same 0006/0010/0011 as ours (his copies are byte for byte ours). Rewritten here as upstream/patches/0018-power-sc27xx-fuel-gauge-UMP9620-capacity-kept-at-power-off.patch; his code read, not run.

What it is about. The capacity a U30 Air boots with, under Linux or Android, is the one in the FGU's always-on user area (§33d). Since 0011 the driver writes it there whenever somebody reads the capacity and its whole percent has changed. Two gaps:

  • Nobody has to read it before a power-off. Here mu300-power reads it every 10 s (its loop), so the gap is at most a loop; without that daemon (stopped, or a power-off right after a change, which is when the low-battery power-off runs) the next boot starts from an older value. A .shutdown callback now reads the capacity once more under the driver's lock, writes it (0-100) and the boot mode "normal power-on" with it. Only on UMP9620 with a battery present: the F50 and the V50 have none (their FGU reports made-up values), SC2731 keeps mainline's behaviour, and a probe that never finished (no driver data) is skipped. A failure is a dev_warn, never a stop: a power-off must go on.
  • The user-area writes could be skipped. The area is written in three steps: CLEAR (the mask), SET (the value), CLEAR back to 0. regmap_update_bits() reads a register first and does not write when the bits already read back as wanted. What these two registers read back is not documented; kano found that a skipped step loses the value ("retained SET/CLEAR registers require unconditional writes even when their readback is unchanged"). The six writes of save_boot_mode() and save_last_cap() are now regmap_write_bits(), which always writes. The values are the same; each write was already followed by the datasheet's 200 us wait. Whether a skip ever happened on our boards is not known: nothing here measured the read-back.

Built for 7.2.10 in a copy of the mu300-mainline volume's tree (all of our patches, then this one; CONFIG_FUEL_GAUGE_SC27XX=y, W=1): no warning. The file is the same in our 6.18.56 tree, so the patch applies there too. Unit tests: tests/test_fgu_shutdown.py compiles the callback as the patch adds it against stubs of the driver's helpers: the capacity kept and clamped, the boot mode with it, nothing written after a failed read or a failed capacity write, the lock released on every path, nothing on SC2731, without a battery or without driver data; tests/test_static.py checks the patch's lines.

Device checklist (before merge; U30 Air, either system on a mainline kernel with this patch; an F50 for the negative):

cat /sys/class/power_supply/sc27xx-fgu/capacity          # note it, e.g. 63
dmesg | grep -i 'boot capacity'                          # this boot's start
# run on battery until the capacity has dropped a few percent, stop mu300-power (systemctl stop mu300-power /
# /etc/init.d/mu300-power stop), let it drop one more percent without reading it, then poweroff
# power on: dmesg 'boot capacity N % (saved 0x...)' with N the last value, not the one of the last read
reboot; dmesg | grep -i 'battery capacity not kept'     # nothing
# Android after Linux: the battery percentage matches what Linux last showed (within a percent)
# F50: poweroff and reboot as usual, nothing new in dmesg (no battery: the callback does nothing)

Device test (2026-10-17; 0018 on #256's 6.18.57 and 7.2.11 trees, Image rebuilt, the rest of the bundle as built). U30 Air, openwrt-luci, 6.18.57 + 0018: two boots and two reboots out of it, each reboot completed (the callback runs at a reboot too: .shutdown is called by device_shutdown() on both paths), boot capacity 80 % (saved 0x050) every boot, the same as the capacity read before each reboot, no warning or oops. The battery stayed at 80 % (Not charging on USB), so a capacity that changed without being read was not produced, and poweroff was not run: the U30 Air has a battery, so nothing here can switch it on again without a button. The low-battery power-off of mu300-power was not reached (not drained); it ends in the same poweroff path. F50-B (Ubuntu, no battery), 7.2.11 + 0018: boots, the fuel gauge's messages are the same as without 0018 (it reads boot capacity from the user area as before), the reboot completed with nothing new in the log. Android after Linux was not checked.

106. Wi-Fi (SC2355): a command the driver never sent returned success, and get_station handed on stack bytes

From kanoqwq's clean-tf-7.2 0e19fe32 ("fix Unisoc WPA3 hotspots"): among his firmware-SAE changes to sc2355/cmdevt.c are three return values in sc2355_send_cmd_recv_rsp(), which our driver (mainline module and the 5.4 vendor driver, the same code at this point) has as he found them. Taken in our words; his SAE part is not (below).

What it was. sc2355_send_cmd_recv_rsp() returned 0 without sending anything in three cases:

  • cmdevt_lock_cmd() refused the command lock: the driver is going away (SPRD_CMD_EXIT_VAL added to the count) or, with DRV_RESET_SELF, the CP has asserted. ret was still the API check's 0.
  • block_cmd_after_close: between the CLOSE of the last interface and the WCN power-off, every command but CLOSE.
  • change_iface_block_cmd: during an interface type change with one mode open, every command but CLOSE and OPEN.

The last two also left *rlen as the caller had set it (the size of its reply buffer), so the caller took its own buffer for the firmware's answer. sc2355_get_station() copies the reply into the station's signal, rates and failures whatever the return value, and sprd_cfg80211_get_station() reports them when the return is 0: the bytes of an uninitialised stack structure went to nl80211, whose GET_STATION any local user may ask (iw dev wlan0 link). A small leak of kernel stack in a narrow window (the hotspot stopping or changing mode, or the module unloading), but one. And every setting sent in those windows "succeeded" with the firmware never seeing it.

Changed (mainline upstream/modules/sprd_wlan_combo/sc2355/cmdevt.c, and the same as kernel/patches/wlan_combo-unsent-cmd-error.patch for 5.4): the refused lock returns -EIO, the two blocked windows -EBUSY with *rlen 0 (the API-check failure keeps its own value and message); get_station's reply structure starts zeroed, which also covers a reply shorter than the structure. Callers that only test for non-zero now see the failure: a userspace setting tried in those windows gets EBUSY instead of a silent no-op.

Not taken from 0e19fe32. The firmware-SAE bridge (driver: sae.h, SAE_OFFLOAD_AP, max_num_akm_suites = 3, a CMD_SET_SAE_PARAM status check; hostapd: unisoc_sae_import(), his patched wpad packages in every image). It imports the PMK from a vendor element (dd 34 40 45 da 04) at the end of the association IEs of NEW_STATION, which is the same design as our opt-in SAE work (docs/U30AIR-SAE.md, open PR #237) and has the same open question that docs/U30AIR-SAE-HANDOFF.md describes: that buffer carries client-controlled association IEs, and nothing shows that the element came from the firmware. His guard (one such element, at the end, or a cached PMKSA) is syntax, not provenance; a client that does PMKSA caching without a fresh firmware element and brings its own is the case to rule out. His build also turns the bridge on for every sae/psk-sae BSS on this driver, while ours is an opt-in. Left to that work; nothing of it here. Also not taken: his wpad replacement, the graphical installer (Tauri) and his desktop installer changes.

Built (2026-10-16, compared with the same build of main): the mainline module for 7.2.10 against the mu300-mainline volume's tree, 92 warnings before and after, none in the changed lines; the 5.4 driver: the thirteen wlan_combo-*.patch apply in the build's order on the pristine vendor driver, and every object compiles (the final ThinLTO link was not run: it needs a writable kernel output tree). Unit tests: tests/test_wifi_tx_path.py (WifiCommandNotSent) reads the source and the 5.4 patch.

Device checklist (before merge; F50 and U30 Air, 6.18, 7.2 and 5.4, the hotspot on):

dmesg -C
wifi down; wifi up   (OpenWrt)  /  systemctl restart mu300-hotspot  (Ubuntu)   # the hotspot comes back, clients rejoin
dmesg | grep -E 'need block cmd'               # the blocked commands, if any, as before
# while restarting the hotspot, ask for the station from another shell as a normal user:
while :; do iw dev wlan0 link; done            # no made-up signal/rates; errors are fine
# switch the Wi-Fi client mode on and off (the wifi-client command or LuCI), then the hotspot again: comes back
# the U30 Air's Wi-Fi key (2.4 <-> 5 GHz, off/on): every change takes effect
rmmod sprd_wlan_combo; modprobe sprd_wlan_combo (or reboot): Wi-Fi comes up, no oops

Device test (2026-10-17). The module of this branch, built against #256's 6.18.57 and 7.2.11 trees, and the 5.4 driver built by kernel/build-all.sh with the new patch (the build is reproducible: of its 187 modules only sprd_wlan_combo.ko differs from v2026.10.16.1's, so it went onto the released 5.4 as the only change). An unprivileged user (ubuntu; nobody on OpenWrt) ran iw dev wlan0 link and iw dev wlan0 station dump in a loop throughout.

F50-B Ubuntu 7.2.11 F50-B Ubuntu 5.4 U30 Air openwrt-luci 6.18.57
hotspot restarts systemctl restart mu300-hotspot x5: AP back in 21-22 s each (7.2.10 released: 21 s) x5: 8-9 s (released driver: 8-9 s) wifi down; wifi up x8: 3-6 s; band 2.4 -> 5 -> 2.4 -> 5 with mu300-wifi-band: takes effect (ch 6 / ch 36)
the user's loop 22902 rounds: Not connected. only 21872 rounds: the same 35965 rounds: the station's line, No such device while wlan0 was gone
module reload rmmod/modprobe under the loop: AP back the same rmmod, insmod of the released module, back to this one: the client rejoined each time
client mode scan mode on, reboot: station mode, scan lists networks; wifi-client disconnect: hotspot back - -
errors no need block cmd, no oops; iface_tx_timeout once per start, as with 7.2.10 iface_tx_timeout and its dev_watchdog WARNING, and the boot's add_uevent_var WARNING: both the same with the released module no oops, no warning

A station's figures on the U30 Air (one client): signal 0 dBm, tx bitrate (unknown), rx 650-780 MBit/s VHT with this module and with the released one alike (the access point side reports what the firmware gives; not this change). Not run: a station whose link the F50 reports in client mode (no network it may join here), iperf.

163. Linux 6.18.57 and 7.2.11 with every module the boards can use, KVM, and what Docker and dockur/windows-arm need

Versions. 7.2.11 (stable) and 6.18.57 (longterm), both of 2026-10-15. kernel.org's sha256sums.asc for v6.x and v7.x carry a good signature of the checksum autosigner (B886 8C80 BA62 A1FF FAF5 FDA9 632D 3A06 589D A6B1, fetched by WKD), and both tarballs match it (build.sh checks the sums; the signature was checked by hand). build.sh and build-modules.sh default to 6.18.57; the release workflow takes the newest of each series from kernel.org anyway. All 17 patches (patches/* and patches/6.18/0007) and every port/install.py edit apply unchanged to both trees: none is upstream yet, none was dropped or changed.

All modules (upstream/all-modules.py). Not allmodconfig. After the fragment, every option declared tristate in the tree that is off becomes m, olddefconfig, again until nothing changes (a fixpoint: a module whose dependencies are only now met comes in on the next round). The rules:

  • Bools stay as the fragment leaves them, except the ones all-modules.config turns on because they only open a family: the Wi-Fi vendors (USB sticks), joysticks, tablets, touch screens (the USB ones), TV/radio/SDR, ALSA's snd-aloop/snd-dummy, iSCSI, the legacy iptables/ebtables tables, /dev/hidraw; and it keeps DRM_FBDEV_EMULATION off (no framebuffer console). A bool that only became visible with a new driver takes its default, except that the ones that look like debugging or tests go off again (6-7 per kernel).
  • PCI cards are left out: the expansion runs once with PCI=n, and only what survives there is taken (the only PCIe link is the soldered Marlin3).
  • all-modules.exclude keeps out test/debug/benchmark code, ASoC, display panels, the SoC GPU drivers (panfrost and co. would bind next to the vendor Mali driver), VFIO (no mainline IOMMU driver for this SoC), legacy gadget drivers and the dummy UDC (mu300-usb takes the first UDC), and by directory the drivers of chips that only a board's device tree wires up (regulators, MFDs, power supplies, clocks, pins, PHYs, camera sensors, DSA switches, platform host controllers, MACs, NAND...). A keep line takes a USB part of such a directory back in (MMC_VUB300, TOUCHSCREEN_USB_COMPOSITE, LED triggers and the multicolor/flash LED classes HID drivers need). Tuners, demodulators and webcam sensors are still built when a USB driver selects them.
  • It stops the build when a built-in option changed, and when something it must not turn on came on. Both fired while the rules were written: MMC_BLOCK would have become a module (depends on RPMB || !RPMB - the eMMC driver), and BT_HCIUART the same through SERIAL_DEV_BUS/POWER_SEQUENCING; EXT4_USE_FOR_EXT2 would have gone with EXT2_FS, I3C_OR_I2C with I3C; PERF_EVENTS (kept off, 31p) came with CoreSight; IOMMU_DMA/OF_IOMMU and CMA/DMA_CMA (the DMA path of every vendor-tree device with an iommus property, and the vendor's shared-dma-pool regions as CMA) came with panfrost/etnaviv, IOMMU_API with VFIO. Each is excluded, with the reason, in all-modules.exclude.
  • check-dt-modules.py (in build-modules.sh) then fails the build when a module's of: alias matches a compatible of the vendor device tree (dt-compatibles.txt: all 314 strings of the F50's and the U30 Air's /proc/device-tree): udev would load it at boot and it would drive SoC hardware next to the vendor drivers. It caught spi_sprd (sprd,sc9860-spi). On the device, F50-B then still loaded sc27xx_vibra (it bound nothing): every Spreadtrum/Unisoc driver the fragment does not name is out now. Two rules were too broad and the device test showed it (ebtables and the Logitech HID drivers were missing); both are fixed.
  • make-bundle.sh checks the Image's embedded config against all-modules.report too (what the expansion added), as against the fragment. MU300_ALL_MODULES=0 builds the fragment alone.
6.18.56 (v2026.10.16.1) 6.18.57 7.2.10 (v2026.10.16.1) 7.2.11
options newly m / bools newly y 2358 / 197 2442 / 206
modules in the bundle 435 2946 442 3034
modules unpacked 28.5 MB 121.7 MB 30.1 MB 129.8 MB
mu300-kernel-*.tar.gz 20.3 MB 52.7 MB 21.0 MB 55.0 MB
Image as LK loads it (bytes) 23 996 424 24 655 880 24 750 088 25 606 152
generic ramdisk segment (bytes) 1 833 133 1 833 152 1 834 504 1 834 499
build tree (out-*) 2.8 GB 6.7 GB 2.9 GB 6.9 GB

The boot image grows only by the Image (+0.66 and +0.86 MB): the generic ramdisk still loads only module-order.txt. The Image grows by what the new drivers select into the core (netpoll for netconsole, devlink, DPLL, quota, hidraw, I2C slave, CRC/crypto library code). Docker's contrib/check-config.sh: the fragment alone missed ten "generally necessary" options (the legacy iptable_*/ip6table_* tables, IP_NF_NAT, MASQUERADE...), both new configs miss none; the optional misses are CGROUP_PERF (needs PERF_EVENTS, kept off), SELinux/AppArmor (not built) and ZFS.

One bundle, no separate extra. The whole set stays in mu300-kernel-<series>.tar.gz. Its size is far below GitHub's 2 GB per asset (the largest Magisk zip, Ubuntu 26.04 with 7.2, goes from 134 MB to about 168 MB). A split would put one module set into two packages whose dependencies cross (the HID drivers need the multicolor LED class, the netfilter targets their cores) and which depmod and kmodloader must see together, and an installer would have to decide which half a device gets. On the device the cost is disk: about 100 MB more per installed mainline kernel and system (Ubuntu 135 MiB under extra/, OpenWrt 125 MiB flat), plus the previous set mu300-update keeps for rollback-boot. The OpenWrt images carry the 6.18 set as before (build-rootfs.sh), so they grow by the same ~96 MiB unpacked (~33 MB in the tarball). Plain OpenWrt in an 804 MiB region (F50-C, 613 MiB free in section 85) keeps about 517 MiB free, and about 270 MiB after a kernel switch (the new set and the kept previous one). A copy that does not fit fails safe: kernel_modules_into_systems returns an error, mu300-update puts the previous modules back and leaves the boot image unchanged.

KVM. The firmware starts every CPU at EL2 on both boards, and both new kernels run KVM in VHE mode (F50-B, 7.2.11; 6.18.57 the same with 568/664 trap handlers):

CPU: All CPU(s) started at EL2
kvm [1]: IPA Size Limit: 40 bits
kvm [1]: GICv3: no GICV resource entry
kvm [1]: disabling GICv2 emulation
kvm [1]: GIC system register CPU interface enabled
kvm [1]: VHE mode initialized successfully

A guest ran: Alpine 3.22's aarch64 vmlinuz-virt + initramfs-virt (6.12.110) under qemu-system-aarch64 -machine virt,accel=kvm,gic-version=3 -cpu host -smp 2 -m 256, pinned to the A76 cores 4-7 (-cpu host needs one core type; the A55/A76 mix is why), QEMU 11.1 from the dockur image, on 7.2.10, 7.2.11 and 6.18.57 alike: the guest logs Booting Linux on physical CPU 0x0000000000 [0x414fd0b0] (an A76), smccc: KVM: hypervisor services detected and reaches Alpine's initramfs shell. The U30 Air logs the same EL2/VHE lines on both kernels (it has no QEMU).

Docker and dockur/windows-arm (on F50-B with Docker 29.1.3 from Ubuntu's archive, installed from .debs and removed again). What the container needs from the host: /dev/kvm (writable), /dev/net/tun, NET_ADMIN, a bridge and a tap for its NAT mode, iptables (nft or legacy) with nat (DNAT, MASQUERADE) and mangle, /dev/vhost-net and macvtap for its DHCP mode, passt as the fallback. docker compose up with its compose.yml (image dockurr/windows-arm, loaded from docker save, restart off):

7.2.10 (released) 7.2.11 (this config)
docker compose up fails: Unable to enable DNAT rule ... Extension DNAT revision 0 not supported, missing kernel module? (no xt_nat) starts, ports published
dockur's network stage Failed to configure IP tables -> "falling back to user-mode networking" (passt) Mode: NAT (bridge docker, tap qemu, DNAT/MASQUERADE rules in place)
its KVM check, info kvm in its QEMU passes, kvm support: enabled the same
its RAM check Windows 11 requires at least 2.0 GB of RAM, but only 668 MB can be allocated. the same (580 MB)

The kernel side is complete now, and the board is not: 1.4 GB of RAM cannot hold Windows 11 (2 GB minimum). With RAM_CHECK=N the container goes on to download Windows, which F50-B (no internet) could not; nothing past that was tried. Small Linux guests run.

Device tests (2026-10-16, bundles installed with MU300_KERNEL_BUNDLE=... MU300_RELEASE=v2026.10.16.1 mu300-update kernel <series>; each board then went back to its released kernel, with the v2026.10.27 boot image as its previous one again, as before):

  • F50-B, Ubuntu 24.04, 7.2.11 (twice: before and after the last exclusions) and 6.18.57: boots, kernel 5.3 s, userspace 34 s, no oops or warning, no failed unit; the 5 GHz access point, Bluetooth, USB network, the mobile bearer (an address and an IPv6 prefix; this carrier passes no traffic without a VPN, and the released 7.2.10 did the same in the same minute), cpufreq and thermal. udev loads drm (systemd's modprobe@drm) and our extra-modules loads snd-aloop, which exists now. modprobe of 109 names across the classes (iptables tables, ebtables, SCTP, TIPC, batman-adv, Open vSwitch, USB serial/net/storage, btrfs/jfs/nilfs2/erofs/ gfs2/ocfs2/ceph/xfs, dm-raid/dm-vdo/bcache/drbd, NVMe-TCP, iSCSI, btusb, rtw88/rtw89/mt7921u/carl9170/ath9k_htc/ rt2800usb/brcmfmac, uvcvideo, em28xx, DVB, snd-usb-audio, HID, xpad, wacom, i2c-tiny-usb, gs_usb, NFC, vhost_net, macvtap...): 94 load, 10 are built in, 5 are not modules by design (reiserfs is gone since 6.13, iio_dummy and VFIO excluded, two names of the list were wrong: hid-cp2112, can-j1939); 252 modules loaded at once, no oops.
  • U30 Air, openwrt-luci, 6.18.57 and 7.2.11: boots in under a minute with the owner's VPN profile (sing-box, kill switch on) back up and its exit IP answering, the access point, the charger and fuel gauge (80 %), the LEDs, mobile data under the VPN; KVM in VHE mode. kmodloader handles 3010 modules: one modprobe takes 0.1 s, the 109-name sample 10.8 s, no oops, the VPN up throughout. At boot it loads 114 modules (100 before): the /etc/modules.d lists of the OpenWrt kmod packages name the legacy iptable_filter/iptable_mangle, ipt_REJECT and some xt_ targets, which exist now; such a table is only set up when iptables-legacy uses it. The VPN configuration is byte-for-byte what it was (checksums compared after the restore).

(The device runs above were made with the set before the review below; the review took modules out on each kernel: 64 of 6.18.57, 43 of 7.2.11 - the dead protocol families - and changed nothing else.)

On-demand loading: the answer to three security reviews of #256. With the whole set installed, every module is one any user can have loaded: the kernel runs its module helper (sysctl kernel.modprobe) as root whenever code asks for something a module provides - a socket family (net-pf-29), a sock_diag or genetlink handler, a link kind (rtnl-link-lowpan), a filesystem (fs-hfs; a mount attempt in a user namespace is enough), a line discipline. Rarely used protocols have been the way in for many local root holes. What changed:

  • Not built at all (all-modules.exclude, with reasons): the n_gsm and n_hdlc line disciplines, ATM (and the DSL modems on it), ISDN, AX.25/NET/ROM/ROSE and the amateur-radio drivers (the HAMRADIO switch of the first version is gone), X.25/LAPB and the WAN cards, AppleTalk, Phonet, RDS, CAIF, KCM, SMC, QRTR, AF_RXRPC with the AFS client, DCCP, LLC type 2 (AF_LLC; the bridge's llc is built in), the parallel port and HSI: 64 modules fewer on 6.18.57, 43 on 7.2.11. GAMEPORT stays (sound and joystick drivers select it; no user can reach it). tests/test_all_modules.py checks both builds' module lists for every one of them.
  • Built, but never loaded on demand: 85 modules listed by name in /opt/mu300/lib/autoload-blocked - TIPC, SCTP, CAN (can, can_raw, can_bcm, can_gw, can_isotp, can_j1939; can_dev for USB CAN adapters stays), NFC and its drivers, AF_VSOCK and its transports (with vhost_vsock, which depends on vsock: root loads it before a VM that wants it), IEEE 802.15.4/6LoWPAN and its radios, every line-discipline module that is built (slcan, can327, slip, ppp_synctty, pps_ldisc, nci_uart; a test checks the build's tty-ldisc-* aliases against the list), and old filesystems (adfs, affs, befs, bfs, ceph, coda, cramfs, efs, freevxfs, gfs2 with gfs2meta, hfs, hpfs, jfs, minix, nilfs2, ocfs2, omfs, orangefs, qnx4/6, romfs, ufs; sysv left upstream in 6.15). Kept loadable on purpose: l2tp_* (L2TP VPNs; OpenWrt carries xl2tpd).
  • /opt/mu300/bin/mu300-modprobe-guard becomes the kernel's helper at boot (mu300-modprobe-guard.service in sysinit.target on Ubuntu, OpenWrt's mu300-hw). It refuses by MODULE, not by request string: the first review showed that matching request strings is bypassable (one module answers to its name, -/_ spellings, several socket aliases, genetlink and rtnl-link aliases, a filesystem's names). The guard makes a table of every listed module's names and aliases - the alias= strings of the module file itself, normalized as modprobe does (- = _ outside [...]) - and refuses a request that matches any of them with modprobe's own glob rules, with a line in the kernel log; everything else goes to /sbin/modprobe unchanged. The list holds every module that depends on a listed one (checked against the build), and where depmod's modules.dep is there (Ubuntu) the table takes in every module whose dependencies reach a listed one besides, so no request reaches them through a dependency. That is not academic: upstream TIPC has no net-pf-30 alias at all, socket(AF_TIPC) never loads it; the way to it is tipc_diag, which pulls tipc in. Root loads a refused module with modprobe NAME (that runs /sbin/modprobe itself), and touch /etc/mu300/autoload-allow-all keeps the guard off.
  • The table is made once per boot and kernel in /run/mu300-modprobe-guard (root's, mode 700) before the guard takes over, never inside a request: OpenWrt's modinfo reads all 3000 modules on every call, and a first version that asked it for each listed module took 7.2 s inside the first request of the boot (on that boot the U30 Air's mobile downlink stayed dead, which could not be pinned on it, and has not recurred since). Reading the strings from the files takes 2.0 s, at boot, in the background. A table gone stale (the running kernel's modules reinstalled) is made again on the spot (a table that cannot be made again leaves the one there was). A request for an alias of a module that is not installed is handed on: modprobe finds nothing for it either. Without any table (the cache directory not root's own) the guard fails closed for the kinds of request the list is about - net-pf-* (socket, diag and genetlink families), fs-*, tty-ldisc-*, rtnl-* - with (no alias table) in the log, and checks the other requests against the names.
  • make-bundle.sh runs check-autoload-blocked.py against the build: every module depending on a listed one must be listed, the real guard script (under sh) must refuse every alias and both spellings of the name of every listed module (304 requests on 7.2.11) without calling modprobe, and must hand on the names and aliases of the modules the systems load every day (nft, wireguard, overlay, usb-storage, vfat, tun, bridge, veth, br_netfilter, xt_*, kvm, vhost_net, l2tp, macvtap, can_dev...: 84 requests). tests/test_all_modules.py runs the same check on a sample of the 7.2.11 build (every socket/diag/genetlink, filesystem, line-discipline and link-kind alias of it) under sh, busybox sh and dash, and also every request the first, request-string list refused (net-pf-29/30/36/ 39/40, SCTP's, the genetlink families, rtnl-family-29, each fs-*): refused, or answered by no module of the build at all.
  • dev.tty.ldisc_autoload = 0 (etc/sysctl.d/98-mu300-modules.conf): line disciplines load on demand for root only. Both mainline kernels have it 0 already (LDISC_AUTOLOAD is not set); the file makes it so on 5.4 too.

Measured on both boards (2026-10-16): F50-B Ubuntu 24.04 with 7.2.11, the U30 Air openwrt-luci with 6.18.57, the guard, its unit or hook and the sysctl file put in by hand. A static test program drops to uid/gid 65534 before it opens its sockets:

Ubuntu, 7.2.11 OpenWrt, 6.18.57
the guard at boot the kernel's helper; 77 modules not loaded on demand, 203 names and aliases (unit active; boot 5.3 s + 34.7 s, as before) the same line (from mu300-hw)
nobody: AF_TIPC, AF_CAN, SCTP, AF_NFC, AF_IEEE802154, AF_RDS all refused, nothing loaded the same
root: ip link add ... type lowpan, mount -t hfs rtnl-link-lowpan (ieee802154_6lowpan) refused, fs-hfs (hfs) refused the same
nobody in its own user and net namespace: ip link add ... type lowpan refused, nothing loaded (no setpriv)
root: modprobe tipc can-raw sctp loaded, the sockets open the same
on demand through the guard vcan, wireguard, vxlan, geneve, gretap, l2tp (ip l2tp add tunnel); Docker with dockur: NAT networking, compose up and down, a KVM guest vcan; the owner's VPN (sing-box, kill switch) up with its exit IP over flowing mobile data, two boots

The third review found that the module-name list had dropped AF_VSOCK, freevxfs and gfs2meta of the first list (gfs2meta is an alias of gfs2, so it was covered); the vsock family and freevxfs are back, LLC2 is out of the build, the dependants come from modules.dep too, and the fallback fails closed. The device runs in the table were made before that; the changed guard was run on the U30 Air's busybox by hand (l2tp_ppp handed on, net-pf-40 refused, its table made in 0.12 s on 6.18.56, which has few of the listed modules).

The kernel log names the module: mu300: on-demand loading of net-pf-29 (can) refused (root: modprobe can; FINDINGS 163). In a control run of the first version, with the system's modprobe as the helper, nobody did load nfc, ieee802154 and ieee802154_socket by opening sockets. No oops in any of these runs.

User namespaces (read, not changed): unprivileged user namespaces are open on both systems (unshare -Ur works for ubuntu on F50-B; user.max_user_namespaces = 7949). The mainline kernels have no AppArmor, so Ubuntu 24.04's kernel.apparmor_restrict_unprivileged_userns does not exist here, and there is no Debian-style unprivileged_userns_clone. kernel.unprivileged_bpf_disabled = 2 on both. That is why the filesystem aliases are in the list: inside a user namespace an ordinary user gets as far as the kernel's request for fs-<type>. Docker and dockur run as root and need none of this.

Not done: no ZTE V50 to read its compatibles from (dt-compatibles.txt has the F50's and the U30 Air's); no release was built or tagged; the boards ran the bundles built here, the CI workflows build the kernels.

The third review's guard on the boards (2026-10-17), the same bundles, the guard, list, sysctl file and unit (or mu300-hw's line) of this branch. F50-B Ubuntu 7.2.11 and 6.18.57, U30 Air openwrt-luci 6.18.57:

  • The guard is the helper from boot (/proc/sys/kernel/modprobe), its table 219 names and aliases of 85 modules (Ubuntu's modules.dep adds no module outside the list: the list is closed). Making it: 1.0-1.2 s in sysinit.target on F50-B (boot 39.7 s on 7.2.11, 40.2 s on 6.18.57, 39.7 s on 7.2.10 before), 2.05 s in the background on the U30 Air. One request through it: 0.11 s against kmodloader's 0.10 s.
  • As nobody (a static probe): sockets of AF_TIPC, AF_CAN raw/bcm, SCTP, AF_NFC, AF_IEEE802154, AF_VSOCK and AF_RDS, sock_diag dumps of TIPC and VSOCK, and generic netlink lookups of TIPCv2, nfc, nl802154: all refused, nothing loaded; wireguard's genl family still found. On Ubuntu, in an unprivileged user+mount+net namespace: mount -t hfs and ip link add type lowpan refused, type vcan and type wireguard work.
  • Root's mount -t hfs|vxfs|freevxfs refused; through the guard as the kernel calls it, refused: tipc, tipc-diag, net-pf-16-proto-4-type-30 (tipc_diag), -type-40 (vsock_diag), -type-2-132 (sctp_diag), net-pf-16-proto-16-family-TIPCv2|nfc, net-pf-29, net-pf-40, rtnl-link-lowpan, fs-hfs, fs-vxfs, fs-gfs2meta, tty-ldisc-17, and the dependants vhost_vsock and vsock-loopback; the kernel log names each. Root's modprobe tipc sctp can-raw vsock loads them.
  • Everyday on-demand loads still work: vxlan, geneve, ip_gre (gretap), l2tp_netlink (ip l2tp), vcan load; wireguard, veth, bridge, tun, overlay, vfat, nf_tables and usb-storage are built in on both kernels.
  • Without a table (the table moved away, the cache directory given to nobody): net-pf-*, fs-*, rtnl-*, tty-ldisc-* refused with (no alias table), the listed names refused, nf_tables, usb-storage, crypto-sha256, l2tp_ppp handed on. The log's hint said root: modprobe no alias table; it names the request now (tests/test_all_modules.py).
  • KVM: VHE mode initialized successfully on both kernels on F50-B and on the U30 Air. No oops on any board.
  • U30 Air: the owner's VPN (sing-box, kill switch on) up after two boots of 6.18.57 with the exit IP answering and HTTPS through the tunnel over mobile data. On a third boot of 6.18.57 (with 0018 of #261, and the dual-SIM live switching turned on for #260's test) the mobile downlink stayed dead: sipa_eth0 received 0 bytes while sending, and an ifdown/ifup wan did not bring it back. The released 6.18.56 with live switching on had a working downlink the boot after; one occurrence in four U30 Air boots of 6.18.57 here (and one in the earlier runs above), not pinned on anything yet. The reboot soak below found no regression.
  • mount -o loop of a fresh image fails with "already mounted or mount point busy" on Ubuntu with 7.2.11, 6.18.57 and the released 7.2.10 alike (losetup -f then mount works): util-linux's, not this kernel's.

The mobile downlink across reboots (2026-10-17). Is the dead downlink above 6.18.57's? A reboot soak, each boot measured the same way: wait for an IPv4 address on sipa_eth0 and a first HTTPS answer, then a 10 MB HTTPS download (speed.cloudflare.com), its bytes counted on sipa_eth0; the ipa/sipa/modem lines of the kernel log and /proc/net/dev kept per boot. A boot passes when the download finishes and sipa_eth0 received more than 10 MB.

  • F50-C, plain OpenWrt v2026.10.16.1, its data SIM (no VPN needed there), Linux made the default boot for the run and Android again after it, soft reboots only below 55 C (the hottest zone never passed 44 C). The same bundles as on the U30 Air (pr256-6.18.tar.gz sha256 e0ba980f..., the released rel-6.18.tar.gz d83c4d3d...), 6.18.57 with this branch's guard, list, sysctl file and mu300-hw line, as mu300-update kernel 6.18 installs them.

    Kernel Boots Downlink working Address / first answer after boot 10 MB download sipa_eth0 RX errors, drops
    6.18.56 (released) 12 12 33-34 s / 34 s 3-50 s (median 43 s) 0, 0
    6.18.57 (this branch) 12 12 33-35 s / 33-36 s 2-43 s (median 13 s) 0, 0

    The kernel log's sipa lines are the same on both, every boot: sipa_eth: fail to send, ret -115, the delegate's dts parsing failed / get resource failed for remote-base! and don't have this flow ctrl err type, one each; no oops, no warning. The download times follow the carrier, not the kernel (the 6.18.56 runs came first). A final boot of the restored 6.18.56 passed too.

  • U30 Air, openwrt-luci, the owner's VPN (sing-box, kill switch on): an earlier soak of the same 6.18.57 bundle, stopped at its ninth reboot for the owner. All 8 measured boots passed: address at 35-36 s, the tunnel at 43-50 s, 10 MB through it in 1-11 s, sipa_eth0 RX 10.42-10.45 MB each, the same four sipa lines, no oops.

20 of 20 boots of 6.18.57 with a working downlink against 12 of 12 of 6.18.56: no regression measurable at this rate. The one dead downlink on the U30 Air came with 0018 of #261 and the dual-SIM live switching turned on for #260, which none of these boots had. A failure that rare cannot be pinned on a kernel without a reproducer: the 6.18.56 to 6.18.57 upstream changes were not bisected. If it comes back, the boot's /proc/net/dev, the sipa lines and whether live switching ran are what to keep.

The mainline workflow at this branch's head (gh workflow run mainline.yml -f kv=...): 7.2.11 run 38969488015 and 6.18.57 run 38969491239 passed; after the build the runner (ubuntu-24.04-arm) had 99 GB free on / (145 GB), the volume held 8.7 GB (7.2.11) and 8.3 GB (6.18.57). The release job builds both into one volume, about 17 GB beside the 5.4 build: no cleanup is needed. Both workflows print df and the volume's size after the kernels now.

170. "Failed to send request: Operation not permitted" behind the VPN's kill switch

A report from the owner's U30 Air (openwrt-luci v2026.10.16.1, a sing-box profile, the kill switch on): mu300-extra install vpn-dae printed Failed to send request: Operation not permitted four times, then cannot download SHA256SUMS of the VPN module and the VPN module could not be downloaded (is the device online? ...). After mu300-vpn killswitch off (which restarts the VPN) the same command downloaded the tarball.

What the message means. uclient-fetch (OpenWrt's wget) prints Failed to send request: %s with strerror(rc), where rc is uclient's own error code, not an errno: UCLIENT_ERROR_CONNECT is 1, and strerror(1) is "Operation not permitted". So the line says only "no connection could be made" - a name that did not resolve, a refused or dropped connect, a timeout - never anything about permissions. The four lines are fetch_stdout's four tries.

Reproduced in an OpenWrt 25.12 container (the real uclient-fetch and busybox) with the uplink renamed sipa_eth0, mu300-vpn's kill switch ruleset, sing-box 1.14.1 with the TUN config gen_singbox writes (auto_route, strict_route, default_mark 0x2d0) and a shadowsocks server in a second container, running v2026.10.16.1's own mu300-extra and mu300-update:

the router's own traffic (ip route get 140.82.121.3) kill switch drops result
tunnel up dev sbtun, table 2022 (sing-box's rules 9000-9010: from 0.0.0.0 iif lo lookup 2022) 0 downloaded through the tunnel and installed in 4 s
tunnel down dev sipa_eth0 (main) 40 packets the report's output, line for line, after 253 s

So the device's own traffic does go through the tunnel when it is up - for sing-box by its auto_route, for xray, mihomo, WireGuard, OpenVPN and dae by the core's routes_up (rule 9010 sends everything unmarked to table 2022, the device's own packets included) - and the kill switch drops it, as it promises, when the tunnel is down. Nothing in mu300-extra install or mu300-vpn engine install stops the tunnel: the download is made with the engine that is running, and the new engine is unpacked beside it. The report's "four failures, then success after killswitch off" is a tunnel that was not carrying traffic at that moment and came back with the restart that killswitch off does (killswitch_cmd: svc restart); a restart with the kill switch left on would have done the same. With the kill switch off, a first try made while the restarted engine was not up yet failed once and the retry went through.

Changed (mu300-update, used by mu300-extra): vpn_ks_blocks - the kill switch's table inet mu300_vpn is there (and is not mu300-vpn's own download window, which has the fetch4 set) and ip route get sends this device's traffic to sipa_eth* or the Wi-Fi client, or nowhere. Then the failure says blocked by the VPN kill switch: the VPN is on and its tunnel is not up, and nothing leaves this device outside it - see mu300-vpn status, and try again once the tunnel is up; offline: mu300-extra install NAME --from DIR instead of "is the device online?", for the VPN module, the other extras and mu300-update check/apply/kernel/boot; and fetch_stdout stops after the first try (one minute instead of four: the kill switch drops the next three the same way). Nothing is let through: no exemption for downloads, the LAN untouched.

dae before the download. mu300-extra install vpn-dae now checks the running kernel first, as the module's dae_kernel_ok does (5.17 or newer, /sys/kernel/btf/vmlinux): on the 5.4 vendor kernel it refuses before 17 MB are fetched and 56 MB unpacked (MU300_DAE_ANY_KERNEL=1 for a kernel the device is about to boot). The mainline kernels of v2026.10.16.1 (6.18.56, 7.2.10) have BTF and the BPF JIT (upstream/mu300-mainline.config, 31p). The v2.0.3 vpn-dae tarball installs with v2026.10.16.1's mu300-extra both online (tunnel up) and with --from.

Open: why the U30's tunnel was not carrying traffic at that moment, and why the owner's later try ended in "vpn-dae was not installed" after the download completed: the device itself could not be examined for this entry.

174. The dashboard showed IMEI and IMSI as null for hours: a partial identity read was cached for 6 h

Seen on the U30 Air (2026-10-17): the dashboard's IMEI and IMSI were -- for hours after a boot. The collector (openwrt/luci-app-mu300/root/usr/libexec/unisoc-modem/cell) keeps the module and SIM identity in a 6 h cache on flash (/etc/unisoc-modem/sim.json, sim-slot1.json for the U30 Air's second slot) and wrote it whenever any of IMEI, IMSI and ICCID had been read. On a boot round where the modem was not ready yet, AT+CGSN and AT+CIMI ran into their 2 s timeout while AT+CCID answered, so "imei":null,"imsi":null was cached and served for the next 6 hours.

The fix. Only a complete identity (IMEI, IMSI and ICCID all read) goes on flash. A partial read is shown for that round and kept in the runtime directory (/var/run/unisoc-modem/sim.json.partial) for 60 s, then asked again; it never replaces a complete cache (an expired complete one is shown meanwhile and stays). A cache without them that an earlier version wrote is read again on the next full round. No SIM, or a SIM still waiting for its PIN, is the same partial case: re-read once a minute on full rounds (six short commands), so a SIM that becomes ready shows within a minute instead of after 6 h. The answers are parsed strictly now: the value is a line of its own after an optional +CGSN:-like prefix, and an error line is none (with tr -cd '0-9', +CME ERROR: 10 was IMEI "10").

ICCIDs with letters. tr -cd '0-9' | cut -c1-20 dropped the A-F that some eSIM profiles and operators have in the ICCID. It is 18 to 22 hex nibbles now, upper case; the F that pads a 19-digit ICCID to 20 nibbles is dropped as before. The panel (home.js paintIdent) masks any string the same way (first 4, last 3), so it needed no change; a test covers a hex one.

Device test (U30 Air, OpenWrt, 2026-10-17), the changed cell copied over the released one; identifiers masked in every output. With an MU300_AT wrapper failing AT+CGSN and separate run/cache directories: round 1 showed imei:null with IMSI and ICCID, wrote no sim.json, wrote the partial; round 2 within the minute asked no AT+CGSN; with the partial aged 61 s and the wrapper passing, round 3 filled the IMEI, wrote a complete sim.json and removed the partial; with that cache aged 7 h and AT+CGSN failing again, the cache stayed byte for byte and the IMEI was still shown. The live path: sim.json removed, one normal full round wrote a complete one, and ubus call mu300dash status (what the dashboard reads) carried IMEI, IMSI and ICCID.

175. The U30 Air's firmware SAE offload is disabled in every layer

Status: current (unit tests, tests/test_wpa2_only.py; the driver built for the mainline kernels by the mainline workflow and, for 5.4, every wlan_combo-*.patch applied with --fuzz=0 in the build's order on the pristine vendor tree and common/report.o, sc2355/vendor.o compiled without a warning (the module is not linked there: ThinLTO wants to write next to the kernel's objects); the wifi-scripts patch run on the OpenWrt 25.12.5 feed's scripts; not yet run on a device, the checklist is below).

Why. §80's open point: the firmware's dd 34 40:45:da:04 <PMK><PMKID> record and the client's association request elements share one element list with nothing between them, so whether a client can choose the PMK hostapd imports depends on the firmware always appending its own record - which nobody can show for a closed blob, and the driver has no SAE-completion signal to check it against. The owner's decision (2026-10-17): no opt-in that might be an authentication bypass; WPA2-PSK only, on the F50, the U30 Air and the V50 (one chip, one driver).

What changed.

  • Driver (upstream/modules/sprd_wlan_combo, and kernel/patches/wlan_combo-softap-no-sae.patch for 5.4, the same code): sprd_report_softap() (common/report.c) runs the station's element list through mu300_strip_sae_pmk_record() before cfg80211_new_sta(): every vendor element starting 40:45:da:04 goes, whoever wrote it and whatever its length, and so does a malformed tail (an element longer than what is left, which no parser takes apart); the list is compacted in place, the rest kept in order; one rate-limited line says a record was dropped, without its bytes. vendor_set_sae_password() (sc2355/vendor.c, vendor subcommand 43) returns -EOPNOTSUPP first thing: the firmware is never given an SAE password. A hostapd built by hand from the old patch finds no record to import.
  • hostapd: openwrt/patches/hostapd/990-u30-sae-offload.patch and openwrt/build-u30-sae.sh removed; the images install the stock wpad-basic-mbedtls; openwrt/build-rootfs.sh stops on MU300_SAE_APK_DIR with a line instead of ignoring it.
  • wifi-scripts (openwrt/patches/wifi-scripts-wpa2-only.patch, after the DFS patch, whose log import it uses; the build checks it is in): in hostapd.setup() an access point whose encryption is sae, psk3, sae-mixed, psk3-mixed or sae-compat (with any +cipher), or whose hostapd_bss_options carries u30_sae_offload, is left out of the hostapd configuration with wifi-scripts: <section>: encryption '<value>' refused: WPA3/SAE is disabled on this Wi-Fi chip ... WPA2-PSK only. The others on the radio start; an SAE access point never starts, so never open. Run on the 25.12.5 feed's scripts for a fake wiphy: psk2 and psk2+ccmp give wpa_key_mgmt=WPA-PSK, wpa_pairwise=CCMP; the five SAE modes and the option give the line and no interface= block.
  • Boot (mu300-hw, before its wifi down; wifi up): openwrt-wifi-sae-guard (precheck, and verify in mu300-post) replaced by openwrt-wifi-wpa2-only migrate. Every access point (mode ap or none) on one of those modes or with the option becomes psk2+ccmp with the same key; ieee80211w, sae_pwe and the option go; the file as it was is kept once in /etc/mu300/wireless.before-wpa2 (mode 600). The password must be one WPA2 takes (8-63 printable ASCII, or 64 hex digits); otherwise, or when uci does not show psk2+ccmp afterwards, that access point gets disabled=1 (and psk2+ccmp) - off, never open. One line to the log (mu300-wifi, daemon.warn; daemon.err when an access point is off), and /etc/mu300/wpa3-disabled (state=migrated|down, the time, the sections; no password). A station-mode interface and a WPA2 hotspot are not touched, and a second boot does nothing.
  • The notice: view/status/include/05_mu300_wpa2.js (in both OpenWrt systems; Status > Overview) and the control panel's home page, which loads the same module, show that file in English, Turkish or Chinese by the page's language (the module carries its own text: the plain image has no panel catalog; other languages get English), amber when migrated, red when an access point is off, with a Dismiss button that removes the file (rpcd ACL mu300-wpa2-notice: that one file, read and remove).
  • mu300-api / web device manager: WPA3 was never offered. A save on a hotspot still on SAE (a hand edit after boot) also makes it psk2+ccmp and restarts Wi-Fi fully; without a password it has or one given, the save is refused (missing password). The manager's text says the mode is disabled and why (en/tr/zh).
  • Ubuntu: the hotspot was always WPA2-PSK (hotspot-start). An ENCRYPTION, SECURITY or KEY_MGMT in hotspot.conf asking for SAE/WPA3 is refused with one line; the hotspot starts WPA2-PSK (CCMP).
  • Kept: the driver's removals of the passphrase, station-key and payload prints (§80), worth having without the mode.

Device checklist (U30 Air first, then an F50; before merge).

  1. A U30 Air with the offload on (encryption sae, u30_sae_offload=1, r9 wpad) updated to an image with this change: after the boot the hotspot is up as WPA2 (ubus call hostapd.wlan0 get_status: ENABLED; the generated /var/run/hostapd-phy0.conf has wpa_key_mgmt=WPA-PSK, wpa_pairwise=CCMP, no sae), logread -e mu300-wifi has the one line, /etc/mu300/wireless.before-wpa2 is the old file (mode 600).
  2. A client joins with the same password, gets DHCP and reaches the internet.
  3. LuCI Status > Overview and the panel's home show the notice (English, then Turkish and Chinese); Dismiss removes /etc/mu300/wpa3-disabled and the notice stays gone after a reload and a reboot.
  4. Setting WPA3 in LuCI and saving: that access point does not come up (LuCI's apply rolls back if it was the way in), logread has the wifi-scripts line; the next boot migrates it again.
  5. dmesg: no oops on join/leave; with the old r9 wpad hand-installed, a WPA3 client cannot complete the handshake (no record reaches hostapd: sprd_wlan: ...: a firmware PMK record ... dropped if the firmware sent one).
  6. The owner's VPN (cengiz-abi) untouched: its configuration and state as before the update, the tunnel up.

On the U30 Air (2026-10-17, OpenWrt 25.12.5, 6.18.57 with this driver, the files of this change copied over a v2026.10.17.1 system; the stock wpad-basic-mbedtls, so not item 1's r9 wpad). encryption sae + ieee80211w 2 and wifi: the wifi-scripts line (wifi-scripts: 01: encryption 'sae' refused: ... This access point is not started.), hostapd.wlan0 not there, no AP - not open. openwrt-wifi-wpa2-only migrate: psk2+ccmp, ieee80211w gone, /etc/mu300/wireless.before-wpa2 mode 600 with the old sae, the notice file (state=migrated, migrated=ap0); wifi: ENABLED, /var/run/hostapd-phy0.conf wpa_key_mgmt=WPA-PSK, wpa_pairwise=CCMP, no sae; the Mac joined again with the same password. A second migrate does nothing. The notice on Status > Overview (amber, English) and on the panel's home; Dismiss removed the file. sae-mixed by hand, then mu300-api wifi.set with the same SSID: security was wpa2-wpa3 before, psk2+ccmp after, the AP ENABLED, the client back. A deauth and rejoin of the client: no oops, no warning. The owner's VPN stayed up throughout. Not done: items 1 and 5's r9 wpad (not built), Turkish and Chinese notice text, an F50.

Status: current (unit tests: tests/test_device_scripts.py MobileData (dl_watch and the tests after it) and VpnUplink; measured on the U30 Air, openwrt-luci v2026.10.17.1, kernels 6.18.57 and 6.18.56, the owner's sing-box profile with the kill switch on, about 60 reboots).

What was seen. A boot of the owner's U30 Air came up with mobile data configured and nothing coming back: sipa_eth0 received 988 bytes (7 packets) in six minutes while sending 206 packets (40 TX errors); ifdown/ifup wan did not help, a reboot did. mobile-data watch was running and did nothing.

How often. A reboot soak (each boot: the address on sipa_eth0, the first HTTPS answer through the tunnel, a 10 MB download through it, sipa_eth0's counters, the kernel's ipa/sipa/modem lines; on a dead boot also the modem's AT+CFUN?, +CEREG?, +CGATT?, +CGACT?, +CGPADDR, +CGCONTRDP, and /sys/kernel/debug/sipa):

Kernel Boots Dead
6.18.57 (v2026.10.17.1) 15 8
6.18.56 (v2026.10.16.1's bundle, MU300_ALLOW_DOWNGRADE=1 MU300_KERNEL_BUNDLE=...) 17 15

The same on both kernels, so not a 6.18.57 regression; and in clusters (06:30-06:47 dead, 06:48-06:52 good, then dead again), which is why the soaks of the morning (FINDINGS 163: 20 of 20, 12 of 12) saw none. The previous kernel was put back with mu300-update rollback-boot afterwards (the boot image's sha256 as before).

What a dead boot looks like. Everything the watchdog asks passes: +CGACT:1,1, sipa_eth0 on exactly the context's address, +CEREG: 2,1,...,13, +CGATT: 1, +CFUN: 1. In the IPA, the AP's side is ready: the receive buffers are posted (sipa/mem, alloc_skb_cnt = 0), the resource handshake of FINDINGS 13f runs whenever the AP sends (type=5 flag=1 out, the modem's type=6 flag=7 ack, PROD_CP granted), and the TX completions come. What never comes is the modem's own request to deliver (sipa_dele: smsg_recv ... type=5, flag=0x1, CONS_WWAN_DL 0->2): on a good boot it is there six seconds after the dial; on a dead one never, or once for a handful of packets. Left alone a dead boot stayed dead (ten minutes watched).

What did not bring it back, each tried on a dead boot: the data context again (ifup wan: AT+CGACT=0, the dial, the same address); the radio off and on (mobile-data suspend off / resume: a new address); the modem restarted (AT+SPATASSERT=1: modem_control reloaded the PS CP, the delegate reopened channel 5-120, the watchdog redialled); sipa_eth0 unbound and bound again (/sys/bus/platform/drivers/sipa_eth). Not one packet came back after any of them.

What did: mu300-vpn restart. On eight dead boots in a row, every one: 85-224 packets within twenty seconds, the tunnel up, the modem asking to deliver again. The VPN service starts at boot (S95) before there is a bearer, finds no uplink and is started again by procd every few seconds; on the dead boots the run that got as far as its engine did so a second or two before netifd had finished with the bearer (sing-box at 42-43 s, the address on sipa_eth0 at 44-45 s). That engine never gets a tunnel up, and nothing restarts it: the bearer's ifup did not touch the VPN, which is why the owner's ifdown/ifup wan changed nothing and the reboot (a new race) did. The engine's own state was not looked into (its configuration stays unread); what it does on such a start is the VPN module's to find out. Counted on the interface, the result is a downlink that is dead at every layer below it, which is what made it look like 13f again.

The open question of 13g (why the watchdog missed a lost context): in the general case, because its round never looks at whether anything comes back; a context check and an address check cannot see a bearer that is up and carries nothing. That is fixed below for both.

What changed.

  • mu300-vpn-uplink (rootfs/overlay/opt/mu300/bin), run at the bearer's ifup (OpenWrt: /etc/hotplug.d/iface/96-mu300-vpn-uplink, sipa_eth* only, in the background; Ubuntu: the end of mobile-data up, in the background): with the VPN on (mu300-vpn enabled), it waits 3 s for netifd, then up to 60 s for a run that is starting to reach its engine (/run/mu300-vpn/since), and when that run started no later than the bearer came up (the same second counts as before) it calls mu300-vpn restart and logs it (logread -e mu300-vpn-uplink). The kill switch is never touched: mu300-vpn restart replaces it in one transaction. A VPN that is off, a run that started after the bearer, or no run at all: nothing. One at a time (a lock); every later ifup (a redial by netifd or the watchdog) gets the same treatment.
  • The watchdog (mobile-data watch, OpenWrt and Ubuntu), on rounds where the context and its address pass: sipa_eth0's own rx_packets and tx_packets. Stalled is at least 20 packets sent (MU300_DL_STALL_TX) and at most 2 received (MU300_DL_RX_ALLOW, a stray router advertisement) over at least 90 s (MU300_DL_STALL_SECS); more received starts a new reference. Nothing is sent to find out: only what the device sends anyway counts, an idle link is never a dead one, and the kill switch stays whole. Then one step per stall, each judged again on a new reference, a step that does not apply passed over in the same round:
    1. the VPN again (mu300-vpn restart), when one is on - the safety net for the hook above;
    2. the data context again (ifup wan under netifd; on Ubuntu AT+CGACT=0, the link down, the dial) - 13g's case;
    3. the radio off and on, then the dial (suspend off / resume, mu300-power's path; not on a managed or native dual-SIM radio);
    4. a reboot, only when sipa_eth0 has received fewer than 200 packets in the whole boot (MU300_DL_REBOOT_RX) and at most 3 times in a row (MU300_DL_REBOOT_MAX, counted in /etc/mu300/downlink-reboots, which goes once a boot has received 1000 packets). Off with uci set network.wan.dl_reboot=0 (OpenWrt) or MU300_DL_REBOOT=0 in /etc/mu300/mobile-data.conf (Ubuntu). After step 4, 600 s until the next round of steps, doubled up to an hour. Every step goes to the system log and /run/mu300/radio.log; at each the counters, AT+CGACT?, AT+CGPADDR, AT+CEREG? and the delegate's last kernel lines go to /run/mu300/downlink.log (copied to /etc/mu300/downlink-reboots.log before a reboot). No identities.

Measured with the change (U30 Air, 6.18.57, the files of this branch on openwrt-luci v2026.10.17.1):

  • 11 reboots: 10 with the tunnel up within 53-77 s and the 10 MB through it; on 7 of them mu300-vpn-uplink had restarted a run that began before the bearer (the VPN started before sipa_eth0 was up), on 3 the run began after it and was left alone. The eleventh had the tunnel up at 55 s and the download stopped after 34 kB (159 packets): a stall of another kind, after a working start, for the watchdog.
  • The watchdog alone (the hook moved away, a dead boot: 7 packets received): downlink stalled: sipa_eth0 sent 30 packets in 91 s and received 0; step 1: the VPN again at 168 s, the downlink is back: sipa_eth0 received 42 packets (after step 1) at 229 s, the tunnel answering; /run/mu300/downlink.log had the counters, +CGACT:1,1, the context's address, +CEREG: 2,1,...,13 and the delegate's lines.
  • An earlier version of the hook compared only since: one boot of two stayed dead until the watchdog's step 1 brought it back at 139 s - the run had looked for its resolver while the bearer was coming up and reached its engine after it. Hence the run's start (/run/mu300-vpn/engine).

Not done: Ubuntu on a device (the same code paths: mobile-data up starts the hook, the watchdog is the same script); why the engine stays dead after such a start (the VPN module, dikeckaan/mu300-linux-vpn: it could restart itself when its uplink changes, which would make the hook here unnecessary).

177. A kernel update wanted 500 MB free at once since every module is built: it did not fit F50-C's 804 MiB region

Status: current (unit tests, tests/test_update.py KernelStep; device-tested on F50-C, internal OpenWrt in the default 804 MiB region, and F50-B, Ubuntu 24.04, 2026-10-17).

What happened. Since §163 a mainline bundle carries every module the boards can use: mu300-kernel-6.18.tar.gz is 52.7 MB and unpacks to 151 MB, 122 MB of it 2947 modules (7.2: 55 MB, 160 MB, 3034 modules). The kernel step of mu300-update (boot_update) kept the download while it unpacked the whole bundle into .mu300-update/boot, read the image in the slot (body, 30 to 36 MB), built the new one (new) and joined it with its vbmeta into a third copy (new.all, in write_boot); then it copied the set in place into boot/prev.modules (122 MB), copied the new set into every system (122 MB each) and copied body to prev.body. About 580 MB at the peak with one system, 120 MB more for each further one. F50-C has 362 MB free after OpenWrt in its 804 MiB region: with the v2026.10.17.1 updater a kernel update (6.18.57 to a rebuild of it) stopped with cp: write error: No space left on device while keeping the modules in place, said nothing was changed - true, the image was untouched - and left the unpacked bundle, the half-made image, the 52 MB download and a 105 MB partial prev.modules behind: 0 bytes free. A user who took the default region could not have taken any kernel update.

Two more things filled the region over time: each kernel release a bundle brought left its set in the systems for good (F50-C had 6.18.56's 29 MB beside 6.18.57's - 120 MB each from now on), and an update with only the kernel to do asked space_needed's 1 GB for a whole system before it started.

The fix (rootfs/overlay/opt/mu300/bin/mu300-update):

  • No copies of a module set. The unpacked bundle, the systems and boot/ are one filesystem, so a set gets more names (mod_link: ln, cp only where a link cannot be made) and names are removed, never a file written into (the delta block's second names, §131). The set in place goes to prev.modules.new as links; the new set goes into each system as links to the unpacked files (one copy of 122 MB for Ubuntu and OpenWrt together); rollback-boot puts the kept set back as links and it stays kept.
  • The kept image and its set change together. prev.modules.new becomes prev.modules (prev_modules_commit) only with prev.body, just before the new image is written. A failure before that puts the set in place back and leaves the image kept from before and its set as they were; a failed write puts the image read from the slot back with its set (as before). The EXIT trap does the same for a run stopped between the modules and the image.
  • One pass, and the download goes once unpacked. Kernel, generic ramdisk, release and modules come out of the bundle in one tar run (was four); the verified download is removed as soon as that worked, Image as soon as it is in the new image, body is moved to prev.body, and write_boot writes the vbmeta behind the body with a second dd instead of from a joined copy (a body that is not whole pages is joined as before; the Magisk installer uses the same function).
  • Room checked first, said in MB. Before the download (boot, kernel): three times the bundle plus the bundle or two images, whichever is more, and 16 MB (kernel_need_kb). After it, from the bundle itself (boot_room): its tar stream, a block for each file, two images of the size in the slot less the download that goes, and 8 MB. apply with only the kernel to do asks kernel_need_kb instead of 1 GB, and update_need counts the kernel step after the images' downloads are gone. A refusal gives the MB needed and free and changes nothing: boot: not enough free space on the Linux partition for the kernel: 237 MB needed (...), 99 MB free and 29 MB in the boot image kept for rollback-boot. Nothing was changed.
  • What the room may take back. The image kept for rollback-boot (the one before the image in place) and its set are replaced by every update that writes its image, and the device runs the image in place either way: when the room is short they are given up first, together (boot: the room is short: the boot image kept from before the one in place (TAG) and its modules are given up; rollback-boot then says none is kept). Module sets of releases no boot image here runs go at the start of the step and after it: only the image in the slot, the kept image and the running kernel need theirs - a switch to another kernel brings its own set. A release is read from the kernel's banner in the image (image_krel, 1.6 s for 25 MB on the F50); when one is not known, nothing is removed. The vendor kernel's sets (5.4.*) are the systems' own, and a directory without modules (OpenWrt's empty 6.12.94) is never touched.
  • Nothing left behind. boot_update wraps the step: however it ends, .mu300-update/boot and prev.modules.new go, and so does the bundle it downloaded when the step did not finish (MU300_KERNEL_BUNDLE, the caller's file, never). Only SHA256SUMS and its tag stay in .mu300-update, as for any run.

A system the same run replaced (found on F50-B with the above, fixed right after): Ubuntu's sets come from the bundles and are never carried over by a system update, so after apply replaced Ubuntu and then the kernel, the new system had no set for the image in the slot and prev.modules kept none: rollback-boot would have brought that image back without its modules (the same before this change). The kernel step now gives the new system the slot image's set from the previous system kept beside it (<os>.old, which ran with that image), as second names (kernel_set_from_old), before it keeps anything.

Hard links between the old and the new set (as §131 does for the systems' files) were measured and left out: two builds of 6.18.57 share 31 of 2946 module files byte for byte.

Peak, measured on the devices (free KiB of the Linux partition sampled while the command ran):

before (v2026.10.17.1 / main) after
F50-B, Ubuntu, 7.2.11 to a rebuild (boot) 446 MB peak, 130 MB more used after 224 MB peak, 1 MB less used after
F50-B, rollback-boot (copies the kept set back) 0 MB peak, 127 MB freed
F50-C, OpenWrt, 362 MB free, 6.18.57 to a rebuild failed: No space left on device, 0 bytes free after 208 MB peak, 148 MB still free at the lowest
F50-C, kernel 7.2 (signed v2026.10.17.1 from a LAN mirror) - 210 MB peak
F50-C, 7.2.11 to a rebuild after the kept image was given up - 213 MB peak
F50-C, kernel 6.18 with 216 MB free and an image kept - kept image given up, update done

Device test (2026-10-17). F50-C: each new kernel was booted from Android (mu300-linux): the rebuilt 6.18.57 (#4 of 2026-10-16), after rollback-boot the release's 6.18.57 (#1), the release's 7.2.11 after kernel 7.2, the rebuilt 7.2.11 (#5), and the release's 6.18.57 again after kernel 6.18; every time all modules loaded (114 on 6.18, 120 on 7.2, as before), no disagrees about version/invalid module format in dmesg, the hotspot up and mobile data reaching the internet. Forced failures: a 100 MB-free partition was refused before the download with the numbers and nothing changed (slot, both sets, boot/ as they were); a filler that took the rest of the partition while the bundle was unpacking made tar fail with ENOSPC - .mu300-update/boot and the download were gone, the slot image and the set it runs with unchanged, and the board booted it afterwards with mobile data. F50-B: the rebuilt 7.2.11 and, after rollback-boot, the 7.2.11 it had both booted with their 52 modules and the mobile bearer up.

178. A V50 updated from another installer's system found no system: its disk was where our init never looks (#290)

What was reported. A ZTE V50 (MU3351) ran 20261016-u30air-pd: a build of kanoqwq's fork (branch clean-tf-7.2, his Windows/macOS desktop installer of 2026-10-16), kernel 7.2.8 of his own. mu300-update apply --from DIR --unsigned to v2026.10.17.1 replaced the system and the boot image; the device then logged stage=pmic-wdt-NOT-ready at ~258 s and stage=timer-reboot at ~302 s, and LK went back to Android. Twice. The updater also said could not arm the Linux slot for a trial (mu300-next-boot --trial): usage: ....

Why. Both lines come from boot/init's rescue path: the pmic-wdt wait (120 x 2 s) only runs after stage=rootfs-unavailable, i.e. when no system was mounted. 258 - 240 = 18 s: init gave up on the root at ~18 s and never switched root, so the modem, the USB network of the system and SSH never came; the rescue shell's USB address on a V50 is 192.168.79.1, not the 192.168.77.1 that was tried. It is not the kernel and not the V50 as such: the generic ramdisk of v2026.10.16.1 and v2026.10.17.1 has the same init (sha256 576f8584...) and the same module list. kanoqwq's desktop installer has its own places for the system, which its boot image's init (his desktop/boot/storage.sh, chosen by /etc/mu300-desktop-root-mode in the ramdisk) knows and ours does not:

  • "Independent internal partition": a new GPT partition named mu300root (ext4, label mu300root);
  • "Userdata image": mu300linux/openwrt.ext4 inside Android's userdata (F2FS), loop-mounted;
  • a TF card labelled mu300sd (ours finds that one). mu300-update keeps the installer's ramdisk as the device segment and appends the release's generic one, whose init replaces his: it looks only on the card and in the area after the eMMC's last partition. With the system in a GPT partition that area holds nothing (the partition is the last one), and the default offset neither. The --trial line: the running system's mu300-next-boot (his, from before --trial) answers with its usage line.

What changed (mu300-update).

  • root_layout tells where the running system's disk is: from /run/mu300-root-dev when our init booted it, else from /run/mu300/disk-dev (his init writes the device it mounted): a loop over a file is image, a partition named mu300root is part. bundle_finds_root: an image never, a partition only with a bundle that lists gpt-root in ./features (none does yet). apply stops before it changes anything and boot/kernel before they write, with the reason; everything that cannot be told is allowed as before.
  • unlock_for_trial: a mu300-next-boot that answers --trial with its usage line (exit 2) is passed over for the copy in the system the update has just installed (the running system's name first, then the others).
  • Tests: test_update.py test_a_disk_another_installer_put_elsewhere_keeps_the_boot_image, test_a_next_boot_from_before_the_trial_hands_it_to_the_new_system.

Not measured here: nobody here has a V50 or a system installed by that installer; the layout is read from his source (commit abc5a93c). Booting a mu300root partition from our init is a separate change.

179. Another installer's GPT partition named mu300root: booted by init, and an installation the installers see

Status: current (unit tests; device-tested on F50-C, 2026-10-17, with the layout emulated). Follows 178.

What was reported. After 178, a U30 user of kanoqwq's desktop installer: our web installer "treats my Linux partition as Android" and says there is no space. That installer can put the system in a GPT partition of its own, named mu300root (ext4, label mu300root), carved out behind userdata, 1 MiB aligned. region_probe (tools/storage.sh) puts the free region behind the last partition - which is now that one - so the region was empty, region_find_existing never looked inside the partition, and the web page drew it as one of Android's. install.sh, install.ps1 and the Magisk zip (the web installer runs the zip's installer) all share that view.

The emulated layout (F50-C). F50-C runs internal OpenWrt in an 804 MiB region right behind userdata (sectors 120504320..122150911, the filesystem 205824 blocks of 4 KiB - exactly the region). One GPT entry was added (76, mu300root, type Linux filesystem) covering exactly that region, nothing moved: both GPT copies (first 34 and last 33 sectors) were saved with their SHA-256 first, the new copies built and CRC-checked on the Mac (a few lines of Python), written with dd and read back. Android started normally with it (/dev/block/by-name/mu300root -> mmcblk0p76, sys.boot_completed=1).

  • Release init (v2026.10.17.2) reproduces #290 exactly: stage=root-offset not-found (trying the default ...), stage=sd-wait, stage=rootfs-unavailable at 13.5 s, stage=pmic-wdt-NOT-ready at 257 s, stage=timer-reboot at 302 s, back to Android - the V50 report's numbers (258/302 s).
  • #296's init (the release's 6.18 bundle with only ramdisk-generic.lz4 rebuilt from the PR's boot/init - the release's segment rebuilt from its own tree gives its published sha256 bit for bit - and gpt-root in ./features, installed with mu300-update boot from a local copy of the release): stage=root-part dev=/dev/mmcblk0p76, /run/mu300-root-dev = mmcblk0@mu300root, / and /mnt/mu300-disk are /dev/mmcblk0p76 (no loop), OpenWrt at 192.168.77.1, mobile data up (sipa_eth0, ping and HTTPS to GitHub).
  • With the table restored (hash-verified against the copies) the same init finds the region again (stage=root-offset found=61698211840), data up, Android fine.

What changed (installers).

  • region_probe also reports each GPT partition named mu300root (part:START:SECTORS, from sysfs uevent) and an image file of that installer in Android's data (/data/mu300linux/openwrt.ext4, its "userdata image" mode). One such partition is the target: OFF/SIZE are the partition, IN_PART=1; the free region stays REG_OFF/REG_SIZE. region_find_existing looks where init does - the region, then the partition, then the old fixed offset (not when it lies inside the partition) - and caps a filesystem's size at the partition's. region_in_bounds: free space or wholly inside that partition, nothing else.
  • What this installer cannot handle is said, not guessed: another ext4 in the partition (never formatted: the device refuses it too), two partitions of that name (neither used), the image file (a note: not updated, the new boot image starts the new system, the file stays). The probe command has no double quotes and is the same in install.ps1 (Windows PowerShell 5.1 drops them on the way to adb).
  • Device side: android-install.sh accepts a filesystem wholly inside the one partition named mu300root (it checks sysfs itself); android-web.sh reports part, part_fs, part_count, foreign_image in its status, and its uninstaller's bounds take the partition (the filesystem is erased, the partition stays).
  • Web page: the partition is not Android's in the bar; verdicts part-existing, part-free, part-dirty, part-foreign, part-ambiguous (EN/TR/ZH); the make-room figures are not offered with such a partition.
  • On F50-C, in the emulated layout: the release's android-web.sh status said size 0, existing no (the report); the new one part 1, part_fs mu300root, existing yes, 843055104 bytes, with the systems read from it. The release's install.sh --check went to "Not enough free space - this looks like the 32 GB variant"; the new one: "Linux partition: the GPT partition named mu300root ...", "existing mu300root filesystem: yes". A real update through the web installer's device side (take, answers, run install of an OpenWrt 6.18 zip built from this branch with #296's bundle): "Linux goes into the GPT partition named mu300root", the device's own check "(sectors 120504320 + 1646592)", update carried 3009 files, boot_b written and verified; then boot-linux: stage=root-part, data up.
  • Tests: test_installer.py Region (the partition, a region that wins over it, another ext4, two partitions, the image file, the probe command shared with install.ps1), test_android_install.py RegionGuard, tests/web/logic.test.mjs (the partition's verdicts and bar).

Found on the way. tools/self-update.sh told a git checkout by [ -d .git ]: in a git worktree .git is a file, so install.sh --check run from a worktree took it for a downloaded copy and overwrote the uncommitted work in it with GitHub's main (it did, twice, during this work). -e now; install.ps1's Test-Path already saw both.

The uninstallers and reset-password (follow-up, PR after #297). uninstall.sh, uninstall.ps1 and tools/reset-password.sh still had their own search (the region and the old fixed offset only): in this layout uninstall.sh said "no mu300root filesystem found (already erased?)" and would have left the system, and reset-password "no Linux filesystem found". They now use the same probe (region_probe/region_find_existing; uninstall.ps1 the same device command as install.ps1, a test compares them) and bounds (region_in_bounds):

  • uninstall in the partition: the plan says "inside the GPT partition named mu300root: the partition stays, only its contents are erased"; quick zeroes the first 64 MiB (never more than the filesystem), secure the filesystem; the GPT entry and the table are never written, and the "grow userdata back" step is not offered (userdata is not the last partition then). Two partitions of that name: nothing is changed. Another ext4 there: "not this project's, left as it is".
  • uninstall.ps1 counted MiB with [int64]($SIZE / 1MB), which rounds (to even): a size that is not whole MiB - a partition's can be - wrote up to 1 MiB past its end. [math]::Floor now.
  • reset-password mounts the filesystem inside the partition (MU300_OFF = the partition's start).
  • Tests: test_answers.py UninstallInPartition on the fake eMMC (tests/fakegpt.py layout part64): quick and secure erase inside the partition, the bytes right in front of and behind it and the table unchanged; keep; another ext4; two partitions; reset-password's mount.

On F50-C (2026-10-17), the same emulated layout (entry 76 over sectors 120504320..122150911; table SHA-256 a780d776.../dd499ab7... while emulated). Before: the region (804 MiB) imaged to the Mac (SHA-256 5259e15f..., equal to the device's), boot_b saved. main's uninstall.sh: "no mu300root filesystem found"; reset-password: "no Linux filesystem found". This branch: "Linux filesystem: offset 61698211840, 804 MiB / in the GPT partition named mu300root ...", reset-password "internal storage: offset 61698211840, 804 MiB, in the GPT partition named mu300root", mounted it and reset root's password of OpenWrt. A real uninstall.sh (quick): boot_b = boot_a, the first 64 MiB of the partition zero, magic gone, "the partition table is left alone", both GPT copies still a780d776/dd499ab7, /dev/block/by-name/mu300root still there; a second run: "no mu300root filesystem found". Then the region image written back (SHA-256 5259e15f... again), boot_b back (c600c020...), the module's remove marker taken away, the original table written back (af016e38.../99fb7db7..., read back after the reboot; 75 partitions), Android up, su -c mu300-linux: /run/mu300-root-dev mmcblk0@61698211840, OpenWrt 25.12.5 on 6.18.57, data up (ping 1.1.1.1), back to Android.

Not done: removing the partition itself is the other installer's job. Not measured on a device that installer set up (nobody here has one); the partition here was made by hand to cover our own region. tools/android-import-hotspot.sh (no caller left) still mounted the old fixed offset and wrote into the filesystem's top level, not a system's: it predated the region and the systems' directories. Removed (2026-10-18): the installers copy Android's hotspot themselves (IMPORT_HOTSPOT in tools/android-install.sh, into each system's own etc/mu300/hotspot.conf), so nothing needed it.

180. Wi-Fi access point: get_station answered for any address with the interface's own counters

Status: current (device-tested on the U30 Air, 6.18.57, and F50-B, 7.2.11, 2026-10-17). From kanoqwq's f59a296 (his notes: the access point no longer passes station or interface figures off as a client's): his upstream/modules/sprd_wlan_combo/common/cfg80211.c and kernel/patches/wlan_combo-ap-stats-scope.patch, read and taken in our words; his code not run.

What it was. sprd_cfg80211_get_station() is the station side's: it reports the interface's own byte and packet counters (ndev->stats) and the firmware's GET_STATION, which describes the link to the access point the interface is connected to (signal, rates, TX failures). It never looked at the address it was asked about. On our access point, iw dev wlan0 station get <MAC> answered for any MAC, a client or not, with the whole interface's counters and a signal that belongs to no client; whatever asked for a station by address got those figures. Since issue #8, dump_station lists the access point's stations from the firmware's peer table with nothing filled in: the firmware keeps no per-client figures, so the two paths disagreed about the same station.

Two smaller ones next to it: get_channel (5.15 and later) indexed wdev->links[link_id] with the caller's link id unchecked (cfg80211 passes 0 for a driver without MLO, which this one is; an index past the array is not ours to read), and dump_station took a negative index as the first station.

Changed (mainline module and, the same code, kernel/patches/wlan_combo-ap-stats-scope.patch for 5.4): in AP and P2P-GO mode, get_station answers -ENOENT unless the address is one of this interface's entries in the peer table (as dump_station lists them, never the interface's own address), and for a station of ours returns it with nothing filled in, as dump_station does. get_channel answers for link 0 only. dump_station refuses a negative index. In station mode nothing changes. So per-client counters do not exist on this driver; iw ... station dump shows the clients and no numbers, and hostapd's own hostapd_cli all_sta is unchanged. On 5.4 the 5.15+ variant of get_channel is not built; the code is kept the same as the mainline copy.

The 5.4 patch applies after the series before it with patch --fuzz=0, no offsets, and so does every later patch (the realme tree at 4381465c, all fifteen wlan_combo-*.patch in their order). His version's hunks were written against his tree; ours is made against ours.

Built: the mainline module for 6.18.57 and 7.2.11 (92 warnings, as before this change; none in the changed lines); the 5.4 driver with all fifteen patches, linked against the U30 Air's 5.4 tree (sprd_wlan_combo.ko, no warning, as without this patch). Tests: test_static.py (test_wifi_ap_get_station_answers_for_its_stations_only: the same lines in the mainline module and the 5.4 patch, the AP branch before anything of the station side's).

Device test (2026-10-17). U30 Air, openwrt-luci v2026.10.17.3, its 6.18.57 kernel bundle rebuilt from this branch (mu300-update kernel 6.18 with the local bundle; afterwards rollback-boot to the release), one client on the 5 GHz hotspot. Before: iw dev wlan0 station get 02:11:22:33:44:55 (no such station) answered with rx 315820 / tx 980745 bytes, signal 0 dBm and an rx bitrate, the same figures as for the real client. After: that address and the access point's own both No such file or directory (-2); the client by station get and in station dump with no figures; iwinfo wlan0 assoclist lists it, iwinfo info channel 36, VHT80. The client stayed associated over two reboots and about 35 minutes, the VPN (sing-box, kill switch on) up throughout. F50-B (Ubuntu, 7.2.11, hotspot, no client): the release module also answered the made-up address with counters; with this branch's module loaded in its place (hotspot restarted, nothing rebooted) -ENOENT, an empty dump, channel 36; then the release module back.

181. The U30 Air's fuel gauge against Unisoc's: the user area's writes, a migration guess, and the charger's Full

Status: current (device-tested on the U30 Air, 6.18.57, 2026-10-17: a full charge to the charger's Full, two reboots; a power-off not run). Review of kanoqwq's f59a296 patch 0020-power-UMP9620-stock-retained-soc.patch against our 0011 and 0018 (FINDINGS 33d, 105), with his claims checked against the U30 Air's own stock module and Unisoc's source; two of his three changes taken, the third not, and replaced. His code not run.

The references. The stock sc27xx_fuel_gauge.ko from our U30 Air's backup (backup/u30air-20260927-205614, vendor_boot_a's ramdisk; vermagic 5.4.254-android12-9-g4098d30a56ae, md5 4f808ad8...; his was the same function layout from -g9444efdc6885), disassembled here, and the U30 Air's 5.4 kernel source (zte-ums9620-mifi-u30air-5.4.254, drivers/power/supply/sc27xx_fuel_gauge.c) with its device tree.

  • The user area's writes: his claim holds. sc27xx_fgu_save_last_cap (at 0x4ba4, as he says) calls regmap_update_bits_base(map, base + 0xa4, 0xfff, 0xfff, NULL, false, false), usleep_range(200, 210), the same on 0xa0 with the value, a wait, 0xa4 to 0, and a third wait: force is false in all three, so it is regmap_update_bits(), not regmap_write_bits(). The source has the same for save_boot_mode(). 0018 had made the six writes regmap_write_bits() after his own earlier, unmeasured report (105); he has retracted it, and the stock module agrees with the retraction. 0018 no longer changes them. It adds the third wait (after the release), which both stock versions have and mainline does not, on UMP9620: the shutdown callback writes the boot mode right after the capacity, and the power-off follows. His patch said "200 us waits" but kept mainline's two.
  • The format and the migration guess: taken. Stock decodes bits 7:0 as whole percent and 11:8 as tenths, as 0011 does. 0011 also sent a multiple of 10 with tenths (value <= 1000) to the OCV when the battery was at rest, for values that the first version of 0011 (0.1 %, October 6-7, never released) might have left. That guess also catches Android's own values (0x244 = 68.2 %, any tenths 1-3 with a whole percent that makes the number a multiple of ten), and a device that ran that build has long since written whole percent. Gone: a value that is a capacity in Android's format is taken as it is, as stock takes it; only one that is not goes to the OCV.
  • The charger's Full: not taken as he has it. 0011 set 100 % on the charger driver's Full only while the OCV table put the battery at 70 % or more (an invented guard). He replaces it with the battery node's fullbatt-voltage (4.2 V) and fullbatt-current (120 mA): Full counts when the battery voltage is at least 4.2 V and the current 0 to 120 mA. Those numbers are Unisoc's charger-manager's (is_full_charged()), which checks them while charging, twice in a row, and then ends the charge itself. Here the check only runs after the charger has said Full, i.e. after bq256xx's own termination (VREG 4.208 V, the node's 300 mA termination current); by then the current is near 0 and the voltage settles below 4.2 V. The one Full measured here (33d) rested at 4.146 V with +2 mA: his condition refuses it, and the capacity would stay where it was (58 % then) - the bug 0011 fixed. Taken instead: the charger's Full (its termination is the voltage and current check, done by the chip) counts while the battery current is within fullbatt-current either way (|I| <= 120 mA; no fullbatt-current in the node: the Full alone). A Full while the battery charges or is drained harder than that is not the end of a charge. No OCV percentage, no voltage condition.

Changed: upstream/patches/0011-...saved-capacity-and-full.patch (no UMP9620_FGU_RELAXED_MA/FULL_MIN_CAP, no ambiguity branch, ump9620_fgu_full_current(), fullbatt-current read from the monitored battery on UMP9620) and 0018-...capacity-kept-at-power-off.patch (the shutdown callback as before, regmap_update_bits() as mainline and stock, the wait after the release on UMP9620). Both kernels take the same file; both patches were regenerated against the tree as 0010 leaves it and apply there with --fuzz=0. FINDINGS 105's second point is superseded by this.

Built: 6.18.57 and 7.2.11, CONFIG_FUEL_GAUGE_SC27XX=y, the file also with W=1: no warning; both bundles made. Tests: test_fgu_shutdown.py (the callback as before; FguFull: the current window compiled from the patch, +2 mA and -3 mA count, 121 mA and -400 mA do not, a failed read does not, no node value leaves the Full alone), test_static.py (the patch lines, nothing of the guess or of fullbatt-voltage, no regmap_write_bits, the two waits).

Device test (2026-10-17; U30 Air, openwrt-luci v2026.10.17.3 with this branch's 6.18.57 bundle, then back to the release by rollback-boot). The battery stood at 80 % (saved 0x050, the owner's charge limit 80). With the limit at 100 for the test, on a CDP port (2 A input): charging from 4.179 V at 721 mA, the FGU's battery voltage never above 4.183 V while the current tapered (the charger's 4.208 V is at its own pin), 294 mA at 14:12, then bq256xx Full (Trickle) and in the same minute charge full: capacity 85 % -> 100 %, read at 4.147 V and 0 mA. Kano's condition (at least 4.2 V) was never met during this charge, before or after the Full. The reboot after it: boot capacity 100 % (saved 0x064) - the 100 written by the calibration and by the shutdown callback, read back - no not kept warning, no oops; the first reboot onto the new kernel had read 80 % (saved 0x050) as before. The release kernel after the rollback read the same 0x064. A power-off was not run (the U30 Air has a battery, and nothing here switches it on again without its button); .shutdown runs on both paths (105). The charge limit was put back to 80. A drain past a percent without a read before a reboot was not produced (the capacity sat at 80 and then 100).

182. A root filesystem with recorded errors was mounted as it was, boot after boot: init now runs e2fsck first

When ext4 finds corruption it sets ERROR_FS in the superblock's s_state (byte 1082 of the filesystem, bit 1) and counts s_error_count. Nothing on the device ever looked at that: init mounted the root, the system ran on the damaged filesystem, and the flag stayed set until someone ran e2fsck by hand from Android or a computer. kanoqwq's desktop init (desktop_ext4_check in his storage.sh) checks the flag before mounting; ours does the same now, with one difference: his returns failure when e2fsck does, ours never stops a boot.

  • boot/init, block fsck: root_fsck DEV before every mount of the root - the loop over the region, the GPT partition named mu300root (#296), the card. A clean filesystem costs one byte read (dd bs=1 skip=1082 count=1). With the bit set: /sbin/e2fsck -fy DEV on the unmounted device, E2FSCK_CONFIG with broken_system_clock = 1 (the clock before NTP is anywhere), at most FSCK_TIMEOUT = 120 s (MU300_FSCK_TIMEOUT), then TERM (e2fsck cancels at a safe point) and 15 s later KILL. Whatever happens, root_fsck returns 0 and the mount follows. Stage lines in /run/stages, kmsg (pstore) and the persistent log: fsck-start (device, state, error count), fsck-done rc=0|1|2 with the time and e2fsck's summary line, fsck-TIMEOUT, and for exit codes 4 and up fsck-FAILED rc=N (errors left uncorrected | operational error | cancelled | killed by signal N; booting anyway). e2fsck's output stays in /run/mu300/fsck.log of the booted system. No e2fsck in the ramdisk (a boot image built from an older bundle): fsck-unavailable, and the boot goes on. MU300_FSCK=force|off on the kernel command line.
  • tools/e2fsck/build.sh: e2fsprogs 1.47.4 from kernel.org (SHA-256 of its signed sha256sums.asc), in alpine:3.20 pinned by digest, musl, static, e2fsck only (no NLS, no undo database), --gc-sections, no build id, stripped: 682 144 bytes, 374 KB in the LZ4 ramdisk; two builds gave the same SHA-256 (c38f85ac...).
  • boot/build-boot-image.py --e2fsck puts it at sbin/e2fsck. tools/make-release.sh builds it, ships it beside busybox in mu300-kernel.tar.gz and puts it in the 5.4 generic segment; upstream/make-bundle.sh takes it from that bundle for the 6.18 and 7.2 segments (an older bundle: a warning, no e2fsck); the release audit refuses a bundle whose ramdisk-generic.lz4 lacks sbin/e2fsck. install.sh and install.ps1 pass it for the vendor 5.4 kernel's first segment (prebuilt: from the bundle; install.sh's build mode builds it); a mainline kernel's segment and the Magisk zips' on-device image (device segment + generic segment) bring it with the generic segment.
  • Tests: test_boot_init.py Fsck (clean: nothing runs; bit set: -fy DEV and the summary; exit codes 4, 8, 12, 16, 32; a hang stopped by the timeout; no binary; force/off; a real e2fsck on an image whose flag and error count debugfs set, both cleared after it, and the next run reads one byte only), RootSelect.test_fsck_before_every_mount, test_boot_image.py test_e2fsck, test_static.py test_e2fsck_is_pinned_and_everywhere.

On F50-C (2026-10-17), OpenWrt 25.12.5 on 6.18.57 in the internal region (804 MiB, offset 61698211840). boot_b (SHA-256 ca76e081...) and the region's superblock saved first; the test images were boot_b with one more ramdisk segment (this init and sbin/e2fsck), written from Android, booted with su -c mu300-linux:

  • clean filesystem: no fsck line; root-offset to switch-root 0.11 s, as with the image before (0.11 s).
  • tune2fs -E force_fsck from Android (state clean with errors, byte 1082 = 03): fsck-start dev=/dev/loop0 state=3, fsck-done rc=0 (no errors) 0.1s: mu300root: 8176/51520 files ... at 5.12 s, switch-root at 5.21 s; the flag was cleared (01), the same lines in dmesg.
  • a fake e2fsck that exits 8: fsck-FAILED rc=8 (operational error; booting anyway), OpenWrt up.
  • a fake e2fsck that hangs, timeout 20 s: fsck-TIMEOUT ... after 20s, fsck-FAILED rc=143 (killed by signal 15; booting anyway) 20.0s, switch-root at 25.03 s, OpenWrt up. Then boot_b written back (ca76e081... read back), Android's e2fsck -fy on the region: clean; F50-C left in Android.

Not measured: the vendor 5.4 kernel and a card or GPT-partition root on a device (the same function, called before those mounts; e2fsck is a static program and does not care which kernel runs it); a filesystem with real damage on a device (the image test in CI repairs only the flag; e2fsck's repairs are its own).

183. The dashboard's bearer QoS and data counters followed fixed names, not the WAN in use

From kanoqwq's fork (kanoqwq/mu300-linux, his dashboard's dashboard-network.sh), rewritten for this tree.

What was wrong. The collector (unisoc-modem/cell) asked AT+CGEQOSRDP=1 on every full round: context 1, whatever bearer the WAN used, and also while the WAN was down, when the answer is an old bearer's or none. dashboard-info took the configured unisoc_modem.main.data_device before netifd's live l3_device, so a WAN on another device (another CID, or the other card's sipa_eth8 after a U30 Air live switch) was counted on the wrong interface.

The fix. lib.sh has data_cid DEVICE SLOT: sipa_eth0-7 are CID 1-8 of slot 0, sipa_eth8-15 CID 1-8 of slot 1 (as mobile-data names them), nothing for any other name or the other card's device. The collector asks AT+CGEQOSRDP=<cid> for the WAN's live device only while the WAN is up, keeps the answer only when it is for that CID, and only when netifd still shows the same connection afterwards (up, same device, an uptime that did not start over: netifd restarts it on a redial on the same device). Otherwise the QoS is null. dashboard-info reads the live l3_device first, then data_device, then the slot's sipa_eth0/sipa_eth8; net_obj reads /sys/class/net only for a name by safe_iface's rule.

Also: mu300-buttons' header said the U30 Air's Wi-Fi LED was "blue 5, white 2.4"; it is white on 5 GHz and blue on 2.4 GHz (152).

Device test (F50-C, OpenWrt v2026.10.17.3, 2026-10-17), the changed cell, dashboard-info and lib.sh: with the WAN up on sipa_eth0 the full round asked AT+CGEQOSRDP=1 (CID 1 of slot 0) and showed QCI 9, 100/20 Mbit/s; with the WAN taken down the round asked nothing and qos was null; a configured data_device of sipa_eth8 no longer replaced the live sipa_eth0 in sysinfo.

Tests: tests/test_dashboard_info.py LiveBearer.

184. VoLTE and VoNR per SIM, kept and replayed at every start of the card

From kanoqwq's fork (kanoqwq/mu300-linux 5f4732e, 53ef7b1: per-SIM VoLTE and VoNR switches with a boot replay), rewritten for this tree: there the switches live in the Locks page's apply jobs; here they are a setting of the dial.

What was there. mobile-data sent AT+CAVIMS=1 at every bring-up (the dial and the early warm-up): VoLTE was always on, and nothing touched VoNR.

Now. mobile-data voice volte|vonr on|off [--slot 0|1], the choice kept in /etc/mu300/sim-voice (volte0=, vonr0=, volte1=, vonr1=; 1 or 0; read, never executed; Ubuntu and OpenWrt alike). Every bring-up of a card sends its choice where AT+CAVIMS=1 was (voice_replay): VoLTE AT+CAVIMS=<x> (on when there is no line, as before), VoNR AT+SP5GCMDS="set nr param",45,<x> only when the user set it, read back with AT+SP5GCMDS="get nr synch_param",42. No radio restart, no redial. A change for the card in use is sent at once and read back; a modem that does not read back what was asked for gets its previous value back and nothing is saved (exit 1). A change for the other card is saved for its next start. voice --json [--read] gives the saved choices and what the card in use says. Front ends: LuCI Cellular > SIM settings (mu300dash simcard_get/simcard_set), mu300-api voice.get / voice.set (EN/TR/ZH and the other catalogs).

Device test (F50-B, Ubuntu, Linux 7.2.11, 2026-10-17), the changed mobile-data and mu300-api: VoLTE off and on for the card in use, sent and read back (+CAVIMS:0/+CAVIMS:1, the modem's reply has no space); with volte0=0 saved, a restart of mu300-mobile-data left the modem at +CAVIMS:0 and data up; VoNR off read back 0. VoNR on is not taken by this F50's firmware: AT+SP5GCMDS="set nr param",45,1 answers OK, but "get nr synch_param",42 stays 0 for at least 30 s ("get nr param",45 is +CME ERROR: 0). So voice vonr on refuses there, puts 0 back and saves nothing - which is the point of the read-back. The card was on LTE (CEREG AcT 13, no 5G registration). mu300-api voice.get/voice.set the same; slot 3 refused. The board was left with the released mobile-data and no sim-voice file.

Device test (F50-C, OpenWrt v2026.10.17.3, 2026-10-17), the panel's files and mobile-data: Cellular > SIM settings shows both cards (SIM1 in use: saved and modem values; SIM2: saved values and "sent when its radio next starts"); simcard_set VoLTE off read back +CAVIMS:0, on again; VoNR on refused there too ("The modem did not take the setting; nothing was saved"), the modem back at 0.

Tests: tests/test_device_scripts.py SimVoice, tests/test_mu300dash_security.py SimCard, tests/test_api.py test_voice.

185. Each SIM's radio on or off, kept across reboots; all off is a persistent airplane mode

From kanoqwq's fork (his unpublished image's mu300-sim-radio, mu300-radio-allowed, sim-radio.js and the changes around them), rewritten for this tree: his F50 runs both protocol stacks at once (mu300-dual-radio), ours runs the card in use only, so the setting decides whether that card's radio may come on, and the other card's whether it may ever start.

What was there. The dashboard's radio button sent AT+CFUN=0 (on: the SFUN power-on sequence) to whichever card, for this boot only: the next dial, the watchdog or a reboot switched the radio on again, and it was refused on the U30 Air's dual-SIM boots. There was no way to keep a card (or the device) off the network.

Now. /etc/mu300/sim-radio is one line, <slot 0> <slot 1>, 1 on and 0 off; no file is 1 1, as every release before. A line that is not one of the four counts as 1 1 and says so: a broken file must not take the device off the network for good. mu300-sim-radio set 0|1|all on|off saves it and, when it concerns the card in use, runs mobile-data rf-apply: off takes the data down (netifd restarts the WAN, whose dial ends with SIM_RADIO_DISABLED and leaves the interface unavailable, so netifd does not retry; LuCI then shows it as "device not present"; Ubuntu's connection goes down as mobile-data down takes it), then AT+CFUN=4 on the card's own channel (flight mode: the SIM stays powered), read back; on brings the radio back (AT+CFUN=1 from flight mode, the ordinary SFUN bring-up from the cold 0) and the data that was held for it (netifd: the interface made available again, which netifd starts unless somebody took it down; Ubuntu: the hold marker). Data somebody had taken down (ifdown, the panel's button, the data cap, a stopped service) stays down. all off is the persistent airplane mode the owner asked for.

Every path that brings a radio up asks first: mobile-data's dial (exit 7 under netifd: SIM_RADIO_DISABLED, the interface unavailable; Ubuntu: exit 0, the service stays up), the early warm-up (the radio stays at its cold CFUN 0 after the RIL handshake), the watchdog, mu300-power's resume, the modem reset (refused), the panel's lock apply (no SFUN restart; the locks take effect when the radio comes on), and on the U30 Air the cold start of the chosen card (put off without a verdict: the pending marker goes, no trial; mu300-sim2-warmup --deferred runs it when the radio is switched on) and the live switch (a target whose radio is off is refused; a card in use in flight mode because of its setting is a known state). Front ends: the dashboard's radio button (the card in use, persistent), LuCI Cellular > SIM settings (per card, and all off/on), mu300-api radio.get / radio.set, EN/TR/ZH and the other catalogs.

Device tests (2026-10-17).

  • F50-C, OpenWrt v2026.10.17.3: the dashboard's button off: +CFUN: 4 within 2 s, the WAN down with SIM_RADIO_DISABLED; on from the SIM settings page: +CFUN: 1, an address 5 s later. All off and a reboot: after the RIL handshake the radio stayed at +CFUN: 0, the WAN at SIM_RADIO_DISABLED, no redial; all on: SFUN=4, registered, an address 8 s after the request. With the radio off the modem reset is refused and the lock helper does no stack restart; a WAN taken down by ifdown stayed down when the radio came back, and came up on ifup. The page renders both cards' radio, VoLTE and VoNR rows. Again with the interface made unavailable instead of a blocked restart: off left it available: false with autostart on and no second dial in 30 s; on brought an address 5 s later. A WAN taken down by ifdown (autostart off) stayed down through off and on, and came up on ifup.
  • F50-B, Ubuntu (7.2.11): off: +CFUN: 4, sipa_eth0 down, still down after 75 s of the watchdog and a restart of mu300-mobile-data (the service active, "mobile data stays down: the radio of SIM1 is off"); on: an address 6 s later. With the service stopped, off and on again left it stopped. One reboot with the radio off came up with the modem's AT channels never ready (stty_nr1 not ready in 240 s; no sbuf channel 5 in dmesg): the CP had not started them, which nothing in userspace does or prevents; the next two boots were normal. The off-at-boot case is the F50-C one above.
  • U30 Air (the owner's router, OpenWrt v2026.10.17.3, SIM1): SIM2 off is saved only; SIM1 off +CFUN: 4 and on +CFUN: 1, an address 3 s later and the VPN's HTTPS answering again 18 s after the off. Every board was left with its released files.

Not run on a device: the U30 Air's dual-SIM boot with the chosen card off and its deferred cold start, the live switch with a card off (one SIM per board here): tests/test_sim2.py, tests/test_sim_hot.py.

Tests: tests/test_device_scripts.py SimRadio, tests/test_sim2.py, tests/test_sim_hot.py, tests/test_mu300cell.py, tests/test_mu300dash_security.py (RadioLock, SimCard), tests/test_api.py test_radio.

Update (FINDINGS 202): off is AT+SFUN=5 now (the vendor RIL's way), not AT+CFUN=4.

186. A slot with no card was dialled every 20 s for ever; now the dial waits for the card

From kanoqwq's fork (kanoqwq/mu300-linux f59a296 and ab26e79: the SIM-state events, registration.sh, his mu300-network-recovery), rewritten for this tree, which has neither his registration cache nor his recovery daemon.

What was wrong. With no card in the slot in use (an F50 set to its internal SIM that has none, a U30 Air position left empty) every dial switched the radio on, waited its 60 s for a registration that cannot come, failed, and netifd started it again 20 s later - for as long as the device ran, each round taking the radio lock and the AT channel. The panel's SMS daemon kept asking the empty card too.

Now. mu300-sim-state check asks the card in use AT+CPIN? once and keeps the answer for the boot in /run/mu300/sim<slot>.state: ready, locked (PIN, PUK) or absent (+CPIN: NOT INSERTED, +CME ERROR: 10). An answer that says nothing about the card (busy, no answer, another error) keeps what was known. Only the card in use is asked: another position may have its SIM power off and answer +CME ERROR: 10 whatever is in it (FINDINGS 74).

  • mobile-data's dial asks it once the radio is on; absent twice, 3 s apart (a card still starting is not none), ends the dial: netifd exit 6, mu300cell reports SIM_MISSING and makes the interface unavailable (no retry; LuCI shows "device not present"); Ubuntu exit 0, the service stays up. A card that goes away while the dial waits for its registration ends that wait.
  • mu300-atd's drainer hands +ECIND: 3,... of the card's event channel (nr0 slot 0, nr3 slot 1) to mu300-sim-state event, which takes the values the stock RIL's onSimStatusChanged reads CPIN after (as kano read them) and asks the card 2 s later in the background. The event is a hint, never a verdict: SIM errors and PIN changes send it too. A card that answers after absent makes the WAN available again (netifd starts it unless somebody took it down) or, on Ubuntu, dials. The watchdog asks again every five minutes while the slot is empty, for an event that was missed.
  • The panel's mu300-smsd asks an absent card nothing (no CPIN, CNMI, CMGL, CNMA) and sets itself up when a card answers.

Device test (F50-C, OpenWrt v2026.10.17.3, 2026-10-17), the changed mobile-data, mu300-sim-state, mu300-atd and mu300cell.sh, with the internal SIM chosen (mu300-sim select internal, a slot without a card on this unit): the radio came on (SFUN=4 at 19 s), AT+CPIN? answered +CME ERROR: 10, the state absent, one line "SIM2: no card; mobile data waits for one", the WAN SIM_MISSING and unavailable, and no second dial in the following minutes (before, by the code: a 60 s registration wait and a new dial 20 s later, for ever). An ifup ran one dial, which ended the same way; making the interface available ran one more. No +ECIND came on nr3 at that boot (nothing to filter). Back on the external card the state was ready and data came up as before. Not seen on a device: a card inserted or removed while running (no hands at the boards); the event path is covered by tests/test_device_scripts.py SimState.

Tests: tests/test_device_scripts.py SimState, tests/test_mu300cell.py.

187. The Ubuntu web panel (Cockpit) complete: every page through mu300-api, and a page Cockpit can show without root

The owner opened Cockpit's MU300 page for the first time and found no VPN, and little else. Three causes, seen on F50-B (Ubuntu 24.04, 7.2.11, the panel extra and the VPN module with every engine installed):

  • The page was not even in the menu with limited access (Cockpit's default after a login): /usr/share/cockpit/mu300 was a link into /mnt/mu300-disk/extra/panel/..., and /mnt/mu300-disk/extra is root's alone (0700). Cockpit reads a package as the logged-in user: sudo -u ubuntu ls /usr/share/cockpit/mu300/ "Permission denied", the menu without MU300, /mu300 "Not found". mu300-panel link (every boot, every install) now copies the page there (0755/0644), again whenever the extra's copy differs, and replaces an older panel's link.
  • The VPN tab came only after test -x /mnt/mu300-disk/extra/vpn/bin/mu300-vpn, run with superuser: "try": as the user (limited access) it always failed on the same 0700 directory, so the tab never appeared. The page now asks mu300-api hello for the methods the device has; the VPN tab is always there (with the module missing it offers vpn.install).
  • The page had its own backend (mu300-panel info, the CLIs one by one) and five tabs. It now has eleven - Overview, Mobile network (data, APN, roaming, SIM choice, radio per SIM, VoLTE/VoNR, TTL, USSD, recovery), SMS, AT terminal, Data usage (cycle, cap, cut, correction, history), Wi-Fi (hotspot settings and clients, joining a network), VPN (switch, kill switch, exit address, profiles, subscriptions, engines, IPv6, log), Power and CPU (mu300-power state and profile knobs, charge limit, LED timeout and test, zram, CPU profile, the EXPERIMENTAL voltage offset with its warning and confirmation word), System (host name, time zone, password, SSH, LAN address, USB role, adb keys, boot, Docker, logs), Updates (status, check and install as the job, kernel, mirror, extras, packages after an update), Backup (export, sealed or not; check and restore) - every call mu300-api METHOD with the request on stdin, the same backend as the web installer's manager and (for the shared methods) LuCI. A tab whose method the device lacks is not shown. Long work runs as mu300-api's job, followed in a box above the page. Without administrative access the page says so and shows the live rates only.
  • New mu300-api methods for it (each with its rules and tests in test_api ModemTools): at.send (the command on mu300-at's stdin), ussd.send/cancel, modem.restart, ttl.get/set, traffic.get/set, power.get/set, led.get/set, zram.get/set, cpu.get/profile/voltage, update.status/source, packages.get/act, docker.status (a stopped, socket-activated Docker is not started by asking: docker ps would start it - it did, once, on F50-B, and was stopped again), vpn.engines.

On F50-B (2026-10-17): logged in with limited access: MU300 in the menu, the page's notice and the live rates; with administrative access every tab rendered with the device's values (signal 5G NSA, SIM 1 in use, dual SIM, VoLTE live, the SMS of the SIM, data usage and history, hotspot F50_2 on channel 36, the four engines, power profiles, CPU policies and the voltage table, Docker inactive, the extras, the mirror). Changes made and put back: AT+CSQ from the terminal, TTL 64 (tc) and off again, the exit address asked, the VPN log, update.check as the job (no internet on the board: it ended with status 1 and its log in the box), the job cleared.

Still only on the OpenWrt panel: network, band and cell locks and their boot replay (mu300dash/lock, uci), SMS forwarding (the SMS pool's daemon), the AT command history and the device's USB network mode.

189. Ubuntu's hotspot held the boot for 20 s; now 2.8 s

Status: current (device-tested on F50-B, Ubuntu 24.04, 7.2.11, 2026-10-18, three reboots each way).

What it was. systemd-analyze blame gave mu300-hotspot.service 20.8 s of a 35 s userspace boot, with the hotspot on the critical chain to multi-user.target (through mu300-power). A traced boot showed where it went:

  • hotspot-verify (ExecStartPost, so the unit is not started until it ends) waited for the firmware's answer to CMD_START_AP in the kernel log for up to 20 s. The mainline driver prints an answer only when it is a failure (pr_debug otherwise, sc2355/cmdevt.c), so a good start left no line and every boot waited the full 20 s.
  • regdb-load waited up to 3 s for each of regulatory.db and its signature to appear under /sys/class/firmware (6 s). The mainline kernels have no sysfs fallback (CONFIG_FW_LOADER_USER_HELPER unset), so /sys/class/firmware does not exist and nothing can ever appear there.
  • iw dev wlan0 set type __ap on the down interface always failed once and slept 2 s: the driver's change_iface records the AP type but returns EINVAL (its firmware close fails on an interface that is closed already); the retry then found the type AP and succeeded at once.
  • a fixed sleep 1 after the country change, which the channel check that follows already waits for.

Now. hotspot-verify stops once iw shows the access point's SSID while the unit's main process is hostapd ($MAINPID: an SSID left from before a restart does not count) and reads the log one last time (CMD_START_AP is synchronous: a refusal is printed before the SSID can appear); a refusal still sends the hotspot to 2.4 GHz. regdb-load waits for the sysfs nodes only where /sys/class/firmware exists (the vendor 5.4 kernel). The type switch counts an interface that is already AP as done; the channel check polls every 0.5 s.

Measured (F50-B, SSID F50_2, channel 36, 80 MHz): before 20.77 s and 20.74 s (AP-ENABLED 9.5 s after the unit started); after 2.79 s, 2.75 s, 2.81 s (AP-ENABLED 2.1-2.3 s after). Cockpit listening on 192.168.79.1:9090 and br-lan up every time. The whole userspace boot stays at about 35 s: the critical chain is now mu300-mobile-data.service (25 s, the dial) before mu300-user-packages.service; the hotspot is up 7.5 s earlier. Not measured: a client joining (nothing near F50-B to join it), the 2.4 GHz fallback on a real refusal (tests only).

forwarding (the SMS pool's daemon), the AT command history and the device's USB network mode. (All of them on Ubuntu since FINDINGS 190.)

190. Cockpit's MU300 page catches up with LuCI: locks and their boot replay, SMS forwarding, AT history, USB mode

Status: current (device-tested on F50-B, Ubuntu 24.04, 7.2.11, 2026-10-18).

What FINDINGS 187 left to the OpenWrt panel is on Ubuntu now, through mu300-api like the rest of the page:

  • Network, band and cell locks. Ubuntu runs the control panel's own programs: /usr/libexec/unisoc-modem/lock, at, boot-replay and lib.sh, copied byte for byte from openwrt/luci-app-mu300/root (test_static holds them equal), not a second implementation. The only OpenWrt tool they used, jsonfilter, became jfilter in lib.sh: jsonfilter where it exists, else the three expression forms the adapters use, through jq (@.a.b, @.a[*]). ifup wan after the stack restart fails silently on Ubuntu, where mobile-data's watch redials by itself (seen: a new address 4 s after the restart). lock.get/lock.set call the program on Ubuntu as mu300dash does on openwrt-luci: the cache served, a reading in the background (fresh), an apply or reset detached; new kind auto_apply. Boot replay: mu300-lock-replay.service runs boot-replay after mu300-atd (it waits for the AT channel, never holds the boot up, and sends nothing when nothing is saved). etc/unisoc-modem is now in Ubuntu's update keep list (mu300-update and tools/android-install.sh), and mu300-backup's locks section works wherever the lock program is.
  • SMS forwarding. mu300-sms-forward moved from the openwrt-luci overlay to the shared /opt/mu300/bin (both get the same file). On Ubuntu: HTTP through /opt/mu300/lib/sms-forward-http.sh, curl with the same stdin protocol as the ucode helper (the URL and headers in curl's configuration on stdin, the body in a 0600 file in RAM: no secret in a command line); the SMS target falls back to sms send. Ubuntu has no SMS pool, so mu300-sms-forward.service (only while enabled=1; the adapter starts and stops it on save) runs sms watch with unisoc-modem/forward-feed as its hook, which writes each new message into a pool of its own (/etc/mu300/sms-pool, root only, newest 200) and enqueues it. MU300_SMS_WATCH_FROM_NOW=1 (new in sms watch): what the SIM holds when the service starts counts as seen, so only messages that arrive while forwarding is on go out. The watch's stdout (it prints every message) goes nowhere, not to the journal. New methods sms.forward_set (the settings to the adapter on stdin; the adapter checks every field), sms.forward_test, sms.forward_log_clear; the page has the LuCI form with both preset menus (body: WeCom/DingTalk, Feishu/Lark; answer check: errcode=0, code=0, code=200, ok=true) and the delivery log. E-mail needs msmtp, which the Ubuntu image does not have either (the page says so).
  • Nothing of a message in a command line. A review of the forwarding path found what anyone on the device could read with ps: the first Ubuntu SMS target passed the forwarding number and the text as sms send arguments, and both sms and openwrt-luci's mu300-sms handed the recipient and the text to the PDU encoder as awk -v arguments (mu300-api's sms.send passed them to sms as arguments too). Now sms send --stdin and mu300-sms send --stdin (without a number) take the number on stdin's first line and the text after it, sms-pdu.awk reads MU300_PDU_NUMBER and MU300_PDU_TEXT from its environment (no -v escape handling either, so a backslash stays one), and mu300-api and mu300-sms-forward use them. mu300-sms-forward refuses a runtime or state directory that is a link or not its own (the /tmp fallback of its RAM directory had a fixed name), and mu300-sms-forward.service runs with UMask=0077 (the watch's list of seen messages holds senders and times). Tests: the stub awk/sms/curl record their arguments and none holds the number, the text, the URL's token or a header; the curl helper's request directory is 0700 and gone afterwards.
  • AT command history. at.send appends to the control panel's file (/var/run/unisoc-modem/at-history, the last 40, RAM, root only) and at.history reads it, newest first. mu300-api says nothing is logged that is secret, so commands that carry a PIN or password (AT+CPIN=, CPWD, CLCK, CGAUTH) are kept as AT+CPIN=.... The page lists them; a click puts one back in the field.
  • USB network mode. mu300-usb net [ncm|ecm|rndis [once]|default] writes /etc/mu300/usb-net, which boot/init already reads from the system it boots (D12); once adds /etc/mu300/usb-net.once, and mu300-usb boot (mu300-fixups) removes both once boot/init says it made the mode (/run/mu300/usb-net-applied). usb.net (on openwrt-luci: its device-usb, UCI) and the System tab show the mode now and from the next boot.
  • SIM state (FINDINGS 186): sim.state answers mu300-sim-state get for the card in use, or asks the card (check, one AT+CPIN?) when nothing is kept or fresh says so; the Mobile tab shows Ready / Locked / No card.
  • The web installer's device manager offers its lock form on Ubuntu now too (features.locks).

On F50-B (2026-10-18), every change put back: lock.get read the modem through jq (auto, LTE automatic, NR none); mode 4g applied (SFUN restart 7 s, registered LTE again, mobile-data redialled with a new address); reset from the page's button (verified read-back, saved settings cleared). endc off and nr 78 saved, reboot: mu300-lock-replay sent both and restarted the stack once (replay done (late)), the userspace boot still 35.3 s; reset again. Forwarding to a webhook on the Mac: the test, then a message through forward-feed (Turkish text, quotes) delivered as WeCom JSON with errcode=0 checked, the URL and header masked in sms.forward; the service seeded 7 messages already on the SIM without sending them; turned off from the page: the service stopped. AT+CSQ from the page listed in the history. USB network ECM for one boot from the page: the next boot made ECM (the Mac connected over it), the choice was used up, the boot after that NCM again. No real incoming SMS was forwarded (nothing near F50-B to send one; the board's data works only through the VPN, so no internet target either).

191. The IPA and Wi-Fi drivers filled OpenWrt's log in two minutes; now 33 kernel lines a minute and a 1 MiB log

Status: current (device-tested on F50-C, OpenWrt, vendor kernel 5.4.254, and on F50-B, Ubuntu 24.04, 7.2.11, 2026-10-18).

What it was. logread on F50-C held 1199 lines (128 KiB) that began 2.5 minutes before it was read: the services' boot lines were gone before anybody looked. A minute of /dev/kmsg on the idle hotspot (uptime 351-411 s, the modem's data up, the board's usual services running) gave 472 kernel lines (41.5 KB of text) a minute, about 56 KiB a minute in logd:

  • 235 from the IPA. With little traffic the IPA powers down and the next packet powers it up again, every 10-15 s, and each round trip printed about 30 info lines: sipa_rm resource state changes and "calling driver CB", sipa_dele's smsg exchange with the modem (smsg_recv, smsg_send, on_cmd, pd_eb_flag), "sipa ready to suspend" / "sipa resume hrtimer start", and in sipa_eth "fail to send, ret -115" (at error level) with "stop queue" / "SIPA LEAVE FLOWCTRL" / "wakeup queue". -115 is -EINPROGRESS: the packet found the IPA asleep, the queue stops, and the resume's SIPA_LEAVE_FLOWCTRL starts it again. sipa_nic_trigger_flow_ctrl_work() did not know that code either and warned "don't have this flow ctrl err type" each time. Nothing was wrong. (sipa_dummy and sipa_sys printed nothing repeating.)
  • 169 from the Wi-Fi driver's TX path (sprd-wlan): seven lines per transmit-complete round (free and data counts, "to free list empty", ring reference counts), every firmware command response ("ctx_id 0 recv rsp[CMD_SET_IE]"), every multicast frame, every beacon update (hostapd updated it every 6 s), and "out of time" at error level whenever two TX completions were more than a second apart, i.e. every idle second.
  • 60 from the WCN loopcheck (four lines every 5 s) and its 5 s DMA throughput line (edma-tp).
  • the rest: the power debug's light-sleep report (18), mdbg_ring_write (10), charger-manager's "battery overheat or cold" (4, kept on purpose by logspam-quiet, #68: the only record of a JEITA charging stop).

The mainline kernels have the same IPA drivers (upstream/modules/sprd_modem): F50-B on 7.2.11 printed 203 lines a minute, all of them IPA lines and the WCN edma-tp/mdbg_tx_cb ones (the mainline Wi-Fi driver was quiet already). On Ubuntu kmsg-forward writes warnings and errors to the journal on the eMMC: "fail to send" and the flow-control warning were 10 of them a minute.

Now. At the source, for 5.4 (kernel/patches/sipa-wcn-logspam-quiet.patch, in KPATCHES after logspam-quiet, and kernel/patches/wlan_combo-txrx-logs-quiet.patch) and mainline (upstream/modules): these lines are pr_debug / dev_dbg / netdev_dbg / WCN_DBG; 5.4 has CONFIG_DYNAMIC_DEBUG, which keeps them available (echo 'module sipa_core +p' > /sys/kernel/debug/dynamic_debug/control; the mainline config compiles them out). A failed send other than -EINPROGRESS is still an error, rate-limited; -EINPROGRESS has its own case in the flow-control switch. The errors next to them (a power domain refused, an smsg that could not be sent, a failed resource callback) are unchanged. On OpenWrt, 90-mu300 raises logd's buffer (system.@system[0].log_size) from a stock size (none, 64, 128 KiB) to 1024 KiB at every run; a size the user set stays. A boot alone writes about 1 MB to logd, a quarter of it the stock command line's initcall_debug=1 (2158 kern.debug lines; the bootloader's, not ours).

Measured (F50-C, same window, uptime 351-411 s, same idle state): 33 kernel lines (3.5 KB) a minute, from 472 (41.5 KB): the light-sleep report, mdbg_ring_write and the charger's JEITA line. In logread, 38 lines a minute of everything once the boot is over (about 4.7 KB). With 1024 KiB, 178 s after a boot logread held 8401 lines from the kernel's 1.47 s on; a service's line from a minute into the boot comes after 968 KB of them, so at 4.7 KB a minute it stays for about three hours (two minutes before). The new modules loaded (their dynamic_debug entries off), mobile data moved and the board's services came up as before after both reboots. sipa_eth0's tx_errors still counts each -EINPROGRESS (the driver returns NETDEV_TX_BUSY); only the line is gone.

F50-B (7.2.11, a bundle of this tree through mu300-update boot, then rollback-boot to its release kernel): 5 kernel lines a minute at uptime 402-462 s, from 203 (one sprd-mpm wakeup report, one loopcheck heartbeat); the journal had no "fail to send" or flow-control line that boot, and br-lan and mobile data came up.

192. kanoqwq's storage fixes for #290 (5161859d): what our init and updater lacked

kanoqwq's commit 5161859d (branch fix/shared-issues-20261017 of his fork) does in his tree what #295-#298 did in ours, plus three things ours lacked:

  • The desktop installer's partition choice. His installer writes /etc/mu300-desktop-root-mode (part, sd, legacy) into the device ramdisk segment, which mu300-update keeps when it appends our generic segment. Our init ignored it and took a mu300sd card, then a region, before the mu300root partition. Now part boots the partition first. It is a choice, not a gate: a partition that is missing or does not mount leaves the usual order (card, region, default offset), and is not mounted a second time. sd gets no gate either (his init refuses the eMMC then; ours falls back to it, FINDINGS 178's bootability rule). His /etc/mu300-root-target (the TF-only marker behind ss12113's stage=tf-root-unavailable) is read by no init of ours, so it cannot stop a boot here.
  • The whole label. gpt_root compared the first 9 bytes of the ext4 label; mu300rootfs passed. Now all 16.
  • His TF installation. His init leaves no /run/mu300-root-dev, only /run/mu300/disk-dev. root_layout now calls a device of a disk the kernel reports as SD the card (sd), and root_on_sd uses root_layout, so the sdcard check of the kernel bundle (an older bundle cannot read the card) covers that installation too.

Already covered here: the GPT partition boot (#296), gpt-root in the bundles and the layout check before anything changes (#295), modules after the image is built with a restore on failure, mu300-next-boot --trial and the installed system's copy when the running one predates it (#295), the offline e2fsck of a dirty root (FINDINGS 182), the eMMC timing fallback (#283). Not taken: the identity of the whole bundle file instead of Image + generic ramdisk (the boot image holds only those two, and the modules are installed even when it is up to date, so a different bundle file with the same kernel and init would only rewrite an identical image); the duplicate-name refusal (two partitions named mu300root boot the first with the right filesystem rather than nothing). The desktop installer's ext4 growth check, the Wi-Fi cipher filter and the U30 Air battery LED colours are not part of #290.

Device test (F50-B, 7.2.11, region layout). A bundle of v2026.10.18.2 with this init in its generic segment, installed with this tree's mu300-update boot: armed for a trial, booted the region (mmcblk0@27762098176), system running, boots since the last good one: 0; the init read back from boot_b had this tree's sha256. The same with /etc/mu300-desktop-root-mode = part added to the ramdisk and no such partition on the board: the region again, no root-part line. Then the release's own mu300-update boot with the release bundle put v2026.10.18.2 back (the release's init read back from boot_b). The partition path itself is not device-tested here: no V50, and no mu300root partition on F50-B.

193. (removed)

195. Wi-Fi PCIe RX: the push interrupt skipped what the chip completed, and a full EDMA ring held the RX refill for up to a second

Status: built, not yet measured on a device (2026-10-19). From kanoqwq's clean-tf-7.2 2d3f7438 and cf4dcd61, reviewed and ported; the 5.4 parts are ours.

The RX push interrupt (wcn_bsp, mainline and 5.4). edma_rx_push_isr() first asked dscr_ring_empty(), which read the hardware cursor and returned "empty" when it was !IS_ERR_OR_NULL - for every valid cursor. The branch that pops the completed descriptors (edma_pop_link, mchn_hw_pop_link) therefore never ran; the interrupt only refilled the ring, and what the chip had completed waited for another path to collect it. kanoqwq compared the function with ZTE's own U30 Air wcn_bsp.ko (edma_rx_push_isr at .text+0x3f588): the stock module reads the cursor once, returns to the refill on NULL or an error pointer, pops what lies between the ring head and the cursor, and then refills. The public 5.4 source (Enceka's ZTE GPL release) and the mainline port both carry the inverted test. Now as the stock module, in upstream/modules/wcn_bsp/pcie/edma_engine.c and kernel/patches/wcn-pcie-rx-push-cursor.patch (KPATCHES, after sipa-wcn-logspam-quiet); dscr_ring_empty() is gone. kanoqwq ran it on a U30 Air (7.2.8): RX worked and nothing regressed, and he saw few RX push interrupts in steady state, so this is a correctness fix, not the answer to the idle hotspot's 20-150 ms ping (his four-point timing put that wait before the host's RX MSI, in the chip or its firmware; not settled).

The RX refill after a full pending ring (mainline). The refill hands the RX buffer addresses to the chip on the data channel (tx_addr_trans). The channel's pending ring has three usable slots; when it is full the submission is refused with -EAGAIN (§103). Since the back-off for issue #94, a refill that got nowhere retried from a timer, 20 ms doubling to 1 s - right for a chip that stopped taking buffers, too slow for a ring that frees a slot microseconds later. Now the bus's completion on that channel (sc2355_pcie_tx_data_complete, IRQ context, which already woke the TX thread) also calls sc2355_rx_bus_complete(): a refill waiting on exactly that refusal is released at once (mod_delayed_work(..., 0)), and a completion that comes before the timer is armed is remembered (refill_bus_ready). An allocation failure, a hard error, an SDIO bus, another channel or a timed-out completion leave the timer as it was, and nothing polls. refill_lock (irqsave) orders the completion against arming the timer and against teardown; hif->rx_mgmt is published with smp_store_release after init and, at deinit, unpublished and followed by synchronize_rcu() before the free, since the completion callback stays registered across an RX deinit/init and looks it up under rcu_read_lock(). The 5.4 driver has neither the back-off nor this. kanoqwq ran this one only offline (his changelog: compiled and unit-tested, not deployed), so it is off by default: sprd_wlan_combo.refill_bus_resume=1 (or echo 1 > /sys/module/sprd_wlan_combo/parameters/refill_bus_resume) turns it on; off, the completion returns at once and the refill keeps the timer exactly as before. To be made the default after a board measurement.

The 5.4 driver's event bounds. The mainline driver has had oswaldxdd's two robustness fixes since PR #282 (§80): the station event's IEs bounded by the event's length, and mgmt_tx without a channel taking the AP's own one instead of an oops. The 5.4 driver lacked both; kernel/patches/wlan_combo-station-event-bounds.patch carries them (wdev->chandef on 5.4).

Checked. tests/test_wifi_rx_path.py cuts edma_rx_push_isr(), sc2355_mm_fill_buffer(), sc2355_rx_bus_complete(), rx_refill_retry() and sc2355_pcie_tx_data_complete() out of the sources and runs them against stub kernel primitives (kanoqwq's harnesses): completed descriptors popped before the refill, wrap-around, NULL and error cursors, no free descriptor; the completion before and after the timer is armed, a duplicate storm, allocation and hard failures keeping their back-off, wrong channel, timeout, SDIO, teardown racing a submission, and the hook removed bringing the old delay back. The modules built warning-free for 6.18.57 and 7.2.11; on 5.4 every KPATCHES and wlan_combo patch applies in order, edma_engine.o compiles and sprd_wlan_combo.ko builds.

To measure on a board (any of them; the U30 Air and an F50 on mainline, F50-C on 5.4): Wi-Fi up and a client associated, an iperf3 run in both directions at full rate for some minutes (no WARN edma_pending_q_buffer full storm, no stall, throughput no lower than the release's), a ping from the client to the board idle and under load, and rmmod/modprobe of the Wi-Fi modules or a hotspot restart with traffic running (the teardown path).

196. The U30 Air's charging boot: no CP after LK's charger boot (#253), power-on on charge, unplug, the power key

kanoqwq's 85d72fa9 (his docs/U30AIR-CHARGER-BOOT-20261019.zh-CN.md) found why a U30 Air that a charger switched on has no modem, and a way round it. Checked here against the same file (work-u30air/android-subset/vendor/bin/ modem_control, sha256 43a3bc8c…819a3; the F50's copy is the same file):

  • In a charger boot LK runs the PM co-processor (it charges and keeps its watchdog) but loads no CP, and says so on the command line, androidboot.mode=charger ... modem=shutdown. Our init and android-vendor-start pass that line to the vendor daemons as it is (only the slot is swapped).
  • modem_control's start (disassembled at 0xcef8-0xcf54): w19 = modem_has_been_boot() (0xc650: does /dev/sctl_pm open, i.e. is the PM running); then the modem parameter is compared with "shutdown"; w8 = (modem != "shutdown") | w19; only w8 == 0 calls load_modem_img(63) (0xa290, every image, the PM's included). In a normal boot LK has loaded everything and modem is not shutdown; in a charger boot modem is shutdown but the PM runs, so nothing is loaded either. The CP then never comes: /dev/stty_nr* answer ENODEV, mu300-atd waits for ever, the panel shows "No response", and mobile-data / RF restarts cannot help. Our charging boot (§36) keeps the radios off until the Wi-Fi key, and the key then wakes a modem that is not there. Only a reboot (a normal boot) brings it back. That is issue #253's report word for word: a U30 Air after a flat battery (LK starts it on the charger), "No response", only a router restart recovers. (#226 was the F50: a SIPC tty not ready, §138, and the eMMC at HS400ES, §160; not this.)
  • The way round (kanoqwq's, kept): mu300-modem-coldboot makes, for that boot only, a copy in RAM (/run/mu300/coldboot, bound to the chroot's /tmp/mu300-coldboot) of the device's own modem_control with two instructions changed: 0xcf0c mov w19,w0 -> mov w19,wzr (the PM running no longer counts as "booted") and 0xcf50 mov w0,#63 -> mov w0,#34 (load the CP and CH images only, not the PM's, which is running). The copy's sha256 must then be 9e3490f2…37c2ae. The program is still named modem_control (sprd_modem_loader checks the task's comm), and android-run runs it only when android-vendor-start names exactly that path.
  • Only when every one of these holds: mu300-device says u30air; the command line has androidboot.mode=charger (or sprdboot.mode=) and modem=shutdown; /dev/stty_nr1 answers ENODEV or is missing (the CP down; a second start of the vendor service in the same boot finds it up); the device's file has the stock sha256 (the loader kanoqwq checked); and /etc/mu300/no-modem-coldboot does not exist. It was opt-in until a U30 Air had shown it (below); now on by default, off with touch /etc/mu300/no-modem-coldboot. Anything else, including any failure on the way, gives the stock modem_control as before. It cannot stop a boot or the modem: the worst case is today's behaviour. kanoqwq's version stopped the vendor service (exit 5) when the copy could not be made; ours does not. F50, V50, normal boots: untouched.

The rest of 85d72fa9, adapted to our charging boot (Linux runs, the radios held off by mu300-power, §36) rather than his (an early init stage that waits with the services not started):

  • Power-on on charge: POWER_ON_CHARGER=1 in /etc/mu300/power.conf (mu300-power set POWER_ON_CHARGER 1, the LuCI and Cockpit power pages, "When the charger switches the device on"). init then makes no charging-boot marker (it reads the booting system's power.conf; stage=boot-mode mode=charger ... power-on=1), and mu300-power starts in active. Default 0: the charging boot as before.
  • Unplugged: the stock charger mode switches off when the charger goes. The charging boot now does too: unplugged by every account (no charger online, no extcon USB=1, the battery not Charging) for two loops in a row (10 s apart), a clean poweroff. Before, it stayed up on the battery until 5 %.
  • The power key: held 3 s in the charging boot it starts the device (a wake without a key name, as the Wi-Fi key), as the stock charger mode does; held anywhere else it still shuts down.
  • Not taken: his mu300-keys -c (a C wait on the power key and power_supply uevents before the services start); our daemon's 10 s loop and mu300-buttons cover it. His mu300-charge-mode early stage and its poweroff -f after a read-only remount: our poweroff goes through procd / systemd.

Run on a device (2026-10-29, the test U30 Air, OpenWrt v2026.10.28.1, 6.18.59, modem W25.30.2; a poweroff with the Mac's USB port attached, so LK starts it again for the charger, /run/mu300/boot-mode = charger):

  • without the copy (the release's default): /dev/stty_nr1 answers No such device in the charging boot and after mu300-power wake wifi too; mu300-at: no answer from the daemon, the WAN stays down. Issue #253 exactly.
  • with it: mu300-modem-coldboot: charger boot with the CP down: loading the CP and CH images at 2.7 s, SEC_KBC_START_CP() ret = 0 and modem run = 1 at 5.1 s, /dev/stty_nr1 opens in the charging boot; after the wake AT+CPIN? READY, the WAN up on sipa_eth0, the VPN and its kill switch back, HTTPS through the tunnel.
  • a normal reboot with it on: no mu300-modem-coldboot line, no copy, the stock loader. So it is on by default since; /etc/mu300/no-modem-coldboot turns it off.

197. The U30 Air's battery while awake: the fuel gauge's interrupts, and a low-battery poweroff in every state

kanoqwq's 99e1316a (his docs/LOW-BATTERY-STOCK-20261018.zh-CN.md, from ZTE's sprd-charger-manager.ko and Android's BatteryService) found two gaps that ours had too:

  • Patch 0023 (upstream/patches/0023-power-sc27xx-fuel-gauge-UMP9620-awake-battery-events.patch). Mainline's sc27xx fuel gauge arms its low-voltage (LOW_OVERLOAD) and coulomb-counter delta interrupts in suspend only and disarms them at resume. The boards do not suspend, so neither was ever armed: the calibration the low-voltage interrupt runs (sc27xx_fgu_capacity_calibration(.., true): at the alarm voltage a capacity above the alarm capacity is pulled down to it) never ran, and no 1 % change sent a power_supply uevent. Now armed once both IRQs are registered, kept at resume, disarmed with the battery removed and armed again when it is back. Ours limits it to the U30 Air (the UMP9620 on a device tree with /charger_policy_service, patch 0016's test); kanoqwq's relied on a battery-policy probe our tree does not have, and the F50 and V50 probe this gauge with made-up readings. Built-in (CONFIG_FUEL_GAUGE_SC27XX=y); applies and builds on 6.18.57 and 7.2.11.
  • The poweroff. Ours powered off for a low battery only in the charging boot (§36: under 5 % for three loops); an awake U30 Air ran on until the battery cut it. mu300-power now checks in every state, the U30 Air only (no battery on the F50 and V50), unplugged only (as above), with the stock rules instead of a percentage of our own:
    • the charger manager's undervoltage rule (cm_uvlo_check_work): the battery at or under the shutdown voltage + 120 mV for 5 samples in a row (stock 800 ms apart, here 1 s, taken within one loop once the first sample is in the window), then off at a capacity of at most 1 % or a voltage at or under the shutdown voltage. That voltage is the device tree's /charger-manager/cm-shutdown-voltage (3.10 V on the U30 Air), 3.10 V without it. A sample that cannot be read ends the run without counting.
    • Android's BatteryService.shouldShutdownLocked: capacity_level Critical where the driver has it, else 0 %, not charging; here three loops in a row (30 s). The poweroff is the usual clean one (poweroff / systemctl poweroff, the shutdown marker first so the radios are not woken on the way down). The charge guard's pause does not stop it.
  • Not taken: his ucode service (unisoc-battery, hotplug -> ubus -> uloop). Ours polls every 10 s already, the undervoltage window samples quickly, and the uevents of patch 0023 are there for anything else that listens.

Not run on a device. What to look at on a U30 Air with this kernel: grep -c sc27xx /proc/interrupts moving as the capacity drops 1 %, udevadm monitor -k -s power_supply (Ubuntu) or logread with a hotplug hook (OpenWrt); a run down to the end unplugged: logread | grep mu300-power (or journalctl -u mu300-power) should name the rule.

198. Network locks: an automatic mode without 2G (152), from kanoqwq's fork

kanoqwq's cf4dcd61 and c1293746 add an "auto work mode" choice: the automatic network mode is written as AT+SPTESTMODE=134,... (every RAT, 2G included) or 152,... (no 2G, his reading of the vendor's table). His users on two SIMs saw long delays and stalls with 134 that 152 eased on some basebands; he does not claim more, and neither do we: the number is not a band priority and does not promise NR.

Here it is one more value of the network mode lock, not a separate setting: mode auto152 writes 152 with SP5GRAN=1, is saved and replayed at boot like every lock, and lock get reads 152 back as auto152 (an unknown first field still reads as auto). Automatic stays 134, and so does the reset (the modem's defaults, verified by its read-back). LuCI Cellular > Network locks and the dashboard's lock summary, Cockpit's MU300 page (mu300-api lock.set), the rpcd check. His separate uci option and its ACL fix (82c01b9e) are not needed: the value travels through the existing lock path. Not taken: his restart_deferred (a lock applied with the card's radio off already skips the stack restart here, FINDINGS 185).

Tests: tests/test_mu300dash_security.py (the value reaches the backend), tests/test_unisoc_plugin.py. Not yet on a device: whether a board's modem takes 152 and registers.

199. Network LED: the V50 lamp of the SIM in use; 5G for a 5G SA registration

V50. mu300-led lit NET1 for the network on every V50, whatever the card. kanoqwq read ZTE's V50 firmware (B15, services.jar, NotificationManagerService.setNetLight(), c1293746, docs/V50-NET-LAMP-MAPPING of his fork): the physical cards 0 and 3 (built-in card 1, the external card: logical slot 0, SIM1) light NET2, cards 1 and 2 (built-in cards 2 and 3: slot 1, SIM2) NET1, and the other lamp is cleared. A user saw his card on NET2 under Android and on NET1 under OpenWrt. Now the lamp follows this boot's slot (/run/mu300/sim-slot, as the AT daemons read it): slot 0 NET2, slot 1 NET1, the colours as before (blue 4G, white 5G, red without service), the other lamp dark; the heat alarm's siren uses the same lamp. The lamp's names in the driver were checked by lighting each one (FINDINGS 95) and do not change.

5G SA. led_up (mobile-data) told 4G from 5G by the AcT of AT+CEREG?. A 5G SA registration is in the NR domain alone: CEREG then says not registered, and the F50 and the V50 showed blue (4G). Now, when CEREG names no NR access technology and is not registered, AT+C5GREG? decides: registered (1 or 5) is 5G. From kanoqwq's network-led.sh (f0ed60ff). A failed read keeps the 4G colour, as before. An LTE registration asks nothing more than before (his case of an EPS registration still reporting LTE while NR is registered as well is not followed: the watchdog's round stays one AT read on LTE).

Not taken: his U30 Air part of f0ed60ff (4G/5G from the slot in use). The U30 Air's network light shows the SIM in use, not the technology, as ZTE's firmware (FINDINGS 154); mobile-data's at already asks the card in use.

Tests: tests/test_device_scripts.py (test_v50 for no slot, slot 0 and slot 1; test_led_from_cereg). Not yet on a device (no V50 here; F50 with SA).

200. CPU cores on and off, and CPU0's low latency (both saved; low latency off by default)

From kanoqwq's c1293746 (per-core switches, cpu-cores.uc) and 2d3f7438 (mu300-lowlatency), rewritten into mu300-cpu (one program for Ubuntu and OpenWrt).

Cores. mu300-cpu core N on|off takes CPU N offline or brings it back now, and saves it (CORES_OFF in /etc/mu300/cpu.conf); mu300-cpu apply (the boot service) takes the saved ones offline again. CPU0 is refused (the kernel's timekeeping and the vendor drivers' interrupts start there). A core brought back gets its cluster's profile limits again. mu300-power's idle, which takes CPU7 offline and brings it back, leaves a core kept offline alone. CONFIG_HOTPLUG_CPU is already =y in both mainline kernels (the 6.18.57 and 7.2.11 builds' kernel.config), so his config change is not needed. status --json lists each CPU, online and switchable.

Low latency. ZTE's U30 Air firmware disables all three idle states of CPU0 after boot (init.md.rc, "zte add for feimao lowlatency"). kanoqwq measured on a U30 Air (docs/U30AIR-WIFI-IDLE of his fork): with CPU0's deeper states allowed, received Wi-Fi events waited 34 ms on average and 100 ms at worst (A), with WFI only 0.6 ms and 2 ms, and 23 ms and 73 ms back (B); on the stock firmware the reverse (0.6 ms, then 6.7 ms and 81 ms at worst with CPU0's idle allowed, then 1.2 ms). Phone pings (the phone's power save off): 12.8 ms and 43.3 ms on average before and after, 7.3 ms with WFI only. He did not measure the power cost. So it is a switch here, off by default: mu300-cpu lowlatency on|off writes every cpu0/cpuidle/state*/disable, saves LOWLATENCY=1, and the boot service applies an "on" (an "off" leaves the kernel's settings alone). His fork applies it to every board unconditionally; that is not taken.

Front ends: LuCI System > CPU (a Cores card: a button per CPU, and the low latency switch), Cockpit's Power and CPU page, mu300-api cpu.core / cpu.lowlatency, rpcd mu300dash cpu_tune; EN/TR/ZH and the other catalogs.

Tests: tests/test_cpu.py (CoresAndLatency), tests/test_api.py test_cpu, tests/test_mu300dash_security.py. Not yet on a device: the boards' hotplug of each core, the latency and the power draw with it on.

201. CPU voltage offset: the U30 Air's and the V50's SoC firmware are known

FINDINGS 133 kept the U30 Air out of the offset until its SML was read. kanoqwq read it (c1293746, docs/U30AIR-CPU-VOLTAGE of his fork): sml_a and sml_b are the same 1 MiB build, f27ac16f44e6cdc87a8ee00a9b53c499c8dde0c3b92c771388e256e84ef12e70, and differ from the F50's known build only in 508 bytes inside the 512-byte authentication area at 0x233e8; the payload [0x200, 0x23150) is the F50's byte for byte. On his U30 Air (7.2.8) +3125,+3125,+3125 moved every one of the 31 table entries of the three domains up by exactly 3125 uV after a reboot, and 0,0,0 put them back byte for byte. Its hash joins the known list in boot/init and mu300-cpu (a test keeps them equal). Nothing else changes: the offset stays 0 until asked for with the confirmation word, and a new value still gets its one trial boot. His V50 build (5b3183f17af9b416..., from his f6b0668d: "the same verified executable and DVFS tables as F50; only 512 bytes in the authentication trailer differ") joins it as well: the owner takes his findings (2026-10-19). Neither board's offset was tried here. His related_cpus fix for the domain labels is in place here already (mu300-cpu reads related_cpus). Not yet tried on our U30 Air.

202. A SIM's radio off is the vendor's AT+SFUN=5, not flight mode

FINDINGS 185 switched a card's radio off with AT+CFUN=4 (flight mode) on its own channel. kanoqwq (cf4dcd61, docs/SIM-RADIO-SFUN of his fork) found that the vendor RIL switches a card's radio with AT+SFUN=5 (off) and AT+SFUN=4 (on); the stock RIL's isRadioOn reads CFUN 0 and 2 as off, 1 as on. On his V50 (baseband MOCORTM_V2_23A_W25.33.6) through the panel: SIM2 off read 1/0 with both cards still READY, all off and back one card at a time, the settings kept across reboots, a data connection taken down by hand left down. The owner takes his findings.

Now mobile-data's rf_off_locked sends AT+SFUN=5 and accepts CFUN 0 or 2 read back; 0, 2 and an earlier release's 4 count as off already. Back on: from 4, AT+CFUN=1 as before; from 0 or 2 the ordinary bring-up, whose AT+SFUN=4 is the vendor's way back (the RIL handshake and the early lock replay are done once per boot, so they are not repeated). radio_on_locked treats 2 like 0. The U30 Air's live switch takes a card in use that is off by its setting at 0, 2 or 4 (it ends that card with SFUN=5 itself). Not taken from the same commit: his SIM2-off default and his "both off at a cold boot" initialisation. Both belong to his mu300-dual-radio, which runs both cards' stacks at once; here only the card in use has a stack, the other one's setting only decides whether it may start, and an all-off boot keeps the cold 0 after the RIL handshake (FINDINGS 185).

Tests: tests/test_device_scripts.py (SimRadio), tests/test_sim_hot.py (test_the_card_in_use_off_by_sfun5_still_switches). Not yet on our boards.

203. OpenWrt hotspot: U-APSD off

kanoqwq (2d3f7438, docs/WIFI-UAPSD-POLICY of his fork) turns U-APSD advertisement off on every access point: openwrt-wifi-config writes option uapsd '0' for a new hotspot, and uci-defaults/94-mu300-ap-uapsd (his migration, as it is) sets it once on every kept wifi-iface in AP mode, stations and the other options untouched. WMM, DTIM, the beacon interval and the channel stay. On his U30 Air hostapd's configuration then had uapsd_advertisement_enabled=0 and the WMM element the driver received had the U-APSD bit clear, but a beacon read from another computer still carried QoS Info 0x80: the firmware may announce it on its own. So this is the configuration his tree has, nothing more is claimed. Ubuntu's hotspot is not changed (his tree changes OpenWrt only).

Tests: tests/test_wifi.py (ApUapsd). Not yet on our boards.

204. The ZTE V50's SIM cards: a third built-in card shares SIM2, the external card SIM1 (#332)

Status: offline only. Nobody here has a V50; the test steps are in the PR for the #332 reporter.

What was asked. #332: a V50 has three positions on its SIM selector (two carriers' built-in cards and the tray), and under Linux only the first built-in card worked. The reporter found the switch in an Android capture: no AT command, a SoC GPIO (soft-psim-switch; gpiochip4 line 108 on the mainline numbering, 172 on Android's) that Android's telephony framework drives; gpioset ... 108=1 before the modem came up gave him the external card.

What kanoqwq read in ZTE's firmware (his f0ed60ff and b4c051c8, docs/V50-CARD-TOPOLOGY-U30-LED-20261019.zh-CN.md in his fork; B15 firmware, ElfDeviceManager and the telephony framework, sim_gpio_ctl.ko disassembled). A V50 has one of four board variants, told by ZTE's board_id (/proc/driver/board_id on Android; the bootloader's androidboot.zte_boardid in the device tree's chosen/bootargs under the mainline kernel):

board_id cards card IDs
0 three built-in 0 1 2
1 three built-in and the tray 0 1 2 3
2 two built-in and the tray 0 1 3
3 two built-in 0 1

The modem still has two SIM interfaces. Card 0 (built-in SIM 1) and card 3 (the tray) share SIM1 behind soft-psim-switch (0/1); card 1 (built-in SIM 2) and card 2 (built-in SIM 3) share SIM2 behind esim2-esim3-switch (0/1). esim1-psim-switch is, despite its name, an input (the card holder's detect line). The reporter's GPIO and polarity agree with this table. ZTE's own switch powers the SIM down first (SFUN=5, SFUN=3), sets the GPIO, waits 5 s and powers it up (SFUN=2, then SFUN=4).

What this tree does with it. kano switches live, with both protocol stacks running; this tree runs one card per boot (the F50's selection, docs/SIM-SELECTION.md), so the card is chosen for the next boot and switched in before the modem's CP starts. No AT command and no power sequence are needed, nothing waits 5 s, and a SIM is never switched while powered.

  • zte-v50-sim.c (kano's driver, built in; CONFIG_ZTE_V50_SIM=y): binds the stock zte,sim_gpio_ctrl node only where the V50's AW9523B is, and exposes chip_select, psim_select (read/write) and psim_present (read). It drives nothing at probe (GPIOD_ASIS): ZTE's module set both outputs from androidboot.simswitch / psimswitch or a default, kano's does the same on a cold boot. Here a V50 whose owner never chose a card keeps exactly the routing it had before this driver, and a write that matches the line's level leaves the line alone.

  • mu300-sim card 0|1|2|3|none (V50 only): checks the card against the board, saves it (OpenWrt network.wan.v50_card, else /etc/mu300/v50-card) and the SIM interface it is on (sim_slot, as select), refuses without the driver; none forgets it. mu300-sim default 1|2 keeps a card on that interface and forgets one on the other. status --json has a v50 member (board, cards, the card in use from the switches' levels, the saved one, the levels); no AT command.

  • mu300-sim v50-boot, from android-vendor-start right before modem_control (OpenWrt S09, Ubuntu alike): once a boot, on a V50 with a saved card the board has and whose interface is the boot's, sets that one switch when its level differs, and then drops the dashboard's identity cache of that interface (sim.json / sim-slot1.json: the previous card's operator and numbers). Anything else (another board, no card, an unknown board_id, a card on the other interface than the WAN page's choice, no driver) leaves the switches as they are, logs why and starts the modem as before. It never stops the boot.

  • The V50 now boots SIM2 as the F50 does (slot1_supported): the same modem and channel set (nr3/nr4/nr5, sipa_eth8, AT+SPSWDATA); this is what makes built-in SIM 2 and 3 usable. Each interface keeps its own APN profile on the WAN page, whose labels say which cards are behind it on a V50.

  • Front ends: LuCI Cellular > SIM (a card list for this board, the card in use and at the next boot; sim_set card), Cockpit's SIM card (mu300-api sim.card), the backup (sim.card in the sim section on a V50). EN/TR/ZH and the other catalogs.

  • kano's live switch, opt-in: mu300-sim card N --now (the CLI only) switches a card on the SIM in use without a reboot, in ZTE's order as his mu300-v50-sim does: the data down, then under mobile-data's radio lock SFUN=5, SFUN=3, the switch, 5 s, SFUN=2, the card's +CPIN: (8 s at most), SFUN=4 when that SIM's radio is allowed; a failure switches the previous card back the same way. A card on the other SIM still needs the reboot (one stack runs here). kano's notes say the physical switching was not tried on any board variant (his V50 is board 3, two built-in cards, and he deployed and read the driver there, without switching), so the reboot path stays the default.

Not taken from kano. His dual-stack data-card transaction around the switch (mu300-data-sim, the identity generation markers; his tree runs both stacks); the cold-boot levels from androidboot.* (a default nobody verified on four variants; here a V50 without a choice keeps the bootloader's routing); the preserve_state module parameter (here it is the only behaviour). His U30 Air network LED and V50 NET-lamp changes are in the misc port.

Risks. A wrong table entry for some board would switch in a card position with nothing in it: SIM1 or SIM2 then has no card, and mu300-sim card none plus a reboot (or choosing another card) gives the bootloader's routing back. The driver does nothing without the V50's AW9523B, so the F50 and the U30 Air are untouched (v50-boot returns at once there).

Tests: tests/test_v50_sim.py (the board table, the mapping, status, card, default, v50-boot and its once-a-boot rule, the live switch's order and its switch back, the identity cache, other boards, the driver drives nothing at probe), tests/test_sim_selection.py, tests/test_api.py, tests/test_backup.py, the catalogs.

Status: measured on a U30 Air running 7.2.11; nothing is changed here. #341, the fix under test, made the flipped orientation worse on this unit (below).

What was asked. #54 reports OpenWrt limited to USB 2.0 (480 Mbps) on the MU300 while Android gives USB 3 host speeds. From the host side (koocyton's four-orientation table) SuperSpeed worked in one plug orientation only. #341 says why: the PHY's TCA and the PTN38003A redriver are written once at power-on and never again, so the orientation that SuperSpeed uses is whatever was latched at boot. This entry adds the device side: a U30 Air plugged into a computer.

Setup. U30 Air (UMS9620), OpenWrt 25.12.5 / mainline 7.2.11, USB-C to an Apple Silicon Mac. That Mac's port controller exposes both lanes (usb-drd0-port-hs and usb-drd0-port-ss), so the attachment point itself says which speed the link trained at. Cable and host are not variables: the same cable on a Cudy TR3600's USB-A port with a Fanxiang S500Pro SSD enumerates usb 2-1: new SuperSpeed ... 5000 (uas), and the U30 Air's UDC reports maximum_speed = super-speed-plus throughout.

Measured — cat /sys/class/udc/25100000.dwc3/current_speed, and macOS Device Speed on the same link:

# state current_speed macOS
1 OpenWrt default, via the Cudy router's USB-A high-speed — (usb 1-1: new high-speed)
2 OpenWrt default, Mac through an LG display hub high-speed 2, under AppleUSB20HubPort
3 OpenWrt default, Mac's own USB-C port high-speed 2, under usb-drd0-port-hs; port-ss empty
4 Android 13 (vendor, 5.4.254) super-speed-plus 4
5 Android → Linux, warm switch, PD off super-speed-plus 4
6 OpenWrt + mu300-usb pd on, orientation A super-speed-plus 4
7 PD off, orientation A super-speed-plus 4
8 plug flipped 180°, orientation B high-speed 2
9 orientation B + mu300-usb pd on high-speed 2
10 flipped back to A high-speed 2, no recovery

What it shows.

  • Device mode behaves like the host side: SuperSpeed is available only in the orientation the PHY/redriver latched at power-on. A replug does not bring it back; only a power cycle does, which is the redriver's once-per-power-on auto detection (#341).
  • mu300-usb pd on (0020) is not a workaround for the flipped orientation: /sys/class/typec/port0 appears and mu300-usb reports role: device, data role: device, power role: sink, but current_speed stays high-speed. The TCPM driver manages CC and the roles; it does not move the SS lanes.
  • Rows 4–5 are why a flipped unit can look fixed: Android has the Type-C driver, configures the port, and a warm switch into Linux leaves that state in place. The link then comes up super-speed-plus without any PD.

dmesg at the failing attach (no driver for the Type-C block, so no redriver lines — as expected without #341):

sprd-ssphy 25310000.ssphy: VBUS from /extcon-gpio (no driver for the Type-C block)
sprd-ssphy 25310000.ssphy: vbus off
sprd-ssphy 25310000.ssphy: ssphy set vbus invalid!
sprd-ssphy 25310000.ssphy: vbus on
sprd-ssphy 25310000.ssphy: ssphy set vbus valid!

#341 on the same unit (2026-10-22, 7.2.11 built from usb-typec-orientation-54, orientation = auto, device mode to the same Mac): orientation A super-speed-plus (10 Gb/s), orientation B not enumerated at all, back to A super-speed-plus. Before #341, B fell back to high-speed and worked. The attach in B logged

USB 3 lanes flipped (from USB_SW; USB_SW 1, Type-C CC1, TCA flip status 1)
redriver: -5

and i2cget -y N 0x30 0x04 fails with EIO on buses 6, 4, 2 and 1, while bus 6 itself works (the charger at 0x6b is held by its driver). The device tree has the sprd,ptn38003a redriver node at 6-0030 (no supply, no enable GPIO). Two readings, not yet told apart: the redriver is not fitted (or not powered) on this unit, so only the TCA routes the SuperSpeed pairs; or auto's source, the AON USB_SW bit, is wrong for this attach (here it disagrees with the PMIC's CC1). The next measurement: the same flip with orientation = cc, then off. #355 is a draft guard (no TCA flip when the redriver did not answer), which would bring back the USB 2 fallback but not SuperSpeed in B.

For reference, the link is not the transfer bottleneck at current cellular speeds: 325.9 Mbps down (NJU mirror) over the SS link, and 244 Mbps over the 480 Mbps fallback on the same mirror.

206. Linux 7.3 as a fourth kernel: what 7.3 changed, and the boards on it

Mainline Linux 7.3 came out on 2026-10-18. It is a fourth kernel choice from the release after v2026.10.19.2 on: sudo mu300-update kernel 7.3, choice 4 in the installers, mu300-kernel-7.3.tar.gz, Magisk zips -k7.3 (15 zips instead of 11). 5.4, 6.18.57 and 7.2.11 stay as they are.

The patches. Every patch of upstream/patches applies to 7.3 unchanged, in order (a dry run of each alone fails for the ones that build on another: 0011 on 0010, 0012/0015/0016/0019 on 0009, 0018 on 0011). None is upstream in 7.3, so none was dropped or changed; three apply with fuzz, as they do on 7.2 (0003: 7.x dropped the cma_skip_dt_default_reserved_mem() line next to it; 0005: dev_err_probe() in the error path; 0019: the gpio/consumer.h include is gone from bq256xx_charger.c), each checked to land where it does on 7.2.11. patches/6.18/0007 stays 6.18's. port/install.py installs unchanged.

What 7.3 changed under the port.

what 7.3 here
CONFIG_PROC_SYSCTL gone: /proc/sys is SYSCTL itself (fs/proc/Makefile: proc-$(CONFIG_SYSCTL) += proc_sysctl.o) config-ignored.txt lists it; build.sh and audit-bundle.py let a listed option be unset only where the kernel has no such symbol at all (not even "is not set"); the fragment also asks CONFIG_SYSCTL=y, so /proc/sys is checked on every kernel
cfg80211 remain_on_channel, mgmt_tx the cookie is chosen by nl80211 (cfg80211_assign_cookie) and handed to the driver by value sprd_wlan_combo: the old ops keep choosing it, the 7.3 ones take nl80211's (MU300_COOKIE, the by-value ops in common/cfg80211.h)
dma_capable() a fifth argument, the DMA attributes sc2355/tx.h passes 0 (a plain mapping) on 7.3; tx.c is unchanged
kernel.org's CDN its sha256sums.asc still had 7.2.11's day hours after 7.3 was out: no line for linux-7.3.tar.xz build.sh takes the signed list from www.kernel.org (the tarball and its signature from the CDN; the list is signed, so where it comes from changes nothing that is checked)
the release's version picker a mainline release is 7.3 (kernel release 7.3.0) until 7.3.1 release.yml takes X.Y or X.Y.Z of each series (6.18, 7.2, 7.3); mainline.yml builds the longterm, the stable, the mainline (never a release candidate) and the newest of each shipped series

The 7.3 code of sprd_wlan_combo sits in its headers (cfg80211.h, tx.h) and in macros of the same width as the text they replace, so the module built for 6.18.57 and 7.2.11 from this source is byte for byte the one v2026.10.19.3 shipped (rebuilt against that release's trees, stripped as build-modules.sh does: same sha256; a first form with the 7.3 code in cfg80211.c changed the 7.2.11 module's build ID through its debug information's columns). 6.18 and 7.2 therefore did not change with 7.3.

The kernel and all its out-of-tree modules build with no new warning (690 in the module build against 691 for 7.2.11); all-modules.py turns 2457 options into modules (7.2.11: 2442). The bundle: 3054 modules (no audio drivers), 135 MiB unpacked, 56.3 MB; the Image as LK loads it 25 860 104 bytes. make-release.sh's audit (the sample modules, prohibited-module checks, the features) passes on it.

On the boards, 2026-10-19 (v2026.10.19.2 with this branch's mu300-update, the 7.3 bundle installed with MU300_KERNEL_BUNDLE; the previous image kept each time was the release's own):

  • F50-B (Ubuntu 24.04, no internet, the files served from a computer), against the same checks on 7.2.11 just before: 7.3.0 boots, KVM in VHE mode (571/710 trap handlers), no oops or warning; mobile data context up with an address on sipa_eth0 (the board has no internet: AT +CPIN: READY, +CSQ: 37,19, +COPS: 0,2,"28602",13, +CGACT:1,1); the 5 GHz access point on channel 36/80 MHz; Bluetooth up; the USB gadget configured; Cockpit answers (200); the LEDs as on 7.2.11; the on-demand guard refuses the same families and lets root load them, the module sample loads 93 of 99 (the same 6 not built as on 7.2.11), no oops; Docker 29.1.3 runs a container (overlay2, cgroup v2, an address on docker0; the container cannot reach the host, which mu300_filter drops on purpose). Boot 41.3 s (7.2.11: 52.8 s).
    • The boot fallback. With mu300-next-boot attempts 1 and mu300-boot-ok disabled for the test, the next boot of 7.3 came up with slot b at tries 1 (1f), and the one after it went to Android by itself; su -c mu300-linux there armed Linux again and 7.3 booted. mu300-boot-ok and 5 attempts back: slot b 6f, as before.
    • A hang that was not 7.3. In a reboot loop afterwards the first reboot did not come back: no USB network, no adb; the board enumerated as iWHALE2 (Spreadtrum 0x1782:0x4d00), LK's dump mode, for about two and a half hours, then booted 7.3 again by itself with one slot try used (5f); rollback-boot then put it back on 7.2.11. The owner found the cause: he had pulled F50-B's plug by accident during that reboot. It is not counted against 7.3.
  • U30 Air (openwrt-luci, the VPN module with its kill switch): 7.3.0 boots with no oops; the SIM ready, data up; the access point on channel 36/80 MHz with its client back; the USB gadget configured; the VPN's tunnel (sbtun) up behind the kill switch (mu300_vpn tables), HTTPS answers through it and the exit is not the carrier's address (the VPN's configuration was not read). The charger came up as on 6.18.57 (charging on, 2000 mA input) and the fuel gauge read the same; the battery took no current at 88 % on either kernel. Then rollback-boot to 6.18.57: the same checks pass there.

The release, v2026.10.22.1 (2026-10-23). 5.4.254, 6.18.57 and 7.2.11 are v2026.10.19.3's builds: every file of their bundles is the same (the outputs reused, the Wi-Fi module shown identical above); 7.3.0 was built fresh. On F50-B (Ubuntu 24.04, offline), updated from v2026.10.19.2 with the release's mu300-update, then mu300-update kernel 7.3: 7.3.0 boots, mobile data, the access point and Cockpit are up; a reboot soak of 10 boots on 7.3 came back 10 times (about 42 s each), every boot with the same checks passing, no oops, no failed unit. F50-B stays on 7.3. (During the update's download, still on v2026.10.19.2's 7.2.11, F50-B reset once by itself, with nothing in the journal or pstore; the second try went through.)

Not tried on 7.3 yet: the CPU voltage offset, the U30 Air's USB host mode, dae (7.3 has BTF and the BPF JIT, as the fragment asks), a reading of the F50's SD card.

207. The U30 Air's charger: the battery's CV and the stock safety-timer policy (and 3 A, off unless asked for)

Status: patch 0024 checked by kanoqwq on a U30 Air (7.2.8); here 0024-0026 apply to 6.18.57, 7.2.11 and 7.3, the Image builds on 6.18.57 and 7.2.11 and both files compile on 7.3, with no warning; not run on a device here. Patch 0025 is off by default.

kanoqwq's c031a58a (his docs/U30AIR-CHARGING-EARLY-FULL-20261022.zh-CN.md): users saw "Full" at about 84 % with a 90 % limit, and a stop near 91 % that only a replug ended. He compared our driver with ZTE's sqc_bq2560x.ko (read from his U30 Air's vendor_dlkm_a, SHA-256 ce42c87c...) and its source:

  • The CV. Patch 0009 capped the vendor node at 4.208 V, a value read once from Android's registers. ZTE's driver takes the battery node's CV (4.3 V on the U30 Air SSV; every JEITA step of SDP/CDP/DCP says 4.3 V too). A low CV enters the constant-voltage phase early and can terminate at a low percentage. Patch 0024 (upstream/patches/0024-power-bq256xx-U30-Air-battery-CV-and-stock-safety-timer.patch): the vendor node (ti,bq2560x_chg, already kept off the F50 and V50 by patch 0016) takes the battery node's CV bounded by the chip; without a valid node, the chip default. Other bq256xx boards as before. Corrected (FINDINGS 224): 0024 rounded 4.3 V down to 4.272 V (REG04 0x68); ZTE's driver programs one step more, 4.304 V (0x70), and patch 0029 does too.
  • The safety timer. ZTE's probe clears REG05 bit 3 (EN_TIMER, at probe+0xdd8), as its source's bq2560x_charger_set_safety_timer(.., DISABLE) does; ours left the chip's timer on, which can end a long slow charge until a replug. 0024 clears it and keeps EN_TERM; TS/NTC, overvoltage and thermal protection are other bits and stay.

kanoqwq's check on his U30 Air: REG04 0x68 (4.272 V; what 0024 itself wrote, not the stock value: FINDINGS 224), REG05 0x87 (termination on, timer off), the 1.98 A ICHG, the computer port's 500 mA and the user charge limit unchanged; he did not run a full cycle or catch the original early "Full" again. His regression for the second point is ours already: mu300-power's charge limit (FINDINGS 33l, 36) works from the capacity, never from a "Full" status. Not taken: ZTE's 16-hour plugged-in policy (charger_policy_service, expired-mode-enable); kanoqwq has not ported it either.

3 A, patch 0025, off by default. His 627cacea (docs/U30AIR-3A-20261022.zh-CN.md) lets the U30 Air charge at the battery node's current (3 A, bounded by the chip; 1.98 A without a valid node), sets that as the initial ICHG, and takes a Type-C source's 3 A Rp as 3 A of input instead of 2 A. BC1.2 SDP/CDP/DCP (0.5/1.5/2 A), the CV, termination and thermal bits are unchanged. He read the registers back (ICHG 3 A, REG02 0xb2) on a computer's port and says himself that this is not a test of 3 A into the battery or from a 3 A charger. So here every part of it is behind bq256xx_charger.u30air_3a (0444, default N): without it the driver is exactly 0024's. The driver is built in, so the switch is a kernel command-line option (MU300_CMDLINE_EXTRA=bq256xx_charger.u30air_3a=1 for a test build; mainline forces its own command line, FINDINGS 160).

tests/test_u30air_charger_ncm.py reads both patches. His tests/bq256xx_stock_cv.py and tests/bq256xx_typec_current.py compile the driver's functions out of a prepared kernel tree; they are not here (no kernel tree in the test run). Device check before merge (U30 Air): i2cget of REG04/REG05 (0x70/0x87 with 0029, FINDINGS 224), a charge from about 80 % on a wall charger with the 90 % limit (no early Full, no stop before it), and with u30air_3a=1 a test build, constant_charge_current 3000000 and the current measured from a charger that offers 3 A.

208. NCM: a timer flush that finds the USB requests busy (off unless asked for)

Status: offline only (kanoqwq's fixture and ours); off by default.

kanoqwq's e4ad30a0 (docs/NCM-TX-TIMER-20261022.zh-CN.md), a backport of Cosmin Tanislav's linux-usb patch of 2026-08-17 (lore 20260817192638.437798-1-cosmin-gabriel.tanislav.xa@renesas.com; not in 6.18, 7.2 or 7.3): ncm_tx_timeout() flushes a half-filled NTB with ndo_start_xmit(NULL, ..) and ignores the result. When every USB TX request is in flight, u_ether's eth_start_xmit() returns NETDEV_TX_BUSY, nothing is wrapped, and the timer returns HRTIMER_NORESTART: no qdisc requeues a NULL skb, so the NTB waits for the next frame. Users reported host-side stalls after long USB use; nobody has captured one, and the fix is not shown to cure them.

Patch 0026 (upstream/patches/0026-usb-gadget-ncm-retry-a-busy-timer-flush-off-unless-asked-for.patch): with usb_f_ncm.tx_busy_retry set, a BUSY flush moves the timer 300 us on (hrtimer_forward_now, so an expired timer does not spin) and returns HRTIMER_RESTART; a successful flush, a gone netdev or the usual hrtimer_cancel at disable end it. Off by default because kanoqwq tested it on a C fixture built from the real u_ether.c/f_ncm.c (10000 BUSY rounds, ASan/UBSan), not on a device; the parameter is 0644, so a device test switches it at run time: echo 1 > /sys/module/usb_f_ncm/parameters/tx_busy_retry. Patch 0008's small-frame flush is unchanged. Applies to 6.18.57, 7.2.11 and 7.3 and builds on all three. His tests/usb_ncm_timer.py and ncm-tx-fixture.h (and 04294c7b, a fix to that test's dry run) need a prepared kernel tree and are not here.

Device check before merge (any board, USB tethered): with the parameter on, a long USB ping and an iperf3 run both ways at once for an hour; no stall, and latency and throughput as with it off (patch 0008's header has reference numbers).

209. kanoqwq's shared installation fixes (b8d4f222): backup restore, the boot-control pair, cpio parents

Status: offline only. From kanoqwq's b8d4f222 ("OTA diff tools and shared installation fixes"); the OTA diff tools themselves are not taken (they are his desktop installer's and his LuCI OTA page's; this tree updates with the signed releases of mu300-update).

  • OpenWrt's sysupgrade wrapper let a backup be made but not restored. /sbin/sysupgrade here refuses firmware images (an armsr image would overwrite the eMMC) and passed only -b/-l; LuCI's System > Backup "Upload archive" runs sysupgrade --restore-backup /tmp/backup.tar.gz, which it refused. Now, as his: one of -b/--create-backup FILE, -r/--restore-backup FILE or -l/--list-backup, with only the options that shape a backup (-k -u -c -o -p -v -q); an image file, -n, -F, -T, two operations or a missing file name is refused. Not taken: his disable-stock-upgrade (it rewrites LuCI's minified flash.js at build time and stops the build on any other layout); the wrapper already refuses the flash, and the panel has its own Update page.
  • mu300-next-boot checks the pair of boot-control blocks. The block's first bytes are the slot suffix LK reads (_a/_b). Without /run/mu300/linux-slot (or a garbled one), the initramfs' Linux block now names the slot, before the command line and the old default b. And a pair where Linux's block names another slot than Linux's, or Android's names Linux's, is never written: every command but status stops with "do not match", misc unchanged. The initramfs never publishes such a pair (publish_slot copies both from the image, for the slot it found); this guards against anything else that did. His other half of this change (boot/init refusing to start without a known slot) is not taken: our initramfs falls back to the slot the image was built for (etc/mu300-linux-slot) before b, and a boot that stops in a rescue shell would trade a working default for a gate (no boot gates here).
  • The initramfs builder writes every parent directory. cpio_archive() put out only the directories it was given; the kernel's unpacker does not create missing parents, so a file under an unnamed directory would be dropped. Every image so far named its directories; now the parents are added (an appended segment that names only etc/mu300-trial-guard gets etc again, which the unpacker accepts).

His SIM-event change in the same commit (a ready report with trailing numbers) is in the next entry.

tests/test_device_scripts.py (SysupgradeWrapper, two NextBoot cases), tests/test_boot_image.py (CpioParents). Device check before merge: OpenWrt, any board: LuCI System > Backup, generate an archive and upload it again (the settings come back, the box reboots as LuCI says); sysupgrade some.img still refuses. Any board, either system: mu300-next-boot status and a reboot with the default boot linux (--rearm at boot-ok works as before).

210. A SIM ready report with trailing numbers, and the U30 Air's charging light after a steady one

Status: the LED part checked by kanoqwq on a U30 Air; the SIM part seen by him on an E5-family board. Offline here.

  • +ECIND: 3,0,0,1 is a SIM event too (kanoqwq's b8d4f222, docs/SIM-EVENTS-EXTENDED-20261020.zh-CN.md in his fork). A card coming up reports +ECIND: 3,100 (CPIN still busy) and then +ECIND: 3,0,0,1. The stock RIL's onSimStatusChanged takes type, value and cause and ignores numbers after them; mu300-sim-state's filter (FINDINGS 186) dropped any report with a fourth field, so the second report started no check, and a card that was busy at the first one was found only by the watchdog's five-minute look. Now trailing fields pass when every field is a decimal number of at most 10 digits and 32 bits; an empty field, a sign, a trailing comma or other characters still drop the line, and value and cause are filtered as before. Seen on his angelcare K1 (E5 family), the same modem firmware's report; not seen on an MU300-family board yet.
  • The U30 Air's battery light stayed steady instead of breathing (his edcdeb27, docs/U30AIR-LED-DOCK-CURRENT-20261022.zh-CN.md). Charging, the trigger was pattern with the right curve, but the PMIC's LED control register read 0x300: RUN and the steady TYPE bit both set, so the light stayed on. The SC27xx driver's pattern_set sets RUN without clearing the steady bit, and the pattern trigger does not always call pattern_clear when it takes over; going from a steady colour (Full, or not charging on the charger) to breathing reproduced it. mu300-led's breathe now writes brightness 0 first when the channel is not on the pattern trigger yet, and leaves a channel that is alone. He read 0x100 after the same steps and ran the colour sequence Full -> Charging -> 49 % -> 50 % -> Full -> Charging on his device.

Not taken from the same commits: his SMS pool resolver and 25-character list column (ours has one pool, /etc/mu300/sms-pool, and mu300-sms list cuts the time column to 21 characters), the dashboard's signed battery current (our battery tile shows the charge or discharge power in watts), his per-SIM VoLTE/VoNR receipt fix (500e5ea4: our mobile-data voice --json --read reads both live values every time, there is no receipt to go stale), his V50 radio resume (c031a58a: it is in his dual-stack mu300-dual-radio; one stack runs here), his sim-reset data-priority call (cb1f761d: this tree sends no CEUS/CEMODE).

tests/test_device_scripts.py: SimState.test_event_filter, and in Led the breathing after a steady light. Device check before merge: U30 Air: full on the charger (steady white), then discharge below full and plug in again: the light breathes (on OpenWrt cat /sys/class/leds/sc27xx:green/trigger shows [pattern]). Any board with a SIM tray: take the card out and put it back; logread | grep sim-state or journalctl -t mu300-sim-state shows a check within seconds of the second report.

211. The panel: power off, a cell entered by hand, the battery as a bar

Status: offline only. The dashboard parts of kanoqwq's b8d4f222 and edcdeb27, in this tree's LuCI app.

  • Power off or restart. The dashboard's restart button asks which: Cancel, Power off, Restart. Both go through mu300-dash-act (reboot or poweroff after the 3 s grace for the reply, the usual orderly way: procd stops the services and unmounts; never forced). mu300dash's act takes poweroff with no argument, as reboot. On a board without a battery the USB supply may start it again; that is the bootloader's choice, as with a long power-key press.
  • A cell entered by hand (Cellular > Network locks, under the neighbor table): the type (LTE or NR), the channel number (EARFCN 0-262143, NR-ARFCN 1-3279165; a channel number, not MHz) and the PCI (0-503, 0-1007). The page checks the ranges and locks it as a neighbor row's button does (lock apply cell lte:EARFCN,PCI, the same confirmation); the cell does not have to be in the neighbor list. The backend's own check (valid_cell: digits, at most 7 and 4) is unchanged. kanoqwq's backend change in the same commit (LTE EARFCN 0 allowed) was his tree's; ours already allowed it.
  • The battery tile has a capacity bar like CPU, memory and storage, hidden without a battery or a percentage.

Not taken: his signed battery current in the tile (ours shows the charge or discharge power in watts). Cockpit's MU300 page has no manual cell entry yet. New messages in all 31 catalogs.

tests/test_mu300dash_security.py (poweroff among the act fields and pass-throughs), tests/test_luci_i18n.py. Device check before merge (OpenWrt, any board): the dashboard's button: Cancel does nothing, Restart restarts, Power off powers off (U30 Air: off until the power key). Network locks: an LTE cell from the neighbor table entered by hand locks as the row's button would (the page's lock summary shows it), out-of-range values are refused on the page; then Unlock. The U30 Air's battery tile shows the bar.

212. Kernel modules whose names differ only in case: one of each pair was lost on the build host

Status: fixed in the release scripts and the installers; v2026.10.23.1 is the first release whose mainline bundles are complete. Found while building v2026.10.23.1.

A mainline kernel builds four pairs of netfilter modules whose names differ only in case: xt_HL.ko (the TTL/hop limit target) and xt_hl.ko (its match), xt_TCPMSS.ko and xt_tcpmss.ko, xt_DSCP.ko and xt_dscp.ko, xt_RATEEST.ko and xt_rateest.ko. The release was built on a Mac, whose default APFS ignores case: the build's upstream/out*/modules (a docker bind mount) and the staging directories kept one file of each pair, under the name the first copy made and with the contents of the second (v2026.10.22.1's 6.18 bundle: xt_hl.ko holds name=xt_HL; its 7.3 bundle xt_HL.ko holds name=xt_hl). So every mainline bundle (6.18, 7.2, 7.3) of every release before v2026.10.23.1 lacks four of the eight modules, and one of the four it has is under the wrong name. The 5.4 bundle has no such pair. Nothing failed: audit-bundle.py asked is_file(), which a case-ignoring file system answers yes for the missing name. v2026.10.23.1 ships all eight in each mainline bundle (built on a case-sensitive volume).

  • upstream/case-sensitive.sh (case_sensitive DIR): makes two files that differ only in case in DIR itself and refuses it, with the way to a case-sensitive volume (hdiutil create -type SPARSE -fs 'Case-sensitive APFS'), when only one is there. upstream/make-bundle.sh asks it of the build's modules and its staging directory, upstream/build-modules.sh of its output (in the container, on the bind mount), tools/make-release.sh of release/TAG and of TMPDIR. The release scripts' mktemp now honour TMPDIR (mktemp -d "${TMPDIR:-/tmp}/mu300-...XXXXXX"), so a case-sensitive TMPDIR is enough for the staging.
  • upstream/audit-bundle.py checks modules.in-tree against the names the directory lists; make-release.sh's audit wants every name of a mainline bundle's modules.in-tree in its modules/, and the TTL and MSS pairs in any case.
  • The installers: install.sh and install.ps1 unpack a mainline bundle on the host (work/release/TAG/kernel-X) for its Image, ramdisk segment and lists, and tools/vendor-overlay.py took the modules for the installed system from that tree, so an installation from macOS (default APFS) or Windows (NTFS) lost one of each pair even with a complete bundle. vendor-overlay.py --kernel-bundle now reads the tarball itself (a tree still works), and both installers pass it the tarball. The Magisk zips, the web installer and mu300-update unpack on the device (/data/adb, ext4/f2fs; the root filesystem), which keeps case.

A system installed with an earlier mainline bundle, or from macOS or Windows before this fix, gets the four modules with its next kernel update (mu300-update kernel 6.18|7.2|7.3 from v2026.10.23.1 on, which unpacks on the device). tests/test_case_sensitive.py.

213. A kernel oops on a restart of mu300-adbd: f_ncm and f_rndis free their MS OS descriptor table twice

Status: fixed in the kernel (patch 0027, every mainline kernel) and avoided in mu300-adbd (every kernel, 5.4 too); both checked on an F50.

On 2026-10-22 our U30 Air (OpenWrt, 6.18.57) oopsed while mu300-adbd restarted, in kstrdup() called from gadget_dev_desc_UDC_store(), the write of the UDC name that binds the gadget again. The string it was copying was -lan - the tail of the kernfs link name upper_br-lan, written into a 16-byte object that the slab still had on its free list. Something had freed a kmalloc-16 object twice, and this kernel has no SLAB_FREELIST_HARDENED to stop it, so the free list handed the same memory out to two owners and the next allocation read the other one's data.

The object is the USB function's os_desc_table (one struct usb_os_desc_table, 16 bytes on arm64):

  • ncm_bind() and rndis_bind() allocate a new table only when the gadget uses OS descriptors (cdev->use_os_string, from configfs os_desc/use), and assign f->os_desc_table only then.
  • ncm_unbind() and rndis_unbind() kfree(f->os_desc_table) and keep the pointer.
  • So: bind with use=1 (a table), unbind (freed, pointer kept), bind with use=0 (no new table: the stale pointer stays), unbind - the same table freed a second time.

mu300-adbd made exactly that sequence on every restart: without_adb (adb out of the gadget, while adbd is down) wrote os_desc/use 0 and removed os_desc/c.1, with_adb turned them on again. Each restart was a double free; most of them went unnoticed until the slab handed the memory to someone who cared.

The same two lines are in 6.18.57, 7.2.11 and 7.3 (checked against kernel.org's trees).

  • Patch 0027 (upstream/patches/0027-usb-gadget-ncm-rndis-os-desc-table-double-free.patch): f->os_desc_table = NULL after the kfree() in both unbinds. kfree(NULL) is a no-op, so an unbind without a table is harmless. It applies after patches 0008 and 0026 (which change f_ncm elsewhere) on all three kernels. It is a mainline bug as well, worth sending to linux-usb.
  • mu300-adbd: without_adb leaves the MS OS descriptors on once with_adb has turned them on, so the gadget is never bound without them after it was bound with them: the 5.4 kernel and a mainline kernel without 0027 are kept off that path too. What the computer sees without adb: bcdDevice 0x0301 as before (0x0302 with RNDIS); NCM's compatible_id is empty, so Windows binds no other driver to it.

Checked on an F50 (Ubuntu 24.04, 2026-10-24), systemctl restart mu300-adbd every ~3.5 s:

kernel mu300-adbd result
7.3 (release, no 0027) the release's (os_desc/use 0 without adb) down within 11 restarts (panic_on_oops on, no log kept); a second run oopsed at restart 118: Unable to handle kernel paging request at virtual address 0065702e73646990, an address made of string bytes
6.18.58 with 0027 the release's 200 restarts, nothing in the kernel log
7.3 (release, no 0027) this one (descriptors left on) 150 restarts, nothing in the kernel log

A U30 Air on OpenWrt (6.18.58, no 0027) running the same loop dropped off the air within minutes and did not come back on its own (on battery, no USB attached): kernel.panic_on_oops is off on these kernels, so an oops there can leave a device hung instead of rebooting.

Tests: tests/test_adb.py (GadgetOsDescTable: both unbinds clear the pointer after the free, one patch with the number 0027, mu300-adbd never turns the descriptors off; Gadget: after adb leaves, os_desc/use is still 1 and os_desc/c.1 still a link).

214. Boot time on the U30 Air (OpenWrt, 6.18): mobile data at 14.5 s instead of 34 s

Our U30 Air, OpenWrt 25.12.5 on 6.18.57, data on SIM2 over 5G SA, hotspot on 5 GHz channel 149. Seconds after the kernel started, from /run/mu300/boot-timeline (dial-addr-ok), dmesg and logread:

before after (three boots)
kernel to /init 2.21 0.34
switch_root 5.02 1.15
procd - init - 13.89 2.05 to 2.14
hotspot AP-ENABLED 28.0 (up at 24.0, then restarted) 10.5 to 11.7
mobile data (dial-addr-ok) 34.26 14.43, 14.50, 14.61

The bootloader's part comes before all of it: the architected counter reads 7.0 s more than CLOCK_BOOTTIME, so LK and the firmware before it take about 7 s from power-on. That is the vendor's and was not touched.

What took the time, and what was done:

  • Kernel, 1.85 s. The PCIe root port of the Marlin3 waited for a link twice at probe (the 6.18 DWC core's dw_pcie_wait_for_link, then pcie-sprd's own check), 10 x 90 ms each, with the init thread waiting; the chip is off until wcn_bsp powers it and brings the link up through sprd_pcie_configure_device(). patches/6.18/0028 lets a host driver skip the core's wait (skip_link_wait, with DW_PCIE_HAS_SKIP_LINK_WAIT so the shared driver still builds on 7.x without it); pcie-sprd sets it and takes a 50 ms look instead of its own 0.9 s wait.
  • The UART, ~2.9 s. boot/init set the console level to 7, so every KERN_INFO line went to the 115200 baud UART synchronously until OpenWrt's sysctl lowered it at ~14 s: 33 KB, and the initramfs' module loads and procd's first second (the TEE's log, ~100 lines) waited on it. Now 4: the stage lines are KERN_ERR and still reach the UART and console-ramoops.
  • Fixed pauses in the initramfs, ~1.9 s. A sleep 1 before the gadget bind (from the first bring-up, no reason recorded) is gone, and the partition lookup polls every 0.1 s: with the faster kernel the eMMC's partitions appear 0.2 s after the modules, and its 1 s pause was then always taken.
  • The random pool, 0.9 s. There is no hardware RNG (no SMCCC TRNG in this firmware), so the kernel initialises it only when something waits for it, with its timer-jitter loop; ubusd did, and procd's init stage waited 0.9 s. The initramfs starts one blocking read of /dev/random in the background at once (crng init done at 1.4 s).
  • procd's first kmodloader, 1.7 s. kmodloader /etc/modules-boot.d/ reads every module of /lib/modules/<release> first (2955 files, a few scattered blocks of each, cold: 1.8 s on its own, 1.6 s with the loop device's direct I/O, 1.5 s with 16 parallel readers; sequential reads run at 270 MB/s). Its list is all in /etc/modules.d, which /etc/init.d/boot loads two seconds later. The initramfs bind-mounts a stub over /sbin/kmodloader that skips that one call, removes itself (lazily: the shell running it holds it open) at its first run whatever that is, and hands any other call to the real binary by its own name; and it starts one cat of the modules, which survives switch_root, so that the later run reads them from the cache.
  • preinit, 4.9 s. OpenWrt waited 4 s (fs_failsafe_wait_timeout) for a failsafe key typed on a console only test pads reach, and preinit_ip ran board_detect (0.9 s) to put 192.168.1.1 on usb0 for that failsafe, which run_init then flushed together with the early DHCP server's address. lib/preinit/31_mu300_failsafe_wait has no wait and sets pi_preinit_no_failsafe; failsafe= on the command line still enters failsafe mode.
  • The dial, ~7 s. mu300-atd retried the channel's open every 2 s (now 0.2 s), and the first command on each channel drained for a whole second (clean=0); it now drains once when the channel is its own, so the SIM2 cold start's commands take ~0.15 s each instead of three of them taking 1 s more. sipa-dele-start slept 3 s after the insmod to look for the channel-open line, which is there in the same millisecond (now looked for every 0.1 s), and asked for the attach every 2 s (now 0.5 s). mobile-data, mu300-sim2-start and mu300-sim2-warmup polled every second on the dial's path (now 0.2 to 0.3 s). Tried and taken back: reading /proc/uptime in mu300-atd instead of forking date +%s for its deadlines. Under bash, read -t keeps what it read past a line from the channel in a buffer it does not tie to the file, and both reads are on fd 0, so the next read of /proc/uptime returned the modem's reply (empty answers under bash, as on Ubuntu; busybox ash was not affected; the Atd tests caught it).
  • The hotspot, ~10 s later than needed. mu300-hw loaded the vendor extras (ten modprobes of modules this kernel does not have, and the Mali GPU's) and zram before the Wi-Fi, and after netifd's own start had brought the access point up, its unconditional wifi down; wifi up took it down again for ~4 s (and the chip with it: a power cycle and a firmware load). Now the regulatory database and the country come first, then the Wi-Fi, then the rest, and the restart only runs when the settings changed meanwhile or the access point did not come up (ap_enabled_soon).

What the dial waits for now, on the boots above: procd at 2.1 s starts the vendor stack at 2.2 s; the modem runs at 5.6 s (modem_control and the TEE: stopping the four subsystems, 50 + 50 ms of power sequencing each, the images' verification, and 1.15 s in the TEE's kbc_update_version); its first output on nr0 comes at 7.4 s; the SIM2 cold start switches the radio on (AT+SFUN=4) at 9.2 s; the network registers it at 13.4 s; AT+CGACT takes 0.5 to 2 s. The rest is the modem's and the network's. Not done: a shorter quiet wait before each AT command (0.1 s, QUICK), and the Wi-Fi chip is still powered off and on twice while hostapd sets wlan0 up (a firmware load each).

218. CPU0's cluster power-down: USB, IPA and the Wi-Fi's PCIe were not wake sources (ums9620_lpintc)

Status: built for 6.18.57 and measured on a U30 Air (OpenWrt 25.12.5, 6.18.57); built for 6.18.58 and checked on an F50 (Ubuntu 24.04, 2026-10-24: pings over USB from a Mac 1.2 ms on average and 1.5 ms at most with it, 30.6 ms and 150 ms without, 60 each), and builds against 7.2.12; its suspend path not yet run on a device, the power with it not measured.

With every cpuidle state allowed, pings over USB from a computer waited up to 120 ms. The waits went away with CPU0 kept out of its deepest state, cluster-pd (PSCI; the A55 cluster and its DSU powered off), and that was the device-local workaround (/etc/rc.local writing cpu0/cpuidle/state2/disable). The reason is in TF-A. A powered-down cluster is woken not by the GIC but by the always-on LP_AP_INTC: eight blocks of 32 lines, line b of INTCn being GIC SPI 32n + b, each line a wake source only where its bit in that block's IRQ_EN is set. TF-A (sml) sets those once at boot from its own table (sml_a.img + 0x114d8, pairs of register and value): INTC0 0xf5085c00, INTC1 0x2080b9fc, INTC7 0x40, INTC2-6 nothing. The USB controller (dwc3, SPI 142: INTC4 bit 14), the IPA (SPI 136-138) and the Wi-Fi chip's PCIe MSI are in INTC2-6, so while CPU0's cluster was powered down their interrupts waited for something else (the system timer, INTC1) to wake it.

block base TF-A's IRQ_EN added on a running U30 Air
INTC0-5 0x640c0000 + n * 0x10000 0xf5085c00, 0x2080b9fc, 0, 0, 0, 0 INTC2 0x00040000, INTC4 0x00044700
INTC6, INTC7 0x645b0000, 0x645c0000 0, 0x40 INTC6 0x02d40018

Each block: +0x08 IRQ_EN (reads the enabled mask, a 1 written sets that bit), +0x0c IRQ_DIS (a 1 written clears it); the clocks are ap-intc0..7-eb (AON gate 0x64900008 bits 11-18, CLK_IGNORE_UNUSED). TF-A did not write IRQ_EN again in 60 s of cluster-pd with a bit set by hand.

upstream/modules/ums9620_lpintc (mainline, loaded by extra-modules after mu300_thermal) adds to IRQ_EN every SPI the kernel has enabled in the GIC distributor (GICD_ISENABLER1..8), at load and every 5 s from deferrable work (period=), which never wakes a CPU itself, so drivers that come later (Wi-Fi, the IPA delegate) are taken up. It only adds: TF-A's bits stay, and a line disabled again keeps its bit (the GIC still masks it). An enabled interrupt is handled anyway, so waking the cluster for it costs no extra work, only removes the wait. The bits it added are cleared again in its syscore suspend, so mem (FINDINGS 37) wakes on exactly what TF-A chose, and set again on resume; rmmod clears them the same way (checked: TF-A's values read back at the next load). The suspend and resume hooks have not run on a device yet: two mem attempts with pm_test=core were aborted before syscore by the Wi-Fi's WAKE# and by the IPA's and Wi-Fi's wakeup sources (traffic). EN and DIS are single writes, so nothing needs a lock with TF-A. Only the UMS9620 is accepted; a block whose clock is off is left alone.

Measured from a Windows PC over the USB network (100 pings, 1 s apart; CPU0's cluster-pd allowed):

average median 90 % max
without the module 15.7 ms 8 ms 47 ms 69 ms
with it 9.5 ms 7 ms 20 ms 42 ms
CPU0 without cluster-pd (the workaround, 60 pings) 10 ms 70 ms
every CPU at WFI only (this link's floor, 60 pings) 7.1 ms 5 ms 14 ms 40 ms

So with the module cluster-pd on CPU0 is as fast as the workaround and near what this computer's link gives at all; CPU0 still entered cluster-pd (3600 to 6600 entries over 60 pings). An earlier test with only INTC4 bit 14 set by hand gave 85 pings of 85 at 1 ms or less (its link not recorded). With the module loaded the workaround can go: CPU0 keeps its cluster-pd.

220. The U30 Air's AT+CGSN answers fifteen zeros: the IMEI is read over diag

Status: fixed in the panel's collector; the diag read is a fallback, used only when AT+CGSN gives nothing usable. Seen on a U30 Air (OpenWrt 25.12.5, v2026.10.23.1, 7.2.11, MOCORTM_V2_23A_W25.03.2_Debug).

AT+CGSN and AT+SPIMEI? answer 000000000000000 on both SIM slots, and through the vendor's own miscserver path on the stock Android, while the modem's NV holds both IMEIs. The vendor's backend reads them over /dev/sdiag_nr (the request 7E 00 00 00 00 0A 00 5E 81/82 00 00 7E; the value follows the 74 00 5E 01 marker, one 8-byte block, nibbles least significant first, an a filler before the first digit). The collector cached the zeros as a complete identity, so the page showed 0000****000 for 6 h.

imei-diag (shell, read-only: no AT and no NV write) makes that read; cell asks it only when AT+CGSN returned nothing or fifteen zeros, and a zero IMEI no longer counts as a complete identity, so an existing zero cache is re-read within the minute. Verified on the unit: slot 0 reads IMEI1 and slot 1 IMEI2, over repeated runs; the cache and mu300dash status then carry the value. tests/test_imei_diag.py.

Device check before merge (U30 Air, OpenWrt): the dashboard's IMEI row shows the active card's IMEI after a round (not 0000****000), and follows the card when the slot is switched.

OpenWrt's own busybox (25.12.6) has neither od nor timeout, so on a stock image the read printed nothing: imei-diag takes both from the image's full busybox (/opt/mu300/bin/busybox). Checked before merge on a second U30 Air (OpenWrt 25.12.6, 6.18.58, firmware MOCORTM_V2_23A_W25.30.2_Debug, whose AT+CGSN answers a real IMEI): both slots read 15 digits, slot 0's is the one AT+CGSN gives, and the collector is unchanged where AT works.

221. The panel shows both IMEIs, marks the card in use and copies them on a click

Status: implemented in the panel; device check below. Follows 220.

cell reads the module's two IMEIs over diag on every identity round (imei1/imei2, plus slot), not only the active card's, so a unit with no card in the other slot still shows that slot's IMEI. The dashboard shows two rows (IMEI1 (SIM1) / IMEI2 (SIM2)); the active card's row carries a green tag with the existing in use message (no new catalog entries), and a click copies the full value -- the page may be masking it -- through the HTTP fallback (execCommand), as the panel is not a secure context.

Verified on the U30 Air (OpenWrt): sim-slot1.json carries "slot":1,"imei1":...,"imei2":...; the active slot's row carries the tag and the other does not; a click copies the unmasked value.

Checked again before merge on a second U30 Air (OpenWrt 25.12.6, 6.18.58, card in slot 0): the cache carries "slot":0 and two different 15-digit IMEIs, the one of slot 0 equal to AT+CGSN's; the dashboard shows both rows, masked, with the tag on IMEI1 only; a click hands the full 15 digits to the copy; no errors in the browser console.

222. The Wi-Fi key toggles the hotspot in one press, awake or asleep

Status: on the U30 Air (OpenWrt); follows 152.

The Wi-Fi key already had the hotspot toggle on a 3 s hold, but two things made it useless for the case it is for: docking the U30 Air to a router over USB and turning its own hotspot off to cut heat.

  • the hold only counted on an awake device; on a sleeping one (LEDs dark) the first hold only woke it, so the hotspot needed two holds;
  • hotspot_set on ran wifi up only. The panel's Wi-Fi switch writes wireless.radio0.disabled=1 (persistent), so after turning the hotspot off from the page the key could not bring it back -- wifi up does not clear the flag -- and the only way back was USB.

hotspot_set now writes the same uci flag the page does (0 on, 1 off) before wifi up/wifi down, and a Wi-Fi hold decides its direction (and writes the user's hotspot-off marker) before the wake starts, so one hold wakes and toggles. A short press still toggles the band, and on a sleeping device still only wakes; the charging boot is unchanged (no services to toggle, so a hold there still only wakes).

Device check (U30 Air, OpenWrt): with the hotspot off from the page, one 3 s hold brings the SSID back; with the device idle (LEDs dark), one 3 s hold wakes it and toggles once, not twice; a short press still switches 2.4/5 GHz.

Checked before merge on a second U30 Air (OpenWrt 25.12.6, 6.18.58), with the installed mu300-buttons fed two Wi-Fi holds 45 s apart (no hand on the key: a stand-in for mu300-keys printing 138 long): awake, the first hold took the access point down with wireless.@wifi-device[0].disabled=1 and the hotspot-off marker, the second brought it back up (ENABLED, flag 0, no marker); the same with the LEDs held dark (mu300-led idle on), one hold each way. The short press and the charging boot were not exercised.

223. LTE band locks use each board's own LTE table (the U30 Air locks B7, B20, B28 and the rest)

Status: implemented in unisoc-modem/lock; checked on a U30 Air (OpenWrt) and an F50 (Ubuntu). Follows #361, #387.

LTE has no capability query, so the lock helper had one fixed table, the F50's (1,3,5,8,34,38,39,40,41), on every board. A cleared mask (AT+SPLBAND=1,0,0,0,0,0) reads back as the modem's own full table:

Board Modem firmware Cleared read-back Bands
F50 W25.39.4 0,482,0,149,0 1,3,5,8,34,38,39,40,41
U30 Air W25.30.2 0,2018,2057,2271,2 1,2,3,4,5,7,8,12,17,20,28,34,38,39,40,41,42,43,66

So the U30 Air could not lock B2, B4, B7, B12, B17, B20, B28, B42, B43 or B66, and get listed all 19 bands of an automatic modem as locked (the page still said "Automatic" by counting candidates).

The table is now picked per board (mu300-device: u30air, anything else the F50's), and becomes the panel's LTE candidates (caps.lte), the apply filter, the boot replay's filter, and the "automatic" test of the reset and replay read-backs (every band of the table present, or an empty mask). get reports the read-back as it is, except that one holding the whole table is reported as nothing locked.

Why fixed and not learned from a read-back (#387 learned it whenever no lock was saved): a read-back taken while a lock sits in the modem's NV -- left by Android, by the stock UI, by a hand-sent AT command, or by a wiped state directory -- would become "the table", and that lock would then read as automatic and pass every reset and replay check (0,450,0,149,0, a lock on the F50's list less B38, is exactly that on the U30 Air). Learning only after an explicit clear and radio restart avoids that, but the learned file lives in the state directory on the SD card or eMMC, which can move to the other board, and needs a reset before the U30's bands show at all. A fixed table per board writes nothing to flash and cannot mistake a lock for the table.

Device check, U30 Air (OpenWrt 25.12.6, 6.18.58, v2026.10.26.1 with this helper): automatic reads locked: "", raw 0,2018,2057,2271,2, 19 candidates; ubus call mu300dash lock_set with 20,7 sent 0,0,8,64,0, read back locked 20,7, and the modem registered; a reboot replayed it (replay done (early), the read-back check passed); lte "" saved automatic, and the reboot's early check accepted the 19-band read-back; a lock sent by hand (AT+SPLBAND=1,0,450,0,149,0) read back as 34,39,40,41,1,3,5,8, not automatic; the reset from a lock and from that hand lock verified ok and left no saved setting. F50 (Ubuntu, 7.3.0): the table and the cleared read-back unchanged; 20,7 refused (none supported), 3,7 locked B3 (B7 left out), reset back to automatic with nothing saved.

224. The U30 Air's battery CV is 4.304 V (REG04 0x70), and a PD frame is waited for before it is read

Status: patch 0029 and the 0020 change build on 6.18.58 and 7.2.12 here; kanoqwq read both on his U30 Air (7.2.8). Not run on a device here. From kanoqwq's b4748534 (his patch 0027 and his sc27xx-ump9620.c).

The CV. Patch 0024 (FINDINGS 207) gave the vendor charger node the battery node's 4.3 V and let the generic bq2560x path round it down to the chip's 32 mV grid: code 13, REG04 0x68, 4.272 V. ZTE's driver does not round down. sqc_bq2560x.ko (SHA-256 ce42c87c..., sqc_mp_set_cv +0x28..+0x5c) and the matching sqc_v8 source program floor((mV - 3856) / 32) + 1: code 14, REG04 0x70, 4.304 V. kanoqwq read 0x70 under stock Android and, with his patch, under Linux on the same U30 Air. The 0x68 of FINDINGS 207 was what our 0024 had written, not a stock value. Patch 0029 (upstream/patches/0029-power-bq256xx-U30-Air-CV-in-the-stock-encoding.patch) computes the CV that way for the vendor node with a battery CV from the device tree, still bounded by the chip's maximum. Without battery information it uses the chip default, and every other board is unchanged. The chip's code 0xf is its special 4.352 V (not 3.856 V + 15 x 32 mV), both when it is chosen and when it is read back, as in ZTE's driver. The difference is 32 mV more at the top of the charge, the stock value.

Not 4.4 V. The U30 Air's battery label says 3.85 V nominal and a 4.4 V charge limit, and the device tree's batt_cap_learn nodes carry bcl,battery-limit-charge-voltage = 4400. That is not what the stock firmware charges to (kanoqwq's fe52afe3, his charge-voltage audit of 2026-10-28, on a U30 Air with UFS): its sqc_daemon (SHA-256 aa7263f4...) reads sqc,max_vbat_mv and the per-stage sqc,fcv table from /vendor/etc/.tp/sqc_charger.conf (4a20fee6...), and both stop at 4300 mV; the 4400 of the capacity-learning node is only reported upwards (VOLTAGE_MAX_DESIGN). So 4.3 V, encoded as above (4.304 V, REG04 0x70), is the stock target, and the 4.4 V of the label is not raised to. The battery node's ir-cv-offset-microvolt (100 mV) is ZTE's charger manager's IR compensation (base voltage plus average current times resistance, bounded), not a fixed 100 mV more; it is not ported.

A PD frame before the FIFO has it. The PD block's packet-received interrupt can come before the receive FIFO holds the frame. Unisoc's receive path first polls PD_STS1 (50 us steps, 2 ms at most) until the FIFO is not empty. Our port controller (patch 0020, FINDINGS 150) read the header at once and could hand TCPM a frame of empty words. 0020 now waits the same way. A frame that is already there does not wait. With nothing after 2 ms, nothing goes to TCPM and the FIFO is flushed as before. A Source_Capabilities whose first object is not the fixed 5 V that every source must offer first is logged (rate-limited) as a frame read wrong. PD stays off unless mu300-usb pd on.

Device check (U30 Air): i2cget REG04 reads 0x70 after boot on a wall charger, and a charge to the user limit behaves as before. With mu300-usb pd on, a PD charger and the dock from FINDINGS 150 negotiate, and the log has no "source capabilities without 5 V first".

Status: built for 6.18.58, 7.2.12 and 7.3 here; kanoqwq ran the 7.2 patch and the options on his U30 Air (7.2.8). Not run on a device here. From kanoqwq's f0b5ad43 (his patches/7.2/0026 and config, after liuwang97).

The link wait. FINDINGS 214's patch (patches/6.18/0028) was 6.18 only. 7.2 and 7.3 have the same wait, 10 x 90 ms in dw_pcie_host_init(), but now act on its result: a timeout fails the probe, nothing in Detect is -ENODEV and goes on. patches/7.2/0028 and patches/7.3/0028 let a driver that sets skip_link_wait count the skipped wait as no error; the wait on resume is untouched. pcie-sprd already set it wherever the header defines DW_PCIE_HAS_SKIP_LINK_WAIT, so on 7.x the Marlin3's root port stops waiting 0.9 s at every boot as on 6.18.

Utilisation clamps (UCLAMP_TASK, UCLAMP_TASK_GROUP). The vendor Wi-Fi driver asks for a utilisation floor of 400 for its TX thread while TX or RX is above 25 MB/s (sc2355_set_thread_uclamp, SET_UCLAMP_THRESHOLD) and drops it below; without the option the kernel refused that request, so the floor never took effect. With it, schedutil runs the CPU that thread is on at about 40 % of its capacity or more during heavy Wi-Fi traffic. Nothing else sets a clamp: the static key stays off until something does, and real-time tasks get the maximum frequency with or without it. THERMAL_NETLINK adds the thermal core's netlink events (trip crossings, cooling changes) for a listener; nothing listens yet.

Device check: on 7.2 or 7.3, dmesg has no "Phy link never came up" / link-wait pause before the root port probe, and the Wi-Fi comes up as before; a Wi-Fi speed test shows uclamp.min 400 on the TX thread (chrt//proc/<pid>/sched) while it runs.

226. The U30 Air's bq256xx charge_type as a pause: N/A keeps the input, Fast charges again

Status: kanoqwq's reading on his U30 Air (OpenWrt, 2026-10-16); the mu300-power side runs offline only here. From kanoqwq's 61bb5a30 (his docs/U30AIR-WEB-CHARGING-20261016.zh-CN.md), which answers the open question of §36 ("what the bq256xx charge_type node does on writes"):

  • Writing N/A to /sys/class/power_supply/bq256xx-charger/charge_type pauses the battery's charge and nothing else: the node then reads N/A, status reads Not charging, online stays 1, the input current limit stays where BC1.2 / Type-C put it (2,000,000 uA on his charger), and USB LAN and the cellular WAN stay up. The device keeps running on the charger; the driver only clears CHG_CONFIG and remembers the pause for its next VBUS check, so it holds across a replug (§33d). It is not a battery bypass: a load the input does not cover still draws on the battery.
  • Writing Fast charges again. Fast is the enum the driver takes for "on", not a fast-charge protocol or a higher current.
  • With a 70/80 % band set on a battery at 100 %, the pause came at once. Not checked by him: the restart at the lower level after a discharge, and a replug or a PD dock during a pause.

mu300-power now offers what his separate mu300-charge service did, as keys of the one charge guard (his service and ours would both have written charge_type): RESUME_AT (charging starts again under it instead of 5 points under CHARGE_TO; with CHARGE_TO=100 a full battery waits until it drops under it), CHARGE_PAUSE=1 (a pause by hand, mu300-power charge pause|resume, kept across boots) and FULL_ONCE=1 (mu300-power charge full: the limit is set aside until the battery says Full at 100 %, then the key clears itself). All off by default; refused where there is no battery (F50, V50). The temperature pause keeps the last word: a resume or a full charge never turns charging on while the battery is out of range. The pause and the limit both give way under 5 % (as CHARGE_TO=0 already did). On the LuCI and Cockpit power pages, U30 Air only.

Device check (U30 Air): mu300-power charge pause: within 10 s charge_type N/A, status Not charging, the panel says "Charging paused: by hand"; charge resume charges again. CHARGE_TO=80 RESUME_AT=60: stops at 80 %, stays off down to 60 %, charges under it. charge full from 80 %: charges to 100 %, FULL_ONCE=0 once Full, then held.

227. LED brightness: which lamps dim, and what the U30 Air's PMIC reads back

Status: kanoqwq's readings on his U30 Air (7.2.8, 2026-10-16, his docs/U30AIR-LEDS-20261016.zh-CN.md) and the drivers in this tree; nothing measured here. Behind mu300-led's per-lamp brightness (LED_*_BRIGHTNESS, ported from kanoqwq's f6b0668d, 2af101f8, c1293746).

  • They dim: the PMIC's RGB channels (sc27xx:red|green|blue, 0-255: the F50's network lamp, the U30 Air's battery lamp); the F50's keypad sink (keyboard-backlight, 0-127; ZTE lights it at 48); the V50's AW9523B lamps, whose DIM registers take 0 up to each lamp's max_brightness from the device tree (FINDINGS 95).
  • They only switch: the U30 Air's network and Wi-Fi lamps: LDOs VDDCAMA0-2 (zte-ldo0..2, 5.4's vddcamaN_status) and the GPIO net_blue, max_brightness 1. The network lamp's red is the keypad sink, but dimming it alone would make one colour of that lamp darker than the others, so the lamp is on or off (kanoqwq's page offers the same).
  • The breathing peak follows the level written. kanoqwq wrote the pattern 0 625 255 750 0 625 0 250 to the U30 Air's battery channel and read the PMIC back: peak register 0xffff, curve registers 0x0505 / 0x0206. A peak of 255 is the PMIC's full scale, so a lower level in hw_pattern (ZTE's 120/200/150, scaled by the setting) is a dimmer breath with the same curve; the curve here stays ZTE's (FINDINGS 151), not his faster one.

Device check: on each board mu300-led set network_brightness 20 (U30 Air: battery_brightness) visibly dims that lamp, a breathing battery lamp too, and mu300-led set network 0 darkens it until ... network 1.

229. The V50's NFC tag: the same FM11NT08, its reset line from ZTE's device tree node

Status: from kanoqwq's f6b0668d, run on his V50. No V50 here; not run on a device by us.

The V50 has the U30 Air's tag (FINDINGS 95): a Fudan FM11NT08 at 0x57 on I2C2, on another reset line, AP GPIO 189 (the U30 Air's is 190). ZTE's tree describes it in a node of its own, /ntag_fm11_gpio, whose ntag-reset-gpio is the usual 12-byte cell: the GPIO controller's phandle, the pin and the flags, big-endian. mu300-nfc reads the pin there on a V50 (mainline boots ZTE's tree unchanged, §31) and drives the tag only when it is 189, the line kano tested; a tree without the node or with another pin leaves the tag alone. mu300-nfc supported says whether this device has a tag it drives, and the callers ask it (Ubuntu's hotspot start, OpenWrt's mu300-hw); OpenWrt also syncs the tag when the wireless settings are saved (a procd config trigger in mu300-post), not only at the next boot. A gpioset that cannot take the line now fails with that, instead of reading a deaf chip.

Device check (V50, mainline): mu300-nfc supported exits 0; mu300-nfc wifi and a phone joins the hotspot with a tap; a new hotspot password in LuCI reaches the tag without a reboot.

230. The 5.4 kernel gets the Wi-Fi TX and SDHCI fixes the mainline kernels have (FINDINGS 92, 93, 103, #339)

Status: built for 5.4.254 and run on F50-B, 5 boots (2026-10-27). From kanoqwq's 149c9d2a, 3cbf37fc and 0438ab01, his 5.4 versions of fixes we had made for mainline only ("the vendor tree is not in the repo" - but kernel/build-all.sh fetches it). He applied them to the pristine trees and compiled the Wi-Fi module; he did not run them.

Seven patches, applied with --fuzz=0 after ours:

patch what mainline
wlan_combo-tx-retry a full EDMA pending ring is retried, not counted as a TX failure (more than 50 flushed the queue); the bus's completion wakes the TX thread FINDINGS 103
sprdwcn-tx-pending-backpressure (kernel) that ring answers -EAGAIN instead of ERROR, logged once a minute; a direct push that fails clears the channel's "pending" state when nothing is queued behind it FINDINGS 103, #339
wlan_combo-skb-headroom the descriptor fill keeps the caller's skb (it freed it and went on with the pointer) and makes a cloned header writable FINDINGS 103
wlan_combo-special-data-prefix the AP's group-frame BK priority is set in the real descriptor, behind the PCIe prefix FINDINGS 103
wlan_combo-ipv6-multicast-data the AP's IPv6 multicast goes by the flow-controlled data queue on PCIe (DHCPv6 and VoWiFi keep the command path) FINDINGS 103
wlan_combo-stale-tx-ratelimit per-frame "sta disconn" / "group lut_index" / "drop msg" lines debug-only or rate-limited FINDINGS 92
sdhci-sprd-dma-ordering (kernel) the SDHCI accessors use ordered MMIO, so ADMA descriptors are visible before the doorbell FINDINGS 93

Not taken: his sprdwcn-edma-pressure-stats, wlan_combo-tx-pressure-logging and wlan_combo-rx-ip-multicast-endian (diagnostics and a change FINDINGS 92 declined). His backpressure patch was written on top of the first; it is rebased here, and gets the two #339 changes the mainline wcn_bsp has since (quiet log, the stuck "pending" state), and the Wi-Fi driver no longer logs -EAGAIN as "push link fail".

Measured on F50-B (5 GHz AP, 80 MHz, a MacBook as the client; 150 MB down and 80 MB up over SSH, IPv6 link-local ping, ping6 ff02::1, RA addresses; the SD card read twice with O_DIRECT and compared; 128 MiB written to the eMMC with O_DIRECT, read back and compared):

v2026.10.27.1's 5.4 with these patches (5 boots)
"push link fail: -1" + "tx return err!" lines after one test 204 + 203 0 + 0
"edma_pending_q_buffer(10) full" lines 10 1 (once a minute at most)
downlink (device TX), Mbit/s 214 127-440 (median 261); 378-412 in a later run
uplink, Mbit/s 483 81-500 (median 448)
IPv6 multicast / RA over Wi-Fi yes yes, every boot
SD read, eMMC write/read-back equal, 0 mmc errors equal, 0 mmc errors, every boot

The throughput spread is the client's (the same runs on 7.3 spread as much); no stall, no lost ping, no call trace beyond the vendor's add_uevent_var warning every 5.4 boot has.

Two resets, not reproduced. Later the same afternoon F50-B (no battery, on one of the Mac's own USB ports) lost power twice: once 1 s into a lock change's stack restart (SFUN 5 -> 4) and once during a 56 MB copy over USB networking. Both times LK reported bootcause="Charger connected", there was no ramoops (no panic) and the journal just stops: a power cut, not a kernel fault. The second boot ran this patched kernel with the release's modules on the root file system. Afterwards neither came back, neither on the release's 5.4 (two 56 MB copies, two stack restarts) nor on this one again (three copies, three stack restarts, the Wi-Fi run above). Nothing in these patches reaches the PMIC or the power path; noted here in case it turns up again on 5.4.

231. The APN settings for one SIM card only (the ICCID binding of kanoqwq's APN profiles)

Status: in the dial on both systems, tested against a fake modem (tests/test_mu300cell.py); not dialled on a device with a second card here. From kanoqwq's 3826be8b and 18d3725a (his APN profiles, a profile bound to a card by its ICCID), in the one form FINDINGS 65 left room for.

FINDINGS 65 declined his profile store for two reasons: our APN is one setting per interface, kept across updates, and a second store of APNs would compete with it; and nobody had asked for more. It also named what that costs: the credentials belong to the settings, not to a card, so a different card put into the device is offered them too. That cost is what the binding answers, and it needs no second store:

  • One more setting beside the APN, opt-in. Ubuntu: MU300_APN_ICCID in /etc/mu300/mobile-data.conf. OpenWrt: option iccid on the wan interface, "Only for the SIM card" on its page (the external card's settings, like the credentials; the internal card dials its own apn_internal and is never bound). Empty, the default: any card, as before; nothing is asked of the card.
  • Set, mobile-data asks the card in use for its ICCID (AT+CCID, quoted or not, letters allowed: FINDINGS 174) before the context is defined. The same card dials with the APN, its PDP type and its credentials. Another card dials with none of them: its own context, as with no APN at all, and credentials given to the modem by an earlier dial are taken back (the mark of FINDINGS 65). A card that does not say its ICCID gets no dial (netifd and the watchdog try again): whether it is the card the settings are for is not known, and the password is not sent on a guess.
  • An ICCID is never printed or logged (the radio log says only "the APN settings are for another SIM card").

Not taken, still: the list of up to 32 profiles and its LuCI page, the automatic choice by IMSI for some Chinese carriers, AT+SPCGAPNCFG (the initial-attach APN), and his "an empty APN clears the modem's" - each for the reasons FINDINGS 65 gives.

Device check (a second SIM card): with the settings bound to card A, card A dials with the APN (AT+CGDCONT? shows it); card B in the same slot dials with its own context, and AT+CGPCO? holds no user name.

232. Mainline keeps the UMP9620 fuel gauge and ZTE's charger node off the F50 and the V50

Status: built for 6.18.58, 7.2.12 and 7.3 (the patch applies to all three with --fuzz=0); run on F50-B with 7.3, compared with v2026.10.27.1's 7.3 on the same board (2026-10-27). Not run on a V50 or a U30 Air here. From kanoqwq's f59a2968 (his patch 0019, which he had checked on an F50 read-only, not flashed).

The F50 and the V50 have the U30 Air's PMIC, and ZTE's device tree gives them its fuel gauge and charger nodes, but no battery. Mainline bound the gauge there and listed a battery sc27xx-fgu: status Full, health "Over voltage", a capacity read back from the PMIC's saved-capacity register ("boot capacity 56 % (saved 0x038)"), a temperature from an unconnected NTC input. Every reader of /sys/class/power_supply had been taught to ignore it by board (mu300-power, mu300-api, the panel, thermal-guard, mu300-sms-forward, the LuCI dashboard). Patch 0016 kept only the charger's 0x1a fallback to the board with a battery.

upstream/patches/0030 ends both probes with -ENODEV before any register access unless the device tree has /charger_policy_service: the same test as 0016, 0023 and mu300-device (kano's version also asked whether the node is enabled; here it is only ever tested for presence, so a U30 Air is told apart exactly as everywhere else). Only the UMP9620 gauge (sprd,ump9620-fgu) and ZTE's charger node (ti,bq2560x_chg) are affected.

F50-B, 7.3, release kernel against this patch:

v2026.10.27.1 with 0030
/sys/class/power_supply sc27xx-fgu empty
kernel lines about bq256xx/fgu/charger 5 ("no charger: -5", the IIO retries, "boot capacity 56 %") 0
mu300-power status battery: none, supply: plugged, profile plugged (auto) the same
mu300-api power.get "battery":null, supply plugged the same
mu300 units 27 services and 3 timers active, 0 failed the same
thermal zones 20 the same 20

Device check (U30 Air): sc27xx-fgu and bq256xx-charger are still in /sys/class/power_supply, with the battery's capacity, and charging works as before.

233. A lock change is a job the page follows to its end (kanoqwq's lock job queue)

Status: in the panel's lock helper and its rpcd backend; tested against a fake modem (tests/test_unisoc_plugin.py, tests/test_mu300dash_security.py) and run on F50-B (Ubuntu, the helper by hand: 5.4, 2026-10-27). From kanoqwq's lock-jobs.sh (db4e5d2a, reworked up to b8d4f222); deferred in the 2026-10-11 review.

A band, mode, EN-DC or cell lock runs detached from the rpcd call (half a minute of stack restart, longer while another change or the dial holds the radio), so the page only ever saw a read-back afterwards: a write the modem refused looked like a lock that "did not take", and "Status confirmed" was shown for it all the same.

  • lock start KIND VALUE checks the value, makes a job (ten random letters and digits, a directory of its own under the private runtime directory, in RAM), starts the worker detached and answers at once with the id. lock status ID says queued, running, done or error, with the reason, and sends no AT. The worker runs the same apply as before and keeps how it ended. rpcd's lock_set starts jobs (the reset and the replay switch as before) and returns the id; the new lock_job (read ACL) is what the page polls before its read-back. A failure is said, and the read-back is skipped; a job that has not ended after 420 s, or whose worker is gone, is reported as such.
  • Bounded like his: four jobs not yet ended and 64 in all; a start waits for no other start (one at a time, else "try again in a moment"); a job that ended ten minutes ago is removed by the next start.
  • What a job can say is one of the helper's fixed messages, translated by the page (seven new ones, in the 31 catalogs). With it, the mode, EN-DC and cell writes are checked as the band writes have been since #356 (his write_setting): an explicit ERROR ends the apply with nothing saved and no stack restart; silence still does not.

Not taken: his split of the helper into lock-apply.sh/lock-jobs.sh, his Chinese messages, his ACK-based early replay (C10b) and the voice-switch receipts. The Ubuntu panel (mu300-api) still starts apply as before.

On F50-B (5.4, the helper by hand): a mode change and an unsupported NR band started together: the mode job ran (stack restart, radio back in 7 s) and ended done, the band job waited for it and ended error "None of these bands is supported by this modem"; an LTE lock on every supported band and back to automatic both ended done, the modem read back automatic, data came back; an unknown id answered "no longer known".

234. Parity with 5.4: every vendor item on mainline, or said why not

Status: upstream/parity-5.4.txt and upstream/check-parity.py, run by build-modules.sh, make-bundle.sh, kernel/build-all.sh and the Tests workflow (tests/test_parity.py). Inventories from F50-B (v2026.10.28.1, 5.4.254 and 7.3.0, 2026-10-28) and the U30 Air (6.18.59).

The rule: nothing the 5.4 kernel has may be missing from mainline without a line that says so. What 5.4 has is three lists - the modules of the 5.4 build (F50 and U30 Air sets, 198 names) and its built-in objects (630), recorded by kernel/build-all.sh in upstream/parity/5.4-build.list with a hash of the build's inputs; the three modules of the display experiment (kernel/build-display.sh); and what a board shows at run time, from upstream/parity-inventory.sh (drivers with a bound device, thermal zones, cooling devices, devfreq, cpufreq, power supplies, Type-C ports, extcon, LEDs, regulators, misc and input devices, hwrng, UDCs, classes). An item mainline has under the same name - a module or built-in object of that name in every shipped series, the same inventory line on the same board - needs no line; every other one is ok with what stands for it (a module or config symbol the mainline build must have, and where it binds on 7.3), missing with its porting group and boards, or na with the reason.

How the claims were checked: the boards' device tree (/sys/firmware/fdt of F50-B: ufs@2000000 disabled, spi@60000 without a device, pwm@30000 referenced by no node, no EHCI, SCPI, SCMI, SPMI, fixed regulator or touchscreen node); i2cdetect under 5.4 on F50-B and under 6.18 on the U30 Air (nothing at the AW883xx amplifier's 0x34, the PTN38003A redriver's 0x30 or the AW9610x SAR sensor's 0x12 on either; the U30 Air's STK501xx SAR sensor answers at 0x28, its NFC tag at 0x57; the F50 has nothing at the charger's 0x6b); what 5.4 binds and what it only loads (sprd-apdu, sprd-thermal, the NPU and the rpmsg drivers load and bind nothing).

Found missing (the porting list, by group): the SoC's TRNG (5.4 has /dev/hwrng from rng@e0000; mainline has no driver, so the pool waits); the PMIC's Type-C port, extcon and BC1.2 by default (mainline's ump9620_tcpc is opt-in, §150); the UMP9621 and UMP9622 (pmic@1, pmic@2: six regulators, the osctsen/outtsen zones), the vibrator, the 7-second reset settings and the PMIC syscons; DDR and modem DVFS; CPU hotplug cooling; MUSB and its USB 2.0 PHY; IPA's fast path and USB offload; GNSS; the display stack; the DMA engine and the ASoC core (config only, but a module of each name ships from elsewhere); the soc ID; ZTE's SIM tray detection and board state, the U30 Air's SAR sensor and charge policy; CoreSight, the PMU and Unisoc's debug drivers (§31p keeps PERF_EVENTS off).

Taken with this change, config only: GENERIC_ADC_THERMAL (the board's NTC zones board-, chg-, nr- and pa-thmzone, which have no trips in the vendor tree), CPU_FREQ_GOV_CONSERVATIVE, and the gadget functions USB_CONFIGFS_SERIAL, USB_CONFIGFS_ECM_SUBSET and USB_CONFIGFS_F_HID.

235. Idle CPU of the shell daemons: a look that finds nothing new starts no process (liuwang97's #372, part A)

liuwang97 measured a U30 Air on the charger, idle (5G SA, the hotspot up with two clients): the userspace daemons together used about 5 % of one core, 300-odd ticks a minute (USER_HZ 100) summed over every process, counted per process over 60 s as utime+stime+cutime+cstime from two /proc/PID/stat snapshots. mu300-power 52-56 ticks a minute, mu300-buttons 29-40, thermal-guard 26-29, mu300-adbd 27-32, ndp-learn 11-13, mu300-traffic 6-8. The sys time was about three times the user time: the cost is processes, not work. On this SoC a fork and exec of a small binary (cat, date, busybox sleep) is 0.7-1 ms, a $( ) 0.5 ms more, and the helpers that are scripts cost more (mu300-device 2 ms).

#372 did this and much more (the panel's status inside rpcd, an event-driven modem daemon, a system daemon on kernel uevents) in 10.5k lines. This entry is its low-risk part, taken in by itself: the same behaviour, fewer processes. The rest stays in #372 as the reference for later work.

The rule for every daemon loop now: a look that finds nothing changed starts no process. Files are read with the shell's own read (read -r v < file, read -r up _ < /proc/uptime for the time), values travel in variables rather than through $( ), and the wait is read -t N on a fifo nobody writes to, opened read-write (it never reaches end of file), where the shell has read -t (busybox ash, bash; OpenWrt's busybox takes whole seconds only), else sleep (dash). A signal still ends that wait at once. During the wait the daemon's timer slack is 500 ms (/proc/$$/timerslack_ns, set around the wait only, so what the loop starts keeps the default): the kernel can serve the wakeups of several daemons with one.

  • mu300-power: one loop started about forty processes (cat, sed | tail per setting, mu300-device several times, $( ) around every helper, rm -f of files that were not there). The loop now reads with builtins (rv, nv, conf_load/conf_v over the file read once a loop, psy_scan, battery_v, plugged_v...; the echo helpers stay for status and the other commands), finds the charge switch and the device once, and asks iw for the stations and hostapd (ubus) for the hotspot only every sixth loop (MU300_POWER_SAMPLE_EVERY, a minute), at once when wlan0 is gone, and always before the idle timer runs out (a client that came since the last look keeps the hotspot up, as before). The loop stays every 10 s: the low battery checks, the charge guard (kanoqwq's resume level, pause and full-once included), the plug edge, a computer on USB and the wake flag are looked at as before. What is slower: a station that wakes an idle device is seen within a minute (in idle the hotspot is normally down), a hotspot that went down by itself while it should stay up is restored up to a minute later. #372's longer waits between loops (30 s on the charger, 60 s on a battery) are not taken here.
  • mu300-buttons / mu300-led: the tick every 5 s ran mu300-led tick, which ran mu300-device and then itself again (exec "$0" sleep --if-due). The tick now leaves $STATE/.tick-hint: the files it depends on (the battery's and the charger's readings, its own state files, the siren's pid file) with what each held, and the uptime from which it has something to do anyway (a timeout that runs out; a minute at the latest). mu300-buttons starts mu300-led tick only when one of those files changed or that time came. Keys never waited for the tick.
  • thermal-guard: $(hottest), $(battery) (a cat per power supply) and $(native_cpu_cooling) (a cat per trip point) around reads that were builtins already. Now no process at all in a round, still every 5 s (#372 also stretched the interval far from the thresholds; that waits for a stress test). kanoqwq's rule stays: a round without a reading lifts no cap and turns no alarm off.
  • mu300-adbd: cat of the role and of UDC and a sleep 1 every second. Now builtins, and a look every 3 s while the gadget is bound with adb in it (MU300_ADBD_IDLE_TICK), every second otherwise; an unbound gadget (an adb connection that ended) is bound again up to 2 s later than before.
  • ndp-learn: awk | sort, two ip calls per prefix, ip | awk and ip | grep every 10 s. A round now reads /proc/net/if_inet6 itself and greps the routing table's lines of the bearer's /64s; learn_once runs only when one of them changed or a withdrawal has rounds to go. With iproute2's monitor (OpenWrt's ip-full) ip -o -6 monitor address route runs as a child and a line starts a round, so a new prefix is routed at once and a route someone removed comes back at once; a safety round every 300 s looks at the routes whatever the monitor says, and while the bearer has no global address it solicits after 10 s, then at doubling intervals up to 300 s. Without a monitor (busybox's ip, dash) the rounds come every 10 s as before, the routes every third round.
  • mu300-traffic: the settings file is read again only when it changed, one date '+%s %z' gives the time and the offset (two dates and an awk before), the summary is read by the shell (a sed per value before).
  • early-recorder (already on the little CPUs since kanoqwq's f0b5ad43): logread -l 300 instead of all of logd's lines through tail, dmesg -s 1000000 instead of the whole kernel log through tail -c, and a round every 30 s after the first 90 s (was 10 s).
  • mu300-cpu services [little|all]: little puts procd's service tree (/sys/fs/cgroup/services, every service and what it starts) on the CPUs of the lowest capacity through the cpuset. The default is all, which changes nothing: the VPN engines are procd services, and on these boards all traffic goes through them.

Measured by liuwang97 on the device, the same work in one shell, old against new: thermal-guard's round 2.6 ticks -> 0.4; ndp-learn's round 1.95 -> 0.15; a traffic round 7.1 -> 1.35; mu300-power, 60 loops against a fake root, 546 -> 17.

Tests: tests/test_power.py (the stations and the hotspot every sixth loop and every loop without wlan0, the stations asked before the idle timer runs out, four loops start no more cat/sed/grep/rm... than one), tests/test_device_scripts.py (Buttons: mu300-led started only when its hint says so - timeouts, the plug, a minute, a key; early-recorder's reads), tests/test_adb.py (an idle gadget is looked at without cat, and without sleep where read has a timeout), tests/test_mu300cell.py (ndp-learn's daemon calls ip only when the addresses or the routes changed, its rounds on the monitor's word, its rounds without a monitor, its solicitations).

236. A restart in the middle of the kernel step leaves no module set the kernel does not match (#422)

Status: in mu300-update (the kernel step) and boot/init; tested against a fake boot partition and disk (tests/test_update.py KernelStep, tests/test_boot_init.py ModulesSettle).

On v2026.10.27.2 (7.3) a restart while the kernel step ran left 307 of 3056 modules as empty files, and the systems with the new build's set while the slot still held the image before. The two 7.3.0 builds disagree on struct task_struct (CONFIG_UCLAMP_TASK), so sprd_wlan_combo.ko read current->nsproxy at the wrong offset: an Oops 25 s into the boot, and the fallback went to Android. Both halves looked complete afterwards.

  • The empty files: the unpack writes 120 MB, and what was written in the last seconds before a hard restart is not on the disk yet (delayed allocation); the systems get those files as second names, so the damage reaches all of them. The step now checks the unpacked set (every module the bundle lists, none empty) and syncs it before any system gets it.
  • The mismatch: from the moment the systems' set changes until the image is written (and in the "already up to date" path), boot/modules.pending holds the release and banner of the new kernel. Whoever finds it next settles it: the ramdisk's init before the system starts (the running kernel's uname -r/uname -v against the banner), or the next mu300-update (the banner of the image in the slot). The new kernel gets the unpacked set again (it was on the disk before the file was written); any other gets the set kept with the image before.
  • The Update page no longer shows "Restart needed" while an update still runs: the system is switched before the kernel step, and that card invited the restart.

The init part works from the next image on: a device restarted in the middle of the step that installs this image still boots the image before, whose init does not know the file; the next mu300-update settles it then.

237. One gadget rebind at boot: the LAN hook waits for adbd's, and the lease check asks for the USB host's

Status: in openwrt/overlay/etc/hotplug.d/iface/10-mu300-usb, mu300-adbd and mu300-usb-reset; tested in tests/test_early_dhcp.py, tests/test_adb.py (Gadget.test_waits_while_the_lan_hook_rebinds) and tests/test_device_scripts.py (UsbReset); on the U30 Air (OpenWrt, 6.18.59) 22 soft reboots and on F50-B (Ubuntu, 7.3) 10, Mac mini host, 2026-10-29.

On the U30 Air under OpenWrt (v2026.10.29.1), 2 soft reboots in 13 left the Mac's NCM interface on a self-assigned 169.254 address: the device side looked fine (usb0 up, in br-lan and forwarding, the UDC configured, adb working over the same cable), but usb0's rx_packets stayed at 34-35 for good and dnsmasq never saw a DHCP request from the gadget's host MAC. Unbinding and binding the gadget by hand brought it back at once. The owner's own reboot that morning was a third such boot (rx frozen at 35 for over an hour).

Why. Two things re-enumerated the gadget at the same moment of every OpenWrt boot. The LAN hook (K10) unbinds 2 s after lan comes up (at about 4.4 s after the kernel started), sleeps 1 s and binds again; mu300-adbd (S19) adds adb with a rebind of its own as soon as adbd has written its descriptors, at about 6.5 s. On every boot measured, both fell within the same 200 ms: adbd unbound and bound (6.51 s), the hook unbound (6.70 s; FunctionFS saw FUNCTIONFS_UNBIND and dwc3 logged request ... was not queued to ep0out), adbd's bind retry bound it again (6.71 s), FunctionFS took it off once more when adbd closed its endpoints (ffs_closed()), and the hook bound it (7.70 s): four enumerations in about 1.2 s. The device-side log of the failing boots is the same as that of the good ones; what differs is the Mac, whose NCM driver came out of some of these bursts with an OUT path that sent nothing (the Mac kept the interface "active", the device kept transmitting to it). The F50 on Ubuntu has no LAN hook: one rebind (adbd's) and every boot was clean, before and after.

The safety net did not catch it either: mu300-usb-reset --if-no-lease 25 (mu300-post) left the gadget alone when any lease file was not empty, and a phone on the hotspot had a lease (the owner's boot: a DHCPACK for the phone at 08:38:12, none for the Mac).

Now.

  • The hook decides at the LAN's ifup whether adb is about to join the gadget (adbd installed, /etc/mu300/adb not off, not the USB host role, configs/c.1/f3 not linked yet). If so it waits up to 12 s for that link; once mu300-adbd has made it, its rebind is the re-enumeration after the LAN came up and the hook makes none of its own (usb gadget re-enumerated by mu300-adbd (adb joined it) in the log). Otherwise (adb off, adb already in, adbd that never comes) it rebinds as before.
  • Both hold /run/mu300-usb-rebind.lock (a directory, with the holder's pid) from the unbind to the bind, and mu300-adbd's loop does nothing while somebody else holds it. A lock whose holder is gone is taken over, and neither waits more than 15 s for it: the gadget is always bound again. mu300-adbd honours only a lock that is root's alone (F50-B's /run is world-writable).
  • --if-no-lease looks for a lease of the gadget's host_addr (the network function's host MAC); a gadget whose MAC cannot be read falls back to any lease, as before. The kernel ends host_addr with a NUL and a newline; both are taken off.

Measured (one reboot every ~2.5 min, the Mac's en16/en17 address, a ping over it, usb0 counters and the boot's log): before, U30 Air 2 of 13 boots without a lease (boots 10 and 11); after, 22 of 22 with the Mac on its lease (192.168.78.200, ping over en16, usb0 rx 218-5093). In the fixed boots mu300-adbd binds once (about 5.4 s), the hook logs that it left it to adbd, no not queued line, and the Mac's DHCPACK comes about 7 s after the kernel started. F50-B (7.3, the new mu300-adbd and mu300-usb-reset): 10 of 10, one rebind each, the Mac on its lease about 10 s after the kernel started, as before the change.

In one of the 22 (boot 116) the Mac had no lease yet when the lease check looked (about 32 s): the check, now asking for the host's MAC, re-enumerated the gadget and the Mac had its lease 5 s later. A phone on the hotspot had a lease then, so before this change that boot would have been left without one. Whether the Mac's OUT path had stalled there is not known (the counters were read only at the end).

Not covered: the other rebinders (mu300-usb-reset, mu300-usb mode changes, the U30 Air's role switch) do not take the lock; they run on request or 25 s after boot, not in the window above.

238. The U30 Air's charger detection (BC1.2) belongs to the USB PHY; the SIPA threads can be stopped

Status: the PHY driver, patch 0032 and sipa_v3 build on 6.18.59 and 7.2.13 here (no new warning); tests/test_u30air_bc12.py, tests/test_sipa_worker_lifecycle.py. kanoqwq ran the BC1.2 change on his U30 Air (7.2.8) over several plug cycles. Here on the U30 Air (OpenWrt v2026.10.30.1, 6.18.59 with this change), 2026-10-31: three boots and 16 VBUS cycles of the Mac port (uhubctl, 1-15 s off); see below. From kanoqwq's b4748534 (his PHY driver, ums9620-bc12.h and patch 0026) and fe52afe3 (SIPA).

Two detectors on the gadget's lines. The mainline PHY switched D+/D- from the PMIC's charger detector to the USB PHY at probe and left BC1.2 out. The charger (patch 0009) then read the PMIC's result itself, and when there was none it started the BQ chip's own input detection (IINDET_EN), which drives D+/D- under a USB link that is already up. ZTE's 5.4 kernel does it the other way round: its PHY hands D+/D- to the detector first, and its dwc3 takes them for USB only when the detector found a USB port (SDP, CDP); a charger (DCP) or no answer stays on the charger side.

Now (U30 Air only: the board with /charger_policy_service; F50 and V50 switch D+/D- to USB at probe as before):

  • The PHY runs one detection per VBUS event, from a work item (the extcon notifier is atomic): D+/D- to the detector, the PMIC's status (0x239c) every 20 ms until DONE, at most 60 times; SDP or CDP gives D+/D- to USB and only then says VBUS valid to the gadget. "No answer" is detected once more with the stock 960 ms delay; a real SDP is never redetected as a DCP. Every plug, unplug and role change starts a new generation, and a result of an older one is never published. The USB host role (mu300-usb host, a powered dock) owns D+/D- and no detection runs there.
  • The result is the PHY's chg_type/chg_state; its charger notifier tells the charger (patch 0032), which takes SDP 500 mA, CDP 1.5 A, DCP 2 A, and 500 mA while it runs or when it found nothing. IINDET is gone, and so is the charger's own extcon notifier. The Type-C Rp current, a PD contract (ump9620-tcpc), 0025's 3 A switch, a charge stopped from userspace and the boost are as before.
  • Where kanoqwq's PHY failed its probe (detector setup, no VBUS extcon), this one goes on with D+/D- on USB and no detection: USB comes first (the charger then keeps a USB port's 500 mA or the Rp current).

kanoqwq saw BC1.2 complete: type 1, DP/DM USB 0.19 s into the boot on a computer, then NCM; DCP and 2 A (REG00 0x13) on a wall charger, PD 5 V/2 A on a C-C charger, and OTG, over several plug cycles. A remaining slow charge he looked into was the same under stock Android with the same battery and charger (DCP, 2 A, about 0.4 A into a battery at 4.27 V): near its CV the battery takes no more, whatever the input limit.

The SIPA threads. The sender's and the receiver's threads (sipa_v3) waited in the main loop on a condition that did not include a stop, so kthread_stop() would have waited for ever, and nothing stopped them before their devm memory was freed (a failed probe). They are now stopped by a devm action, the main loop's wait ends on a stop, a failed receive-array allocation fails the creation instead of leaving a NULL array, and the sender's error paths no longer kfree() devm memory. Their start before the first resume was already this tree's (fill_started, free_started).

Device check (U30 Air, mainline): boot on a computer: BC1.2 complete: type 1, DP/DM USB in dmesg, NCM up, the charger at 500 mA (or the Rp current); unplug and plug again; a wall charger: type 2, 2 A; mu300-usb host: no detection while host.

Measured on the U30 Air at a Mac port (6.18.59 with this change, OpenWrt v2026.10.30.1, VPN and kill switch on): every boot logged BC1.2 complete (type 3, CDP, or type 1, SDP) at 0.17 s and came up with NCM, adb and mobile data through the VPN; the charger read usb_type 3 with 1.5-2 A (the Rp). On each port power cycle the charger first took the Rp current with type 0 while the PHY detected, and about 0.4 s later the PHY logged BC1.2 complete: type 3, DP/DM USB and the charger CDP. In the first series the second cycle (3 s off, both hub ports switched back on with the USB 2 one first) left the gadget configured at high speed with adb working but usb0 without carrier (the Mac never started NCM); two more cycles and mu300-usb-reset did not change that, a reboot did. The 12 cycles after that (both orders, 1-15 s off) all brought NCM back by themselves, and three on the release kernel did too. This looks like the Mac's NCM state (as in 237), but it is not proven. Not covered here: a wall charger (DCP), a PD charger and the host role (mu300-usb host), which need someone at the device.

239. Making room without losing Android's data: userdata's F2FS shrunk while Android runs

Status: EXPERIMENTAL, offered by install.sh, install.ps1 and the graphical installer next to the reset of FINDINGS 112 (MU300_ANS_MAKE_ROOM_METHOD=keep|reset); tested in tests/test_online_shrink.py, tests/online-shrink-e2e.sh (the real helper on a real F2FS, CI's arm64 job) and tests/test_resume.py (OnlineShrink); run on an F50 (below). Method: dikeckaan; implementation: kanoqwq (kanoqwq/mu300-linux fe52afe3, c69be3a3, dad8224b).

The make-room path of FINDINGS 112 erased everything in Android: the table was rewritten and Android's recovery reset it, because a filesystem cleared from outside is one an encrypted Android cannot mount. It need not be. Android's own kernel can shrink the mounted F2FS on /data (F2FS_IOC_RESIZE_FS): it works on the decrypted mapping, moves what lies past the new end, and leaves the files, the keys and the encryption alone. After that the partition table can say a smaller userdata, and on the next start Android maps the smaller partition and mounts the same filesystem.

How. tools/f2fs-online/mu300-f2fs-online (kanoqwq's f2fs-online.c, a static arm64 program of 67 KB, built reproducibly by build.sh; CI rebuilds it and compares) and tools/android-online-shrink.sh (his eligibility checks in shell) on the device; tools/resume.sh / install.ps1 and tools/resume.py on the computer.

  • Offered only where /data is an F2FS on all of userdata: mounted from userdata itself, or from one device-mapper node whose only slave is userdata and which covers all of it (file-based plus metadata encryption, as on the F50); never with block encryption, a layered or offset mapping, or a read-only /data. The F2FS must be whole sections.
  • The target is whole sections, smaller than now, and keeps 2 GiB more than what is used (kano's margin).
  • The disk is the internal one of tools/storage.sh's internal_disk (mmcblk0, or sda on a UFS, #396), and the table is read, rebuilt and committed in its logical blocks (resize-last-partition.py --sector-size; on 4096-byte blocks the first 48 and the last 40 sectors, and the worker is given the backup table's place by that count). F2FS blocks are 4096 bytes either way.
  • Before anything is written: the backup of FINDINGS 112, and a transaction with both tables (before and after) and the F2FS's UUID and size, on the computer.
  • On the device everything runs from /dev/mu300-online-TOKEN (tmpfs), never from the userdata being resized. First the kernel's ioctl at the current size, a no-op that shows it takes the ioctl at all; a kernel that refuses changes nothing and the transaction is put aside. Then a detached worker (adb may drop) checks both copies of the table against the old (or new) ones it was given, shrinks, reads the superblocks back, writes the backup table and then the primary, each read back.
  • The computer then checks both copies and the F2FS again, writes the token of FINDINGS 112 into the region and asks for a normal restart. In a terminal it waits for Android and goes on with the installation; the next run of a program that drives the installer (the graphical one: Refresh) does the same, checked as every resumed run is, and for this way also against the F2FS's UUID and size (Android not restarted yet: it says so).
  • An interrupted run is picked up from where the device is, never guessed: a worker that still runs is waited for; the old table at the old size is nothing done (the transaction is put aside); the old table at the target size is a worker that stopped between the two (it runs again and commits the table); the new table at the target size is done; anything else stops, with the backups kept.

Evidence. kanoqwq shrank an encrypted Android this way on a device of his line (64 GiB) and, on a user's F50, by 8 GiB, with the UUID, both superblocks and the data checked after a normal restart; his notes say the full installation after it and power cuts were not tested on hardware. Here: tests/online-shrink-e2e.sh runs the committed helper and script on Linux 7.0 against a 6 GiB loop disk with a GPT, the F2FS 40 % full and mounted through a device-mapper mapping (and directly), files written during the shrink; afterwards both table copies are the new table, the F2FS has its target and UUID, fsck.f2fs is clean and every file reads back. A read-only /data and a stale table are refused before anything changes.

On a board (2026-11-01, F50-B: Android 12, kernel 5.4.254, 58 GiB eMMC, /data an F2FS on dm-default-key with file-based encryption). Its userdata was first grown in the table to the end of the disk (the F2FS stayed at 20 GiB), which is the 32 GB variant's layout to the installer; 36 marker files (5 GiB of random data, some deleted in between) and a setting were written in Android. The same-size probe passes on this kernel. Refused before anything changed, the table and the F2FS read back as before: a stale old table, a wrong UUID, a wrong old size, a target above the F2FS or below what is used plus the margin. Two real runs: 20 -> 15.4 GiB (the computer killed while the worker shrank; the next run found "committed", finished and restarted Android) and 15.4 -> 11.4 GiB (a terminal run, which went on to install Ubuntu 24.04 with kernel 7.3, v2026.10.30.1, into the 41 GiB region; Linux booted). After each restart every marker's SHA-256 and the setting were the same, and Android's own boot fsck of /data (fsck.f2fs -a) reported no error. Three bugs found and fixed: the worker's byte offsets were computed in Android's 32-bit sh (every start was refused), the terminal run lost the F50 when it drops off USB once about 5 s after boot_completed, and a resumed run printed sizes before gib was defined. Two more from that test: the region found by a resumed run was an old mu300root superblock left at the fixed offset of the first releases (27762098176) inside the region made, not the region itself - a resumed run now looks at the transaction's region only (tools/storage.sh, install.ps1); and the restart in the middle of a terminal run gives Android its USB functions (MTP) back, so the run sets adb alone again in the new boot (#473's usb_adb_only), whose restore at the end is for that boot. vold also runs resize.f2fs on /data at every boot (it failed on the unclean image here); on the shrunk table the F2FS already fills userdata to within a section, so there is nothing for it to grow into.

Not taken. kano's growth of an encrypted userdata at uninstall (474e8018: a temporary Android boot image with a Magisk overlay that runs resize.f2fs before /data is mounted) - it changes Android's boot partition; our uninstall still offers the old growth (which erases Android's data) or leaving the space free. His backup of the metadata partition (encryption key material) is not made either: nothing here writes it.

240. kanoqwq's power and services work of October 23-25: what is taken, and how

What was still missing of kanoqwq's cc0ecce7 (CPU0 idle controls, fewer background wakeups), f0b5ad43 (event-driven services, boot work) and the CPU part of fb0b28e7 ("preserve confirmed CPU settings"), after #399, #402, #405, #408, #416 and the liuwang97 work of FINDINGS 235. His tree runs a modem daemon (mu300-modemd, a ubus object) and a system daemon (mu300-sysd); ours has neither, so his behaviour goes into our scripts and nothing that needs them is taken.

CPU0's low latency (cpu-idle.uc, cc0ecce7; FINDINGS 200 has the switch). mu300-cpu lowlatency on|off is all or nothing: a state that does not take the value (written, read back) puts every state of CPU0 back as it was, and a setting that cannot be saved is undone the same way. status --json has lowlatency.mixed (some states off, some on). His web switch leaves WFI alone and writes only core-sleep-* and cluster-pd; ours writes every state, which comes to the same: with every state disabled the menu governor still takes state 0. His UMS9621 (T158) refusal is not needed (no such board here).

The CPU voltage offset after a power cut (fb0b28e7). Ours dropped an offset after any boot that ended without a clean shutdown (FINDINGS 133), and on a board without a battery (F50, V50) pulling the cable is that. kano's version confirms a value at S99 and then keeps it through any later end. He did not try it on a device, so here it is a switch, off by default: mu300-cpu voltage keep-good on|off (.mu300/cpu-voltage-keep-good on the Linux disk, keep_good in status --json; CLI only). mark-good now writes up under the armed value at every boot that reaches its 10 minutes with the good value; with keep-good on, the initramfs keeps a good value when the armed mark of the boot that ended says up (stage=cpu-voltage-kept). A boot that ended before its 10 minutes still drops the value, so an offset that crashes early cannot loop the boots; one that crashes later is kept, as in his version, until mu300-cpu voltage off.

Wi-Fi at boot (mu300-hw, f0b5ad43). The "no restart" shortcut (unchanged settings, the access point up) also needs the country to be live: an access point that came up under the world rules is restarted under the country's. A settings file whose checksum cannot be read never counts as unchanged.

SMS receiver (mu300-smsd; his sms-events.sh, f0b5ad43, and its 500 ms slack, cc0ecce7). His receiver listens to the modem daemon's ubus events. Ours keeps its look every 5 s, but a look that finds nothing new starts no process: before, every look ran mu300-sim-state get (and through it mu300-sim active, head, tr) and cat | grep | md5sum over the URC logs. Now the logs are checksummed again only when one of them was written since the last checksum, and the card is asked about again only when its state files (/run/mu300/sim-slot, sim0.state, sim1.state) changed, and at every periodic sync. The times are compared by the shell's own test FILE -ot MARK against a mark in the lock directory, written before the look, so a write during the look is seen at the next one; a write in the mark's second counts as new. Without a mark (it could not be written) every look is as before. The wait is FINDINGS 235's: a read with a timeout on a private fifo (busybox ash, bash; sleep under dash), with 500 ms of timer slack during the wait only.

Data watchdog (mobile-data watch; his data-events.sh). His watchdog wakes on the modem daemon's URC and netifd events; ours keeps its AT look every 30 s, and the sleep between two looks now runs with 500 ms of timer slack (set by the sleep's own subshell; the AT and route work keeps the default). His watch_cleanup fixes a bug ours had too: the traps removed a lock path that was a local of watch(). On F50-B every systemctl restart ended in wlock: unbound variable (the EXIT trap, after the locals were gone) and status 1; on the U30 Air the TERM trap removed the lock and the watchdog went on without it, until a KILL. The path is now at process scope, TERM exits 0 (a stop) and INT 130, and the lock goes only while it is still this process's. The sleep runs in the background and is waited for, so the TERM trap runs at once rather than after up to 30 s.

Already here, or not taken:

  • Already in: thermal-guard's "no reading is unknown" rule (#399), the LED tick hint (FINDINGS 235), ndp-learn on ip monitor with slack, early-recorder's logread -l 300 and 30 s rounds, mu300-cpu services, the boot work (printk 4, the entropy kick, the eMMC wait at 100 ms, no sleep 1 before the UDC bind, the module prefetch, regdb before the PHY, iw reg set before wifi-start, no wait for a firmware class the kernel lacks), sipa-dele's 0.5 s polling and its 0.1 s handshake check, ums9620_lpintc, the 7.x link-wait patch, the NCM/RNDIS os_desc patch.
  • Not taken: his adaptive 5-30 s thermal cadence (as in #399); everything on mu300-modemd/mu300-sysd and the ubus objects (the native AT owner mu300-atd-io, dashboard RPCs, the uevent mode of mu300-keys, the LED deadline scheduling inside sysd); the native U30 dual-SIM changes; his TTL engine; calls, SIP and audio; the Chinese reports.
  • His explicit-off replay of CPU0 idle at boot: ours never disables CPU0's idle states unless asked, so off needs no replay.

Tests: test_cpu.CoresAndLatency (all or nothing, nothing saved, mixed), test_cpu_voltage (keep-good: kept only with the switch, up and the good request; mark-good writes up; the switch is root's and off by default), test_wifi.HwRestart (hw_bringup itself with stubs), test_sms_pool.Daemon.test_an_idle_look_starts_no_process (dash, bash, busybox ash; Linux only), test_device_scripts.MobileData.test_only_the_watch_wait_gets_timer_slack.

On the boards (scripts deployed live, the originals put back after):

  • F50-B, Ubuntu 24.04, 7.3.0. CPU0's states are WFI, core-sleep-lit and cluster-pd. lowlatency on turned all three off and off turned them back on, with active and mixed right each time. One state switched off by hand read partly off (mixed: 1). voltage keep-good was off, then on (keep_good: 1), then off again. mark-good with nothing armed did nothing. The watchdog's sleep child ran with 500000000 ns of slack and the watchdog itself with 50000. systemctl restart of the watchdog: the old script stopped with status 1 (wlock: unbound variable), the new one "Deactivated successfully" at once.
  • U30 Air, OpenWrt 25.12.6, 6.18.59, the VPN (sing-box) and its kill switch up throughout. mu300-smsd: 169 CPU ticks in 120 s before, 141 after (what is left is the full sync every 30 s, not touched here); in the looks between two syncs it had no child at all, and its slack read 500000000 during the wait. The OpenWrt busybox does test -ot to the second and read -t on the fifo (also checked in the 25.12.6 image). A real receive: mu300-sms send 7000 KALAN, and the operator's two-part answer came by direct delivery, joined into one message, in the pool 8 s later. The data watchdog's sleep had 500000000 ns of slack. The old watchdog ignored TERM there: its trap removed the lock and the loop went on (it took a KILL); the new one exited, and procd started it again. mu300-hw, a reboot with the hotspot on: "no restart" (the country, TR, live), the access point up, the VPN up.
  • Not tried on a board: keep-good across a real power cut (it needs the initramfs of this branch and an offset).

241. The IPA delegate says when its channel is open; the dashboard says "No SIM card" and whether it roams

Status: the delegate part checked by kanoqwq on a U30 Air (7.2.8) and here on a U30 Air (OpenWrt, 6.18.59); the dashboard parts here on the same U30 Air, "No SIM card" offline only. From his 0043a5d8, c84da8ba, fe52afe3 and b9f71e72, taken into this tree's code.

  • sipa_dele has a readiness interface (0043a5d8). The delegate module now keeps a channel status (0 handshake pending, 1 open, negative: the open failed) and shows it in sysfs next to sipa_dele_reset: /sys/bus/platform/drivers/sipa_delegate/*/sipa_dele_ready (the number) and sipa_dele_wait, whose read waits on a kernel wait queue until the status is not 0: 1 at once when the channel is open, -ETIMEDOUT after 3 s, the open's error, -EAGAIN for a channel that closed in between. The status goes to 1 on the first OPEN and on every later one, to 0 on a CLOSE or a receive that says the channel is FREE/gone (-EIO/-ENODEV); other receive errors leave it. Two fixes in the same place: the connection thread is woken only after the resource graph and its callback are in place (it was woken first, so a request from the CP could arrive before there was anything to take it), and a failed start now frees what init made (the thread was left parked, the delegator allocated, sysfs registered after success only).
  • sipa-dele-start asks it. After insmod it reads sipa_dele_wait instead of looking for channel 5-120 send open msg in dmesg (that line only said the OPEN was sent): not open, exit 1, and mobile-data makes no PDP context this round. mobile-data now also calls it when the module is already loaded (a reconnect), and there it only asks: no wait for the packet domain, no insmod. A module without the file (an older build, the 5.4 vendor one), or more than one such device, cannot say: exit 0 as before, so an image with an older module never stays off the network for it (bootability over lockdown). His SPACTCARD prefix on the AT+CGATT? probe is not needed here: ours already asks the selected card's own channel (mu300-sim active).
  • The dashboard says "No SIM card" (fe52afe3). With no card the radio is off too, and the page said "Radio off". dashboard-info now reports modem.sim_state, the card in use's last word on itself (mu300-sim-state's /run/mu300/sim<slot>.state, FINDINGS 186; a file, no AT command): absent, ready, locked or null. Absent: the network and registration rows say "No SIM card", and what belongs to a card is dropped from the shown snapshot (the identity cache may still hold the last card's IMSI, ICCID and number; operator, cells and signal go too). The IMEIs, model, firmware and the CFUN stay. null (not asked this boot) is never taken for absent.
  • Whether the card roams now (c84da8ba). The data roaming row shows the setting (FINDINGS 120) and now the network's word after it: "Roaming now" (stat 5 or 10 on the 5G or the LTE registration) or "Home network" (1 or 9); nothing when neither says. Both registrations are asked: on 5G SA the LTE one may be empty while the 5G one roams. The registration row also names a 5G roaming registration. His two IMEI rows with the "in use" badge were already here (FINDINGS 221).
  • The locks page's live signal: busy is not a failure (b9f71e72). When both dashboard channels are taken by other readings (the home page, a second browser), cell exits 75 and mu300dash signal answers {"busy":1,...}; the page keeps its last reading and does not back off. Any other failure is shown as before.

Not taken: his dual-standby switch and single-standby policy (0043a5d8: in this tree only the card in use has a live stack, FINDINGS 185, so single standby is how it already runs); his AT+SFUN=2 presence preflight for the U30 Air (it lives in his dual-stack mu300-dual-radio; mu300-sim-state never asks the card that is not in use); the 152 default for automatic mode (here "Automatic" stays the modem's 134, 152 is the explicit "Automatic without 2G", FINDINGS 198); the auto-mode ACL fix (82c01b9e: no page here writes uci over rpc); the voice receipt fix (500e5ea4, see FINDINGS 210); the SMS pool resolver, list column and LF fixes (edcdeb27, fe52afe3: one pool here, FINDINGS 210, and our encoder takes the text from the environment, so a newline is encoded, not a line break); his battery summary in amperes (b9f71e72: our tile shows the direction, watts, volts and the USB input); his ubus_rpc_session argument (his native modemd; ours is an rpcd shell backend); the VPN removal in fe52afe3.

tests/test_device_scripts.py (SipaDele: the readiness of a loaded and a freshly loaded delegate; MobileData: a loaded delegate is asked), tests/test_dashboard_info.py (sim_state, SimAbsent, RoamingNow), tests/test_mu300dash_security.py (the busy signal reply). Checked here (U30 Air, OpenWrt 25.12.6, 6.18.59, SIM in, VPN on): the module built from this tree, a reboot: the loader logged "packet domain attached", "loaded sipa-dele", "delegate channel and resource callbacks ready", sipa_dele_ready read 1, data through the VPN (HTTP 204), no oops. ifdown wan; ifup wan: the ready check passed (/tmp/mu300-sipa-dele-ready.log) and data came back. The vendor DT's "get resource failed for remote-base" / "dts parsing failed" line is in the boot log with the old module as well. Dashboard: sim_state "ready", "absent" from a state file given by hand; the data roaming row read "Allowed · Home network"; with every dashboard channel held, mu300dash signal answered busy. Everything was put back afterwards. Not checked on a board: the page with a card taken out, and an F50. Device check before merge (still open): a mainline board with the rebuilt sipa-dele.ko: cat .../sipa_dele_ready reads 1 after the dial, /tmp/mu300-sipa-dele.log says "delegate channel and resource callbacks ready", data flows; ifdown wan; ifup wan passes the ready check (/tmp/mu300-sipa-dele-ready.log). The dashboard of a board with its card taken out (or an empty slot selected) says "No SIM card", the IMEIs stay.

multi. mu300-usb net multi (the Device page and the web panel: "NCM + RNDIS") makes RNDIS and NCM in the one configuration there has always been, RNDIS first, then NCM, then the ACM console (and adb, f3): RNDIS is interface 0, the one the MS OS descriptors (compatible ID RNDIS) name, NCM's compatible ID stays empty and Windows 10 2004+/11 bind UsbNcm.sys to it by class. It is a single configuration on purpose: Windows makes no composite parent for a device with several, and the earlier RNDIS + NCM in two configurations bound the whole device to usbser (K6). bcdDevice is 0x0305 (0x0306 while adb is in the gadget), apart from NCM's 0x0301/0x0303 and RNDIS' 0x0302/0x0304, because Windows caches the MS OS descriptors per VID/PID/bcdDevice. The configfs links are f1 (RNDIS), f4 (NCM) and f2 (ACM); the interfaces follow the order the links are made in. At the bind RNDIS registers usb0 and NCM usb1: init names them rndis0 and usb0, in that order. The early DHCP server (K5) answers on usbbr, a bridge of the two that exists only in the initramfs and goes before switch_root (lan-start and the LAN hook bridge usb0 and rndis0 into br-lan, as they did for RNDIS alone; OpenWrt's preinit serves usb0). usb-net-applied says multi only when both functions were made; a kernel whose configfs refuses rndis.rn0 makes NCM (then ECM) and says ncm, as for a saved rndis. Both kernels here have the stock f_rndis built in (the vendor 5.4 and the mainline ones, CONFIG_USB_F_RNDIS=y), so that fallback is for other kernels; it is covered by the tests only. mu300-usb-reset --if-no-lease takes a lease of either host MAC; the LuCI backend's bound_function says multi for RNDIS beside NCM ("mixed" for any other mix).

net-name. Linux names a CDC Ethernet, NCM or RNDIS link usb%d when the driver marks it point-to-point (FLAG_POINTTOPOINT: cdc_ether, cdc_ncm and rndis_host all do) and the device's MAC is locally administered (bit 0x02 of the first byte), eth%d otherwise (usbnet_probe). Our host MACs are 02:50:...: usb0. Stock Android on the F50 (measured on F50-B, sys.usb.config ecm,mtp,adb) writes the device's Wi-Fi address (/mnt/vendor/wifimac.txt, vendor block 5c:7d:ae) into both dev_addr and host_addr of ecm.gs0 and ncm.gs0, so a Linux computer saw eth0. mu300-usb net-name eth (/etc/mu300/usb-net-name, read by boot/init with the mode, one rebind) gives every function's host_addr the first three bytes of LK's androidboot.wifimac and the device's own two bytes after them (:02 for NCM/ ECM, :04 for RNDIS); dev_addr stays as it is. Not the Wi-Fi address itself: wlan0 has it and is a port of the same br-lan, where a frame from the computer with the bridge's own port address as its source would be dropped. Without a usable androidboot.wifimac (missing, multicast or locally administered) it is the usual MAC with bit 0x02 cleared. The address is in a vendor's block, as Android's is; it only ever appears on the USB link and the LAN behind it. A computer that renames links itself (systemd's predictable names: enx) does so either way; macOS sees a new MAC and makes a new network service for it. Windows keys its MS OS descriptor cache on bcdDevice, not on the MAC.

Checked here (F50-B, Ubuntu 24.04, v2026.11.01.1 with this init appended to the release's generic ramdisk, a Mac on USB): 7.3: multi made (stage=usb-ifnames rndis=usb0->rndis0, ncm=usb1->usb0, usb-bridge-early usbbr, usb-bridge-gone), bcdDevice 0x0306 with adb, bridge link: rndis0, usb0, wlan0 in br-lan; the Mac bound NCM (AppleUSBNCMControl on interface 2, its known en interface and lease), ACM and adb, and no network service for RNDIS; SSH, adb, 50 MB over SSH in 1.5 s; four reboots. 5.4.254: the same, three reboots. net-name eth on 7.3: host_addr 5c:7d:ae:..:..:02 and :04, dev_addr unchanged, the Mac made a new interface for the new MAC and had network; RNDIS alone (once) and NCM afterwards as before. Not checked: Windows (none here: RNDIS on old Windows, both adapters on new Windows), a Linux computer (two adapters; eth0 as the name), OpenWrt, a computer taking its first lease from the early bridge (the Mac kept its lease), a kernel without f_rndis.