From 22d79a5c5eab9c1e86ff2af210bb072689e2d630 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 12 Jan 2010 16:18:33 -0800 Subject: make offsets in firmware update header not point to bad blocks (This is being cherry-picked from master.) hboot will apparently fail to install if the first block of the image (the one pointed to by the offset in the block 0 header) is a bad block. (Hopefully it handles subsequent bad blocks.) This change makes the MTD write code keep track of the bad blocks it has skipped over, so that the offset in the header can be adjusted to be the address of the first successfully written block. http://b/2358012 - passion: failure to flash hboot (bad blocks?) --- mtdutils/mtdutils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mtdutils/mtdutils.h') diff --git a/mtdutils/mtdutils.h b/mtdutils/mtdutils.h index 8d2cb56b1..528a5bbe8 100644 --- a/mtdutils/mtdutils.h +++ b/mtdutils/mtdutils.h @@ -49,6 +49,7 @@ void mtd_read_close(MtdReadContext *); MtdWriteContext *mtd_write_partition(const MtdPartition *); ssize_t mtd_write_data(MtdWriteContext *, const char *data, size_t data_len); off_t mtd_erase_blocks(MtdWriteContext *, int blocks); /* 0 ok, -1 for all */ +off_t mtd_find_write_start(MtdWriteContext *ctx, off_t pos); int mtd_write_close(MtdWriteContext *); #endif // MTDUTILS_H_ -- cgit v1.2.3