diff options
author | Koushik Dutta <koushd@gmail.com> | 2010-11-10 10:40:44 -0800 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2010-11-10 23:31:34 -0800 |
commit | 19447c05506e4dfd19f621081770fe03e29d0457 (patch) | |
tree | 301e637311e817165d030878adb102f32b28ab14 /install.c | |
parent | fef77c02533ee2e62c6827af5ba3cfcc2bd0e749 (diff) | |
download | bootable_recovery-19447c05506e4dfd19f621081770fe03e29d0457.zip bootable_recovery-19447c05506e4dfd19f621081770fe03e29d0457.tar.gz bootable_recovery-19447c05506e4dfd19f621081770fe03e29d0457.tar.bz2 |
Refactor recovery's block device handling to work across variant hardware in a cleaner fashion.
Re add firmware update
Change-Id: I699ad22390ed14e597d17a7bcb32ad1b1af00b4b
support mmc misc
Change-Id: Iff02f8d03db6835f501d052140cebeefee521305
fix compile errors
Change-Id: I032edbd157a8a15f561bb83330c715ebaa008d18
fix compile errors
Change-Id: Idff3449be3376f22fceefc2c35637527f8df8f3f
Initial work to clean up the block devices.
Change-Id: I4be20ac124864a281be9cd116e211a2618404a27
all done
Change-Id: I0338f62f6a045556ebe90b0200685be113178319
fix up nandroid
Change-Id: I886f00271183e6d2921c080b0939341f2cf12a4d
Diffstat (limited to 'install.c')
-rw-r--r-- | install.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -28,7 +28,7 @@ #include "minui/minui.h" #include "minzip/SysUtil.h" #include "minzip/Zip.h" -#include "mtdutils/mounts.h" +#include "mounts.h" #include "mtdutils/mtdutils.h" #include "roots.h" #include "verifier.h" @@ -182,6 +182,9 @@ try_update_binary(const char *path, ZipArchive *zip) { } close(pipefd[1]); + char* firmware_type = NULL; + char* firmware_filename = NULL; + char buffer[1024]; FILE* from_child = fdopen(pipefd[0], "r"); while (fgets(buffer, sizeof(buffer), from_child) != NULL) { @@ -201,6 +204,18 @@ try_update_binary(const char *path, ZipArchive *zip) { char* fraction_s = strtok(NULL, " \n"); float fraction = strtof(fraction_s, NULL); ui_set_progress(fraction); + } else if (strcmp(command, "firmware") == 0) { + char* type = strtok(NULL, " \n"); + char* filename = strtok(NULL, " \n"); + + if (type != NULL && filename != NULL) { + if (firmware_type != NULL) { + LOGE("ignoring attempt to do multiple firmware updates"); + } else { + firmware_type = strdup(type); + firmware_filename = strdup(filename); + } + } } else if (strcmp(command, "ui_print") == 0) { char* str = strtok(NULL, "\n"); if (str) { @@ -221,6 +236,11 @@ try_update_binary(const char *path, ZipArchive *zip) { return INSTALL_ERROR; } + if (firmware_type != NULL) { + return handle_firmware_update(firmware_type, firmware_filename, zip); + } else { + return INSTALL_SUCCESS; + } return INSTALL_SUCCESS; } |