TrungNguyen1909 / qemu-t8030

iPhone 11 emulated on QEMU
Other
2k stars 210 forks source link

Restore failed with CFError: 0: AMRestoreErrorDomain/4e: Storage with invalid GPT header 0000000000000000 0000000000000000 #60

Closed reknohT closed 2 years ago

reknohT commented 2 years ago

I am attempting to install iOS 15.5 on the QEMU machine with an iOS 15.5 kernelcache. Every time when I go through the restore procedure, it fails at checkpoint 1662 with an invalid GPT header error.

iOS log excerpt (Full iOS log)

[23:53:00.0051-GMT]{3>6} CHECKPOINT BEGIN: RESTORED:[0x067E] verify_storage_for_update

restore-step-ids = {0x1103067E:26}

restore-step-names = {0x1103067E:verify_storage_for_update}

restore-step-uptime = 103

restore-step-user-progress = 0

[23:53:00.0106-GMT]{3>6} CHECKPOINT FAILURE:(FAILURE:78) RESTORED:[0x067E] verify_storage_for_update [0]D(Storage with invalid GPT header 0000000000000000 0000000000000000)

restore-step-results = {0x1107067E:{0:78}}

restore-step-codes = {0x1107067E:{0:78}}

restore-step-domains = {0x1107067E:{0:"AMRestoreErrorDomain"}}

restore-step-error = {0x1107067E:"[0]D(Storage with invalid GPT header 0000000000000000 0000000000000000)"}

restore-step-uptime = 103

restore-step-user-progress = 0

[23:53:00.0135-GMT]{3>6} CHECKPOINT NOTICE: (NVRAM set) restore-step-user-progress=0 [sync=true] (first failure)

[23:53:00.0141-GMT]{3>6} CHECKPOINT BEGIN: RESTORED:[0x067C] cleanup_boot_command

QEMU boot args

#!/bin/sh

~/ios_test/qemu-t8030/build/qemu-system-aarch64 -s -M t8030,trustcache-filename=Firmware/078-12427-117.dmg.trustcache,ticket-filename=root_ticket.der \
-kernel kernelcache.research.iphone12b \
-dtb Firmware/all_flash/DeviceTree.n104ap.im4p \
-append "debug=0x14e kextlog=0xffff serial=3 -v" \
-initrd 078-12427-117.dmg \
-cpu max -smp 4 \
-m 4G -serial mon:stdio \
-drive file=nvme.1,format=raw,if=none,id=drive.1 \
-device nvme-ns,drive=drive.1,bus=nvme-bus.0,nsid=1,nstype=1,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvme.2,format=raw,if=none,id=drive.2 \
-device nvme-ns,drive=drive.2,bus=nvme-bus.0,nsid=2,nstype=2,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvme.3,format=raw,if=none,id=drive.3 \
-device nvme-ns,drive=drive.3,bus=nvme-bus.0,nsid=3,nstype=3,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvme.4,format=raw,if=none,id=drive.4 \
-device nvme-ns,drive=drive.4,bus=nvme-bus.0,nsid=4,nstype=4,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvram,if=none,format=raw,id=nvram \
-device apple-nvram,drive=nvram,bus=nvme-bus.0,nsid=5,nstype=5,id=nvram,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvme.6,format=raw,if=none,id=drive.6 \
-device nvme-ns,drive=drive.6,bus=nvme-bus.0,nsid=6,nstype=6,logical_block_size=4096,physical_block_size=4096 \
-drive file=nvme.7,format=raw,if=none,id=drive.7 \
-device nvme-ns,drive=drive.7,bus=nvme-bus.0,nsid=7,nstype=8,logical_block_size=4096,physical_block_size=4096 \
-monitor telnet:127.0.0.1:1235,server,nowait -vnc 127.0.0.2:1
TrungNguyen1909 commented 2 years ago

You are using the update ramdisk. You need the CustomerRamdisk, which is generally the smaller one in the ipsw.

On another note, iOS 15 restore is known to be failing in the later stages as sealing is required while not yet supported.

reknohT commented 2 years ago

Thank you for responding. The iOS VM is now restoring without any problems whatsoever.