Commit Graph
11 Commits
Author SHA1 Message Date
Abdurrahman Kaan DikeçandClaude Opus 5.5 cba8e92541 After the final review: no eMMC CID fallback, only failed connections retried, build-wlan.sh strict
* init: the eMMC serial only from androidboot.emmcid. The /sys CID fallback ran before the modules that find the
  eMMC, so it would have come and gone between boots; without the argument the identity is the serial number alone.
  An emmcid without a serial number no longer gives "MU300LINUX--<emmc>".
* mu300-update: fetch_stdout retries only a failed connection (curl 6 7 35 52 56, GNU wget 4). A timeout (28) had
  been retried by curl already; four more rounds held "check" for half an hour. A 404 through wget is not retried.
* mu300-at: a test of the loop itself (a writable directory, a dead owner's lock that cannot be removed: "busy").
* build-wlan.sh: a Wi-Fi patch either applies or is applied already, as in upstream/build.sh (it was `|| true`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:29:46 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 44548ee90b lan-start: udev names the bridge before usb0 joins it, so br-lan's link-local stays the same (U30 Air test D6)
Under 7.2.9 br-lan's IPv6 link-local was sometimes made from usb0's MAC: when the bridge came up before udev had
given it its persistent MAC, it had taken its port's. udevadm settle after creating it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 02:59:59 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 5f3364f95d mu300-at as a user says it needs root instead of looping for ever (U30 Air test D4)
`mobile-data status` without sudo never returned: mu300-at found a stale lock in /run/mu300-at, could not
remove it, and the "continue" after the failed rm skipped the wait counter. A client that cannot write the
daemon's directory now says so and exits; a stale lock that cannot be removed counts as busy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 02:52:39 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 1a69a41ea9 mu300-led: a siren the pid file does not name stops by itself
CI caught two sirens flashing together (white lit throughout, red and blue at once): one left running by an
earlier alarm kept writing next to the new one. The same could follow a restarted thermal-guard on a device.
The siren now checks the pid file every round and ends when it names another process or, after the first
round, nothing. Test: a stale siren stops.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-29 08:45:10 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9e60666858 F50: the heat alarm no longer reads a battery that is not there
Under mainline the PMIC's fuel gauge probes on the F50 too and reports a battery, at 75.0 C from an unconnected
NTC input (TEMP=750, HEALTH=Over voltage): since v2026.10.04 the LED heat alarm went on at every boot and its
clear condition (battery at 45 C) never came. thermal-guard now reads the battery on the U30 Air only, as
mu300-toolkit already did; the SoC's zones still set the alarm off on both. Reported with the readings on an F50
under 6.18.54; the same readings on our F50. Test: the F50's junk battery sets nothing off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-29 08:45:10 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 fa13a3676f Windows installs push LF scripts; the AP lists its stations; stale trial guards disarmed; mu300-nfc on|off
- Windows (fixes #7): a clone with core.autocrlf=true checked the device scripts out as CRLF, and Android's sh
  ran none of android-install.sh ("unexpected 'do'"), with an empty log. .gitattributes keeps text LF on every
  system; install.ps1 pushes scripts through PushUnix, and build-boot-image.py writes init, ueventd-perms.sh and
  the module orders with LF, for clones made before. Checked on Windows: 5 of 5 scripts CRLF on main, 0 now.
- Wi-Fi (#8): the vendor driver had no dump_station, so iw, iwinfo assoclist and LuCI's Associated Stations
  were empty although hostapd had the clients; nor get_channel ("Channel: 0"). dump_station lists the firmware's
  peer table entries of the AP (address only: the firmware gives no signal or counters), get_channel returns
  what cfg80211 kept from start_ap. Mainline copy and a 5.4 patch; the channel checked on the F50 under 6.18.
- A U30 Air restarted every ten minutes after mu300-linux from Android: boot_b's device segment, which
  mu300-update keeps, still held an old experiment's --trial-guard. The generic segment carries an empty guard
  file that replaces it; an experiment's guard goes last, into a segment of its own. Checked on the U30 Air.
- mu300-nfc on|off: ZTE's NFC switch is bit 5 of the tag's configuration byte 0x3bf (found by reading the chip
  with the switch on and off); set, phones get nothing. mu300-nfc says so. Checked on the U30 Air.
- Tests: CRLF inputs, no plain adb push of scripts, the empty guard, NFC on/off. FINDINGS 33g, 33h.

Fixes #7

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-29 00:32:03 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 a8e529cfcb U30 Air: mu300-nfc writes its NFC tag (the hotspot's Wi-Fi, a URL, text)
- The tag is a Fudan FM11NT08 at I2C 2-0x57, reachable while GPIO 190 is held low (libgpiod). mu300-nfc shows
  it (a Wi-Fi record by its name only), writes the hotspot's name and password as ZTE's firmware does (the same
  bytes), a URL (with the NDEF prefix codes), text, or nothing; each 16-byte page only when it differs, and read
  back after writing.
- sync, at every hotspot start (Ubuntu) and at boot (OpenWrt): the Wi-Fi record again if that is what the tag
  holds, so a changed password reaches it; a URL or text written by hand stays.
- Ubuntu and OpenWrt get i2c-tools and gpiod(-tools); mu300-nfc is on PATH.
- Tested on the U30 Air under 7.2: a phone joined the hotspot and opened a URL written from Linux, once NFC was
  switched on in ZTE's web interface (a setting the tag keeps). Tests: a fake tag, ZTE's record byte for byte,
  long URLs, what sync leaves alone. FINDINGS 33g.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 20:00:24 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 cb641bc5d6 U30 Air: every LED under control as in ZTE's firmware; a heat alarm on the battery LED
- The network and Wi-Fi lights never went out under mainline: they are PMIC LDOs (VDDCAMA0-2), which ZTE switches
  with zte_ldo_leds and mainline left on. leds-zte-ldo makes them zte-ldo0..2 and starts them dark.
- The network LED's red is the PMIC's keypad backlight sink: leds-sc27xx-kpled, after Unisoc's driver, under its
  Android name keyboard-backlight. The device tree's other GPIO LEDs light nothing, under Android too.
- mu300-led: battery white while Linux is up, network blue on 4G, white on 5G, red without service, Wi-Fi white on
  2.4 GHz, blue on 5 GHz; under 5.4 the LDOs through vddcamaN_status. mobile-data re-reads the access technology
  on every watchdog round.
- thermal-guard: the SoC at 85 C or the battery at 50 C sets off mu300-led alarm, the battery LED's colours one
  at a time, until they cool down; it now runs on 5.4 too, where it only watches.
- Mapped by lighting each LED on the device and by sampling Android's LEDs with the radio off; 6.18 and 7.2 on
  the U30 Air. Tests: 4G/5G, the siren, the 5.4 LDO switches, the heat alarm. FINDINGS 33f.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 19:20:33 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 c58ab80b18 USB host tested on the U30 Air; the installers ask which adb device; a trial guard only in a trial boot
- USB host under 6.18 and 7.2: a Logitech receiver (HID) and a flash drive (mounted, read) through a USB-C
  adapter. The PHY now provides otg_set_vbus(), through which dwc3 hands it the role (host eye pattern, A-type ID,
  D+/D- pull-downs). Patch 0007 is 6.18 only (7.2 has it upstream): patches/<major.minor>/ holds such patches.
  mu300-usb waits for the role switch, which works in the background, and reads a fake /sys in tests.
- init applied a --trial-guard left in the device segment of boot_b to every boot of an installed system: it
  restarted every 10 minutes (mu300-update keeps boot_b's device segment). A guard now counts in a trial only.
- install.sh, install.ps1, uninstall.ps1: with more than one adb device they always ask which one (the F50/U30 Air
  is the default), and with the device in Linux and only a phone or tablet in Android they offer to send the
  device to Android first - an installer about to work on a tablet was reported.
- tests: device selection, and mu300-usb against a fake charger (never 5 V against a supply, the boost off at
  boot, the F50 refused); FINDINGS 33e; README.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 16:53:00 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 71db73d941 U30 Air: its battery under mainline (efuse, ADC and fuel gauge for UMP9620)
upstream/patches 0004-0006 teach mainline's sc27xx efuse, ADC and fuel gauge drivers the UMS9620's PMIC, from
the values in Unisoc's 5.4 drivers: the efuse read window, the ADC's scales, calibration and 26 MHz clock vote,
the FGU's enable bits and calibration field. On this board "bat-temp" is the NTC's voltage (the battery node's
voltage-temp-table converts it), the charger IC has no driver (the status comes from the battery current), and
mainline read every discharge current as ~2 billion (an unsigned subtraction; now s64 like the vendor driver).

Tested on the U30 Air (6.18 and 7.2): level, voltage, current (-2..-18 mA on USB power, full), 33 degC, status.
A first version recursed (status -> capacity -> calibration -> status) and overflowed the stack at every boot:
five failed boots later the device was back in Android by itself, and the panic was in pstore (FINDINGS 33d).

Also: mu300-wifi-band falls back to the hotspot's channel when it cannot read hotspot.conf (not root), and
mu300-led tells the band from the setting while the hotspot has no channel yet (it lit white on 5 GHz).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 10:55:22 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 ed13857c26 Tests for the scripts on every system; the buttons and an LED timeout on the U30 Air
tests/ (python3 -m unittest discover -s tests; CI on Ubuntu, macOS and Windows):
- the device scripts under dash (Ubuntu), bash and busybox ash (OpenWrt), with stub commands and a fake / :
  mu300-device, -lan-ip, -led (both devices, the timeout), -ttl, -wifi-band, -buttons, mu300-vpn (URI parsing,
  JSON, networks kept out of the tunnel, the sing-box config), mu300-update (release files, kernel choice, the
  byte helpers boot images are edited with, which bundles may go onto which device)
- tools/i18n.sh with every translation; install.ps1's T/NormalizeAnswer/Gib under PowerShell 5.1 and 7
- build-boot-image.py's generic ramdisk and the U30 Air's modules; the U30 Air's module order
- every script parses under the shells that run it; rules from past bugs (no double quotes in install.ps1's
  device commands, ASCII PowerShell, init looks for partitions after the modules)
To be testable, mu300-update and mu300-vpn define their functions only with MU300_LIB=1, and paths can point at
a fake root (MU300_SYSROOT, MU300_BIN, MU300_*_CONF).

Found by the tests: mu300-vpn's fallback for the device's own network sourced a missing lan.conf, and dash and
busybox ash leave the whole subshell when "." cannot open its file - the address came out empty.

Buttons (mu300-keys, a small static C reader of /dev/input; mu300-buttons, Ubuntu and OpenWrt):
- power: a short press wakes the LEDs, held 3 s shuts down (logind no longer powers off at a touch)
- the U30 Air's Wi-Fi key: short press switches the hotspot 2.4 <-> 5 GHz (mu300-wifi-band), held 3 s turns it
  off or on
- LEDs go dark after LED_TIMEOUT (/etc/mu300/led.conf; 60 s on the U30 Air, 0 = always on, the F50's default);
  what they should show is kept and shown on the next wake. The Wi-Fi LED shows the band: blue 5, white 2.4 GHz.
- mainline kernels: CONFIG_KEYBOARD_GPIO (there was no /dev/input at all)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
2026-09-28 10:18:37 +03:00