[GUIDE] How to port Stock/GB/CM7/CM9/ICS/CM10/JB Based ROMs [Update: Sept.25.2012]

Search This thread

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
Code:
/*
 * ~ Please READ ME ~
 *
 * I do not guarantee any successful porting. I am not responsible
 * for bricked devices, dead SD cards, or a broken device. [B]YOU[/B] are
 * choosing to make these modifications, and if you point the finger
 * at me for messing up your device, I will laugh at you. But I will try
 * my best to explain all the necessities, so you won't mess up your Device.
 *
 * ~ END OF AGREEMENT ~
 */

Before we start, let's read the Title of this Guide. Notice it says: based
This means, if you do not have a GB/ICS/JB already compiled for your device, then this Guide is useless for you.
Android Source | Compile GB | Compile ICS | Compile JB ~ Thanks dastin1015 |- Building/Compiling - Durations

Before you a port a ROM, make sure you asked permission from the Developer!

This Guide applies the same principle for porting the following: Sense, Lewa OS, JoyOs, MIUI, LiGux OS, etc...

What you'll need:



Notes:
  • I will be referring to the following:
    • BASE = The GB/ICS/JB ROM made for your Device only.
    • PORTED = The ROM you are trying to port from.
  • BASE and PORTED must be the same CPU. e.g. ARMv7, ARMv6, ARMv5
  • You must have the same settings in Notepad++ like mine.
  • Ignore the procedure, if the file or folder is not present!
  • BASE & PORTED should be the same Android version.
  • If you are porting a custom GB ROM, then use a GB BASE, the same goes for ICS and JB
  • Make sure both BASE & PORTED are deodexed (It's hard to port an odexed ROM)
  • Final ROM is inside PORTED Folder
    (Don't get confused! This is a Major change from the previous Guide because this method is a lot faster and easier)



Inside PORTED:​

Remove kernel:
  • boot.img | zImage | kernel.sin | etc...

Remove the following inside /system:
  • cameradata
  • tts
  • usr
  • vendor
  • firmware
  • modules
  • wifi
Now you get 2 options:
  1. Delete bin & xbin & lib folder, but keep libandroid_runtime.so inside /system/lib
  2. Keep bin & xbin & lib folder
Explanation:
  1. If PORTED has no tweaks or addons to those folders.
  2. If PORTED has tweaks and addons.
Remove every folder inside /system/etc except:
  • init.d
  • permissions
  • license

Remove the following inside META-INF:
  • CERT.RSA
  • CERT.SF
  • MANIFEST.MF

Remove: META-INF/com/google/android/update-binary



Inside BASE:​

Move kernel to PORTED:
  • boot.img | zImage | kernel.sin | etc...

Delete libandroid_runtime.so inside /system/lib

Move the following inside /system to PORTED:
(If prompted, select YES to copy and Replace all)
  • cameradata
  • bin
  • lib
  • tts
  • usr
  • vendor
  • firmware
  • modules
  • wifi
  • xbin
(If prompted, select YES to copy and Replace all)

Move everything inside /system/etc
To: PORTED's /system/etc
(If prompted, select YES to copy and Replace all)

Move: META-INF/com/google/android/update-binary
To: PORTED's META-INF/com/google/android/

For ICS & Newer:
Move the following inside /system/media to PORTED's media:

  • LMprec_508.emd
  • PFFprec_600.emd



build.prop​

Inside PORTED:
Open /system/build.prop
Copy & Replace the following:

  • ro.modversion
  • ro.cm.version
  • ro.config.ringtone
  • ro.config.notification_sound
  • ro.config.alarm_alert
  • ro.config.sms_received_sound
  • ro.config.sms_delivered_sound
  • persist.sys.themeId
  • persist.sys.themePackageName
and anything similar to that, to: BASE's build.prop

For MIUI:
Add & Make sure the following values are like this:

  • ro.build.id=MIUI
  • ro.build.display.id=MIUI x.x.x
  • ro.build.version.incremental=x.x.x
  • ro.config.ringtone=MI.ogg

For Lewa OS:
Add & Make sure the following values are like this:

  • ro.build.display.id=LeWa_ROM_DeviceNickname_xx.xx.xx
  • ro.lewa.version=LeWa_ROM_DeviceNickname_xx.xx.xx
  • ro.lewa.device=DeviceNickname
  • ro.lewa.swapper.part_path=PORTED's_Value
  • ro.lewa.swapper.flash_swappiness=PORTED's_Value
  • ro.lewa.swapper.sd_swappiness=PORTED's_Value
  • ro.error.receiver.system.apps=com.lewa.fc
  • ro.error.receiver.default=com.lewa.fc

Make sure the following is for your Device:
  • rild.libpath=
  • rild.libargs=


Inside BASE:
Open /system/build.prop
Highlight from:
ro.build.tags=
to: # ADDITIONAL_BUILD_PROPERTIES
Shown in this picture
Copy & Replace that highlighted part to: PORTED's build.prop's highlighted part

Copy everything from: # ADDITIONAL_BUILD_PROPERTIES
To: the end of the file
Paste it to PORTED's build.prop
Shown in this picture



For XPERIA devices:
The whole build.prop is untidy and filled with tweaks and addons.
To edit an XPERIA build.prop you really just need to use your common sense.
Make sure you follow the above and just decide on your own on what to do ;)



For HTC devices (Sense):
The whole build.prop is filled with tweaks, addons and extra libs values.
To edit an HTC build.prop you really just need to use your common sense.
Make sure you follow the above and just decide on your own on what to do ;)



updater-script​

Inside BASE:
Move the following, to PORTED:
(If prompted, select YES to copy and Replace all)
  • META-INF/com/google/android/update-binary
  • META-INF/com/android/metadata
  • META-INF/com/android/otacert

Open: META-INF/com/google/android/updater-script
Replace the following values, to PORTED:
  • mount("xxxxxx");
  • format("xxxxxx");
  • retouch_binary
  • The installation of the kernel (Something like: assert(package_extract_file("boot.img",)
  • Take note of the added set_perms & set_perm_recursives that PORTED added. Then replace all set_perm and set_perm_recursive from BASE to PORTED. Put back in the noted set_perms & set_perm_recursive you wrote down, to PORTED's updater-script

For ICS & Newer itself:
  • If the updater-script in PORTED is modded to have tweaks & addons do the set_perms procedure above
  • Now use BASE's entire META-INF Folder. Copy it to PORTED


For MIUI v4:
Add the following values to PORTED:
  • set_perm(0, 0, 06755, "/system/xbin/invoke-as");
  • set_perm(0, 0, 0755, "/system/lib/liblbesec.so");


For AROMA Installer:
It's actually too hard & time consuming to explain on how to make the script work on your Device when it came from another.
So it's best to use BASE's META-INF folder, rather than try to make the AROMA Installer work on your Device. (Becuase it will be time consuming)​



Porting from a different Manufacturer​

If you are porting from a different manufacturer like, HTC or Sony, you have to check the kernel from them.


  1. Unpack the kernel from PORTED
  2. Unpack your Device's kernel
  3. Open PORTED's init.rc
  4. Replace the BOOTCLASSPATH from PORTED's init.rc to BASE's init.rc
  5. Compare the two files, and addon to your Kernel's init.rc
  6. Packup/Repack your Kernel



Porting Wallpapers | Lockscreen Wallpapers | bootanimation​

Usually you get a wallpaper/bootanimation that doesn't fit your device. Here's a quick tutorial on how to port it to your device.

Download & Install FreeImageConverter then launch it.
For Wallpapers & Lockscreen Wallpapers:
  1. Click Add Folder... and add the folder were the wallpapers are
  2. Then click Advanced Convert...
  3. Select Exact Size and set the image quality to 100
  4. Set your Width and Height resolutions for your device.
  5. Uncheck Add "Converted by www.freeimageconverter.com"
  6. Select Leave the same file name and leave the Postfix & Prefix empty. Then set your output in a folder.


For bootanimation:
  1. Extract /system/media/bootanimation.zip OR /data/local/bootanimation.zip OR /system/customize/resource/bootanimation.zip (For Oxygen ROM, the bootanimation is built into the framework-res)
  2. Do the steps above
  3. Move the new resized folder(s) into your bootanimation workspace
  4. Edit the desc.txt to match your device resolutions
  5. Zip the contents ( folder_name desc.txt )
  6. Set compression method to Store
  7. Delete the extracted bootanimation files
  8. Make sure this new bootanimation.zip is in PORTED



Logging & DDMS​

This is very important if your a developer in the Android world. These tools help you debug your device to search for errors or see which processes are running.


Tutorial - How to Logcat


Tutorial from Android


If you want me to help you, don't give me a Logcat from ADB. Instead, give me a screenshot of your DDMS.​



Review

  • Make sure you did everything inside PORTED first, then work your way up/down to BASE.
  • Did you replace Kernel?
  • Is libandroid_runtime.so from PORTED?
  • Did you edit the updater-script, format & mount values?
  • Make sure dalvik.vm.heapsize is BASE's value inside build.prop
  • Make sure build.prop is mostly for your Device ;)
  • If the Port doesn't boot, try using your own META-INF folder. But backup the previous








Happy porting! :laugh:
 
Last edited:

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
Frequently Asked Questions

Q: How do you port a higher CPU ROM to my lower CPU device?
A: P.M me or any big-name developers. You must already know what to do. The person you P.M will give you extra info... :cool:

Q: Is it possible to port a lower CPU ROM to my higher CPU device?
A: I think it'll work (But why would you do this:confused:). If it doesn't boot try changing the DPI values in the build.prop

Q: How do I make a bigger DPI ROM work on my smaller DPI device?
A: Resize all PNGs in every app & framework-res using Android Resizer Tool

Q: Can I Port a smaller DPI device to my device?
A: Yes. It probably won't run & it wouldn't look good if you did. The icons would be small or if you resized it, the icons would be blurry.​
 
Last edited:

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
You say that we can use any ROM as BASE but you don't specify what to use as PORT.
Can you please clarify that?
You can port any Rom as long as it's based on CM7/GB/Stock Rom, the same CPU (Armv6, Armv7, Armv5) as your BASE, and it's best to port a Rom from the same manufacturer, if not, you can still do it, just change BOOTCLASSPATH

there is no /data folder in cyanogen mod from galaxy mini.. wat to do now??
i m porting cyano from mini to galaxy y
If there is no data then it's fine to not include it :)

Peteragent5 your arm7 port rom problem solve from this way?:)
Lol. No not yet :p
 

FeralFire

Senior Member
Jan 18, 2012
510
232
I want to port CM7 from LG O2X to Samsung Galaxy R (They both have the same CPU- Tegra 2).
Can I use the official LG O2X CM7 ROM and the stock Galaxy R ROM?
Or should I use the Galaxy S2 CM7 ROM?
 
Last edited:

FeralFire

Senior Member
Jan 18, 2012
510
232
Now open Notepad++ and open the build.prop in PORTED
Also open the build.prop in BASE, so now you have them side by side in the tabs
In PORTED, edit the build.prop to match with your device!

NOW This is very important!
Your
ro.build.description=
and
ro.build.fingerprint=

must be the same same as the build.prop in BASE!

If not, your Rom will not boot!

Save the Build.prop in PORTED and close NotePad++

Why are we editing the build.prop in the PORT, shouldn't we edit it in BASE?
 
  • Like
Reactions: rasenkiba

Reviewers

Senior Member
Mar 5, 2011
4,147
1,671
Brooklyn, NY
I finished this and the ROM won't boot.
I tried the Base as a Sense 3.0 (2.3.4 Gingerbread ROM)
porting a Sense 4.0 (4.0.3 IceCreamSandwich ROM)
 

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
I want to port CM7 from LG O2X to Samsung Galaxy R (They both have the same CPU- Tegra 2).
Can I use the official LG O2X CM7 ROM and the stock Galaxy R ROM?
Or should I use the Galaxy S2 CM7 ROM?
They must both be CM7 :)

Can we port Sense to Gio using this guide? :D
Sense is quite hard, to be honest. I'm still trying to figure out how I should do it ;)

I have a galaxy tab p1010. That have ARM8.

This means that wont work?
As long as both PORTED and BASE is the same CPU, this guide will work.

Why are we editing the build.prop in the PORT, shouldn't we edit it in BASE?
Because. The build.prop in PORTED has more values than than the one in BASE. So if we use BASE's Build.prop, you'd have to copy over everything that was in the PORTED (The extra values, like tweaks and some more stuff) ;)
 

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
I finished this and the ROM won't boot.
I tried the Base as a Sense 3.0 (2.3.4 Gingerbread ROM)
porting a Sense 4.0 (4.0.3 IceCreamSandwich ROM)

Sense is hard to port is you are from a different Manufacturer.
But if you are not, this is what you need to do:
Your BASE needs to be an ICS Base in order to port the Sense 4.0 :)
 

ocovarr112

Senior Member
Feb 23, 2011
468
577
Tepic
Motorola Edge
Because. The build.prop in PORTED has more values than than the one in BASE. So if we use BASE's Build.prop, you'd have to copy over everything that was in the PORTED (The extra values, like tweaks and some more stuff) ;)

Then when you finish your edit on ported you should replace build.prop from PORTED to BASE, isnt¿?

BTW excellent guide!
 
Last edited:

Peteragent5

Senior Member
Jan 1, 2012
1,280
2,028
Richmond
Sense 3.6 (4.0.3) base?
or Pure 4.0.3 base.
Woulden't using Sense 3.6 as a base be good since it's Sense and ICS so is Sense 4.0
Yup. Sense 3.6. As long as both BASE and PORTED are same (4.0.3) :)

Then when you finish your edit on ported you should replace build.prop from PORTED to BASE, isnt¿?

BTW excellent guide!

Yup when you finished build.prop in PORTED, you copy that build.prop into BASE

And your final Rom is BASE
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 462
    Code:
    /*
     * ~ Please READ ME ~
     *
     * I do not guarantee any successful porting. I am not responsible
     * for bricked devices, dead SD cards, or a broken device. [B]YOU[/B] are
     * choosing to make these modifications, and if you point the finger
     * at me for messing up your device, I will laugh at you. But I will try
     * my best to explain all the necessities, so you won't mess up your Device.
     *
     * ~ END OF AGREEMENT ~
     */

    Before we start, let's read the Title of this Guide. Notice it says: based
    This means, if you do not have a GB/ICS/JB already compiled for your device, then this Guide is useless for you.
    Android Source | Compile GB | Compile ICS | Compile JB ~ Thanks dastin1015 |- Building/Compiling - Durations

    Before you a port a ROM, make sure you asked permission from the Developer!

    This Guide applies the same principle for porting the following: Sense, Lewa OS, JoyOs, MIUI, LiGux OS, etc...

    What you'll need:



    Notes:
    • I will be referring to the following:
      • BASE = The GB/ICS/JB ROM made for your Device only.
      • PORTED = The ROM you are trying to port from.
    • BASE and PORTED must be the same CPU. e.g. ARMv7, ARMv6, ARMv5
    • You must have the same settings in Notepad++ like mine.
    • Ignore the procedure, if the file or folder is not present!
    • BASE & PORTED should be the same Android version.
    • If you are porting a custom GB ROM, then use a GB BASE, the same goes for ICS and JB
    • Make sure both BASE & PORTED are deodexed (It's hard to port an odexed ROM)
    • Final ROM is inside PORTED Folder
      (Don't get confused! This is a Major change from the previous Guide because this method is a lot faster and easier)



    Inside PORTED:​

    Remove kernel:
    • boot.img | zImage | kernel.sin | etc...

    Remove the following inside /system:
    • cameradata
    • tts
    • usr
    • vendor
    • firmware
    • modules
    • wifi
    Now you get 2 options:
    1. Delete bin & xbin & lib folder, but keep libandroid_runtime.so inside /system/lib
    2. Keep bin & xbin & lib folder
    Explanation:
    1. If PORTED has no tweaks or addons to those folders.
    2. If PORTED has tweaks and addons.
    Remove every folder inside /system/etc except:
    • init.d
    • permissions
    • license

    Remove the following inside META-INF:
    • CERT.RSA
    • CERT.SF
    • MANIFEST.MF

    Remove: META-INF/com/google/android/update-binary



    Inside BASE:​

    Move kernel to PORTED:
    • boot.img | zImage | kernel.sin | etc...

    Delete libandroid_runtime.so inside /system/lib

    Move the following inside /system to PORTED:
    (If prompted, select YES to copy and Replace all)
    • cameradata
    • bin
    • lib
    • tts
    • usr
    • vendor
    • firmware
    • modules
    • wifi
    • xbin
    (If prompted, select YES to copy and Replace all)

    Move everything inside /system/etc
    To: PORTED's /system/etc
    (If prompted, select YES to copy and Replace all)

    Move: META-INF/com/google/android/update-binary
    To: PORTED's META-INF/com/google/android/

    For ICS & Newer:
    Move the following inside /system/media to PORTED's media:

    • LMprec_508.emd
    • PFFprec_600.emd



    build.prop​

    Inside PORTED:
    Open /system/build.prop
    Copy & Replace the following:

    • ro.modversion
    • ro.cm.version
    • ro.config.ringtone
    • ro.config.notification_sound
    • ro.config.alarm_alert
    • ro.config.sms_received_sound
    • ro.config.sms_delivered_sound
    • persist.sys.themeId
    • persist.sys.themePackageName
    and anything similar to that, to: BASE's build.prop

    For MIUI:
    Add & Make sure the following values are like this:

    • ro.build.id=MIUI
    • ro.build.display.id=MIUI x.x.x
    • ro.build.version.incremental=x.x.x
    • ro.config.ringtone=MI.ogg

    For Lewa OS:
    Add & Make sure the following values are like this:

    • ro.build.display.id=LeWa_ROM_DeviceNickname_xx.xx.xx
    • ro.lewa.version=LeWa_ROM_DeviceNickname_xx.xx.xx
    • ro.lewa.device=DeviceNickname
    • ro.lewa.swapper.part_path=PORTED's_Value
    • ro.lewa.swapper.flash_swappiness=PORTED's_Value
    • ro.lewa.swapper.sd_swappiness=PORTED's_Value
    • ro.error.receiver.system.apps=com.lewa.fc
    • ro.error.receiver.default=com.lewa.fc

    Make sure the following is for your Device:
    • rild.libpath=
    • rild.libargs=


    Inside BASE:
    Open /system/build.prop
    Highlight from:
    ro.build.tags=
    to: # ADDITIONAL_BUILD_PROPERTIES
    Shown in this picture
    Copy & Replace that highlighted part to: PORTED's build.prop's highlighted part

    Copy everything from: # ADDITIONAL_BUILD_PROPERTIES
    To: the end of the file
    Paste it to PORTED's build.prop
    Shown in this picture



    For XPERIA devices:
    The whole build.prop is untidy and filled with tweaks and addons.
    To edit an XPERIA build.prop you really just need to use your common sense.
    Make sure you follow the above and just decide on your own on what to do ;)



    For HTC devices (Sense):
    The whole build.prop is filled with tweaks, addons and extra libs values.
    To edit an HTC build.prop you really just need to use your common sense.
    Make sure you follow the above and just decide on your own on what to do ;)



    updater-script​

    Inside BASE:
    Move the following, to PORTED:
    (If prompted, select YES to copy and Replace all)
    • META-INF/com/google/android/update-binary
    • META-INF/com/android/metadata
    • META-INF/com/android/otacert

    Open: META-INF/com/google/android/updater-script
    Replace the following values, to PORTED:
    • mount("xxxxxx");
    • format("xxxxxx");
    • retouch_binary
    • The installation of the kernel (Something like: assert(package_extract_file("boot.img",)
    • Take note of the added set_perms & set_perm_recursives that PORTED added. Then replace all set_perm and set_perm_recursive from BASE to PORTED. Put back in the noted set_perms & set_perm_recursive you wrote down, to PORTED's updater-script

    For ICS & Newer itself:
    • If the updater-script in PORTED is modded to have tweaks & addons do the set_perms procedure above
    • Now use BASE's entire META-INF Folder. Copy it to PORTED


    For MIUI v4:
    Add the following values to PORTED:
    • set_perm(0, 0, 06755, "/system/xbin/invoke-as");
    • set_perm(0, 0, 0755, "/system/lib/liblbesec.so");


    For AROMA Installer:
    It's actually too hard & time consuming to explain on how to make the script work on your Device when it came from another.
    So it's best to use BASE's META-INF folder, rather than try to make the AROMA Installer work on your Device. (Becuase it will be time consuming)​



    Porting from a different Manufacturer​

    If you are porting from a different manufacturer like, HTC or Sony, you have to check the kernel from them.


    1. Unpack the kernel from PORTED
    2. Unpack your Device's kernel
    3. Open PORTED's init.rc
    4. Replace the BOOTCLASSPATH from PORTED's init.rc to BASE's init.rc
    5. Compare the two files, and addon to your Kernel's init.rc
    6. Packup/Repack your Kernel



    Porting Wallpapers | Lockscreen Wallpapers | bootanimation​

    Usually you get a wallpaper/bootanimation that doesn't fit your device. Here's a quick tutorial on how to port it to your device.

    Download & Install FreeImageConverter then launch it.
    For Wallpapers & Lockscreen Wallpapers:
    1. Click Add Folder... and add the folder were the wallpapers are
    2. Then click Advanced Convert...
    3. Select Exact Size and set the image quality to 100
    4. Set your Width and Height resolutions for your device.
    5. Uncheck Add "Converted by www.freeimageconverter.com"
    6. Select Leave the same file name and leave the Postfix & Prefix empty. Then set your output in a folder.


    For bootanimation:
    1. Extract /system/media/bootanimation.zip OR /data/local/bootanimation.zip OR /system/customize/resource/bootanimation.zip (For Oxygen ROM, the bootanimation is built into the framework-res)
    2. Do the steps above
    3. Move the new resized folder(s) into your bootanimation workspace
    4. Edit the desc.txt to match your device resolutions
    5. Zip the contents ( folder_name desc.txt )
    6. Set compression method to Store
    7. Delete the extracted bootanimation files
    8. Make sure this new bootanimation.zip is in PORTED



    Logging & DDMS​

    This is very important if your a developer in the Android world. These tools help you debug your device to search for errors or see which processes are running.


    Tutorial - How to Logcat


    Tutorial from Android


    If you want me to help you, don't give me a Logcat from ADB. Instead, give me a screenshot of your DDMS.​



    Review

    • Make sure you did everything inside PORTED first, then work your way up/down to BASE.
    • Did you replace Kernel?
    • Is libandroid_runtime.so from PORTED?
    • Did you edit the updater-script, format & mount values?
    • Make sure dalvik.vm.heapsize is BASE's value inside build.prop
    • Make sure build.prop is mostly for your Device ;)
    • If the Port doesn't boot, try using your own META-INF folder. But backup the previous








    Happy porting! :laugh:
    90
    Frequently Asked Questions

    Q: How do you port a higher CPU ROM to my lower CPU device?
    A: P.M me or any big-name developers. You must already know what to do. The person you P.M will give you extra info... :cool:

    Q: Is it possible to port a lower CPU ROM to my higher CPU device?
    A: I think it'll work (But why would you do this:confused:). If it doesn't boot try changing the DPI values in the build.prop

    Q: How do I make a bigger DPI ROM work on my smaller DPI device?
    A: Resize all PNGs in every app & framework-res using Android Resizer Tool

    Q: Can I Port a smaller DPI device to my device?
    A: Yes. It probably won't run & it wouldn't look good if you did. The icons would be small or if you resized it, the icons would be blurry.​
    9
    Updated the Guide! GO READ! It looks better when I was editing it... :S
    LOL :laugh:
    7
    You say that we can use any ROM as BASE but you don't specify what to use as PORT.
    Can you please clarify that?
    You can port any Rom as long as it's based on CM7/GB/Stock Rom, the same CPU (Armv6, Armv7, Armv5) as your BASE, and it's best to port a Rom from the same manufacturer, if not, you can still do it, just change BOOTCLASSPATH

    there is no /data folder in cyanogen mod from galaxy mini.. wat to do now??
    i m porting cyano from mini to galaxy y
    If there is no data then it's fine to not include it :)

    Peteragent5 your arm7 port rom problem solve from this way?:)
    Lol. No not yet :p
    6
    Added a FAQ section in 2nd post!