uzbek-plus/linux/ramboot-usb1.init.diff
q 105bef466a Project Aurora: mainline ARM64 Linux on JZ08AU (MSM8916) LTE modem
Sanitized research log, build/reproducibility docs, DTS, kernel configs,
patches, initramfs sources, bootchain migration plans and test logs.
B5 direct boot PASS; B6 modem lifecycle in progress.
No dumps, NV/EFS, vendor firmware or device identifiers included.
2026-09-30 17:23:18 +03:00

64 lines
2.8 KiB
Diff

--- ../initramfs/init 2026-09-29 23:47:12.862029108 +0600
+++ init 2026-09-30 03:43:03.785764611 +0600
@@ -1,20 +1,53 @@
#!/bin/busybox sh
-# Aurora RAM boot #1 — diagnostics only. No block devices, no network, no firmware, never exits.
+# Aurora RAM boot USB1 — diagnostics + USB NCM gadget (static 172.16.42.1/24).
+# No block devices, no firmware, no radios. Never exits (failures leave the UART shell).
/bin/busybox mkdir -p /proc /sys /dev /tmp /usr/bin /usr/sbin /sbin
/bin/busybox --install -s
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev 2>/dev/null
+mount -t configfs configfs /sys/kernel/config
+log() { echo "[init] $*"; echo "[init] $*" > /dev/kmsg 2>/dev/null; }
echo
-echo "=== AURORA RAM BOOT ==="
+echo "=== AURORA RAM BOOT USB1 ==="
uname -a
-echo "--- cmdline"; cat /proc/cmdline
-echo "--- model"; cat /proc/device-tree/model; echo
-echo "--- cpuinfo"; cat /proc/cpuinfo
-echo "--- meminfo"; head -5 /proc/meminfo
-echo "--- interrupts"; cat /proc/interrupts
-echo "--- clocksource"; cat /sys/devices/system/clocksource/clocksource0/current_clocksource
+echo "--- model"; cat /proc/device-tree/model; echo
+echo "--- cmdline"; cat /proc/cmdline
echo "--- block devices (expected: none, eMMC disabled in DT)"; ls /sys/block
+
+usb_up() {
+ for i in $(seq 1 50); do
+ udc=$(ls /sys/class/udc 2>/dev/null | head -1)
+ [ -n "$udc" ] && break
+ sleep 0.2
+ done
+ echo "--- /sys/class/udc:"; ls -l /sys/class/udc 2>&1
+ if [ -z "$udc" ]; then log "NO UDC found - USB gadget skipped"; return 1; fi
+ # DEVELOPMENT-ONLY IDs (same dev setup as JZ02: Google 18d1:d001) - not for production
+ G=/sys/kernel/config/usb_gadget/aurora
+ mkdir -p $G || return 1
+ echo 0x18d1 > $G/idVendor
+ echo 0xd001 > $G/idProduct
+ mkdir -p $G/strings/0x409
+ echo "Aurora" > $G/strings/0x409/manufacturer
+ echo "Aurora RAM Boot" > $G/strings/0x409/product
+ echo "<EMMC_SERIAL>" > $G/strings/0x409/serialnumber
+ mkdir -p $G/functions/ncm.usb0 || { log "ncm function create FAILED"; return 1; }
+ mkdir -p $G/configs/c.1/strings/0x409
+ echo "NCM" > $G/configs/c.1/strings/0x409/configuration
+ ln -s $G/functions/ncm.usb0 $G/configs/c.1/
+ echo "$udc" > $G/UDC || { log "bind to UDC '$udc' FAILED"; return 1; }
+ log "usb gadget bound to UDC '$udc'"
+ ifc=$(cat $G/functions/ncm.usb0/ifname 2>/dev/null)
+ log "ncm ifname='$ifc' dev_addr=$(cat $G/functions/ncm.usb0/dev_addr) host_addr=$(cat $G/functions/ncm.usb0/host_addr)"
+ [ -n "$ifc" ] || return 1
+ ip link set lo up
+ ip addr add 172.16.42.1/24 dev "$ifc"
+ ip link set "$ifc" up
+ ip addr show "$ifc"
+ log "network: $ifc 172.16.42.1/24 up (static, no DHCP)"
+}
+usb_up || log "USB/NCM setup incomplete - staying on UART shell"
echo "=== entering shell (exit restarts it) ==="
while true; do
setsid cttyhack sh