Merge branch 'gingerbread' of git://github.com/CyanogenMod/android_bootable_recovery into gingerbread

This commit is contained in:
Koushik Dutta 2011-05-15 18:49:22 -07:00
commit 63605f1d45
2 changed files with 16 additions and 5 deletions

View File

@ -490,8 +490,19 @@ typedef struct {
int is_safe_to_format(char* name)
{
return !(strcmp(name, "/misc") == 0 || strcmp(name, "/radio") == 0
|| strcmp(name, "/bootloader") == 0 || strcmp(name, "/recovery") == 0);
char str[255];
char* partition;
property_get("ro.recovery.format_ignore_partitions", str, "/misc,/radio,/bootloader,/recovery");
partition = strtok(str, ", ");
while (partition != NULL) {
if (strcmp(name, partition) == 0) {
return 0;
}
partition = strtok(NULL, ", ");
}
return 1;
}
void show_partition_menu()

View File

@ -127,10 +127,10 @@ try_update_binary(const char *path, ZipArchive *zip) {
}
bool ok = mzExtractZipEntryToFile(zip, binary_entry, fd);
close(fd);
mzCloseZipArchive(zip);
if (!ok) {
LOGE("Can't copy %s\n", ASSUMED_UPDATE_BINARY_NAME);
mzCloseZipArchive(zip);
return 1;
}
@ -240,13 +240,13 @@ try_update_binary(const char *path, ZipArchive *zip) {
waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
LOGE("Error in %s\n(Status %d)\n", path, WEXITSTATUS(status));
mzCloseZipArchive(zip);
return INSTALL_ERROR;
}
if (firmware_type != NULL) {
mzCloseZipArchive(zip);
return handle_firmware_update(firmware_type, firmware_filename, zip);
} else {
return INSTALL_SUCCESS;
}
return INSTALL_SUCCESS;
}