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

This commit is contained in:
Arif Ali 2011-07-22 01:30:08 +01:00
commit 1a873797f7
2 changed files with 8 additions and 20 deletions

View File

@ -26,7 +26,14 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_VERSION := ClockworkMod Recovery v4.0.1.4
ifdef I_AM_KOUSH
RECOVERY_NAME := ClockworkMod Recovery
else
RECOVERY_NAME := CWM-based Recovery
endif
RECOVERY_VERSION := $(RECOVERY_NAME) v4.0.1.4
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

View File

@ -586,8 +586,6 @@ int cmd_mtd_restore_raw_partition(const char *partition_name, const char *filena
return -1;
}
// If the first part of the file matches the partition, skip writing
int fd = open(filename, O_RDONLY);
if (fd < 0)
{
@ -603,23 +601,6 @@ int cmd_mtd_restore_raw_partition(const char *partition_name, const char *filena
return -1;
}
MtdReadContext *in = mtd_read_partition(partition);
if (in == NULL) {
printf("error opening %s: %s\n", partition, strerror(errno));
// just assume it needs re-writing
} else {
char check[HEADER_SIZE];
int checklen = mtd_read_data(in, check, sizeof(check));
if (checklen <= 0) {
printf("error reading %s: %s\n", partition_name, strerror(errno));
// just assume it needs re-writing
} else if (checklen == headerlen && !memcmp(header, check, headerlen)) {
printf("header is the same, not flashing %s\n", partition_name);
return 0;
}
mtd_read_close(in);
}
// Skip the header (we'll come back to it), write everything else
printf("flashing %s from %s\n", partition_name, filename);