48 lines
1.2 KiB
Bash
Executable File
48 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
qemu_bin=${QEMU_BIN:-"$script_dir/build/qemu-system-arm"}
|
|
rom_path=${ROM_PATH:-"$script_dir/firmware/s5l8950x-secure-rom.bin"}
|
|
dfu_image=${DFU_IMAGE:-}
|
|
|
|
if [ ! -x "$qemu_bin" ]; then
|
|
echo "QEMU introuvable: $qemu_bin" >&2
|
|
echo "Configurez ce dépôt avec --target-list=arm-softmmu puis compilez-le." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "$rom_path" ]; then
|
|
echo "SecureROM introuvable: $rom_path" >&2
|
|
echo "Placez votre dump A6 de 65536 octets dans firmware/s5l8950x-secure-rom.bin." >&2
|
|
exit 1
|
|
fi
|
|
|
|
set -- \
|
|
-machine iphone5 \
|
|
-bios "$rom_path" \
|
|
-no-reboot \
|
|
-no-shutdown \
|
|
-display none \
|
|
-serial mon:stdio
|
|
|
|
if [ -n "$dfu_image" ]; then
|
|
if [ ! -f "$dfu_image" ]; then
|
|
echo "Image DFU introuvable: $dfu_image" >&2
|
|
exit 1
|
|
fi
|
|
set -- "$@" -global "s5l8950x-usb-otg.dfu-image=$dfu_image"
|
|
fi
|
|
|
|
echo "QEMU macOS : $qemu_bin"
|
|
echo "SecureROM : $rom_path"
|
|
if [ -n "$dfu_image" ]; then
|
|
echo "Image DFU : $dfu_image"
|
|
echo "Injection DFU interne active."
|
|
else
|
|
echo "La SecureROM attend en dfuIDLE."
|
|
fi
|
|
echo "UART A6 : cette console (Ctrl+A C = moniteur, Ctrl+A X = quitter)"
|
|
|
|
exec "$qemu_bin" "$@"
|