Files
mu300-linux/boot
Abdurrahman Kaan DikeçandClaude Opus 5 ccc9bb9fd0 mainline: one boot brings the whole device up, and the host gets its address
A cold boot of the mainline kernel now ends with the modem alive, mobile data
connected, the Wi-Fi hotspot running, /dev/mali0 present and the host holding a
DHCP lease - no commands over the serial console.

Three things were needed:

* The vendor modules load from the initramfs again (upstream/module-order.txt),
  but the USB gadget is bound *after* them, as the last thing before
  switch_root. The host starts asking for a lease the moment the gadget
  appears, so the closer that is to the DHCP server coming up, the better.
* Even then the host can lose the race - and macOS, once it has fallen back to
  a self-assigned 169.254 address, stops asking. mu300-usb-reset re-enumerates
  the gadget, which looks like a fresh cable, and mu300-post runs it 25 s into
  the boot if nothing took a lease. Measured: host on 169.254 before, DHCP
  address and 2 ms ping after, and the next cold boot came up addressed on its
  own.
* mu300-usb-reset detaches before it unbinds. Unbinding kills the console or
  SSH session it was started from, and a rebind that never runs leaves the
  device with no USB at all - which cost a power cycle to learn.

extra-modules also loads the mainline modem stack and the Bluetooth tty when it
finds them, and android-vendor-start waits for /dev/modem, so the vendor
services no longer need the modules to exist before they start.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-19 09:14:23 +03:00
..