From da22dd466548a776a62208e060017aa6cdc2df52 Mon Sep 17 00:00:00 2001 From: Clément Decoodt Date: Tue, 25 Jul 2023 15:17:49 +0200 Subject: Display iBoot boot stage This helps debugging cases where the iDevice does not go into stage 2 because of a missing firmware --- src/dfu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/dfu.c') diff --git a/src/dfu.c b/src/dfu.c index 0c3c480..4487ade 100644 --- a/src/dfu.c +++ b/src/dfu.c @@ -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"); -- cgit v1.1-32-gdbae