[HOWTO] Update HBOOT to 1.00 keeping your Legend rooted

Search This thread

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
Medvode
CAUTION!! By upgrading HBOOT to 1.00+ you loose the ability to S-OFF your Legend!!!

Preface
Because there are too many ppl without any knowledge spreading false findings and statements I decided to write this HOWTO.

Audience
This HOWTO is primarily ment for those who already have rooted Legends but they recently experienced problems flashing CM's or new Vodafone FroYo boot.img.

Background
HBOOT is like a BIOS in our PCs and to cut a long story short it also contains partition table for phone's internal storage. That means it has info on where exactly certain partition starts and how big it is.

At HTC they decided to partition Legend's internal storage this way:
  1. misc 640 kB
  2. recovery 4,375 MB
  3. boot 2,5 MB
  4. system 240 MB
  5. cache 40 MB
  6. data 185 MB
...but as we found out (first with CM nightly) boot partition was a little short for the boot.img to fit in if we had one or more bad cells (sectors) on it. Eventually we found out that quite some Legend's had bad cell on boot partition and those unfortunate souls that owned such phone were unable to upgrade to Vodafone FroYo rooted ROM too.

I think that HTC also recognized that Legend's boot partition was kinda small so they rearanged partition table in HBOOT 1.00 a bit making boot partition bigger (now it is 3 MB) by shrinking recovery partition a little.

So now we know that some of us actually need HBOOT 1.00 in order to flash FroYo's boot.img without a problem. But how do we keep root then?


Prerequirements
  • Android SDK (primarily adb)
  • working USB drivers (for adb to work)
  • goldcard (in case you are trying to flash ROMs with different CID than your phone has)
  • ClockWorkMod recovery (if your Legend is already rooted)


Rerequirements


Instructions
I will split instructions into two parts... for already rooted phones and phones that were already updated with Vodafone OTA thus they lost root.

Already OTA updated with HBOOT 1.00
That one is relatively easy. You could also follow Paul's guide but I like my approach better ;)
Connect your phone to your PC. Second you have to install VISIONary r13 into your phone and do the "temproot" procedure. After a successful "temproot" you should be able to adb shell and then su. Fire up command prompt and issue:
Code:
adb shell
su
...you should have root privileges now (showing #). Next thing is backing up misc partition and replacing it with one from hack4legend-v5.zip. Extract this zip somewhere and fire another command promt there. Now you should upload flash_image binary and misc1-2.img:
Code:
adb push flash_image /data/local/
adb push misc1-2.img /data/local/
...switch back to 1st command prompt and change permission of flash_image_binary:
Code:
chmod 755 /data/local/flash_image
...and backup your current misc partition:
Code:
cat /dev/mtd/mtd0 > /sdcard/misc_backup.img
Now flash misc1-2.img:
Code:
/data/local/flash_image misc /data/local/misc1-2.img
exit
...and you are set to downgrade retaining HBOOT 1.00.
Unzip r4-legend-root.zip and find testimage.zip in it. Put it on your phone's sdcard renaming it to LEGEIMG.zip. You can then reboot into bootloader issuing:
Code:
adb reboot bootloader
...from command prompt. Phone will reboot and find LEGEIMG.zip on your sdcard, copy it into RAM and check it. If you get CID error at this point, then you don't have goldcard. Make your sdcard gold and try again. After successful flash and reboot you may remove LEGEIMG.zip from sdcard. Next step is upgrading of rooted FroYo ROM. Put FroYo update ROM zip to your sdcard and install it via ClockworkMod recovery. You may also flash backed up misc partition after that. Still in recovery mode and hooked with your PC switch to command prompt and restore it back:
Code:
adb shell
flash_image misc /sdcard/misc_backup.img
exit
...and reboot.

Rooted Eclair Voda FroYo or CM with HBOOT 0.43
Since you have already rooted phone we can prepare everything before we start. Hook your phone to your PC. Put FroYo ROM update zip to phone's sdcard. Put also misc1-2.img and flash_image from hack4legend-v5.zip and testimage.zip from r4-legend-root there. Extract Vodafone FroYo OTA and put firmware.zip to your phone's sdcard renaming it to LEGEIMG.zip. Reboot into bootloader from command prompt:
Code:
adb reboot bootloader
...bootloader will find LEGEIMG.zip extract it into RAM and check its integrity. If you get CID error at this point you don't have gold card. Make your sdcard gold and retry the procedure.
After successfull flashing of LEGEIMG.zip (firmware.zip from FroYo OTA) you have HBOOT 1.00, new (unrooted) recovery, new (unrooted) boot but old and intact system with superuser.apk and su. Reboot. When system is available, tick "USB debugging" in Settings->Applications->Development. After that you will be able to adb shell into your phone. Fire up some command prompt and issue:
Code:
adb shell
su
...while phone screen is still on. Superuser will pop-up. Grant it. Now make a backup of misc partition:
Code:
cat /dev/mtd/mtd0 > /sdcard/misc_backup.img
...now copy flash_image from sdcard to internal storage, change its permissions, and flash misc1-2.img:
Code:
cp /sdcard/flash_image /data/local/
chmod 755 /data/local/flash_image
/data/local/flash_image misc /sdcard/misc1-2.img
...rename LEGEIMG.zip to firmware.zip and testimage.zip to LEGEIMG.zip:
Code:
mv /sdcard/LEGEIMG.zip /sdcard/firmware.zip
mv /sdcard/testimage.zip /sdcard/LEGEIMG.zip
...exit from adb shell and reboot into bootloader:
Code:
exit
adb reboot bootloader
Phone will reboot, find LEGEIMG.zip and flash it over. You will end up with HBOOT 1.00 and downgraded and rooted recovery. Boot into ClockworkMod recovery and flash Voda FroYo custom update of your choice from your sdcard. You may also want to restore backed up misc partition after updating is done:
Code:
adb shell
flash_image misc /sdcard/misc_backup.img
exit
...and reboot.
 
Last edited:
  • Like
Reactions: mbrio and Kot_Ik

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
Medvode
Goldcard (no remove, no format, no data loss)

Here are few easy steps on how to make Goldcard without taking it out of your phone but you have to be root (VISIONary temproot is fine).

You will be doing this from command prompt:
Code:
adb shell
su
First you need to find out sdcard's CID:
Code:
cat /sys/class/mmc_host/mmc0/mmc0:*/cid
...copy it into text box on http://hexrev.soaa.me/. Now go to http://psas.revskills.de/?q=goldcard and put in the reversed CID you have got on previous web page. Push goldcard.img to your phone via 2nd command prompt:
Code:
adb push goldcard.img /data/local/
...unmount sdcard via Settings, go back to 1st command prompt and make a backup then make goldcard:
Code:
dd if=/dev/block/mmcblk0 count=1 of=/data/local/sdcard_backup.img
cat /data/local/goldcard.img > /dev/block/mmcblk0
sync
exit
You may also pull that backup to your PC:
Code:
adb pull /data/local/sdcard_backup.img .
 
Last edited:

BesFen

Senior Member
Mar 11, 2008
1,039
10
Surabaya
Hi blay0,

I follow your link to vodafone ota update and appoint me to the website, where is the the link to download it?
Thanks.

Sent from my HTC Legend using Tapatalk
 

gyroing

Senior Member
Sep 9, 2010
226
8
THX

@blay0:
thanks you are great developer.
so if you could temproot automated so you could build pc software to root legend with one click automatically like as wildfire desire ......
thx again
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
Medvode
Hmm, I don't understand what are you trying to say???

Sent from my HTC Legend
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
Medvode
VISIONary has an option to "temproot" on every boot.

But I don't see why you would do that if you can root the way I described.

Sent from my HTC Legend
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
Medvode
The primary use of OTA here is just to extract firmware.zip flashing it to upgrade HBOOT. This is not HOWTO for updating the whole system via OTAs.

Sent from my HTC Legend
 

g0dshead

Senior Member
May 8, 2010
59
0
46
Spijkenisse
Hey guys , im really troubled gettin permission denied on push.
any suggjestions? googled loads of it but nothing related to my issue
Edit: i got root tru visionary yes , it aply's well and su promts for permission so i guess i got root
so was wondering why i keep gettin permission denied on any command in adb

Second EDIT : Nevermind total noobness , forgot i cant push within adb shell.
 
Last edited:

nemphis

Senior Member
Nov 9, 2006
107
17
Amazing, thanx a million!!
Keeps the Legend running smoothly with custom Froyo Modaco rom.................
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    CAUTION!! By upgrading HBOOT to 1.00+ you loose the ability to S-OFF your Legend!!!

    Preface
    Because there are too many ppl without any knowledge spreading false findings and statements I decided to write this HOWTO.

    Audience
    This HOWTO is primarily ment for those who already have rooted Legends but they recently experienced problems flashing CM's or new Vodafone FroYo boot.img.

    Background
    HBOOT is like a BIOS in our PCs and to cut a long story short it also contains partition table for phone's internal storage. That means it has info on where exactly certain partition starts and how big it is.

    At HTC they decided to partition Legend's internal storage this way:
    1. misc 640 kB
    2. recovery 4,375 MB
    3. boot 2,5 MB
    4. system 240 MB
    5. cache 40 MB
    6. data 185 MB
    ...but as we found out (first with CM nightly) boot partition was a little short for the boot.img to fit in if we had one or more bad cells (sectors) on it. Eventually we found out that quite some Legend's had bad cell on boot partition and those unfortunate souls that owned such phone were unable to upgrade to Vodafone FroYo rooted ROM too.

    I think that HTC also recognized that Legend's boot partition was kinda small so they rearanged partition table in HBOOT 1.00 a bit making boot partition bigger (now it is 3 MB) by shrinking recovery partition a little.

    So now we know that some of us actually need HBOOT 1.00 in order to flash FroYo's boot.img without a problem. But how do we keep root then?


    Prerequirements
    • Android SDK (primarily adb)
    • working USB drivers (for adb to work)
    • goldcard (in case you are trying to flash ROMs with different CID than your phone has)
    • ClockWorkMod recovery (if your Legend is already rooted)


    Rerequirements


    Instructions
    I will split instructions into two parts... for already rooted phones and phones that were already updated with Vodafone OTA thus they lost root.

    Already OTA updated with HBOOT 1.00
    That one is relatively easy. You could also follow Paul's guide but I like my approach better ;)
    Connect your phone to your PC. Second you have to install VISIONary r13 into your phone and do the "temproot" procedure. After a successful "temproot" you should be able to adb shell and then su. Fire up command prompt and issue:
    Code:
    adb shell
    su
    ...you should have root privileges now (showing #). Next thing is backing up misc partition and replacing it with one from hack4legend-v5.zip. Extract this zip somewhere and fire another command promt there. Now you should upload flash_image binary and misc1-2.img:
    Code:
    adb push flash_image /data/local/
    adb push misc1-2.img /data/local/
    ...switch back to 1st command prompt and change permission of flash_image_binary:
    Code:
    chmod 755 /data/local/flash_image
    ...and backup your current misc partition:
    Code:
    cat /dev/mtd/mtd0 > /sdcard/misc_backup.img
    Now flash misc1-2.img:
    Code:
    /data/local/flash_image misc /data/local/misc1-2.img
    exit
    ...and you are set to downgrade retaining HBOOT 1.00.
    Unzip r4-legend-root.zip and find testimage.zip in it. Put it on your phone's sdcard renaming it to LEGEIMG.zip. You can then reboot into bootloader issuing:
    Code:
    adb reboot bootloader
    ...from command prompt. Phone will reboot and find LEGEIMG.zip on your sdcard, copy it into RAM and check it. If you get CID error at this point, then you don't have goldcard. Make your sdcard gold and try again. After successful flash and reboot you may remove LEGEIMG.zip from sdcard. Next step is upgrading of rooted FroYo ROM. Put FroYo update ROM zip to your sdcard and install it via ClockworkMod recovery. You may also flash backed up misc partition after that. Still in recovery mode and hooked with your PC switch to command prompt and restore it back:
    Code:
    adb shell
    flash_image misc /sdcard/misc_backup.img
    exit
    ...and reboot.

    Rooted Eclair Voda FroYo or CM with HBOOT 0.43
    Since you have already rooted phone we can prepare everything before we start. Hook your phone to your PC. Put FroYo ROM update zip to phone's sdcard. Put also misc1-2.img and flash_image from hack4legend-v5.zip and testimage.zip from r4-legend-root there. Extract Vodafone FroYo OTA and put firmware.zip to your phone's sdcard renaming it to LEGEIMG.zip. Reboot into bootloader from command prompt:
    Code:
    adb reboot bootloader
    ...bootloader will find LEGEIMG.zip extract it into RAM and check its integrity. If you get CID error at this point you don't have gold card. Make your sdcard gold and retry the procedure.
    After successfull flashing of LEGEIMG.zip (firmware.zip from FroYo OTA) you have HBOOT 1.00, new (unrooted) recovery, new (unrooted) boot but old and intact system with superuser.apk and su. Reboot. When system is available, tick "USB debugging" in Settings->Applications->Development. After that you will be able to adb shell into your phone. Fire up some command prompt and issue:
    Code:
    adb shell
    su
    ...while phone screen is still on. Superuser will pop-up. Grant it. Now make a backup of misc partition:
    Code:
    cat /dev/mtd/mtd0 > /sdcard/misc_backup.img
    ...now copy flash_image from sdcard to internal storage, change its permissions, and flash misc1-2.img:
    Code:
    cp /sdcard/flash_image /data/local/
    chmod 755 /data/local/flash_image
    /data/local/flash_image misc /sdcard/misc1-2.img
    ...rename LEGEIMG.zip to firmware.zip and testimage.zip to LEGEIMG.zip:
    Code:
    mv /sdcard/LEGEIMG.zip /sdcard/firmware.zip
    mv /sdcard/testimage.zip /sdcard/LEGEIMG.zip
    ...exit from adb shell and reboot into bootloader:
    Code:
    exit
    adb reboot bootloader
    Phone will reboot, find LEGEIMG.zip and flash it over. You will end up with HBOOT 1.00 and downgraded and rooted recovery. Boot into ClockworkMod recovery and flash Voda FroYo custom update of your choice from your sdcard. You may also want to restore backed up misc partition after updating is done:
    Code:
    adb shell
    flash_image misc /sdcard/misc_backup.img
    exit
    ...and reboot.
    1
    There's no firmware.zip in RUU.exe. But is rom.zip. Run RUU.exe and after you get a ROM Update Utility dialogue, find rom.zip somewhere in your Windoze Documents and Setting or equivalent directory and copy it to some place else. You can then close that dialogue.
    1
    any solution?im trying everything without success
    1
    Hi I am rooted on HBOOT 1.01 just decided to go a resotre my misc partition. so i boot up in to clockwork recovery
    adb shell
    flash_image misc /sdcard/misc_backup.img

    but get this error message

    error opening /sdcard/misc_backup.img: no such file or directory
    so then I tried to pull the img and get a does not exist message but once I reboot the phone and do the pull command I can pull the file no problem.

    Any ideas?

    Mount the sdcard? Or is it not possible to have it unmounted in recovery?
    1
    Make new backup and compare both or make a md5 checksum of both.

    Sent from my HTC Legend