Commit Graph

49 Commits

Author SHA1 Message Date
Koushik Dutta
d280f6e0d8 rewrite mtd_restore_raw_partition to use the new aosp code 2011-11-21 11:22:04 -08:00
Koushik Dutta
0df56f4db4 wip 2011-11-16 16:00:35 -08:00
atinm
7e70b6be7f 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
2011-07-21 18:41:49 -04:00
Jeff Brown
b0462e6ae2 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: Ib465fdb42c8621899bea15c04a427d7ab1641a8c
2011-07-11 22:11:45 -07:00
codeworkx
9c4c8e2c66 bml_over_mtd: Take care of bad blocks on "boot" partition for Samsung Galaxy S Phones.
The Samsung Galaxy S bootloader apparently expects the kernel to be flashed to BML-managed flash - bad erase blocks will be mapped from a reservoir area.
CWM however just skips bad blocks, the usual procedure for mtd-accessed flash.
Consequently, the bootloader sees a corrupt zImage, and will usually crash when the kernel initializes.
This of course will only happen when the "boot" partition has bad blocks.

This patch was written by "eifert" and adds a tool called "bml_over_mtd" for flashing boot images which takes care of bad blocks and maps them to a reservoir area, like BML does.

Change-Id: If570717a19b879d47d70d937a0751cd85853eacd
2011-04-25 11:16:41 -07:00
Ying Wang
4c05d95112 Fix x86 build.
Change-Id: Iada6268b0a72ee832113ea397334cc7950a37051
2011-02-08 19:51:07 -08:00
Christian Lindeberg
862c83bb31 Free allocated struct after freeing field
Free allocated MtdReadContext after freeing buffer field in struct,
not before.

Change-Id: I237920dc36115389cd2d6948e7a962dbec22fe56
2011-01-19 12:22:41 +01:00
Koushik Dutta
df1e406782 Merge from ClockworkMod recovery
Change-Id: Id5b312147173ced559a62d97029acede6c2f8766
2010-12-18 17:42:31 -08:00
Steve Kondik
4123b58299 recovery: Autodetection of device flash type
Detect flash type at runtime rather than requiring this to be set in the
device configuration. The detection is based on the existence of /proc/mtd,
/proc/emmc, or /dev/block/bml1.

Change-Id: I464962a567022c5862c249f06d36c2d1cddeacba
2010-11-14 22:40:30 -05:00
Antonio Vazquez
158d25cae4 Supress "warning: comparison between signed and unsigned integer expressions" in minui/resources.c and mtdutils/mtdutils.c 2010-11-13 05:23:33 +08:00
Koushik Dutta
19447c0550 Refactor recovery's block device handling to work across variant hardware in a cleaner fashion.
Re add firmware update

Change-Id: I699ad22390ed14e597d17a7bcb32ad1b1af00b4b

support mmc misc

Change-Id: Iff02f8d03db6835f501d052140cebeefee521305

fix compile errors

Change-Id: I032edbd157a8a15f561bb83330c715ebaa008d18

fix compile errors

Change-Id: Idff3449be3376f22fceefc2c35637527f8df8f3f

Initial work to clean up the block devices.

Change-Id: I4be20ac124864a281be9cd116e211a2618404a27

all done

Change-Id: I0338f62f6a045556ebe90b0200685be113178319

fix up nandroid

Change-Id: I886f00271183e6d2921c080b0939341f2cf12a4d
2010-11-10 23:31:34 -08:00
Doug Zongker
5d6309e77f fix comparison of ECC stats before and after mtd reads
ECC errors are found by comparing the result of ioctl(ECCGETSTATS)
before and after the read.  But if an error was found causing us to go
to the next block, we'd compare the stats before the *first* read to
the stats after the second (third, fourth, etc.) reads, so we'd read
to the end of the partition without ever succeeding.  Fix logic so we
compare the values before and after each read independently.

Bug: 3162777
Change-Id: I5a13abd7243d2afd1d21bd98cbb233e5124b2e80
2010-11-03 14:31:01 -07:00
Doug Zongker
8e5e4dada7 close update package before installing; allow remount
Close the update package before invoking the binary, to allow the
installer to unmount /cache if it wants to.  Add a function to allow
remounting of a mount as read-only.

Change-Id: Idfcc96c3da66083295177f729263560be58034e4
2010-09-14 21:26:38 -07:00
Doug Zongker
d12560aa21 add the ability to seek to a raw location while reading MTD partition
Change-Id: Id1563ca667c50e61cf1bb15d2cf783a50937eece
2010-09-14 15:28:54 -07:00
Doug Zongker
61ba7a83ef stop treating all-zero blocks as bad
Change-Id: If49fa6485f66598d16a7e44fce3129de55fab422
2010-09-12 13:36:40 -07:00
Doug Zongker
aaf3f56c44 block is bad if ioctl() returns nonzero
Change-Id: I6fc4ce796bc663d05035927c0af0ce7ab6d07218
2010-09-09 16:54:35 -07:00
Koushik Dutta
14239d291a begin to abstract out the file system and mount information. known issue: create_fstab causes segfault on incredible. and thus subsequent crash loop of recovery. 2010-06-14 15:02:48 -07:00
Koushik Dutta
cd9e3ce55b revert change from zinx 2010-05-25 13:14:50 -07:00
Koushik Dutta
2c3cc50356 add a utility erase_image. possible fix for d/s flashing bug from zinx 2010-05-21 10:11:05 -07:00
Koushik Dutta
bca9243339 add a static flash_image to the utilities 2010-05-06 11:50:32 -07:00
Steve Kondik
8fa54d19f1 Fix the module class fail. 2010-04-06 13:23:35 -04:00
Steve Kondik
59be31ed31 Fix the build. 2010-04-06 13:12:55 -04:00
Koushik K. Dutta
5552aa38f5 Create a static arm dump_image utility. 2010-04-05 22:25:16 -07:00
Koushik K. Dutta
16f0b49bea working erase_image and options in recovery now 2010-03-19 14:37:11 -07:00
Magnus Eriksson
75b930f396 added erase_flash, utility to erase mtd partition
primarily for platforms without engineering SPL or native fastboot support
2010-03-19 13:35:20 -07:00
Koushik K. Dutta
a85d7cc65a nandroid backup is now implemented in C 2010-03-12 17:00:58 -08:00
Koushik K. Dutta
4a8e7d2a09 tabs vs spaces. 2010-03-12 14:30:56 -08:00
Koushik K. Dutta
3836f72fbf delete script before running it, otherwise you have potential recovery loops 2010-03-11 22:17:43 -08:00
Koushik K. Dutta
f68aaaf20c run amend scripts from the command line 2010-03-07 13:39:21 -08:00
Koushik K. Dutta
99fb6fef11 merge busybox and other tools into recovery. 2010-03-03 00:42:58 -08:00
Koushik K. Dutta
36d02893cd fix build 2010-02-24 22:46:28 -08:00
Koushik K. Dutta
ff32e8c7e5 clean up 2010-02-24 13:16:43 -08:00
Koushik K. Dutta
a37e9b1f19 Patch from Magnus to fix issues with bad blocks and dumping a boot image. Need to clean up the patch a bit. Also reverted mtdutils.s to korg/eclair-release 2010-02-24 13:13:34 -08:00
Koushik K. Dutta
7400dc2700 missing file 2010-02-22 08:53:47 -08:00
Koushik K. Dutta
981b0cd1e1 roll recovery tools into a single binary. fix up nandroid to work without deviceid requirement 2010-02-22 08:53:34 -08:00
Koushik K. Dutta
1a7ee5384d add mkfstab.sh script to create an fstab on any device. clean up dump_image to use libmtdutils 2010-02-21 17:52:30 -08:00
Koushik K. Dutta
f9476fbfe8 fix build break 2010-02-21 01:02:30 -08:00
Koushik K. Dutta
c788c26397 more fixes 2010-02-20 17:25:03 -08:00
Koushik K. Dutta
8ce0be4956 nearly working nandroid, built against libc 2010-02-20 15:59:06 -08:00
Koushik K. Dutta
841b2bf352 Add static flash_image for recovery 2010-02-15 01:45:38 -08:00
Doug Zongker
22d79a5c5e 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?)
2010-01-13 10:07:28 -08:00
Doug Zongker
4c5f9f3416 make offsets in firmware update header not point to bad blocks
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.

Change-Id: I45d58e32a36d0c1dbc0a7f871bd5985b6c8ff524
http://b/2358012 - passion: failure to flash hboot (bad blocks?)
2010-01-13 09:21:25 -08:00
Doug Zongker
17a47098d2 use MEMGETBADBLOCK to look for bad blocks when reading MTD partitions 2009-12-14 18:27:03 -08:00
Doug Zongker
20697b965c only build flash_image for eng
With the recovery image being installed by applypatch, the flash_image
tool isn't needed any more.  Continue to build it for eng just in case
it's handy for debugging.
2009-07-23 15:17:00 -07:00
Doug Zongker
bec02d57fb skip over all-zero blocks when reading MTD partition
We fail to detect certain bad blocks (marked in the factory as bad, I
think?) when reading mtd partitions.  These come back as a block of
all zeros.  Since it's fairly unlikely a legitimate boot or recovery
block will contain 128k of zeros, change mtdutils to skip over such
blocks.

Arve says https://review.source.android.com/10535 may be a long-term
fix for this, but he isn't yet sure.
2009-07-01 12:09:29 -07:00
The Android Open Source Project
c24a8e688a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00
The Android Open Source Project
ffb48f64fe auto import from //depot/cupcake/@135843 2009-03-03 18:28:14 -08:00
The Android Open Source Project
ff3d93821e Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:49 -08:00
The Android Open Source Project
23580ca27a Initial Contribution 2008-10-21 07:00:00 -07:00