From ac78b820e4144617f80c27f866f153f49ffdd92e Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Tue, 5 May 2015 01:02:14 +0200 Subject: Improved command sequence and use SystemPartitionPadding from build identity to make sure we use correct values. --- src/recovery.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/recovery.c') diff --git a/src/recovery.c b/src/recovery.c index 5930db6..c21af19 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -164,10 +164,6 @@ int recovery_enter_restore(struct idevicerestore_client_t* client, plist_t build } } - if (recovery_set_autoboot(client, 0) < 0) { - return -1; - } - info("Recovery Mode Environment:\n"); char* value = NULL; irecv_getenv(client->recovery->client, "build-version", &value); @@ -197,6 +193,10 @@ int recovery_enter_restore(struct idevicerestore_client_t* client, plist_t build } } + if (recovery_set_autoboot(client, 0) < 0) { + return -1; + } + /* send logo and show it */ if (recovery_send_applelogo(client, build_identity) < 0) { error("ERROR: Unable to send AppleLogo\n"); @@ -393,8 +393,11 @@ int recovery_send_ramdisk(struct idevicerestore_client_t* client, plist_t build_ } } - irecv_send_command(client->recovery->client, "getenv ramdisk-size"); - irecv_receive(client->recovery->client); + char* value = NULL; + irecv_getenv(client->recovery->client, "ramdisk-size", &value); + info("ramdisk-size=%s\n", (value ? value : "(unknown)")); + free(value); + value = NULL; if (recovery_send_component(client, build_identity, component) < 0) { error("ERROR: Unable to send %s to device.\n", component); -- cgit v1.1-32-gdbae