From 044a0b4d49a11edfa13471ce20914b0514eb7e0e Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 8 Jul 2013 09:42:54 -0700 Subject: recovery: try to write EMMC partitions more reliably Nexus 4 has flash errors that manifest during large writes (eg, of the radio partition). Writes of some blocks seem to be dropped silently, without any errors being returned to the user level. Make two changes to the partition-writing code: - break it up into 1MB writes instead of writing partitions with a single fwrite() call. Pause for 50ms in between every chunk. - read the partition back after writing and verify that we read what we wrote. Drop caches before reading so we (hopefully) are reading off the actual flash and not some cache. Neither of these should be necessary. Bug: 9602014 Change-Id: Ice2e24dd4c11f1a57968277b5eb1468c772f6f63 --- applypatch/applypatch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'applypatch/applypatch.h') diff --git a/applypatch/applypatch.h b/applypatch/applypatch.h index d1a023293..f1f13a100 100644 --- a/applypatch/applypatch.h +++ b/applypatch/applypatch.h @@ -65,7 +65,7 @@ int LoadFileContents(const char* filename, FileContents* file, int retouch_flag); int SaveFileContents(const char* filename, const FileContents* file); void FreeFileContents(FileContents* file); -int FindMatchingPatch(uint8_t* sha1, const char** patch_sha1_str, +int FindMatchingPatch(uint8_t* sha1, char* const * const patch_sha1_str, int num_patches); // bsdiff.c -- cgit v1.2.3