install_zip command
This commit is contained in:
parent
19459f31fa
commit
ea46fe29d9
18
commands.c
18
commands.c
@ -836,6 +836,21 @@ cmd_print(const char *name, void *cookie, int argc, const char *argv[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cmd_install_zip(const char *name, void *cookie, int argc, const char *argv[],
|
||||
PermissionRequestList *permissions)
|
||||
{
|
||||
UNUSED(cookie);
|
||||
CHECK_WORDS();
|
||||
|
||||
if (argc != 1) {
|
||||
LOGE("Command %s requires exactly one argument\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return install_zip(argv[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function definitions
|
||||
*/
|
||||
@ -1211,6 +1226,9 @@ register_update_commands(RecoveryCommandContext *ctx)
|
||||
ret = registerCommand("print", CMD_ARGS_WORDS, cmd_print, (void *)ctx);
|
||||
if (ret < 0) return ret;
|
||||
|
||||
ret = registerCommand("install_zip", CMD_ARGS_WORDS, cmd_install_zip, (void *)ctx);
|
||||
if (ret < 0) return ret;
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ void toggle_script_asserts()
|
||||
ui_print("Script Asserts: %s\n", script_assert_enabled ? "Enabled" : "Disabled");
|
||||
}
|
||||
|
||||
void install_zip(const char* packagefilepath)
|
||||
int install_zip(const char* packagefilepath)
|
||||
{
|
||||
ui_print("\n-- Installing: %s\n", packagefilepath);
|
||||
set_sdcard_update_bootloader_message();
|
||||
@ -59,13 +59,14 @@ void install_zip(const char* packagefilepath)
|
||||
if (status != INSTALL_SUCCESS) {
|
||||
ui_set_background(BACKGROUND_ICON_ERROR);
|
||||
ui_print("Installation aborted.\n");
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
if (firmware_update_pending()) {
|
||||
ui_print("\nReboot via menu to complete\ninstallation.\n");
|
||||
}
|
||||
ui_set_background(BACKGROUND_ICON_NONE);
|
||||
ui_print("\nInstall from sdcard complete.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* INSTALL_MENU_ITEMS[] = { "apply sdcard:update.zip",
|
||||
|
@ -30,3 +30,7 @@ do_mount_usb_storage();
|
||||
|
||||
void
|
||||
show_choose_zip_menu();
|
||||
|
||||
int
|
||||
install_zip(const char* packagefilepath);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user