Remove All Ads from XDA
H10 Turbo

[2ndboot][04-10-2012] Custom kernel... this time with radio

223 posts
Thanks Meter: 574
By czechop, Senior Member on 27th September 2012, 07:40 PM
Post Reply Email Thread
It seems that finally I was able to boot custom kernel with working radio
It's not very stable yet(it stops/crashes at bootanimation quite frequently), and is quite laggy just after boot, but once it boots it seems to be almost usable. Wifi works, sdcard also. Haven't checked bluetooth.

Credits for this goes to:
* milestone1 devs... for sharing 2ndboot source code and providing so much info regarding milestone1/2 phones
* Motorola ... for providing source code(not fully working, but was a great help anyway) for enabling UART over micro usb for debugging purposes(without this I woudn't make any progress)
* tezet... for making quite good roms used by 2ndboot

If you wish to try it(BEWARE THAT IT MIGHT BRICK YOUR PHONE, SO DON'T SAY THAT I HAVEN'T WARNED YOU ), then do as follows:


1. Install tezet's JB10(if you don't have one already).
2. extract 2ndboot.tar(attached) into /data folder, check that /data/2ndboot/hbootuser file has execute permissions.
3. overwrite /system/bootmenu/script/'T TOUCH!!!) with the one from tar( and check it has execute permissions.
4. reboot into bootmenu
5. change the default boot method to 2ndboot
6. Restart your phone. Most likely it will crash few times at bootlogo, but be patiant, it finally should boot
7. If you wish to get back to 2nd-init, then enter bootmenu again and change default boot method back to 2nd-init, or manually boot 2nd-init

Please let me know if someone actually run it and was able to boot(so that to find out if I haven't forgot to include some more files(see changelog for 03.10.2012)


  • Boots very sloooowly
  • Its' quite laggy just after boot.
  • GPS does not seem to work yet



01.10.2012 - corrected battery problems(thanks to Quarx and kabaldan)
03.10.2012 - corrected ramdisk(previous one was calling some script which I forgot to attach to this post, new one has this script inside), so that now you should be able to boot it; updated instructions how to install it; enabled TLS in the kernel(thanks to kabaldan)
04.10.2012 - touch driver updated, now should work with lastest JB(thanks to Eleanor_Ir, Quarx), adb fixed(I hope, stability fix(thanks to Quarx)

NOTES for devs
In milestone2(as probably in many others UMTS phones made by Motorola) the BP is somehow very sensible and does not like to be disconnected/reenumerated. The main goal of this 2ndboot is then to not allow it to be disconnected. To do this, in the new kernel I've skipped a few resets(EHCI, TLL, individual port resets), and instead of enumerating BP, I've used the hardcoded usb device address(which for milestone2 seems to be equal to 2).
I attach patch(radio.patch) with the changes I've done to the kernel sources from here:

This seems to work(sometime) for both milestone2 and defy.

For other motorola phones:
1. First of all, check with lsusb what's the address and vendor/product id of your BP(for milestone2 it's 0x22b8 and 0x40e6).
2. If the BP usb device address is 2, then just apply the patch(probably it will need some small modifications), and check if it works.
3. If the BP usb device address is not 2, then edit usb/core/hub.c function hub_port_init(providing that it's there for your kernel), and replace 0x02 in the place where usb_control_msg to get descriptors is sent with address of your device

If it does not work, then you can try the following:
Create a procedure to send usb GetDescriptors request using omap3 ehci registers, and call it at different boot stages/usb initialization stages to find out how long the radio remains attached, and comment/change appropriate fragments of kernel code, to preserve this until usb port is initialized. If you wish, I can share the procedure I've written(in the patch file this is that czecho_get_descriptors called in many places) for milestone2, but it probably would need some modification to work with your device).

2ndboot module sources are here:
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-09-27-19-11-21.jpg
Views:	6474
Size:	23.7 KB
ID:	1359294  
Attached Files
File Type: tar - [Click for QR Code] (10.0 KB, 526 views)
File Type: patch radio.patch - [Click for QR Code] (10.9 KB, 470 views)
File Type: tar 2ndboot.tar - [Click for QR Code] (3.78 MB, 559 views)
The Following 162 Users Say Thank You to czechop For This Useful Post: [ View ] Gift czechop Ad-Free
27th September 2012, 07:59 PM |#2  
Anonymous_'s Avatar
Senior Member
Thanks Meter: 130
Wow, thats perfect This could bring M2 development to another level.

Holding thumbs up and keep it up!
27th September 2012, 08:41 PM |#3  
tezet's Avatar
Senior Member
Flag Cracow
Thanks Meter: 902
Great news! Thx for your work. I've just bought an OTG cable to start playing with kernel stuff and here's a surprise
The Following 10 Users Say Thank You to tezet For This Useful Post: [ View ] Gift tezet Ad-Free
27th September 2012, 09:35 PM |#4  
JoseBerga's Avatar
Senior Member
Flag Formosa
Thanks Meter: 102
Donate to Me
Fabulous! That means it starts a new era in the development of our MS2 Roms!

27th September 2012, 09:46 PM |#5  
djlooka's Avatar
Senior Member
Thanks Meter: 25
Wonderful job man
27th September 2012, 11:50 PM |#6  
Senior Member
Flag Ho Chi Minh City
Thanks Meter: 12

Sent from my A953 using Tapatalk 2
28th September 2012, 02:56 AM |#7  
skeevydude's Avatar
Recognized Contributor
Flag Hot Springs
Thanks Meter: 3,058
I'm gonna try on the Motorola Bravo as soon as PA is done uploading. Hopefully this'll work on Froyo kernels as well

What kernel are you using? A recompiled MS2 GB kernel unmodified?

Awesome job man. This could possibly be the start of a new generation of roms for our common platform if this works on other similar phones like the Defy\Bravo. Only time will tell .
The Following 3 Users Say Thank You to skeevydude For This Useful Post: [ View ] Gift skeevydude Ad-Free
28th September 2012, 03:25 AM |#8  
nidhish91's Avatar
Senior Member
Thanks Meter: 361
Well good work OP, can this be implemented on other Moto phones like Defy?
The Following User Says Thank You to nidhish91 For This Useful Post: [ View ] Gift nidhish91 Ad-Free
28th September 2012, 05:33 AM |#9  
Flag Lille (Nord)
Thanks Meter: 24
Donate to Me
Great work !

I see that your work is based on Moto's Linux kernel (2.6 branch as far as I remember...)

Any hope of using another kernel source one day ?
28th September 2012, 05:57 AM |#10  
Quarx's Avatar
Recognized Developer
Flag Omsk
Thanks Meter: 18,854
Donate to Me
Great News!, Thanks
Waiting for source code
The Following 50 Users Say Thank You to Quarx For This Useful Post: [ View ]
28th September 2012, 06:01 AM |#11  
Megalith27's Avatar
Senior Member
Flag Baku
Thanks Meter: 278
Donate to Me
Wow! Tezet and Quarx on the same thread?! I feel like up on the Mount Olypmus lol

Great job, man!...been following your work from General section.

P.S. add Kabaldan to the list Clash of the Moto Titans
The Following 10 Users Say Thank You to Megalith27 For This Useful Post: [ View ] Gift Megalith27 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes