Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[HOW TO][4.2.2+] Port Custom Roms From Other OMAP 4 Devices (REVAMPED!)

OP Aceofzeroz

12th December 2013, 06:44 AM   |  #1  
Aceofzeroz's Avatar
OP Senior Member
Flag Brown's Town
Thanks Meter: 860
 
710 posts
Join Date:Joined: Apr 2013
More
Introduction
Greetings Atrix 2 community! I'm here to guide you the best I can to being able to port custom (not stock) roms that aren't available for the Atrix 2 from other Mototrola OMAP 4 devices, such as the Droid RAZR, Droid 4, etc. It may not be limited to only Motorola phones, but rule #1 of porting is that the CPU HAS TO BE THE SAME OR VERY SIMILAR! Rule #2 is that you can ONLY port from the same android custom rom version, e.g. 4.2.2 - 4.2.2, not 4.3 to 4.2.2, etc. due to major file differences in most cases. (More rules are mentioned within the linked guides) Rule #3 is that they have to either be GSM band or be able to completely convert from CDMA to GSM though patch.

Wait a sec, what do you mean by "porting roms"??? This link will help you get started on knowing what you'll be learning to do here. The top benefit to all of this is to provide yourself with roms from other compatible devices as well as learn what happens behind the scenes in a custom rom. I recommend that you try porting GSM Droid Razr/UMTS_Spyder roms to get yourself into it before attempting any other device.

Now that's out of the way, in this tutorial/guide, I'll be making a lot of reference links to save some time explaining certain steps since that's where I learned how to do this. I take no credit for each OP's guide and all credit goes to them and others who assisted, I'm just sharing. If you want to see a successfully ported example, go to page 2 of this thread.




"ENOUGH TALK, LET'S DO THIS!!!" ...is what all will be saying while reading my boring intro, but the next section is something you need to read, don't say I didn't warn you!


Disclaimer and Precautions

>This is a risk YOU are taking, you will be possibly voiding YOUR warranty and may even brick YOUR phone due to lack of instruction following
>I am not a developer, just a normal user who wants to share something useful.
>I am not responsible for whatever happens during your port projects, nor are any of the other guide OPs and so on. MAKE BACKUPS!!!
>This is a choice, your choice, I'm not forcing anyone to do this so please use your head when you want to blame.
>USE BOOT MENU MANAGER (by Team Lens from the play store), NOT ATRIX 2 BOOTSTRAP PLEASE!!!!!!!!!!!

>After installing and setting up BMM, MAKE SYSTEM PARTITIONS (3-6) AND USE ONLY THEM FOR FLASHING WHILE TESTING, i.e. DO NOT FLASH ON SYSTEM 1 (in case of bootloop or worse).
>Do not flash with JBX kernel until you are able to get your ported kexec rom at least 95% functional. You may test it afterwards.
>Ported roms will have the same bugs as they had for their corresponding device and they won't fix any of our bugs (maybe).
>Some roms require more specific actions to successfully port them with everything working (MIUI, PA, etc.) and from other devices outiside your own.




Porting Tools Needed
1. A Brain with an open mind (CRUCIAL)
2. Time and patience for trial and error (VERY CRUCIAL, so if you don't have enough, try again when you do)
3. A Good amount of disk space, so if you have less than 1gb available, DELETE SOME OF THAT PORN!!!
4. A file comparison tool; use WinMerge for Windows or Meld for Ubuntu
5. A compression tool such as WinRar, 7zip, or any other that can make .zip files (typical rom extension)
6. Notepad++ (for editing file scripts)
7. A rooted Atrix 2 that is on at least 4.04 ICS stock kernel, NOT GB!
8. Boot Menu Manager Recovery with an unused System set up for testing your port



NOW we're ready to begin Porting!

There are many ways to port roms, however there are 2 main categories of porting methods:

The Basic Porting Method - Using the Base (Previously known as Method 1)

Basically follow all the instructions in this thread for using the working base rom. I highly recommend using the port rom's corresponding base (CM, AOKP, PA, etc), unless you're porting a rom that we already have but want to update it. This is another good guide that has similar instructions.

*NOTE*: This method rarely ever works for our OMAP devices, but other device users might benefit from it.



The Actually Working Porting Methods - Using the Port itself (Previously known as Method 2)

This style of porting has proven to work for all the roms the A2EPT has ported thus far for all Moto OMAP4 android versions. However, for the sake of organization I will outline furter devisions in the methods used for general and specific cases. These methods will be called the Motorola Porting Methods (MPM), but can be useful to any other device based on recent feedback.



Motorola Porting Method 1 (MPM1) - This will outline the surefire steps that will usually port roms from our Moto OMAP cousins with everything functional!


These steps below involve a lot of copy and paste using your comparison tool of choice: ('unique'=files on either left or right alone)

>Start off with the updater script, compare the ones for your base and port and copy only the single line differences from base to port.

>After you copy everything except those consecutive lines to the port's updater_script, now go to system/etc and copy apns_config, mkshrc, firmware folder and all unique items from base to port.

>Next, head on over bin and copy over all unique unique bin files over to your port, then copy rild.bin over as well and that's all.

>Next victim is the most influential one; LIB FOLDER! Starting off with the hw folder, copy all the edison.so files over to you port rom.

>Afterwards, replace the entire modules folder and copied over all unique lib*.so from base to port.

>Locate all libs with ril in their names and replace the ones in your port

>Now head onto the xbin folder, and copy over all unique files from base to port.

>That should do it for xbin, so now head on back to /sysem and copy the entire vendor folder, then do the same for usr.

>Finally, build.prop is your last stop and to make it simple for everyone, download and use this sample build.prop as a guide for what lines you should always replace: Sample build.prop




Motorola Porting Method 2 (MPM2) - This is specifically for all Moto OMAP 4.3/4.3.1/4.4+ roms and others that need to replace the storage_list.xml such as the Droid 4 and Droid Bionic (previously called Method 2.5 behind the scenes ):

>Perform all the steps in MPM1 on the desired 4.3 or whatever rom that needs the replacement.

>In a working 4.3/4.3.1/etc. rom for the A2, open system/framework/framework-res.apk with winrar or any other file compression tool.

>Look for the storage_list.xml file in /res/xml and extract it to your Desktop (or wherever you want)

>Now open your corresponding 4.3+/etc. port rom and navigate all the way to the /xml folder in framework-res.apk

>Take your extracted storage_list file and replace the one in the port with it, AND THAT'S IT!!

>Test to see if it is actually booting and as long as you can get to the setup screen without bootlooping, you are home-free!



!NEW UPDATE VIDEO!: I received a suggestion to actually show how to do the above Moto porting methods, now that I got the time, I have done just that for all those who were having a hard time with following my steps! Here it is for all who are interested:Turorial Video, it's 27 minutes of hearing my boring voice so prepare yourselves!



Common Challenges with Porting (experiences may vary)

This sorta depends on which method you used to port you rom, but I'll list all the typical expected problems I at least faced and (possible) solutions:

Issues Faced with Both Methods:
1. The rom doesn't boot past the boot animation - this may be due to the updater script's permissions and/or build.prop mistakes, so make sure everything is in place according to the instructions.

2. It boots to the setup screen but there are numerous crashes, then it bootloops - this is a system/app, /lib or /etc problem and you may have to try replacing the android_server.so and media_jni.so from the ported rom, but a logcat may be needed.

3. "YIPPEE, IT BOOTED PAST SETUP, but where is my signal?" - Baseband issues *sigh*, its very tricky to get this part so you may either need to move signal and modem-related files from your base to your port and check build.prop

4. "My SD card won't mount?! D:" - This can be fixed by going into your ported rom and opening system/framework/framework-res.apk with WinRar/7zip then go to res/xml/storage_list.xml and open it. Then go to vold.fstab in system/etc and make sure that the 'sdcard' numbers are the same, e.g. sdcard0, sdcard1, etc.

5. "WTF, I'm not rooted/ o_O" - LOL, I experienced this in porting the kitkat rom below using the 1st Method. xD If that's the case, you need to copy these files from /lib in port to base: libandroid_runtime.so, libcutils.so, libbinder.so, libutils.so, libsqlite.so and libsqlite_jni.so.

6. "Ok, I have signal and most things working but x always FCs"- at this point, you're a bit better off and that can be solvable if you specify what it is in this thread.

All other problems may need logcat, but before posting them here, search in this thread yet again to see if they were solved.



Credits are Needed!!!


  • Credits go to the OP's of these guide threads
  • XDA and Google search for when I was lost as a lamb xD
  • qkdxorjs1002 for his Carbon Rom 4.4.1 kitkat (below)
  • alteredlikeness, Ravikirancg, deveshmanish, dtrail1, all Motorola OMAP 4 developers and rom maintainers/porters.
  • Respective custom rom developers; CM, PA, PACMan, AOKP, Carbon Rom, Liquid Smooth, etc.
  • My curiosity and stubbornness (LOL, kidding).
  • And last but not least, the Atrix 2 community for providing a noob like me with the best first android experiences I never expected!
Last edited by Aceofzeroz; 23rd May 2014 at 04:53 AM.
The Following 30 Users Say Thank You to Aceofzeroz For This Useful Post: [ View ]
12th December 2013, 06:46 AM   |  #2  
Aceofzeroz's Avatar
OP Senior Member
Flag Brown's Town
Thanks Meter: 860
 
710 posts
Join Date:Joined: Apr 2013
More
Thumbs up Proof!!!
Screenshots
Click image for larger version

Name:	Screenshot_2013-12-10-21-33-59.jpg
Views:	606
Size:	49.3 KB
ID:	2449666Click image for larger version

Name:	Screenshot_2013-12-09-15-01-39.jpg
Views:	508
Size:	56.1 KB
ID:	2449667Click image for larger version

Name:	Screenshot_2013-12-09-15-17-14.png
Views:	414
Size:	204.1 KB
ID:	2449668Click image for larger version

Name:	Screenshot_2013-12-09-15-17-26.png
Views:	367
Size:	174.3 KB
ID:	2449669

Examples
Currently I could only upload this due to slow bandwidth, but I will upload the Non-kexec Liquid Smooth another time (I can re-kexec it on request).

Carbon 4.4.1 Using the Atrix 2 CM 11 as a Base rom (Update on trying this out - it works ok enough but has some issues if you reboot it sometimes so don't use it as a daily driver, just a reference point!)

~UPDATE~: Alrighty, I managed to upload the ported 4.2.2 Liquid Smooth v2.9 that I made using the 2nd Method. It's my current daily driver as it's really stable for the most part, it has new transition animations and it's non-kexec so it has very good battery life! (Note: Do not flash JBX kernel with this, it won't work!)

Liquid Smooth v2.9 using the 2nd Conversion Method, grab it and enjoy!


Quote:

[Small Backstory]Just last week, I became curious in wanting to know how to port a rom after learning how to de-kexec them thanks to our own alteredlikeness and Ravikirancg. So most of last week I went about trying to port the last 4.2.2 version of Liquid Smooth v2.9 rom since our original porter, deveshmanish, can no longer do so. So since we had LS v2.8, I felt it wouldn't hurt to try, but it was much more challenging than I thought! But I continued to persevere and eventually I successfully ported it which will be shared in this tutorial. [/Small Backstory]

Last edited by Aceofzeroz; 14th December 2013 at 01:55 AM. Reason: Adding needed items
The Following 11 Users Say Thank You to Aceofzeroz For This Useful Post: [ View ]
12th December 2013, 06:47 AM   |  #3  
Aceofzeroz's Avatar
OP Senior Member
Flag Brown's Town
Thanks Meter: 860
 
710 posts
Join Date:Joined: Apr 2013
More
Phone Samsung Galxay Roms Incoming!
Reserved for anything else I need to add! ~New Update, now I have something to add~

Samsung Galaxy OMAP 4 Porting (Galaxy S2-I9100G and the Galaxy Nexus - all variants!)

In this post, I'll be Introducing the porting methods me and my team have made for porting roms from these two S. Galaxy phone series. The methods are basically the ones used for the Moto OMAP phones as well but with additional steps that are needed for full/almost full functionality. (NBnly rom versions up to 4.3.1 can be ported with methods 2 and 3, 4.4+ roms cannot be ported at this time).

Notes about Samsung Galaxy ROMS:
  1. Porting from these two phones has a higher difficulty than Moto phones in some cases, so patience is NEEDED!
  2. On startup they will have all sound options enabled
  3. The Galaxy Nexus-based roms will have the Nav bar on startup
  4. Their battery charging lights are always enabled (should be able to turn that off in Settings)
  5. Samsung-unique features don't work on our phone (duh)
  6. On some roms, the lcd density will be high (large screen items) but they have dpi settings so don't panic lol
  7. Only a few roms still don't have the 1% battery hack, so if you don't mind that then great!


Samsung Galaxy Porting Method 1 (SGPM1) - The "Preview Method".
I'll write this and the other methods in more detail when I revamp my thread in the coming month. But basically this can be done by doing the same steps in the 2nd Porting Method along with the additional steps I stated for getting 4.3/4.3.1 roms to boot (replacing the storage list). It is HIGHLY recommended that you use bases from our phone that are most compatible with the rom you want to port based on their sources.

Why is it called the "Preview Method"? Simple, because you won't be able to use the rom with some of our components working like audio, camera and wifi. However, if you want to get wifi working then replace these additional files after you've replaced the ones above:
  • In /system/bin, replace the two wpa binaries
  • In /system/etc, replace the entire wifi folder
  • And in /system/lib, replace lbhardware_legacy.so and libwpa_client.so


This method is applicable for all android versions based on our tests, but not all roms will boot even with this method, so keep that in mind. My personal advice is to test your port first without gapps to see if it boots and see what it has since gapps are pointless without wifi and audio. :P


Samsung Galaxy Porting Method 2 (SGPM2)- The "Lucky Porter".

In this method for SG roms, the same steps for SGPM1 are involved except for further replacements that fully ports your SG rom with whatever is working in your base. This works for some roms but not all, so if it doesn't work for you then refer to SGPM3 below.



+Start off with modifying the updater script and build prop based these examples:

+After performing all the steps of SGPM1, go inside your system folder and replace the entire bin folder

+Afterwards, go inside the lib folder and replace everything except libandroid runtime, libandroid servers and libmedia jni.

+Make sure that the build.prop and updater script have everything in place, then you can zip the META_INF and system folders into a new rom zip and test away!

+If you're lucky enough to have it boot and the charging LED changes colour then you're at least very close to fully porting it if it didn't already do so!



Samsung Galaxy Porting Method 3 (SGPM3) - The "Advanced Porter".

This advanced method is for porting SG roms that would otherwise not works as desired with SGPM2 by either bootlooping, booting with endless FCs, etc.

#Alrighty, go to the app folder where the only thing you copy over is OMAP 4 parts.apk from your your base (and any other app you wish to add).

#Now onto the bin folder, in there you will copy over all unique files from the your base and these specific ones; adb, app process, atrace, dalvikvm, dbus-daemon (if present), mediaserver, rild, sensorservice, tfdaemon and the two wpa binaries.

#Next in the etc folder, you will copy over all unique files and folders except the entire permission folder, dhcpcd, security, updatecmds and ppp. Then go and copy the unique files inside the permissions and in init.d folders. Also if there's a paranoid folder present, use one of our pacman roms to replace it in there so that there are no dpi issues.

#Back in system folder, replace the entire usr and vendor folder, then go to framework to replace the storage list.xml in framework-res.apk/res/xml with the one in your base.

#Finally in the lib folder, replace all of the folders inside lib, then libaudio ext, libaudioflinger, libaudioeffect jni, libaudioutils, libbinder, libc, libcamera client, libcutils, libdl, libdomx, libexif, libhardware and hardware legacy, libjpeg, liblog, libmedia, libmm osal, all of the libOMX files, libril files, libsensorservice, libstagefrighthw, libutils, libwpa client and libz. For making non-kexec 4.2.2 roms, delete libedid.so and libselinux.so as well.

#Make sure that the build.prop and updater script have everything in place, then you can zip the META_INF and system folders into a new rom zip and test away!

#If it boots, has wifi and camera working but still no audio, then go back to your port folder, open system/lib and replace everything except libandroid runtime, libandroid servers and libmedia jni.




That's all for now, stay tuned for more from the A2EPT!
Last edited by Aceofzeroz; 22nd February 2014 at 08:02 PM.
The Following 7 Users Say Thank You to Aceofzeroz For This Useful Post: [ View ]
12th December 2013, 07:20 AM   |  #4  
shardul.phatak's Avatar
Senior Member
bangalore
Thanks Meter: 102
 
413 posts
Join Date:Joined: Jan 2012
Thumbs up
nice .... will give a shot in free tym ....

thanks a lot
The Following User Says Thank You to shardul.phatak For This Useful Post: [ View ]
12th December 2013, 07:35 AM   |  #5  
Aceofzeroz's Avatar
OP Senior Member
Flag Brown's Town
Thanks Meter: 860
 
710 posts
Join Date:Joined: Apr 2013
More
Quote:
Originally Posted by shardul.phatak

nice .... will give a shot in free tym ....

thanks a lot

No problem, I hope this will help liven up the place by giving people something to do while they wait on updates.
The Following User Says Thank You to Aceofzeroz For This Useful Post: [ View ]
12th December 2013, 07:48 AM   |  #6  
devilhunter47's Avatar
Senior Member
Flag Kottayam
Thanks Meter: 241
 
869 posts
Join Date:Joined: Jun 2012
More
Awesome!!!

Sent from my MB865 using Tapatalk 2
The Following User Says Thank You to devilhunter47 For This Useful Post: [ View ]
12th December 2013, 11:36 AM   |  #7  
atrix2man's Avatar
Recognized Contributor
Thanks Meter: 388
 
812 posts
Join Date:Joined: Dec 2012
More
Thumbs up
Been up all night porting. Cant get past boot animation D: but its a WIP for me lol great guide!
The Following 2 Users Say Thank You to atrix2man For This Useful Post: [ View ]
12th December 2013, 12:42 PM   |  #8  
Uzayr's Avatar
Senior Member
Flag Chennai
Thanks Meter: 485
 
387 posts
Join Date:Joined: Mar 2013
More
i had been working on porting for a while,
thanks ace, this guide really helped me a lot. and pointed out where i went wrong.

I have successfully ported ROM "X" i shall not name it yet , i'll keep it a suspense until i get the devs permission.
it's just a start for many things, right now i'm working on a few bugs.

thanks again ace for taking your time to share us your knowledge.
The Following 3 Users Say Thank You to Uzayr For This Useful Post: [ View ]
12th December 2013, 03:33 PM   |  #9  
Aceofzeroz's Avatar
OP Senior Member
Flag Brown's Town
Thanks Meter: 860
 
710 posts
Join Date:Joined: Apr 2013
More
Quote:
Originally Posted by Uzayr

i had been working on porting for a while,
thanks ace, this guide really helped me a lot. and pointed out where i went wrong.

I have successfully ported ROM "X" i shall not name it yet , i'll keep it a suspense until i get the devs permission.
it's just a start for many things, right now i'm working on a few bugs.

thanks again ace for taking your time to share us your knowledge.

You're welcome Uza and I'm very happy to hear that! Looking forward to what it is and I'll continue to help where this is concerned. :thumbup:

Sent from the Ace's MB865 using xda-developers app
12th December 2013, 04:35 PM   |  #10  
darth_nihar's Avatar
Senior Member
Flag Vizag
Thanks Meter: 123
 
408 posts
Join Date:Joined: Aug 2013
More
GJ awsm Guide..............

The Following User Says Thank You to darth_nihar For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
atrix 2, how to port rom, port a rom
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes