Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Skrilax_CZ
Old
(Last edited by Skrilax_CZ; 17th June 2012 at 05:48 PM.)
#1  
Skrilax_CZ's Avatar
Recognized Developer - OP
Thanks Meter 921
Posts: 570
Join Date: Dec 2009
Location: Prague

 
DONATE TO ME
Default [BOOTLOADER][DUALBOOT + RECOVERY][BOOTMENU] Patched ICS bootloader V8 (07/06/2012)

Allright, final ICS is out, but the stock bootloader still doesn't have fastboot oem unlock working. So, it's either HC bootloader or patched ICS bootloader. Please note that installing custom kernel / recovery on unpatched ICS bootloader will require recovering your device only with nvflash!

This bootloader can only be flashed using nvflash. You can use the guide here http://forum.xda-developers.com/show....php?t=1622425. There is also a post explaining nvflash in here: http://forum.xda-developers.com/show...62&postcount=9

YOU DO EVERYTHING AT YOUR OWN RISK!!!

Patched Bootloader V8: (07/06/2012)
- based on latest Acer BL 0.03.14-ICS, it will pass 0.03.14-MUL to command line
- fastboot handler is completely build from source code
- fastboot:
- A) download command will no longer write downloaded data to cache,
this means that on using flash and boot command, cache won't be wiped
- B) more convenient bootloader flashing (reboots right away to new BL)
- C) you won't have to have cache partition sized larger than other partitions,
in order to flash them
- D) maximum data size that can be send with fastboot is 700 MiB
- revamped GUI, now with fullscreen bootsplash and custom font, and themable
- added fastboot oem sbk command, which will print sbk on the tablet
- several small changes

Patched Bootloader V7: (31/05/2012)
- based on latest Acer BL 0.03.14-ICS, it will pass 0.03.14-MUL to command line
- one bootloader for both A500 / A501
- expanded bootmenu application (built from source) with handling several fastboot commands
- fastboot getvar serialno will return real serial number
- bootmenu has options to boot primary / secondary image on current boot
- attempting to boot invalid kernel image will result in being stuck in bootmenu

Patched Bootloader V6: (20/05/2012)
- based on latest Acer BL 0.03.14-ICS, it will pass 0.03.14-MUL to command line
- added simple boot menu (built from source)

Patched Bootloader V5: (18/05/2012)
- based on latest Acer BL 0.03.14-ICS, it will pass 0.03.14-MUL to command line
- dualboot (read lower for more information)
- added "fastboot flash bootloader bootloader.blob" command

Patched Bootloader V4: (13/05/2012)
- based on latest Acer BL 0.03.14-ICS, it will pass 0.03.14-UNL to command line
- allow bootlogo change (scroll down)
- allow unsigned update via bootloader.blob using CWM
- fixed: AKB partition is no longer used
- fixed: debug on / off works correctly
- fixed: bootloader will now boot to recovery if you erase boot (LNX) partition
- change: bootloader won't pass vmalloc parameter to cmdline

Patched Bootloader V3: (26/04/2012)
- no signature checks
- no "itsmagic" check
- based on latest Acer BL 0.03.12-ICS, it will pass 0.03.12-UNL to command line
- enabled fastboot (details lower)
- replaced bootlogo (moreover just testing that, need to allow bigger image)

FASTBOOT & BOOTMENU (since V6):

POWER + VOLUME DOWN will boot to recovery (won't erase cache).
POWER + VOLUME UP will boot to bootmenu.

In bootmenu, you can do:
A) Reboot
B) Go to fastboot mode
C) Toggle boot mode between primary / secondary kernel image
D) Toggle debug mode (modifies cmdline)
E) Wipe cache (in case you get bad bootloader update and tablet won't boot)

Fastboot has these commands:
Code:
flash
boot
download
erase
oem debug on
oem debug off
oem setboot b1     //setboot for primary kernel image, since V5
oem setboot b2     //setboot for secondary kernel image, since V5
oem sbk            //prints your SBK on the tablet, since V8
for flash / erase command there are these partitions
Code:
boot
recovery
system
flex
userdata
secboot    //secondary boot image since V5 (AKB partition, 10 MB size)
and these variables

Code:
id-bootloader   //since V8
version-bootloader
version-baseband
version
secure
serialno    //V7 - correct serial number
mid
wifi-only   //since V7
bootmode    //since V7
debugmode   //since V7
product     //changed in V7
Here is CWM for ICS bootloader: http://forum.xda-developers.com/show....php?t=1654476 , you can flash it from fastboot after you flash the bootloader.

Do NOT run itsmagic on V5+ if you use dualboot, it will corrupt the secondary boot image.

BOOTLOGO CHANGE (since V4):

Changelog:

1.05 (07/06/2012)
- new application for V8
- customizes bootsplash and the colors

1.04 (31/05/2012)
- updated to support V7

1.03 (19/05/2012)
- updated to support coming V6

1.02 (18/05/2012)
- updated to support V5 as well

1.01 (14/05/2012)
- fixed blob loading & generation
- fix: require only .NET 2.0

1.00 (13/05/2012)
- Initial release

Download the tool from here: http://skrilax.droid-developers.org/a500/tools/ (win for Windows, mono for other OS with Mono installed).

Steps to change bootlogo:
(V4 - V7, applcation version 1.00 - 1.04)

A) Open the bootloader using File menu.
B) Open the image you want using Image menu (the image size must be 268x72)
C) Save the bootloader as *.blob
D) Flash it with a fastboot

(V8, applcation version 1.05)

A) Open the bootloader using File menu.
B) Open the image you want using Image menu (the image size must be 1280x800), note file limit max is 200 kB
C) If you wish, tick the checkbox for color customization and set the colors at your wish
D) Save the bootloader as *.blob
E) Flash it with a fastboot

Stock bootlogo is in attachment.

If you want to flash as *.blob, you have to create an update.zip for CWM and flash using this update script:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
package_extract_file("bootloader.blob","/tmp/bootloader.blob");
unmount("/cache");
format("ext4","EMMC","/dev/block/mmcblk0p4","0");
run_program("/system/bin/dd","if=/tmp/bootloader.blob","of=/dev/block/mmcblk0p4");
unmount("/system");
mmcblk0p4 is cache partition. Please note that flashing a nonworking bootloader via *.blob will require recovery using nvflash.

DUALBOOT (since V5):

Before I start, the bootloader will work correctly if you just use single kernel image as you were used to on previous versions. You can just use it the very same as the older versions.
In other words, you can just install it and not have to bother about this at all.


Allright, new feature of V5 is dualboot, i.e toggling to boot two different images and keeping the recovery intact, it is primarily intended to run both Android & Native Linux ported by sp3dev. Running dualboot is compatible with every rom, as long as you don't use itsmagic, which will corrupt secondary kernel image.

First, basic information:

Dualboot sets the booting partition with permament effect (i.e not like holding down a button to boot secondary partition, nothing like that).

Primary kernel image is LNX partition (/dev/block/mmcblk0p2, size 8 MB), or "boot" when using fastboot flash / erase command. This is the default partition, used by older bootloaders as well.
Secondary kernel image is AKB partition (/dev/block/mmcblk0p7, size 10 MB), or "secboot" when using fastboot flash / erase command. This parition used for storing checksums on HC bootloader.

Now, how to toggle between booting primary and secondary kernel image:

A) Using special binary, download zip file and install using recovery: http://skrilax.droid-developers.org/...otmode_bin.zip. Then from console run:
"setbootmode b1" - sets to boot primary kernel image
"setbootmode b2" - sets to boot secondary kernel image

B) Using recovery update.zip, just by installing it:
- for primary kernel image, use: http://skrilax.droid-developers.org/...de_primary.zip
- for secondary kernel image, use: http://skrilax.droid-developers.org/..._secondary.zip

C) Using fastboot:
- "fastboot oem setboot b1" - sets to boot primary kernel image
- "fastboot oem setboot b2" - sets to boot secondary kernel image

D) Since V6 also using bootmenu GUI

Now, how to flash the secondary kernel image:

Either use "dd if=secboot.img of=/dev/block/mmcblk0p7" from within android or recovery, or in fastboot, you can use:

Code:
fastboot flash secboot secboot.img     <- to flash
fastboot erase secboot     <- to erase
DEV:

A) Dualboot

setbootmode binary source can be downloaded here: http://skrilax.droid-developers.org/...otmode_src.zip. I believe the source is self explainatory. Precompiled binary can be downloaded from here (normal and static): http://skrilax.droid-developers.org/...otmode_bin.zip

It uses a byte in MSC partition to check which partition to boot from:
Code:
Boot mode               | Debug | Partition | Unused
X X X X X X X X X X X X |   D   |     P     | 0 0 0 0 0 0
Boot mode is one-time command:
FOTA - Recovery
FastbootMode - Fastboot
FactoryReset - Factory Reset
BootmenuMode - Bootmenu

Debug is either set to 00 for off or 01 for on. It will modify the cmdline passed to the kernel (if that isn't overriden)
Partition is either set to 00 for LNX partition or 01 for AKB parition

B) Bootmenu

Bootmenu part of the bootloader is open source, with basic functions of the bootloader map. This includes full framebuffer access (hacked a bit as of V8), some standard library functions (you can use your own of course), partition handling, gpio (key handling), fastboot, reboot. Bootmenu currently acts as sub-bootloader, as it passes control back to the bootloader for booting the actual image.

Bootmenu is licensed GPL V3, you can find repository here: https://github.com/SkrilaxCZ/a500_bootmenu

Compile it by making "make", with CROSS_COMPILE set. You can also use "O=../obj" if you prefer obj folder like I do. Please note that makefile is primitive, so you have to make clean before making new build.

FAQ:

Q: What are the main advantages over HC bootloader?
A: Mainly fastboot. Then more comfort, but for running a custom ROM, HC bootloader is just as fine. And since V5, the possibility of dualboot.

Q: Can I unbrick my A500 with nvflash?
A: Provided, that you saved CPUID to generate SBK and have mmcblk0_start backup, yes. You can recover by installing this bootloader over HC bootloader should you have SOS and LNX image checksum failure.

Q: What is the best way to install ICS bootloader?
A: First install the bootloader with nvflash. Then using fastboot (POWER + VOLUME UP) flash recovery. From there flash ROM for ICS bootloader. You can however install the recovery with nvflash too.

Q: How do I use fastboot?
A: Fastboot is part of Android SDK, you get it just as you get adb. To recover with fastboot, reset the tablet and hold POWER + VOLUME_UP, the tablet will say "Fastboot Mode". Open up command line in the directory where you have fastboot, and use:
Code:
fastboot flash boot boot.img <- flashes boot.img (to kernel partition - LNX)
fastboot flash recovery recovery.img <- flashes recovery.img (to recovery partition - SOS)
Basically, to unbrick it, use the one to flash recovery. Then boot to the recovery, and flash working backup / ROM, whatever you like.

Q: Fastboot oem debug on / off:
A: This has use only for kernel developers. Fastboot oem debug on / off will only change the cmdline to serial console (on) or null console (off). The console parameter can be edited on offset 0x87638, by default it is "console=ttyS0,115200n8".

Q: Updating BL via recovery:
A: Since V4 supports flashing custom bootloader.blobs. Trying to flash custom bootloader.blob on any other bootloader will result in update failed and bootloader not modified (so this part is safe). Flashing a bad bootloader via bootloader.blob will require recovering with nvflash.

Q: Factory reset:
A: Factory reset (Vol UP and switching the rot. lock) is not supported on patched bootloader, use recovery or "fastboot erase userdata".

Q: The tablet won't boot secondary kernel image, but I have working kernel image. What should I do?
Toggle boot partition in boot menu back to primary.

Q: The tablet doesn't boot after bootloader install.
Boot to bootmenu and wipe cache.

INSTALL:

There are four methods of installing:

A) Flashing the *.bin file using nvflash manually, providing as the bootloader_apx.bin to "-bl" argument

B) Using blackthund3r's tool, see guide here: (guide here: http://forum.xda-developers.com/show....php?t=1622425

C) If you have V4+ installed (or newer), you can flash the update.zip for CWM

D) If you have V5+ installed, then you can also use fastboot: "fastboot flash bootloader bootloader.blob". Please note that if you supply invalid block image, then you have to use "fastboot erase cache".

CREDITS:

Bootmenu uses code from following applications:
GRUB: jpg loading
SUSE: V8 Splash screen image

DOWNLOAD:

There are zip files with bootloaders for a500 / a501 - containing three files:
bootloader_apx.bin - this is bootloader binary to be booted when flashing via nvflash (use with -bl argument)
bootloader_hc.bin - this is HC bootloader, w/o signature and itsmagic checks
bootloader_ics_vx.bin - this is the ICS bootloader file

Please note that using old bootloader_apx.bin (from pre-V5 package) when updating manually will corrupt your secondary kernel image.

Alternatively, you can find there a500apx images for blackthund3r's tool (http://d-h.st/Fkt), there is also repository for the tool on this URL "http://skrilax.droid-developers.org/a500/nvflash", contains only bootloaders. They can be downloaded manually as well.

Download page: http://skrilax.droid-developers.org/...vflash/images/

A500 / A501 ICS V8 BL:

Green background:
Zip: http://skrilax.droid-developers.org/...s_v8_green.zip
blackthund3r's tool package: http://skrilax.droid-developers.org/...loader.a500apx
Update.zip for CWM: http://skrilax.droid-developers.org/...e_v8_green.zip

Blue background:
Zip: http://skrilax.droid-developers.org/...cs_v8_blue.zip
blackthund3r's tool package: http://skrilax.droid-developers.org/...loader.a500apx
Update.zip for CWM: http://skrilax.droid-developers.org/...te_v8_blue.zip
Attached Thumbnails
Click image for larger version

Name:	stock_logo.png
Views:	4508
Size:	4.5 KB
ID:	1058265   Click image for larger version

Name:	v7_logo.png
Views:	3630
Size:	18.4 KB
ID:	1097582  
Motorola Photon Q
Bootloader: 10.9B
Firmware: CM10.1
Nightly Builds: CM10.1

Acer Iconia A500
Bootloader: V9 0.03.14-MUL (dualboot + recovery + extfs boot + bootmenu)
Android: CM10.1
LUbuntu: 13.04


2nd-init for Locked Bootloaders

Acer Iconia A500 / A501 Patched Bootloader Thread

Motorola Phones Stock Firmwares

You may donate me if you like my work.
The Following 58 Users Say Thank You to Skrilax_CZ For This Useful Post: [ Click to Expand ]
 
yaworski
Old
#2  
yaworski's Avatar
Senior Member
Thanks Meter 45
Posts: 158
Join Date: Jun 2007
Location: Warsaw
Wow, you found a way to boot into fastboot directly . Thank you. As for bigger logo I think that it would require to extend the space where the logo resides in bootloader file and that would require to recalculate all addresses after that area. I don't have sufficient knowledge in this area to even guess if this is possible .
 
civato
Old
(Last edited by civato; 26th April 2012 at 11:52 AM.)
#3  
civato's Avatar
Recognized Contributor
Thanks Meter 7428
Posts: 2,792
Join Date: Apr 2011

 
DONATE TO ME
This with strra , bat makes it so easy .

Thanks !!!!!!!!!!!

EDIT:

Maybe and I think it is a stupid question but anyway gonnan ask it.

I installed this and it runs fine , I can go into recovery and all but not into to fastboot ,( it says fastboot starting..............) = STUPID me need to type commands so it does sommething
And if I check my bootloader it still shows 3.01 HC ?

Do I need to flash the official leak first and then run this unlocked patch ?
I will try some different stuff , new to this nvflashing things on a tab , did it 100+ times on GPU's but never on my tab.

It pass the flash thing but then I get in red : secure boot : image LNX checksum fail !

EDIT2:
After flashing some more all is well , but still want to know what the following line means after I installed the V3 bootloader :
secure boot : image LNX checksum fail !
If I check my bootloader version now it is 0.03.12-UNL and I got the Thor 1.7 recovery for ICS bootloader users running.
I can flash custom roms and all so no problems here.

Again thanks for the work !! Just a nvflash noob asking some side info !

EDIT3: Question
If I make a update .zip with only bootloader.blob and then the user runs this with the strra packages will that do the trick to make it easy to update to unlocked bootloader and custom recovery?


What I did:
See attachment ; you find what I used and your V3 is in the package , I followed the guide and links by
jm77 but I used the stuff in the attachments.

Make sure you got your uid (CPUuid) so you can get your SBK. (you find this in your cwm backup folder or follow instructions from jm77 guide)
Going back to HC roms is not possible just so you know.


The Following 4 Users Say Thank You to civato For This Useful Post: [ Click to Expand ]
 
Skrilax_CZ
Old
(Last edited by Skrilax_CZ; 12th May 2012 at 07:34 PM.)
#4  
Skrilax_CZ's Avatar
Recognized Developer - OP
Thanks Meter 921
Posts: 570
Join Date: Dec 2009
Location: Prague

 
DONATE TO ME
Quote:
Originally Posted by yaworski View Post
Wow, you found a way to boot into fastboot directly . Thank you. As for bigger logo I think that it would require to extend the space where the logo resides in bootloader file and that would require to recalculate all addresses after that area. I don't have sufficient knowledge in this area to even guess if this is possible .
Yeah, I rewrote the fuction setting the boot mode. Well, I wasn't thinking of full screen bootlogo, just purging the other unused images and using the space for a single logo. Full logo is over 4 M.

Quote:
Originally Posted by civato View Post
Do I need to flash the official leak first and then run this unlocked patch ?
I will try some different stuff , new to this nvflashing things on a tab , did it 100+ times on GPU's but never on my tab.

It pass the flash thing but then I get in red : [COLOR=Red]secure boot : image LNX checksum fail !
We're using the HC bootloader when you communicate with nvflash (for some reason, ICS will not work). This means that after flashing, don't continue booting, just power off the tablet (as HC bootloader will fail booting on the checksums) and then power it back on.

To upgrade:
1) flash the bootloader with nvflash
2) boot to fastboot (POWER + VOLUME UP), flash CWM via fastboot
3) flash ROM via CWM

Quote:
Originally Posted by civato View Post
If I make a update .zip with only bootloader.blob and then the user runs this with the strra packages will that do the trick to make it easy to update to unlocked bootloader and custom recovery?
No, that can't be used to install unlocked bootloader. The bootloader is checked for signature that way. Only nvflash.
The Following 3 Users Say Thank You to Skrilax_CZ For This Useful Post: [ Click to Expand ]
 
Skrilax_CZ
Old
#5  
Skrilax_CZ's Avatar
Recognized Developer - OP
Thanks Meter 921
Posts: 570
Join Date: Dec 2009
Location: Prague

 
DONATE TO ME
Ignore this post. Quoted myself by accident.
 
civato
Old
#6  
civato's Avatar
Recognized Contributor
Thanks Meter 7428
Posts: 2,792
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by Skrilax_CZ View Post
We're using the HC bootloader when you communicate with nvflash (for some reason, ICS will not work). This means that after flashing, don't continue booting, just power off the tablet (as HC bootloader will fail booting on the checksums) and then power it back on.

To upgrade:
1) flash the bootloader with nvflash
2) boot to fastboot (POWER + VOLUME UP), flash CWM via fastboot
3) flash ROM via CWM



No, that can't be used to install unlocked bootloader. The bootloader is checked for signature that way.
Thanks , m8 , all went OK and works so no problems , got your V3 running and I got custom cwm .
Was just looking if it was possible to make the steps even more simple to the new users.
 
Zatta
Old
#7  
Zatta's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 971
Posts: 1,858
Join Date: Dec 2010
Location: Sneek
Can't we flash the bootloader ànd the cwm through nvflash anymore? I use a modified script from strra to flash back and forward between hc bootloader icw twrp and bootloader V2 icw the corresponding cwm.

Taptalked u see
 
civato
Old
#8  
civato's Avatar
Recognized Contributor
Thanks Meter 7428
Posts: 2,792
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by Zatta View Post
Can't we flash the bootloader ànd the cwm through nvflash anymore? I use a modified script from strra to flash back and forward between hc bootloader icw twrp and bootloader V2 icw the corresponding cwm.

Taptalked u see
Yes you can , I did it that way with the package I uploaded , it is strra package with this V3 in it.

Can you upload the HC bootloader for me so I can go back and fort if I want.
The Following 2 Users Say Thank You to civato For This Useful Post: [ Click to Expand ]
 
civato
Old
#9  
civato's Avatar
Recognized Contributor
Thanks Meter 7428
Posts: 2,792
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by Skrilax_CZ View Post



We're using the HC bootloader when you communicate with nvflash (for some reason, ICS will not work).


No, that can't be used to install unlocked bootloader. The bootloader is checked for signature that way. Only nvflash.
Could it be if we use the USB driver from the a200 ICS from Acer that is will work , communication with nvflash.

And not asking if it is possible to flash the patched bootloader with cwm.
Just a update zip with the original bootloader.blob flash it with cwm and then run nvflash to install the patched boot loader and custom recovery.
That way user won't have to download and install the whole original rom .
 
Skrilax_CZ
Old
(Last edited by Skrilax_CZ; 26th April 2012 at 05:13 PM.)
#10  
Skrilax_CZ's Avatar
Recognized Developer - OP
Thanks Meter 921
Posts: 570
Join Date: Dec 2009
Location: Prague

 
DONATE TO ME
No, the error is in the nvflash interface in ICS bootloader itself. However it's pretty much irrelevant which bootloader you use to communicate with nvflash, if they all were working.

Quote:
Originally Posted by civato View Post
And not asking if it is possible to flash the patched bootloader with cwm.
Just a update zip with the original bootloader.blob flash it with cwm and then run nvflash to install the patched boot loader and custom recovery.
That way user won't have to download and install the whole original rom .
Not entirely sure if I understand what you mean. If you flash original bootloader.blob with ICS, you have to have signed kernel / recovery flashed on the device. Otherwise the only way to recover from that is using nvflash. Easiest way is as I said in 1st post:
1) patched BL using nvflash
2) custom recovery with fastboot
3) ROM (or fixed boot.img for ICS bootloader)

Keep in mind, that in V2, you could only boot to fastboot via "adb reboot bootloader", POWER + VOL_UP to boot to fastboot is new in V3.

The Following 2 Users Say Thank You to Skrilax_CZ For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...