Sync worktree updates into main repo folder
This commit is contained in:
parent
bc1a502c1d
commit
c4d2b5d9d1
21 changed files with 1565 additions and 347 deletions
32
start.sh
32
start.sh
|
|
@ -139,7 +139,37 @@ main() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exec "$BINARY" "$@"
|
||||
# On WSL, keep usbipd auto-attaching the device so it stays visible
|
||||
# after each USB reset the exploit triggers.
|
||||
start_usbipd_auto_attach
|
||||
|
||||
# In DFU mode on some WSL/usbipd stacks, descriptor reads can intermittently
|
||||
# fail even when lsusb still reports CPID/ECID. If parse_device_info()
|
||||
# recovered fallback IDs, pass them explicitly unless caller already did.
|
||||
local run_args=("$@")
|
||||
local has_cpid=0
|
||||
local has_ecid=0
|
||||
local arg
|
||||
for arg in "${run_args[@]}"; do
|
||||
case "$arg" in
|
||||
--cpid|--cpid=*) has_cpid=1 ;;
|
||||
--ecid|--ecid=*) has_ecid=1 ;;
|
||||
esac
|
||||
done
|
||||
if [ "$DEVICE_MODE" = "dfu" ]; then
|
||||
if [ $has_cpid -eq 0 ] && [ -n "${DEV_CPID:-}" ] && [ "${DEV_CPID:-}" != "0x0000" ]; then
|
||||
run_args+=("--cpid" "$DEV_CPID")
|
||||
fi
|
||||
if [ $has_ecid -eq 0 ] && [ -n "${DEV_ECID:-}" ] && [ "${DEV_ECID:-}" != "0x0" ]; then
|
||||
run_args+=("--ecid" "$DEV_ECID")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run binary (not exec so we can clean up usbipd afterwards).
|
||||
"$BINARY" "${run_args[@]}"
|
||||
_rc=$?
|
||||
stop_usbipd_auto_attach
|
||||
exit $_rc
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue