core repair
This commit is contained in:
parent
26a4786ea9
commit
f4a9b4eb6f
@ -23,11 +23,29 @@ udevadm settle
|
||||
|
||||
echo "[lesavka-core] ⏳ waiting for UDC to register ..."
|
||||
UDC=""
|
||||
for _ in {1..40}; do # 40 × 100 ms = 4 s max
|
||||
UDC=$(ls /sys/class/udc 2>/dev/null | head -n1) && [ -n "$UDC" ] && break
|
||||
for _ in {1..100}; do # 100 × 100ms = 10s
|
||||
UDC=$(ls /sys/class/udc 2>/dev/null | head -n1) && [[ -n $UDC ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
[ -n "$UDC" ] || { echo "❌ no UDC present after 4 s"; exit 1; }
|
||||
|
||||
if [[ -z $UDC ]]; then
|
||||
echo "[lesavka-core] ⚠️ UDC still absent – trying manual bind"
|
||||
for drv in dwc2 dwc3; do
|
||||
drv_root="/sys/bus/platform/drivers/$drv"
|
||||
[[ -d $drv_root ]] || continue
|
||||
for node in /sys/bus/platform/devices/*usb*; do
|
||||
node=${node##*/} # strip path → “1000480000.usb”
|
||||
echo "$node" >"$drv_root/bind" 2>/dev/null || continue
|
||||
done
|
||||
done
|
||||
# re‑check for another 5 s
|
||||
for i in {1..50}; do
|
||||
UDC=$(ls /sys/class/udc 2>/dev/null | head -n1) && [[ -n $UDC ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
fi
|
||||
|
||||
[[ -n $UDC ]] || { echo "❌ UDC not present after manual bind"; exit 1; }
|
||||
echo "[lesavka-core] ✅ UDC detected: $UDC"
|
||||
|
||||
# 3) Mount configfs once
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user