[Motorola Atrix 2] Aceofzeroz:
Introduction​

Greetings Atrix 2 community!:cool: 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. :D 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!!!!!!!!!!!:mad:

>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!!!:laugh:

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!:p​

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.:good:

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!:good::cool:

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 :p):

>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!!:cool:

>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!:D:cool: Here it is for all who are interested:Turorial Video, it's 27 minutes of hearing my boring voice so prepare yourselves!:laugh::p

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!!! :D

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!:D