From 45df699a5e03676a33afdd84c47a2bcaa6072b82 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Thu, 21 Jul 2011 16:31:57 +0100 Subject: [PATCH 1/2] cwm: Clarify on-screen labeling of recoveries Koush is the only authoritative source for clockworkmod recoveries, so lets try to reduce confusion as to what is "officially supported" and what isn't... Change-Id: Icb0f93530e69829ce69f2500b6f29df350099273 --- Android.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 1db7fda..336f75f 100644 --- a/Android.mk +++ b/Android.mk @@ -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) From 7e70b6be7fdb94d91bfb9d3555add1f852ae8d7b Mon Sep 17 00:00:00 2001 From: atinm Date: Thu, 21 Jul 2011 18:41:49 -0400 Subject: [PATCH 2/2] Deleted check for equality in flash image header and partition header. Skipping flash after just checking a 1K header is incorrect in the case where something scribbles over the partition after the header because flash_image would not be able to rewrite the whole partition due to this check. Also, Samsung devices use a combined boot and recovery image where the header is the same even if the initramfs changes and these do not get flashed even if the boot.img is actually different due to different appended initramfs. Change-Id: I53ab0a23347cdf1fa7ff58dff37e812fd84645be --- mtdutils/mtdutils.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c index c8dbba4..4e259cd 100644 --- a/mtdutils/mtdutils.c +++ b/mtdutils/mtdutils.c @@ -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);