How to Port a ROM to Milestone2

Search This thread

---UFO---

Senior Member
Oct 5, 2008
308
158
Ok devs need some help here.
I am trying to port a rom to our Milestone 2...but it bootloops on rom animation.
I tried to logcat it but I don't think it gets as far as adb server to detect the device.and just keeps saying "waiting for device"...so I end up with no logcat to diagnose the problem.
I can logcat my current working rom but only after the phone boots....am i missing something here? please, help
Any help is very much appretiated.
Thanks a lot in advance


You need to enable adb in bootmenu.

Then you can get logcat also when ROM is not booting.
 
  • Like
Reactions: Megalith27

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Question to devs:
Is there a chance to find sdk add-on for Milestone 2 (A953/ME722)? Or should I try using Defy's?
Thanks in advance
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Officialy, Milestone 2's SDK Addon provided by Motorola is the Droid 2 Global one, and yet, it only works with Froyo SDK from what I remember...

Sent from my A953 using xda app-developers app

I guess, that means that i wont be able to test a custom rom on emulator which uses GB kernel?or is there a way?

Also, where can i find Droid 2 Global sdk addon? It is not listed on motodev website

Sent from my A953

EDIT: Found Droid 2 Global addon based on GB, never mind
 
Last edited:

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Might be a dumb question here: but is there a way to convert rom zip into img's to test the rom on Emulator before flashing it?
 

ZoLion

Member
Aug 28, 2009
20
8
Szeged
Hi Developers!

I've installed a Defy+ ROM on my MS2, but the phone module doesn't work, I can't make phone calls. What do I have to replace in the zip to get a workable phone modul?
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Hi Developers!

I've installed a Defy+ ROM on my MS2, but the phone module doesn't work, I can't make phone calls. What do I have to replace in the zip to get a workable phone modul?

One would assume that you need to replace RIL* smali files in framework.jar with MS2 ones.
But just out of curiosity, why don't you use already ported UFO's MIUI JB rom which is based on Wajk's rom?!:confused:
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Hi guys I need help yet again.
This is my second experience with porting ICS roms, I keep getting the "com.android.phone has stopped" error continuously. I have copied MotoWrigley3GRIL.smali to the framework of port.
Also tried following so far:
- replaced RIL*.smali files with the ones from CM9, specified MotoWrigley3GRIL in PhoneFactory.smali
- used PhoneFactory and BaseCommands from CM9

Not sure where else to look...also phone doesn't seem to recognize the sim card.

Help is appreciated.

---------- Post added at 09:46 PM ---------- Previous post was at 09:46 PM ----------

Hi guys I need help yet again.
This is my second experience with porting ICS roms, I keep getting the "com.android.phone has stopped" error continuously. I have copied MotoWrigley3GRIL.smali to the framework of port.
Also tried following so far:
- replaced RIL*.smali files with the ones from CM9, specified MotoWrigley3GRIL in PhoneFactory.smali
- used PhoneFactory and BaseCommands from CM9

Not sure where else to look...also phone doesn't seem to recognize the sim card.

Help is appreciated.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    As lately some people are asking me about ROM porting I decided to create this new thread where we can share knowledge about this hard task.

    Please note this is a Dev talk thread, so DON'T ASK about fixing a particular ROM problem here. Also don't ask questions like "My phone is bricked! please help!". This IS NOT the appropriate place for it. There are plenty of other threads to help you out.

    Also note that this is not a step by step guide (and not a guide at all), it's just a point where you can start from. Android is a very complex system and there are many things I don't know yet. So, research and hard work is what you need to learn it deeply. My first tip is Google really works. Don't be afraid to search :)

    Ok, to the basics. Porting a ROM is no simple task. It requires advanced understanding of how android works and how it is organized. Previous Linux/Unix knowledge helps A LOT. As android is based on this O.S. there are many similarities between both. In fact many ppl consider android to be a kind of linux distro.

    The very first task to port a ROM is finding a device which is compatible with your own. For example Defy/Milestone2. Then you are going to choose a ROM to port to your device.

    As our devices (Milestone2) have a locked bootloader we now need to find a system image that have a compatible kernel with the ROM we are trying to port. This is mainly based on trial and test and takes a long time. You'll be ending flashing your phone several times with RSD Lite. You should learn how to use MotoAndroidDepacker and how to create a fixed SBF.

    The basic procedure to try that:
    1. Open original ROM update.zip and remove any files/commands that flashes boot/devtree/recovery/anything.
    2. Install this new file on your phone via CW Recovery.
    3. Boot into bootmenu and enable ADB so you can read logcat while phone boots.
    4. Choose Boot/Normal. If your ROM uses 2nd-init you will need to place/edit/adapt bootscripts into bootmenu 2nd-init folder.
    5. Check logcat for errors:
    - If you're getting HAL errors you're going to need a new kernel;
    - If you can start android without getting HAL errors but still getting errors and bootloop on android animation you should try to replace libs with appropriate original ones.
    6. Once you are able to boot android you should test it's features to see what needs to be fixed.

    This is what I have to say for now. The thread is now open for discussion.
    2
    The only thing i can get from SBF is a bunch of smg files.
    But the only ones i can open are
    preinstall.smg
    CG39.smg

    Is there a way to open/see the rest?


    2)
    Im trying to modify the CM7 rom, what boot does it use? 2nd-init or 2nd-boot?

    SMG files are disk images of certain partitions of your flash memory.
    You can only open CG39.smg and preinstall (CG66.smg) because they are the only images in ext3 format. The rest of images may be on ramdisk format or some proprietary format. For more details on partition codes take a look here:
    http://and-developers.com/partitions:cdt

    You may be able to open and see contents of other partitions but the only one that matters aside from system and preinstall is the boot partition (CG35.smg), which contains the init scripts we should mod in order to make they work with 2nd-init. Boot partition is in ramdrive format. More details here:
    http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

    http://elinux.org/Android_on_OMAP

    It is easier to unpack boot image using Dsixda's Kitchen here:
    http://xdaforums.com/showthread.php?t=633246

    Edit: To see what boot your CM7 uses just go inside /system/bootmenu/config and look for a file called default_bootmode.conf. That should be the boot method used. It's normally 2nd-init.
    2
    Officialy, Milestone 2's SDK Addon provided by Motorola is the Droid 2 Global one, and yet, it only works with Froyo SDK from what I remember...

    Sent from my A953 using xda app-developers app
    1
    I don't know if this will be relevant or not.

    I wanted to know if to do any of this, having a Linux distro as OS a must or can I try my hands at it on a windows based machine. I mean I'm sure that a Linux distro will give certain advantages (as Android is based on UNIX/Linux) but can we get things to work a 100% on windows.
    If yes, then will someone be kind enough to get give the list of all softwares etc. which will be required to do the job on Windows machine as well as a Linux machine.

    I do know a few softwares but I'm not sure if I have an exhaustive list. I would like to learn and try and at least be able to modify in bits n pieces to begin with.

    I apologize if this wasn't supposed to be asked in this thread.

    Don't worry, this is the right place :)
    As for your question: yes you can work in windows if you like, but using at least a Linux VM is more productive. I don't have a full list of applications to give you, as different mods may require different tools, but I advice you to have at least:
    - Notepad++ (essential for editing text files and keeping linux end-line format);
    - dsixda's Android Kitchen (http://xdaforums.com/showthread.php?t=633246)
    - 7zip (or some other compress tool you like)
    - Moded putty for ADB as working with windows command prompt really suck (http://xdaforums.com/showthread.php?t=803225)
    - Oracle Virtual Box (if you are going to use linux VM).
    1
    Hi All,
    Just a quick question. I have ported Paranoid Android 2.10 to MS2 but the problem I am facing is that Reboot goes through Bootmenu and I have to choose reboot from Bootmenu again.
    Any inputs?
    Thanks in advance

    I meant to get to it last night, but I was tired after work and fell asleep watch tv. Eventually, later tonight, I'll be uploading PA for MS2. Check my Defy PA thread in 12-14 hours cause I'm about to go to work and I'm not gonna feel like making a MS2 PA thread or updating my Bravo PA thread -- but the Defy Thread is always up to date when I put out new roms.

    Also, I'm looking to get either a Defy or MS2 -- I've heard that there's 3G issues with AT&T users (which I am) with the MS2 -- Apparently the MS2 has different 3G frequencies than AT&T. Are there any AT&T MS2 users who are knowledgeable about that? While I can deal with no 3G, edge only, calls only -- I need to make sure I can at least do that before I commit to something.

    I'd rather have the MS2 because I want a hw keyboard and I don't have the $300+ to try and get a Photon Q LTE from eBay (and I don't have to change up my repos if I get a MS2). If anyone here knows of a phone that's AT&T compatible, Defy code compatible, and has a keyboard, please let me know.

    Thanks.

    //Normally I'd post the latter half in the Q&A section, but ya'll don't have one so I'm just gonna piggyback :p
    //My Bravo doesn't have a Q&A page either -- it needs one that's not my PM box...Don't PM me on how to root your phone and flash CM7 -- read one of the 5 guides on the first page of both General & Dev...:silly: