ios: phone-ld re-sends the SDK when the phone's copy is gone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
astar76 2026-10-27 23:36:46 -05:00
commit a505cdb89d

View file

@ -40,6 +40,13 @@ job=/var/mobile/mulberry-build/ld.$$.$RANDOM
ssh_=(ssh -i "$KEY" -o BatchMode=yes -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPersist=60
-o ControlPath="$HOME/.ssh/cm-phone-ld-%r@%h" "$IPHONE")
"${ssh_[@]}" "mkdir -p $job"
# The SDK copy on the phone may have been cleaned up: send it again (once, over the LAN).
if ! "${ssh_[@]}" "[ -d $REMOTE_SDK/usr/lib ]"; then
LOCAL_SDK=${SDK:-$HOME/.local/opt/dl/sdk18/iPhoneOS18.6.sdk}
echo "phone-ld: copying the iOS SDK to the phone (one-time, ~300 MB over the LAN)…" >&2
tar -cf - -C "$(dirname "$LOCAL_SDK")" "$(basename "$LOCAL_SDK")" | \
"${ssh_[@]}" "mkdir -p $(dirname "$REMOTE_SDK") && tar -xf - -C $(dirname "$REMOTE_SDK")"
fi
# Ship inputs under unique names (two inputs may share a basename).
stage=$(mktemp -d)
trap 'rm -rf "$stage"' EXIT