diff options
author | Clément Decoodt | 2023-07-25 15:17:49 +0200 |
---|---|---|
committer | Clément Decoodt | 2023-07-25 15:17:49 +0200 |
commit | da22dd466548a776a62208e060017aa6cdc2df52 (patch) | |
tree | 941959bcb1653ae8a004f1c0e37f9d4c8ace3207 | |
parent | 73438a6ff3fe5758e927c05d389d0e9587dcbb50 (diff) | |
download | idevicerestore-da22dd466548a776a62208e060017aa6cdc2df52.tar.gz idevicerestore-da22dd466548a776a62208e060017aa6cdc2df52.tar.bz2 |
Display iBoot boot stage
This helps debugging cases where the iDevice does not go into stage 2
because of a missing firmware
-rw-r--r-- | src/dfu.c | 15 | ||||
-rw-r--r-- | src/recovery.c | 14 |
2 files changed, 29 insertions, 0 deletions
@@ -473,6 +473,21 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide return -1; } + char *value = NULL; + unsigned long boot_stage = 0; + irecv_getenv(client->dfu->client, "boot-stage", &value); + if (value) { + boot_stage = strtoul(value, NULL, 0); + } + if (boot_stage > 0) { + info("iBoot boot-stage=%s\n", value); + free(value); + value = NULL; + if (boot_stage != 1) { + error("ERROR: iBoot should be at boot stage 1, continuing anyway...\n"); + } + } + if (dfu_send_iboot_stage1_components(client, build_identity) < 0) { mutex_unlock(&client->device_event_mutex); error("ERROR: Unable to send iBoot stage 1 components to device\n"); diff --git a/src/recovery.c b/src/recovery.c index a9d6b61..02f5689 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -158,6 +158,20 @@ int recovery_enter_restore(struct idevicerestore_client_t* client, plist_t build free(value); value = NULL; + unsigned long boot_stage = 0; + irecv_getenv(client->recovery->client, "boot-stage", &value); + if (value) { + boot_stage = strtoul(value, NULL, 0); + } + if (boot_stage > 0) { + info("iBoot boot-stage=%s\n", value); + free(value); + value = NULL; + if (boot_stage != 2) { + error("ERROR: iBoot should be at boot stage 2, continuing anyway...\n"); + } + } + unsigned long radio_error = 0; irecv_getenv(client->recovery->client, "radio-error", &value); if (value) { |