Installing MIUI with a stock recovery partition


anti-pop

Members
Jul 17, 2011
4
11
I'm the unlucky owner of a Nexus One. Why unlucky? Because my recovery partition has a bad block preventing me from flashing anything on it.

I've tried flashing a lot of custom recovery (clockwork, amon_ra etc.), but not matter how tiny a recovery I try to flash the bad block always makes the process fail at some point. Basically I'm stuck with a stock recovery.

Hence my question: Is it possible to install MIUI with a stock recovery partition? (meaning using only fastboot and the stock recovery during the whole process)

I've read the official flashing guide and a few others, but they all seem to recommend using clockwork (or another custom recovery).

My bootloader is unlocked and I've flashed stock ROMS before, so my guess is it must be possible to flash MIUI using only fastboot. The reason I'm asking is because I'm really unsure of myself. Since I wouldn't be following any guide, I don't want to blindly go ahead and flash things, I might miss a step and screw up.
 
So according to the official flashing guide at http://en.miui.com the steps are:

Using clockwork:
- wipe data and sd-ext
- wipe cache partition

I guess I can do the equivalent using fastboot:
fastboot erase userdata
fastboot erase cache


Using clockwork:
- install zip from sdcard

This is the part where I'm lost. All the MIUI roms I've downloaded (from en.miui.com, miui.us or miuiandroid.com) are zip file, meaning they have to be installed using clockwork.

So inside the rom .zip there's a boot.img so I guess I could flash that one using:
fastboot flash boot boot.img

But how about the system partition? Is there a way I can go from the downloaded .zip file to an .img file that I could flash using fastboot?
 
Is there a way I can go from the downloaded .zip file to an .img file
Search Mkyaffs and yaffs'em ;]
System folder in rom is not fully System.img, so you should dump other files that aren't included in rom and compile them with rom files.
 
Thanks for your answer.

So, to put it simply: "system folder" ≠ system.img

There's more to it than that, meaning there's no simple way to convert the folder to a image file (some files would have to be added to the folder to generate a valid img file - obviously I'm in way over my head here).

Has a MIUI rom ever been distributed using .img files? Does that even exist or should I stop looking because that's not the way it is done?
 
OK, tried it, it doesn't work.

First I have to confirm that my bootloader is unlocked, I've got the pink UNLOCKED at the top of the screen - and I was indeed in fastboot mode.

I was able to clear cache and userdata:

fastboot erase userdata
fastboot erase cache

It all went dandy. But when trying:
fastboot erase system

I got the following message:
Code:
C:\android-sdk-windows\tools>fastboot erase system
erasing 'system'...
FAILED (remote: not allowed)
finished. total time: 0.065s

I gave up on wiping the system, but went ahead and tried to flash the rom anyway:

fastboot update miuiandroid_N1-1.7.15.zip

And I got:
Code:
C:\android-sdk-windows\tools>fastboot update miuiandroid_N1-1.7.15.zip
archive does not contain 'android-info.txt'
archive does not contain 'android-product.txt'
error: update package has no android-info.txt or android-product.txt

I went ahead and added an android-info.txt to the zip file.

And then got:
Code:
C:\android-sdk-windows\tools>fastboot update miuiandroid_N1-1.7.15.zip
archive does not contain 'boot.sig'
archive does not contain 'recovery.img'
archive does not contain 'system.img'
error: update package missing system.img

So my advice for people trying to flash custom roms using "fastboot update": don't, it won't work. The roms provided by the community are only meant to be flashed using a custom recovery. The roms provided by the community are only meant to be flashed using a custom recovery. If a rom doesn't come as an .img file, it can't be flashed using fastboot.
 
Official Update packages have a Customer Signature, that's why you can't flash custom roms by this method..
It's really strange that system can't be erased.. ah, it should be unmounted first, then you should be able to erase this.. then, as I said before, you should assemble .img from ur rom and system files.