summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 20:14:31 +0100
committerGravatar Nikias Bassen2012-02-02 20:14:31 +0100
commit5421b825d98a0e84f7336e24083bbc4f123d00f6 (patch)
tree9c26ab62d5672259c758d96c11152fdb62f13b21 /src/recovery.c
parent93cc13ff963fbc97d96b466db745f213a727003d (diff)
downloadidevicerestore-5421b825d98a0e84f7336e24083bbc4f123d00f6.tar.gz
idevicerestore-5421b825d98a0e84f7336e24083bbc4f123d00f6.tar.bz2
recovery: improve recovery_send_kernelcache
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/recovery.c b/src/recovery.c
index 3833b2a..54ea14f 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -338,8 +338,10 @@ int recovery_send_kernelcache(struct idevicerestore_client_t* client, plist_t bu
const char* component = "RestoreKernelCache";
irecv_error_t recovery_error = IRECV_E_SUCCESS;
- if (recovery_client_new(client) < 0) {
- return -1;
+ if (client->recovery == NULL) {
+ if (recovery_client_new(client) < 0) {
+ return -1;
+ }
}
if (recovery_send_component(client, build_identity, component) < 0) {
@@ -347,6 +349,13 @@ int recovery_send_kernelcache(struct idevicerestore_client_t* client, plist_t bu
return -1;
}
+ if (client->restore_boot_args) {
+ char setba[256];
+ strcpy(setba, "setenv boot-args ");
+ strcat(setba, client->restore_boot_args);
+ recovery_error = irecv_send_command(client->recovery->client, setba);
+ }
+
recovery_error = irecv_send_command(client->recovery->client, "bootx");
if (recovery_error != IRECV_E_SUCCESS) {
error("ERROR: Unable to execute %s\n", component);