[Q] Learning to Create ROMs: How Do I Port a ROM from One Device to Another? - Android

So I'm trying my luck at ROM creation and am learning as much as I can. One thing I haven't been able to find through Googling etc is how to port a ROM from one device to another, or more specifically what folders/files need to be replaced in a ROM to make it work on another device?
Appreciate any guidance, thanks guys!
PS I'm using DsiXDa's Kitchen, but it "doesn't support any devices besides HTC devices" and I want to port a ROM to a Dell Streak from an HTC Nexus One. Is it even possible and what files can I manually replace to get it to run?

dcogen said:
So I'm trying my luck at ROM creation and am learning as much as I can. One thing I haven't been able to find through Googling etc is how to port a ROM from one device to another, or more specifically what folders/files need to be replaced in a ROM to make it work on another device?
Appreciate any guidance, thanks guys!
PS I'm using DsiXDa's Kitchen, but it "doesn't support any devices besides HTC devices" and I want to port a ROM to a Dell Streak from an HTC Nexus One. Is it even possible and what files can I manually replace to get it to run?
Click to expand...
Click to collapse
I'm looking at a Streak ROM right now, and it looks fairly standard for Android. I would search for 'vendor tree' and/or 'extract-files.sh' to get an idea about what files and settings you might need. That will get you started. You have to swap kernels, that's a given. You'll probably need a few additional things from a stock Streak ROM, like:
files in:
/system/usr/keychars
/system/usr/keylayout
/system/lib/hw
/system/lib/modules
/system/etc
some libs in /system/lib
Probably a few things from /system/bin and /system/xbin
Look at the *.rc files in both the N1 ROM and the stock Streak ROM. They will call binaries and make changes. It's all tied together and is quite complex for such a 'small' thing... Get ready to do some research and testing and don't expect it to just work right away. If it does, your lucky.
I use WinMerge to compare ROMs all of the time. It will give you clues as to what is needed for the ROM to work on your device. And logcat will also point you in the right direction on occasion

Thanks a bunch gnarlyc!
Least I have a starting point now, going to get to Googling and see what I can figure out. And WinMerge is an awesome tool, thanks for that. I'll post back here if anything. Thanks again!
Anyone else have some information to share as well that could help?
EDIT: How do I get WinMerge to work? I installed it and tried to compare the two .zip files and it just shows jibberish in each window?

dcogen said:
EDIT: How do I get WinMerge to work? I installed it and tried to compare the two .zip files and it just shows jibberish in each window?
Click to expand...
Click to collapse
Well, it shouldn't show gibberish. I have it up right now with two init.desirec.rc files from two different ROMs. It's not going to be able to compare .zips though. Only text files and folders. You'll have to unzip those.
There are other programs that do the same thing, like 'N-way folder compare' and 'Beyond Compare' and plain old 'diff' in Linux or cygwin. Find what works best for you.

gnarlyc said:
It's not going to be able to compare .zips though. Only text files and folders. You'll have to unzip those.
Click to expand...
Click to collapse
I actually found that they have a .zip plugin to allow you to compare .zips and I tried to install it but it just isn't working. When I try to unzip them and just select the unzipped folder it opens it in the selector window instead of just using the folder.
I'll keep messing with it, thanks again for the starting point at least

Related

How to port a ROM?

I put this in the Q&A but it is really a dev question so....
No bashing please, Im just asking for help
-download dsixda's Kitchen
http://forum.xda-developers.com/showthread.php?t=633246
-install/setup the kitchen
-cd to kitchen directory and type ./menu
-type 1 'setup working folder from ROM' and enter, choose the rom you want to port
-when you get back to the menu type 0 for advanced options and choose '19-porting tools', type a for 'port from another device, then move a rom made for the eris and the rom you want to port to the /kitchen/original_update/ directory, and follow the kitchen's prompts.
-once you completed the previous step, open up build.prop located at /kitchen/WORKING_XXXXXX_XXXXXX/system/build.prop and change the name of the device to desirec or eris (Ex. ro.product.device=desirec), and the carrier to Verizon (unless its a rom from a gsm phone, then you have more things to do). After that do the same thing for the update-script at /Kitchen/WORKING_XXXXXX_XXXXXX/META-INF/com/google/android/update-script.
-after that is done go back to the kitchen, hit 0 for advanced settings, type 20 for unpack or repack a boot.img, type w to extract ramdisk, then go to /kitchen/BOOT-EXTRACTED/boot.img-ramdisk/ and change init.heroc.rc (or whatever the devices name is) to init.desirec.rc
-finally get desirec-keypad.kcm.bin, desirec-keypad.kl, and sensors.desirec.so from an eris rom at /system/usr/keychars, /system/usr/keylayout/ and /system/lib/hw respectively, and copy them to the same location in your working folder.
-now go back to the kitchen, type 99, it will build an update.zip that you can flash of your ported rom
homewmt said:
-download dsixda's Kitchen
http://forum.xda-developers.com/showthread.php?t=633246
-install/setup the kitchen
-cd to kitchen directory and type ./menu
-type 1 'setup working folder from ROM' and enter, choose the rom you want to port
-when you get back to the menu type 0 for advanced options and choose '19-porting tools', type a for 'port from another device, then move a rom made for the eris and the rom you want to port to the /kitchen/original_update/ directory, and follow the kitchen's prompts.
-once you completed the previous step, open up build.prop located at /kitchen/WORKING_XXXXXX_XXXXXX/system/build.prop and change the name of the device to desirec or eris (Ex. ro.product.device=desirec), and the carrier to Verizon (unless its a rom from a gsm phone, then you have more things to do). After that do the same thing for the update-script at /Kitchen/WORKING_XXXXXX_XXXXXX/META-INF/com/google/android/update-script.
-after that is done go back to the kitchen, hit 0 for advanced settings, type 20 for unpack or repack a boot.img, type w to extract ramdisk, then go to /kitchen/BOOT-EXTRACTED/boot.img-ramdisk/ and change init.heroc.rc (or whatever the devices name is) to init.desirec.rc
-finally get desirec-keypad.kcm.bin, desirec-keypad.kl, and sensors.desirec.so from an eris rom at /system/usr/keychars, /system/usr/keylayout/ and /system/lib/hw respectively, and copy them to the same location in your working folder.
-now go back to the kitchen, type 99, it will build an update.zip that you can flash of your ported rom
Click to expand...
Click to collapse
Wow thank you! I have messed with the kitchen before but it all seemed kinda confusing when it came to porting
Completely off-topic but, wow, another Nikolai in this forum
NikolaiT said:
Completely off-topic but, wow, another Nikolai in this forum
Click to expand...
Click to collapse
ten char
Look at Froyolicious and SgShultz. I laid out the steps that I took to get them to where they are. The links are in my sig.
And this one -
http://forum.xda-developers.com/showthread.php?t=723319
gnarlyc said:
Look at Froyolicious and SgShultz. I laid out the steps that I took to get them to where they are. The links are in my sig.
And this one -
http://forum.xda-developers.com/showthread.php?t=723319
Click to expand...
Click to collapse
What happens if i port a rom and the wifi doesnt work?
Nikolai2.1 said:
What happens if i port a rom and the wifi doesnt work?
Click to expand...
Click to collapse
The most common issue is that you have the wrong wlan.ko. You need to have the wlan.ko that is compiled against the kernel that you are using. You can also look in build.prop and make sure you are assigning the correct interface. There are also some wpa_* and dhcp* setting in the init.desirec.rc (in the ramdisk part of the boot.img) that might mess you up. I have had one instance where I could never get it working. Apparently, more than one of us is having the same issue right now. Hopefully, someone will figure that out.
I always use WinMerge to compare build.prop, init.devicenamehere.rc, and init.rc to stock Eris versions to try and catch settings that I would miss otherwise. And then rename init.devicenamehere.rc to init.desirec.rc.
gnarlyc said:
The most common issue is that you have the wrong wlan.ko. You need to have the wlan.ko that is compiled against the kernel that you are using. You can also look in build.prop and make sure you are assigning the correct interface. There are also some wpa_* and dhcp* setting in the init.desirec.rc (in the ramdisk part of the boot.img) that might mess you up. I have had one instance where I could never get it working. Apparently, more than one of us is having the same issue right now. Hopefully, someone will figure that out.
I always use WinMerge to compare build.prop, init.devicenamehere.rc, and init.rc to stock Eris versions to try and catch settings that I would miss otherwise. And then rename init.devicenamehere.rc to init.desirec.rc.
Click to expand...
Click to collapse
Wow thanks alot! I will use all this if I ever decide to port something. Lol I was gonna try porting that 2.2 Sense Rom, but it looks like 2 people with experience beat me to it
Nikolai2.1 said:
Wow thanks alot! I will use all this if I ever decide to port something. Lol I was gonna try porting that 2.2 Sense Rom, but it looks like 2 people with experience beat me to it
Click to expand...
Click to collapse
You should still try, even if you don't release it to the public. I have several ROMs that no one has ever seen but me. It's a good way to learn, and I find that it is easier to please me than me + other people. That's not necessarily a good thing, because I wind up not fixing things that I should.
I would like to add something that I have recently learned about the wifi issues. Apparently, in the past, some devs have had success with hex editing any references to the wifi driver that are in libhardware_legacy.so to make them point to wlan.ko instead of whatever driver the ROM has. So far, this hasn't worked with the 2.2 Sense as far as I know, but it's something else to add to the list.
Well I tried porting an Aria Rom, but when i flashed it, it failed..
I dont mean to resurrect a dead thread that i created, but i cant port anything to save my life. GSM or CDMA (in fact, how do you port a GSM rom?)
Help?

[Q] Signing Help ..

Hey all, Well i know we could not wait for a Honeycomb theme, i know i cannot, but heres my conundrum.
I have made a honeycomb keyboard, but cannot get it to install for the life of me, ive used the testkeys, shared, platform, etc (all using Signapktic from Stericson. Does anyone have any clue as to why it will not install?
A few questions that i know you might ask, answered ...
No, there is no other keyboard, other than swype, and samsung keypad..
I made it off of the GB keyboard...
Yes, I have made many of themes, many of changes to Frameworks, and have had sucess installing, and running my custom roms....
My question basically is this, IF POSSIBLE, CAN ANYONE SIGN THE FILES I HAVE TO MAKE THIS WORK? PM ME AND I SHALL SEND THE FILES. CREDIT WILL BE GIVIN, I AM ON THE OTHER HAND GOING TO NEED SOME SORT OF PROOF YOU KNOW WHAT YOUR DOING, I WORKED REAL HARD ON THIS, SO FOR RIGHT NOW ITS PRIVATE, HENSE THE PM.
THANKS AGAIN IN ADVANCE. REMEMBER .. LETS GET THIS HONEYTCOMB GOING
I know that most of the keyboards dont work simply by installing but rather need to be pushed to the data\app or data\app_s folder depending on which rom you are running. You can accomplish this using adb or using a file explorer like RootExplorer.
Thanks
Thank you man, this helps a whole lot. Now do i need to re-sign each apk inside the rom folder? or can i just re-sign the .zip?
georgegreco86 said:
Thank you man, this helps a whole lot. Now do i need to re-sign each apk inside the rom folder? or can i just re-sign the .zip?
Click to expand...
Click to collapse
I'm not sure what .zip you're refering to other than a CWM recovery flashable .zip for you keyboard. If this is what you mean, then use the same signiture (key) you'd find in any of the flashable .zips on the forums. In other words, just copy over the META-INF folder from some other .zip to yours. Of course, you'll want to make sure the update-script in this folder is pointing at the proper directories for installation.
For your apk, you should only need to sign it if you changed the AndroidManifest.xml. Otherwise, just keep the META-INF folder from them original apk.

[Q] APK Creation

Well as many of you know we're over most of the hurdles we needed to jump with the CM7 build for Nook tablet.
Updates for the internal version are simple via CWM, the SD version is not so simple of course.
I'm assuming that it should be possible to built an APK that gains superuser permissions then copies the new files to the system. Can anybody confirm this is possible please?
We need to know that we can tell our SD user that they can update their version just as easy as the internal user
Thanks in advance for your help again everyone!
Well presumably this is how ROM Manager and Metamorph both do their thing, just in a slightly more round about way (as they don't come with the files they need to copy). I'm almost 100% sure this is possible, but I've never tried it personally.
EDIT: Looks like this is how you'd do it: http://developer.android.com/reference/java/io/File.html. Specifically the renameTo() method.
CelticWebSolutions said:
Well as many of you know we're over most of the hurdles we needed to jump with the CM7 build for Nook tablet.
Updates for the internal version are simple via CWM, the SD version is not so simple of course.
I'm assuming that it should be possible to built an APK that gains superuser permissions then copies the new files to the system. Can anybody confirm this is possible please?
We need to know that we can tell our SD user that they can update their version just as easy as the internal user
Thanks in advance for your help again everyone!
Click to expand...
Click to collapse
Well there are about a dozen ways to do this. First of one of the hardest things is comming up with the commands/script. I can defiantly do this. If you want an apk, there are a few guys whom could port my script to an apk. I'm going to make a script here that will format, and create partitions and extract directly from the nook, no need to go through the fancy formatting and such, just go into terminal and run the script. Ill post a prototype for you to have the testers test!
Do you think something like BacksideUpdater inside custom ROM for LG Optimus V?
made by JerryScript
JerryScript i very nice guy, I bet if you ask him, he will let you play with his code
if is it what you looking for
Yes, this is possible. I wrote an app that flashes the recovery partition for my older Froyo phone in the very rudimentary Basic4Android. Copying files under root privileges was part of this process. Fairly easy if you find the right coding examples in whatever your development platform of choice.
xdajunkman said:
Yes, this is possible. I wrote an app that flashes the recovery partition for my older Froyo phone in the very rudimentary Basic4Android. Copying files under root privileges was part of this process. Fairly easy if you find the right coding examples in whatever your development platform of choice.
Click to expand...
Click to collapse
So one of the problems is its not really copying. Its more of an extraction from one place to another. We are required to use dd, and fdisk(for formatting).
GREAT! I was worried updates would be to complicated for people
Sent from my Nook Tablet using xda premium
... and I was worried that I might have to wipe my NT clean again to get the updates. After a week with this wonderful upgrade, I've got a LOT of customization I don't want to lose...
Whoops, wrong button with the thanks. Anyway, it occurs to me you could just have people run a script from a terminal emulator. That would probably be the simplest way to do it. Make an Update folder on the SD card, add it to the PATH by default, and users could just copy over the update files and run the script. Just a thought.
Sycobob said:
Whoops, wrong button with the thanks. Anyway, it occurs to me you could just have people run a script from a terminal emulator. That would probably be the simplest way to do it. Make an Update folder on the SD card, add it to the PATH by default, and users could just copy over the update files and run the script. Just a thought.
Click to expand...
Click to collapse
Has to be simple, something like copy an update.zip onto the SD card then run the apk which will automatically run the update in the zip But my knowledge of such things is limited so I need help there
Same process. With the above method, the user would only have to copy over the file, open a terminal, and type 'update'. With the apk idea you just have to add a little more time for someone to actually write the app (not that it would take too long).
Sycobob said:
Same process. With the above method, the user would only have to copy over the file, open a terminal, and type 'update'. With the apk idea you just have to add a little more time for someone to actually write the app (not that it would take too long).
Click to expand...
Click to collapse
Hmm.... that sounds good.
Anybody know how to actually implement it ?
Dammit, idk why I keep hitting the thanks button thinking it's reply >.>
Anyway, it's just a matter of setting the PATH variable to include /sdcard/Update/ or something similar. To make an actual update, make a folder called Update, fill it with all the files that need to be copied over (probably in a directory structure), and write a script that actually copies everything over. You'll need to make sure sh is in /system/bin (I think it is by default).
You could zip the the files as well, using gunzip (busybox?) to extract them before copying them, then deleting them when you're done, just to keep it cleaner for the user.
The only downside to all this is that I don't know how you would flash a kernel.
Sycobob said:
Dammit, idk why I keep hitting the thanks button thinking it's reply >.>
Click to expand...
Click to collapse
That makes two of us!
Sycobob said:
Anyway, it's just a matter of setting the PATH variable to include /sdcard/Update/ or something similar. To make an actual update, make a folder called Update, fill it with all the files that need to be copied over (probably in a directory structure), and write a script that actually copies everything over. You'll need to make sure sh is in /system/bin (I think it is by default).
You could zip the the files as well, using gunzip (busybox?) to extract them before copying them, then deleting them when you're done, just to keep it cleaner for the user.The only downside to all this is that I don't know how you would flash a kernel.
Click to expand...
Click to collapse
I'm guessing you'd just flash it as usual, surely that one is the easiest? Copying stuff to boot partition would hopefully be just as simple, I was mainly worried about updating system files. I could do with building one for the current update to test the theory!

Looking for a proper order to flash

ok so im loving the svn and superlte and all that, can someone please give me some direction as an order to flash all the different mods and such? i understand different orders for different purposes im just looking to get mine as fast as possible and able to tweak the hell out of everything and . Also a follow up question when checking out and after exporting i add my apps and such what do i gotta do besides zipping up the file to make it flash right? has always i appreciate any feed back anyone can give me
BigTexastrev said:
ok so im loving the svn and superlte and all that, can someone please give me some direction as an order to flash all the different mods and such? i understand different orders for different purposes im just looking to get mine as fast as possible and able to tweak the hell out of everything and . Also a follow up question when checking out and after exporting i add my apps and such what do i gotta do besides zipping up the file to make it flash right? has always i appreciate any feed back anyone can give me
Click to expand...
Click to collapse
Not sure I'm quite up to date on the latest ROM slang lingo, but I'll do my best to provide some insight from a developers point of view.
In regards to creating a ROM .zip, which I think is what is referred to as, "checking out and after exporting I add my apps and such what do i gotta do besides zipping up the file to make it flash right?", the process is fairly generic. The ROM .zip (update.zip) file will be processed and loaded in the custom recovery.
The directions are generally all located in the updater-script file under META-INF/*. If the only action being done is adding apps to /system/app on a ROM .zip which already contains apps in /system/app, nothing should need to be changed in the updater-script file.
If apps are being added to /data/app, but nothing in the ROM currently installs to /data, might need to a copy_recursive to updater-script to make sure the /data directory from the ROM .zip is installed properly.
If there are other questions, the more detailed the links and question, the better we can answer! Hope some of the technical details help resolve the question!

[Q] Making / editing custom ROM's using Linux

I'm looking for a little bit of help with understanding something.
My ideal place to get to is to eventually provide the community here with custom roms and mods which everyone can enjoy on their devices, just like what all the greats devs do here day in day out.... but before I get there, I'm on a path of discovery. At the minute, I want to take a XDA dev's already pre worked ROM, go in to it and change a few things up.... edit the apps, maybe play with a few apks, change the ringtones etc, and then resign the ROM and flash it to my device.
I've been reading some great tutorials such as http://forum.xda-developers.com/showthread.php?t=1801690 and http://forum.xda-developers.com/showthread.php?t=1843506 which I am finding very helpful, however....
They seem to be geared towards someone working on a windows machine. I dont want to do it in Windows, I want to do it in Linux... I dont wish to use "CygWin" and I would rather do it manually than use a kitchen - I could easily follow these guides in Windows and achieve my stated aim of a slightly modified custom ROM, however, the overall goal here is to acquire knowledge, and enjoy the process as it goes along.
Now, my current understanding under Linux (Mint 13) is that I can download a recovery flashable Zip, go in to it, and just change up some of the files as I desire.... but then I get confused when it comes to repackaging the ROM prior to flashing it to my device. How would I go about doing this?
As a side note, when it seems that all development for these devices is done under Linux / Mac... why do all the newb guides steer you to Windows?
Are you asking how to rezip or how to recompile?
If you're asking about zipping up the folder, go here:
http://forum.xda-developers.com/showthread.php?t=1499885
If you're asking about recompiling, it should state how to do so on the page you got the apktool from.
Hi, thanks for your reply. I guess for now what I am asking is how to get the ROM back to a flashable zip file.
The I believe is that you need to have the ROM signed. The windows tutorials point you to a batch file script that does the signing and creates you an "update.zip" file. What id the alternative to this under linux?
Also, in the post you just provided a link to, someone says that you must also edit an update script to reflect the changes you made, such as any apks removed or added etc, where would I find this?
You need signapk.jar which I believe is included in the android sdk if not just Google and you can find it, once you have that you need a key to sign with, again Google for a testkey.
Then in your terminal you would run:
Code:
java -jar signapk.jar certificate.pem key.pk8 your-update.zip your-signed-update.zip
Sent from my PACman GT-I9100 using xda premium
Excellent, thank you very much.. will play with this later

Categories

Resources