[HOWTO] Cook your custom rom for LG P500 - Optimus One, P500 Android Development

Hi there, we are going to use excellent dsixda's HTC Android Kitchen to cook our custom ROMs for LG P500. The list of the things we are going to need:
Original ROM (Check this thread)
LG Utils 0.4.2 (Check this URL)
DzDecryptor v1.0b(Check this thread)
Cygwin (Check this URL
Unyaffsmbn (Check this thread)
Dsixda's HTC Android Kitchen (Check this thread)
Note: I have a "romcooking" folder on my home (C:\Users\Patricio\romcooking), inside i have all the utils needed, and the .kdz file for the stock ROM. I recommend to use tab to complete filenames since they are too long.
First we need to get a dz from the kdz (original firmware), extract LG Utils 0.4.2 and open KP500-Utils-EN.exe (You need to run this as administrator, or else you are getting an empty .cab file), select the I option (Extract files from KDZ file), and type the route to your .kdz file (Mine is C:\Users\Patricio\romcooking\V10A_00.kdz). Now, you must have a V10A_00.cab (Or another name, it depends on the stock rom you downloaded), open it with a extractor like 7zip or similar and extract the file "LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" or similar to our romcooking folder.
Then we are going to uncompress the .dz with DZDecrypt (Press Win + R, type cmd and enter, then you cd to the folder where DzDecrypt is located (ex:
Code:
cd C:\Users\Patricio\romcooking\DZDecryptor_v1.0b
then we type:
Code:
DZDecrypt.exe "C:\Users\Patricio\romcooking\LGP500AT-00-V10a-EUR-XX-SEP-25-2010+0.dz" C:\Users\Patricio\romcooking\stockrom
This is going to create a "stockrom" folder in our original romcooking folder, you are going to see a lot of files in the stockrom folder, the important ones are boot.img and system.mbn (DZDecrypt should have merged your system.mbn_0, system.mbn_1 and system.mbn_2)
We need to install cygwin, open the setup.exe, just keep hitting next until you are on the select packages screen, go to "Devel" menu and select to install gcc, gdb and make, in "Interpreters" check perl, in "Archive" check zip and unzip, in "Web" check wget, in "Editors" check nano and vim and in "Utils" select cpio, util-linux and ncurses. Make some tea and wait for the cygwin install to finish and we are ready to go to the next step.
We are going to compile unyaffsmbn, copy the extracted files from unyaffsmbn, system.mbn and boot.img to C:\cygwin\home\Patricio, now fire up cygwin and compile unyaffsmbn with:
Code:
gcc -o unyaffsmbn unyaffsmbn.c
Now uncompress system.mbn, delete symlinks of bin/ and zip everything with:
Code:
mkdir system
cd system
../unyaffsmbn.exe ../system.mbn
find bin -type l -exec rm {} +
cd ..
zip -r stockrom.zip boot.img system/
We are ready to go to the kitchen (We have a stockrom.zip on C:\cygwin\home\Patricio, remember that)
Now we are going to use dsixda's HTC Android Kitchen, we need to have installed JDK. After we have downloaded and uncompressed the kitchen (Mine is in C:\cygwin\home\Patricio\kitchen), we need to put the ziped file we got in the previous step into the original_update folder of the kitchen. We are ready to go! fire up cygwin and cd to the kitchen location and exec ./menu , select option 1, you should see the zip file, put the number of it, and you are ready to go (It will create a WORKING_XXXXXX_XXXXXX folder, you can modify the files in WORKING_XXXX_XXXXX/system, add APKs, modify the apns file, etc).
This command also gives us a lot of options for our rom: enable root, add busybox, deodex our files, zipalign, etc. If you are going to edit text files, use an editor like Notepad++ or any other program that can open/edit/save files in linux compliant style. It's pretty easy to use the kitchen, just check the official thread for options or help
The common options i use are:
Add root permission (option 2), press f when asked and you are done
Add Busybox
Change name of the rom, easy cake
Advanced options, press 0
Add /data/app functionality
Add Apps2SD
Add custom boot animation functionality
Deodex files in your ROM
And Finally: Zipalign all *.apk files to optimize RAM usage
That should do the trick, when you are ready to cook your rom, just type 99, wait for it to build and it should be in the OUTPUT_ZIP folder in your kitchen folder.
Took info from this thread (About decompressing .dz and .mbn, and making it to work with the kitchen), and info from ruigui and tritant in this thread. The awesome android kitchen by dsixda. Sorry if i forgot to mention any work, just post it or pm me
If you have anything you want to add to the guide, just post it

You don't need to dual boot to linux. It can be done with cygwin.
When you follow dsixda's guide to install kitchen, do as said but don't install cygwin from that guide.
Instead, download from official site, choose default options, but add these packages (it will be compliant with kitchen and give a little extra funcionality):
Devel: gcc, gdb, make
Interpreters: perl
Utils: cpio, util-linux, ncurses
Archive: zip, unzip
Web: wget
Editors: vi, nano
Good guide, nicely done
EDIT:
In my wife's machine (using windows 7 64bit. i'm without computer, for now....), i've installed cygwin as said above.
Then added two folders to my home dir:
kitchen and unyaffsmbn
In kitchen, use the kitchen
In unyaffsmbn, copy the files from unyaffsmbn.zip to that dir, then compile it there
EDIT2:
If you edit text files under windows, USE NOTEPAD++, or any other program that can open/edit/save files in linux compliant style.
There are differences in Windows and Linux when ENTER is pressed, and you'll have issues when trying to flash or run your custom ROM

hi there... thanks a lot for your guide.
I'm trying to do the things you wrote step by step... I have extracted the dz file successfully, then I extracted the content using DZDecrypter... I found three files called system.mbn0, system.mbn1 and system.mbn2. The first and second are 80 Mbytes, the third just 17... Which one is the correct? When I try to use the command "unyaffsmbn system.mbn" (obviously I renamed the first and then the second) I get an error message ("impossible to execute binary file", or somenthing like that... I don't know how's in english because I'm italian).. Is that concerning to the presence of those three different files? Did somethind go wrong with the extracting process? Or maybe I didn't do somenthing important? Before doing this, I installed "build-essential" and did "gcc -o unyaffsmbn unyaffs.h" but apparently nothing happend... I got neither errors nor processes...
can you help me?

Awesome bro, I can try to make custom rom with indian version, ty.

vinnux said:
hi there... thanks a lot for your guide.
I'm trying to do the things you wrote step by step... I have extracted the dz file successfully, then I extracted the content using DZDecrypter... I found three files called system.mbn0, system.mbn1 and system.mbn2. The first and second are 80 Mbytes, the third just 17... Which one is the correct? When I try to use the command "unyaffsmbn system.mbn" (obviously I renamed the first and then the second) I get an error message ("impossible to execute binary file", or somenthing like that... I don't know how's in english because I'm italian).. Is that concerning to the presence of those three different files? Did somethind go wrong with the extracting process? Or maybe I didn't do somenthing important? Before doing this, I installed "build-essential" and did "gcc -o unyaffsmbn unyaffs.h" but apparently nothing happend... I got neither errors nor processes...
can you help me?
Click to expand...
Click to collapse
you shouldn't get three system.mbn files, did you used the 1.0b of DzDecryptor? when i used it, it said something about merging, i think that it gets the three files and then combines them to get a proper system.mbn

I used the downloaded version from the link you posted. At least I guess... :/ Well I'm going to try again soon! Thanks a lot again for your guide!
Sent from my LG-P500 using XDA App

Other methode for exctract mbn file, not need to connect the phone.
Windows only....
(1) Download LG-Utils 0.4.2: http://www.assembla.com/spaces/ks360...tils-0.4.2.zip
(2) Run KP500-Utils-EN.exe (or whatever language you prefer out of the available choices) and select I to extract the KDZ.
(3) Open the resulting CAB file and extract the DZ file.
(4) Download DZExtract: http://www.frenchcoder.com/upload/DZExtract-V0.2.zip
(5) Use DZExtract to extract the MBN files:
DZExtract -x GW620RAT-V10c-OCT-21-2009-RGS-CA_DZ+0.dz C:\extractedTo\

after compiling and chmod I do:
Code:
[email protected]:~/work/unyaffsmbn$ unyaffsmbn system.mbn
unyaffsmbn: command not found
both files are in that folder. Am I doing anything wrong?
Cheers.
@tritant - LG-Utils link not working

So.... You MUST compile unyaffsmbn first. Only then you'll have an "executable".
Code:
gcc unyaffsmbn.c -o unyaffsmbn
Then copy system.mbn to unyaffsmbn folder.
After that, do:
Code:
cd PATH_TO_UNYAFFSMBN
./unyaffsmbn system.mbn
You missed the ./
You can download lg utils from here

tuxcomputing said:
after compiling and chmod I do:
Code:
[email protected]:~/work/unyaffsmbn$ unyaffsmbn system.mbn
unyaffsmbn: command not found
both files are in that folder. Am I doing anything wrong?
Cheers.
@tritant - LG-Utils link not working
Click to expand...
Click to collapse
'course I compiled
of course your method worked and the one in the first post didn't...

exist only a windows version of dzextract?

ioshi said:
exist only a windows version of dzextract?
Click to expand...
Click to collapse
couldn't find a linux version, sorry.
btw, i'm rewriting the guide, hope to update it soon

please add the compiling method from ruigui (in the previous page). For some reason that's the only way I was able to compile on Ubuntu 10.
Cheers

It was a typo in first post (he switched file to be used in gcc).
Give the man some time to reorganize his thread

I did not mean to be rude by any means!
I appreciate the effort to create the how-to! Hopefully people will read the thread if they get stuck and use the right commands so that they don't abandon the idea of creating their own ROM

I also didnt want to call you rude... Sorry...
But we were exhanging some pms and he is redoing this tutorial.
Sometimes we make mistakes while typing long posts

installation aborted
thanks for this great tutorial
everything works like a charm , but when i flash my new rom i have an error says no enough space while writing boot image
any idea?
Update: okay i solved the problem, it seems that i missed up with the boot settings!

I finally made the zip file, but when I start the kitchen and select it, i find this:
"Warning: No META-INF folder found under working folder!
Warning: No META-INF/com/google/android folder found, creating it.
Did not find an update-script. Shall I create one (y/n)? (default: y): "
is that normal? and what should I do? :/

vinnux said:
I finally made the zip file, but when I start the kitchen and select it, i find this:
"Warning: No META-INF folder found under working folder!
Warning: No META-INF/com/google/android folder found, creating it.
Did not find an update-script. Shall I create one (y/n)? (default: y): "
is that normal? and what should I do? :/
Click to expand...
Click to collapse
yes this is normal, i got that warning, and i entered "yes" to create one, and everything went just fine!
good luck

For me, work with wine on linux mandriva 2010.2
[[email protected] rootlg]$ wine DZDecrypt.exe "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz" rom
DZ-Decryptor v1.0b *ALPHA RELEASE* by BIGB0SS from COPS.
[■] Opening file "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz".
[■] Allocated memory: 280 Mo.
[■] Unpacking informations:
- Unpacking "amss.mbn" (Packed:008D2935 - Unpacked:010F6000).
- Unpacking "partition.mbn" (Packed:000000E9 - Unpacked:00000390).
- Unpacking "qcsblhd_cfgdata.mbn" (Packed:00000240 - Unpacked:00002534).
- Unpacking "qcsbl.mbn" (Packed:00007D88 - Unpacked:0000DFF0).
- Unpacking "oemsblhd.mbn" (Packed:00000026 - Unpacked:00000028).
- Unpacking "oemsbl.mbn" (Packed:0002C637 - Unpacked:0005EFB4).
- Unpacking "amsshd.mbn" (Packed:00000028 - Unpacked:00000028).
- Unpacking "appsboothd.mbn" (Packed:00000022 - Unpacked:00000028).
- Unpacking "appsboot.mbn" (Packed:00008A6F - Unpacked:0000D484).
- Unpacking "boot.img" (Packed:00385B3F - Unpacked:0038A800).
- Unpacking "system.mbn_0" (Packed:0307280E - Unpacked:05000000).
- Merging "system.mbn_1" (Packed:028EAA5A - Unpacked:05000000).
- Merging "system.mbn_2" (Packed:00738F81 - Unpacked:01003F40).
- Unpacking "recovery.img" (Packed:003BE683 - Unpacked:003C3800).
- Unpacking "splash.img" (Packed:00001C3A - Unpacked:0004B000).
[■] SubFiles: 0x780C3E84. (DzCreator)
[■] Closing file "LGP500AT-00-V10b-EUR-XX-OCT-01-2010+0-DZ.dz".

Related

Extracting files from KDZ

HI,
I am trying to get an apk from a KDZ file. I can open up the KDZ but then there are many other files inside. I guess the apks are in one of these other files. Does anyone know how to get the apk from within .img files etc?
Thanks
ballandbiscuit said:
HI,
I am trying to get an apk from a KDZ file. I can open up the KDZ but then there are many other files inside. I guess the apks are in one of these other files. Does anyone know how to get the apk from within .img files etc?
Thanks
Click to expand...
Click to collapse
How you extracted KDZ?
Why don't you get it from the sapps module zip on void's rom?
I need a particular app from the Orange UK ROM - the app is called Signal Boost and it is for UMA calling.
Is that app in the ROM you mention?
What you need is this: http://forum.xda-developers.com/showpost.php?p=6303911&postcount=827
It allows you to decompress system.mbn (where all the files are).
Compile it under linux, or use cygwin.
Remember that official ROMs are odexed. If you want to deodex apks, you can use dsixda's excelent kitchen. It is used to make lots of ROMs you see around here.
For that, take a look here (you can also use it under cygwin):
http://forum.xda-developers.com/showthread.php?t=633246
If you understand portuguese, or use a translator, check these:
http://www.androidpt.com/index.php?option=com_kunena&func=view&catid=97&id=91547&Itemid=30
http://www.androidpt.com/index.php?option=com_kunena&func=view&catid=97&id=97416&Itemid=30
Most info was gathered from xda forums, only translated and organized to portuguese folks.
Many thanks, I will see if I can get anywhere with this.
You just need to compile unyaffsmbn (gcc unyaffsmbn.c -o unyaffsmbn).
Then copy system.mbn to unyaffsmbn folder. Then do:
./unyaffsmbn system.mbn
You'll have all files extracted in few seconds.
Then if you want to use those files in kitchen, do this:
First install kitchen, as explained in link i posted above.
Delete all symlinks in bin/ (i think there are 52)
Then you must create a zip file with this structure:
/boot.img
/system/ (here you put all the files you extracted. You should have 10 folders and 1 file)
Now just copy this zip to PATH_TO_KITCHEN/original_update/
Then run it with:
cd PATH_TO_KITCHEN
./menu
Right I have three system.mbn files named:
system.mbn_0
system.mbn_1
system.mbn_2
I have tried a few tools (under Windows) to extract them. Firstly a windows compiled version of unyaffs which falls over with : Exception: STATUS_ACCESS_VIOLATION at eip=61100F73
I then tried another version which didn't error but also didn't do anything!
A different tool errored with "the header states that its binary is longer than the whole file" which makes me think perhaps these three files need combining into one?
I have tried combining them into one file using the copy /b command in Windows which creates a single large file but I still have the same issues trying to unpack it.
Any more ideas? Thanks
Right have now installed Cygwin and managed to extract the files using unyaffsmbn! Thanks for all your help, learnt a lot today!
Right I have three system.mbn files named:
system.mbn_0
system.mbn_1
system.mbn_2
Click to expand...
Click to collapse
How did you decompress kdz? I use LG Utils to extract to dz, then dzdecryptor to decompress dz to individual files. Then i use the tools i named to do the rest of it.
Also i can see that lg utils finds those system*, but puts them together before it ends. Maybe you used different software.
Anyway, i'm glad you managed to work it out
I have tried a few tools (under Windows) to extract them. Firstly a windows compiled version of unyaffs which falls over with : Exception: STATUS_ACCESS_VIOLATION at eip=61100F73
Click to expand...
Click to collapse
There is unyaffs, and unyaffsmbn. unyaffs also never worked with me.
I've read somewhere that with lg roms we must use unyaffsmbn. Don't remember were i saw it, neither why...
I used LG utils to extract the KDZ, then used DZExtract to expand the .dz file. Then I combined the system.mbn_0,1,2 files using copy /b.
I then used Cygwin and gcc to make unyaffsmbn.exe which then worked on the combined system.mbn file. Managed to get the apk I needed too.
PLease upload unyaffsmbn.exe for me please as i seriously need it.
Here you go...

[Q] Customized ROM

Is there a guide how to put your own apps in system\app??
i tried searching closes to this is a kitchen but i'm having some problems understanding it...
if there is a guide please do paste some links i want to learn how to edit and personalize the best roms that the devs here has created
thanks in advance
sorry this is not an answer but i know what you mean.. i tried just putting the apk in the app folder than zipping and signing the rom but the app never installs on boot... so please someone answer this question.. lol
Its pretty simple, all you have to do is
Unzip ROM, remove APK(s) from /system/app, add APK(s) to /system/app (or /data/app if you want them to be removable), rezip ROM, flash it.
but heres a more indepth explanation:http://www.askabouthugo.com/mobile-technology/how-to-remove-unused-android-apps-from-custom-rom/
heres another good link:
http://forum.xda-developers.com/showthread.php?t=639726
I strongly recommended installing dsxidia's rom kitchen, probably the best kitchen for customizing roms.http://forum.xda-developers.com/showthread.php?t=633246
Thanks for your answer... ill check it out,
i tried installing the ROM Kitchen but i cant get it running...
i wonder why...
im using windows 7 64bit...
when i run the icon on my desktop the cmd quickly appears and disappears
i tried to edit the batch file... added pause just so i could see the error message
'bash' is not a recognized as an internal or external command, operable program or batch file.
i check the location of what this batch file was trying to call
nothings under the bin on the installation path
any suggestions? ^_^
marchking said:
i tried installing the ROM Kitchen but i cant get it running...
i wonder why...
im using windows 7 64bit...
when i run the icon on my desktop the cmd quickly appears and disappears
i tried to edit the batch file... added pause just so i could see the error message
'bash' is not a recognized as an internal or external command, operable program or batch file.
i check the location of what this batch file was trying to call
nothings under the bin on the installation path
any suggestions? ^_^
Click to expand...
Click to collapse
some apps can be put in data/app folder instead of system/app
ldrifta said:
some apps can be put in data/app folder instead of system/app
Click to expand...
Click to collapse
some apps can be put in data/app folder instead of system/app
well my real issue is i want to fix some bugs with froyo by laszlo... which seems that the applications installed in sd - ext or external disappears when usb mass storage is used... im not completely sure that the usb mass storage is the one that triggers the bug... but what im thinking of is putting the apps that i want in system/app... coz when the bug happens it seems like it on safe mode only system apps are running then the app that are in data/app disappears
marchking said:
i tried installing the ROM Kitchen but i cant get it running...
i wonder why...
im using windows 7 64bit...
when i run the icon on my desktop the cmd quickly appears and disappears
i tried to edit the batch file... added pause just so i could see the error message
'bash' is not a recognized as an internal or external command, operable program or batch file.
i check the location of what this batch file was trying to call
nothings under the bin on the installation path
any suggestions? ^_^
Click to expand...
Click to collapse
Did you install exactly as instructed? Did you install jdk before you installed cygwin as instructed? Did you follow the kitchen.readme in the cygwin file when setting up cygwin? I say reinstall it but make sure you do every step correctly.
Sent from my COS-DS using XDA App
maximo360 said:
Did you install exactly as instructed? Did you install jdk before you installed cygwin as instructed? Did you follow the kitchen.readme in the cygwin file when setting up cygwin? I say reinstall it but make sure you do every step correctly.
Sent from my COS-DS using XDA App
Click to expand...
Click to collapse
i did follow the instructions carefully...
im not sure why nothing gets installed on the cygwin folder...
if i check the files inside the folder nothings there...
ill try to install it again tomorrow once i get home from work...
marchking said:
i did follow the instructions carefully...
im not sure why nothing gets installed on the cygwin folder...
if i check the files inside the folder nothings there...
ill try to install it again tomorrow once i get home from work...
Click to expand...
Click to collapse
theres 2 kitchen.readme's one in the kitchen , and one in the cgywin.zip you downloaded, when installing cygwin, follow the directions in the kitch.readme in the cygwin.zip
this is what mine says:
1) Unzip the contents of this archive
2) Run Setup.exe
3) Select "Install from Local Directory"
4) The root directory can be C:\Cygwin if you want, but ensure there are NO SPACES in the folder name
5) Local Package Directory *must* be the path to the cygwin_packages folder that you just extracted
6) When it shows all the package names, go to the top and select "All <-> Default" until it changes to "All <-> Install" (you must click on the arrows)
7) Click on Next and it will install everything you need for the Android Kitchen
This Cygwin installation includes the following packages, required for the kitchen to work:
* Devel / gcc
* Interpreters / perl
* Utils / cpio
* Utils / util-linux
* Utils / ncurses
* Archive / zip
* Archive / unzip
* Web / wget
Also, dont forget to rename the dsxidia folder to "kitchen", makes things easier.
maximo360 said:
theres 2 kitchen.readme's one in the kitchen , and one in the cgywin.zip you downloaded, when installing cygwin, follow the directions in the kitch.readme in the cygwin.zip
this is what mine says:
1) Unzip the contents of this archive
2) Run Setup.exe
3) Select "Install from Local Directory"
4) The root directory can be C:\Cygwin if you want, but ensure there are NO SPACES in the folder name
5) Local Package Directory *must* be the path to the cygwin_packages folder that you just extracted
6) When it shows all the package names, go to the top and select "All <-> Default" until it changes to "All <-> Install" (you must click on the arrows)
7) Click on Next and it will install everything you need for the Android Kitchen
This Cygwin installation includes the following packages, required for the kitchen to work:
* Devel / gcc
* Interpreters / perl
* Utils / cpio
* Utils / util-linux
* Utils / ncurses
* Archive / zip
* Archive / unzip
* Web / wget
Also, dont forget to rename the dsxidia folder to "kitchen", makes things easier.
Click to expand...
Click to collapse
yeah ive followed carefully the instructions...
but im getting bothered with this part
6) When it shows all the package names, go to the top and select "All <-> Default" until it changes to "All <-> Install" (you must click on the arrows)
when i click on it it changes to install then click again uninstall then default then something else... i made sure that install is selected...
still nothing gets installed in the cygwin folder... there are folders there but under bin and other folders not much is there...
btw i was wondering where i should put the dsxidia kitchen folder?
maximo360 said:
theres 2 kitchen.readme's one in the kitchen , and one in the cgywin.zip you downloaded, when installing cygwin, follow the directions in the kitch.readme in the cygwin.zip
this is what mine says:
1) Unzip the contents of this archive
2) Run Setup.exe
3) Select "Install from Local Directory"
4) The root directory can be C:\Cygwin if you want, but ensure there are NO SPACES in the folder name
5) Local Package Directory *must* be the path to the cygwin_packages folder that you just extracted
6) When it shows all the package names, go to the top and select "All <-> Default" until it changes to "All <-> Install" (you must click on the arrows)
7) Click on Next and it will install everything you need for the Android Kitchen
This Cygwin installation includes the following packages, required for the kitchen to work:
* Devel / gcc
* Interpreters / perl
* Utils / cpio
* Utils / util-linux
* Utils / ncurses
* Archive / zip
* Archive / unzip
* Web / wget
Also, dont forget to rename the dsxidia folder to "kitchen", makes things easier.
Click to expand...
Click to collapse
got it fixed! yeah!
the problem was...
when i extracted the files...
5) Local Package Directory *must* be the path to the cygwin_packages folder that you just extracted
ok its there...
but the when i open the cygwin_packages folder there is another folder containing all the things it needs...
i cut those things and moved it to cygwin_packages folder
before it was like cygwin_packages/$#@%^dsakjdgaskd%[email protected]#%^ folder
Time to cook! ^_^
marchking said:
Time to cook! ^_^
Click to expand...
Click to collapse
glad to hear it worked

[Guide]How to Port roms to your mobile

This guide will help you in porting ROM's to different devices. Although it my not work 100% of the time, it should you show the steps involved in porting a ROM but also which files are important to a device's functionality.
Some handy tools to have before starting:
- The Android SDK, this contains ADB logcat which is a hugely important tool in ROM development. It lets us know what is perhaps causing an app to F/C or a ROM to bootloop. See our guide on how to set this up HERE
- Notepad++ , very useful for altering scripts.
- Patience, getting ports to boot can sometimes take a lot of effort and time but hopefully this guide will show you the quickest and easiest way to get your ported ROM booting.
Okay first decide which ROM you would like to port, don't port HDPI ROM's to MDPI devices or vice versa it just won't work.And it's best to start with the easy and simple ports to get some experience behind you before you go off porting Sense 3.0 to your X10.
Let's get started...
Porting is fairly easy and requires only some folders, files and a boot.img to be replaced.
Now because this is a universal guide I can only tell you how to get the basic hardware working on your port. AOSP ROMs are fairly easy to figure out so you won't have much trouble figuring out what needs replacing. Manufacturer specific ROMs such as Sense 3.0 ROMs are bit more difficult to figure out but the basic skills you will be taught here can be applied in principle to those ROMs.
1. First off lets start with the biggie, the kernel. Those of you familiar with linux will know how important the kernel is a to system, I won't go into detail here but if your kernel isn't specific to your device then your ROM won't boot. The kernel is contained within the boot.img of your ROM's zip (or zImage if it's a Samsung). During flashing it is unpacked and wrote to the system.
To replace the kernel we need to decompile it and no this isn't as easy as opening it winzip. The best way to do this is using Linux; we can use a combination of both perl scripts and terminal commands.
In order for us too see the kernel files contained within the boot.img, we need to first unpack it and this will extract the kernel binary and the ramdisk. What you need at this point is the split_bootimg.zip. This contains a perl script which will extract both files and display the boot.img header, the kernel command line and the board name (if specified).
An example of the output would be:
Page size: 2048 (0x00000800)
Kernel size: 1388548 (0x00153004)
Ramdisk size: 141518 (0x000228ce)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend=1
So how to use this perl script you ask? Well...
First open a terminal and cd to the directory which contains the perl scripts you just downloaded. Next, type this command: "perl split_bootimg.pl boot.img" and that will extract the kernel to your current directory.
Now, we need to extract the ramdisk, the ramdisk has been unpacked from the boot.img and is sitting your current directory with the file name "boot.img-ramdisk.gz", at the moment this still isn't useful to us so we need to un-gzip and then un-cpio it.
So for that we need the Linux terminal. So again from the terminal or using the same terminal enter these commands:
mkdir ramdisk < Creates a directory where we can store the ramdisk
cd ramdisk < Changes our current directory to that of the ramdisk
gzip -dc ../boot.img-ramdisk.gz | cpio -i < Will un-gzip and un-cpio ramdisk
Okay so now we can see all the ramdisk files:
./init.devicename.rc
./default.prop
./proc
./dev
./init.rc
./init
./sys
./init.goldfish.rc
./sbin
./sbin/adbd
./system
./data
So what's important here is the "init.devicename.rc" and "unvented.device.rc". This is the target devices .rc files contained within the ramdisk, now all we have to do here is rename this .rc file to that of the device you are porting to, e.g: "init.trout.rc" > "init.hero.rc"
Some devices ramdisk differ and may not contain "unvented.device.rc" so if this is case for you,then begin by renaming the init.device.rc to your model id and leave it at that. If you get problems well.. that's what the live support is for.
The other file which may be of use to us here is "init.rc", this contains all the system wide kernel properties which we can change to our liking but we'll leave as it is for now.
So now we've edited the ramdisk, we need to change the kernel so that the one the ROM uses is actually specific to our device, when we used the split_bootimg perl script it also unpacked the kernel and that is also in our current directory with the filename "boot.img-kernel".
Easiest way to replace the kernel is to take a kernel update zip for your device, un-zip it and rename the zImage file to "boot.img-kernel" and copy and replace the file of the same name in your directory.
Okay, now that's all done, we need to pack this back up into something that android can understand when it's being flashed. So we need to make a new boot.img from the files we have in our current directory.
First, we need to pack the ramdisk back up into it's original state, so again we need to use the Linux terminal. The command that will do this is this:
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
Remember the ../ is the path to the directory of your ramdisk, remember to remove anything that won't be used by the kernel as cpio will include EVERYTHING in the working directory.
Okay now that the ramdisk is back in it's original format we need to repack the kernel and ramdisk into the boot.img.
So back into the terminal we go and this time we're going to use the "repack-bootimg" perl script (as if that wasn't obvious enough). The command you will ise here is esentially the same to the one we used to split it, so:
"perl repack-bootimg.pl ../path to kernel ../path to ramdisk directory ../path to outfile"
And the boot.img is complete!
So if we look back to the ROM we are porting we can see that we need to put the boot.img into the root of the zip, this will hold true for almost every Android ROM. Next we need to replace some of the files which allow the hardware and keys to work. This is the easy part.
Go into the root of the zip and follow this path to the kernel modules; "/system/lib/modules" Delete all the files you find here.
Now take the kernel modules which came along with the kernel you added to the boot.img and copy them there. Next follow this path to the propietary hardware files;
"/system/lib/hw" Delete all the files you find here.
Again this as simple as taking the files from a ROM meant for your device and copying them into this directory. So what we've done there is added the kernel modules that we can set symlinks to in the updater-script and contain the modules needed for things like WiFi, bluetooth etc. The "/hw" directory as you can see contains the files which control the sensors and lights such as GPS and the accelerometer.
Next, we can look at making sure the hard and soft keys work, the files which contain the layout of your device keys can be found in;
"/system/usr/keylayout" and "/system/usr/keychars"
Touch only those 2 directories.
Delete all the files in here and copy the ones from your device (following the same directory) here.
Okay now to finish off we need to copy over the mount point information for your device and the WiFi drivers.
Follow this path; "/system/etc" and delete only these files and directories.
- vold.fstab
- /wifi
- /ppp
Now follow the same path in a ROM for your device and copy over these files.
Okay we're done!
Before flashing take a look and some guides which show you how to write updater-scripts, incase you need to create important symbolic links.
Happy Porting!
**mod edit** credits to JieeHD from the VillainROM team for this guide! original thread here: http://www.freeyourandroid.com/guide/porting-android
reserved for future......
Hey,how did i help in this?
PS:i m thinking of buying this phone.....is it any good?
i have both the galaxy sl and spice mi 410 i copied from your thread so had to give you credit even though you are not the original poster
spice mi 410 competely outshines galaxy sl so much so that i hardly use sl hooked to this at i.6ghz its lightning fast great plays any game hardly random reboots though average camera galaxy sl better
side note :if you could build succh a nice rom with sl god knows what good you can do with mi 410 please buy it haha
cranium rocks
oh cool............i had forgotten about that thread
2nd hand for 9999 only.................
Hey that's my tutorial... Hope it helps someone....
Sent from my SAMSUNG-SGH-I777 using xda premium
rdannar said:
Hey that's my tutorial... Hope it helps someone....
Sent from my SAMSUNG-SGH-I777 using xda premium
Click to expand...
Click to collapse
than credit to you i am just sharing with everyone "hope it helps someone"
Thank you!!! Will try too port a gt-I9100 rom to a gt-I9100G.
Hope it will be easy with this guide.
Dear Preyesh1.... Could you add the credit to the creator of this guide or at least you mention the url source because I've seen this guide just exactly as in this thread somewhere in the internet.
Except if this guide is pure of yours.
Just to remind...
Edited: Never mind... The creator has been here after all...
I have some questions:
so this means you can take the U9000 android 2.2.2 kernel and merge with ICS?
or does this only works with kernel coming from a GB build to another GB build?
It will help me cause I'm gonna use it soon
Sent from my Triumph using XDA
ziggy46 said:
It will help me cause I'm gonna use it soon
Sent from my Triumph using XDA
Click to expand...
Click to collapse
Hey are you going to port your rom to your device this will be great...!!
I wanna try this great tutorial
Sent from my Droid using Tapatalk
Nice plagiarism.
I mean look at that OP. You've selected the entire article, hit copy, hit new post here, hit paste then hit submit. That's plagiarism of the laziest kind you could have at the very least put some effort in, formatted the text, used code blocks etc.
My word.
edit:
preyesh1 said:
See our guide on how to set this up HERE
Click to expand...
Click to collapse
Hahahahaha.

[Q] building cm 7 from source

1>First of all I would like to know how to sign the custom-rom again after adding or deleting some of the apps. I added G-apps and signed with testsign jar it worked. But I add any other apk in to the rom and sign with testsign it signs the zip but at recovery installation gets aborted.. please Help
2>I wanted to start build cm7 for my galaxy mini from source I followed the steps given in cyanogen.wiki site but when i am cloing the repo it is giving only htc saphire device. Please help by giving a tutorial how to proceed ..........
3> I was wondering how to get ring lock for tjstlye cm7 ...? I can i copy cmsettings apk to tj rom from 7.2 by SQADZONE will it work or should i do any more changes? or it is not possible at all? because tj was 2.3.5 and SQADZONE version is 2.3.7
i am newbie here so I can not post in developement thread.
thank you in advance ..........
It will also clone Galaxy Mini (tass), just wait for it to finish.
You can still search in Dev section :
squadzone said:
Requirements :
1. OS linux Ubuntu 11.04 64bits ( recommended ) or above
2. 2Gb RAM with 3Gb swap or above
3. Processor Centrino Duo or above
4. 120Gb Harddisk or above
5. Fast internet connection ( i have no this )
First download this file
Installer SDK and Build packages by me
Password : squadzone
you will get installerBuildRomGalmin.sh , run this file via Terminal on Ubuntu
follow all instruction that appears,
after Finish, now we goto download repository
still on Terminal
type
mkdir -p ~/android/system
sudo curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
sudo chmod a+x /bin/repo
cd /android/system
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j32
now you can build the rom, and choose what device that you want to build
for reference , READ THIS
have fun to build the rom
Click to expand...
Click to collapse
---------------------------------
Sent from my Samsung Galaxy Mini GT-S5570 via xda-dev app
CyanogenMod 7.2.0-RC2-KANG by squadzone
Thank you, I will try to do it..........
You can skip signing your zip file. Let's say you have a CM7 flash zip file, and have WinRAR installed.
1. EXTRACT CM7 zip, and make a backup of your zip file. In the extracted folder you'll get META-INF folder, system folder and boot.img
2. Add / remove any .apk in system/app folder. Just be cautious with several apk such as mms and phone and contacts, these are needed and should not be replaced. Gallery and music is safe to replace.
3. Add any library files (.so) you want
4. When you're done with above steps, using WinRAR, OPEN (do not extract again) CM 7 zip
5. In WinRAR you'll see the contents of your CM 7 zip. DELETE system folder.
6. Back to Windows Explorer, DRAG your extracted system folder (which now contains whatever it is that you modified) into the WinRAR window (that shows the content of your CM 7 zip file).
7. A window will pop-up asking you to change archive name. Just click OK to proceed. It will be a brief moment before your CM 7 zip has the new system folder.
8. Close the WinRAR window, and proceed with flashing.
One more thing, in folder META-INF you can look for file updater-script, which contains the syntax for flashing (mounting system and or data partition, extracting zip file contents to designated folders, setting permission and ownership for files and folders, installing busybox if any, flashing boot.img, etc.) You can open it using Notepad++. Don't mess with it yet until you figure out how things work.
Good luck !
---------------------------------
Sent from my Samsung Galaxy Mini GT-S5570 via xda-dev app
CyanogenMod 7.2.0-RC2-KANG by squadzone

Automated system/boot.img unpack/repack script

Hello everyone,
I've been playing around with adding root to my stock ROM these past few days, and have found it very slow and tedious trying to remember all the commands to unpack and repack the images.
To make things simpler I've created a script that automates almost the whole process.
I've named it worker as it does all the work for you, and it is just simply a bash script. But it makes things a lot quicker and easier.
I have only been able to test with my S3 Mini, but should work with any ROM that has boot.img and system.img
Simply extract the .img files from the tar.md5 or .zip ROM file, and place them in the original folder.
Once you have those in the original folder just simply run the worker.txt file from the terminal, making sure you are in the worker folder directory.
When the script is run you will be given the options to unpack/repack system.img, mount system.img (This is after you extract it do not try and mount the original file it wont work), unpack/repack boot.img, unpack/repack ramdisk, create ROM (This will create an odin flashable tar.md5 from the repacked files) and finally clean up (This will clear all unpacked and repacked files only leaving the files in the original folder)
To select an option simply type y then enter to execute that command or just hit enter to skip.
When the system.img is mounted it will be mounted in the mount folder.
When repacking the system.img you will be prompted to enter the file size, if you have and S3 Mini I8190N simply type s3mini for the size (This may work for other S3 models but I have no way of testing so let me know). If you have a different device use the file size of the original UNMODIFIED system.img, enter the size in bytes or MB (If entering in MB use this format, xxx being a number. xxxM).
Please give me feedback for improvements or problems,
Thanks for reading.
P.S. Sorry if in wrong place please move if necessary
EDIT: If you can't run the script with the ./ command, chmod +x the file
Antonyb1995 said:
Hello everyone,
I've been playing around with adding root to my stock ROM these past few days, and have found it very slow and tedious trying to remember all the commands to unpack and repack the images.
To make things simpler I've created a script that automates almost the whole process.
I've named it worker as it does all the work for you, and it is just simply a bash script. But it makes things a lot quicker and easier.
I have only been able to test with my S3 Mini, but should work with any ROM that has boot.img and system.img
Simply extract the .img files from the tar.md5 or .zip ROM file, and place them in the original folder.
Once you have those in the original folder just simply run the worker.txt file from the terminal, making sure you are in the worker folder directory.
When the script is run you will be given the options to unpack/repack system.img, mount system.img (This is after you extract it do not try and mount the original file it wont work), unpack/repack boot.img, unpack/repack ramdisk, create ROM (This will create an odin flashable tar.md5 from the repacked files) and finally clean up (This will clear all unpacked and repacked files only leaving the files in the original folder)
To select an option simply type y then enter to execute that command or just hit enter to skip.
When the system.img is mounted it will be mounted in the mount folder.
When repacking the system.img you will be prompted to enter the file size, if you have and S3 Mini I8190N simply type s3mini for the size (This may work for other S3 models but I have no way of testing so let me know). If you have a different device use the file size of the original UNMODIFIED system.img, enter the size in bytes or MB (If entering in MB use this format, xxx being a number. xxxM).
Please give me feedback for improvements or problems,
Thanks for reading.
P.S. Sorry if in wrong place please move if necessary
Click to expand...
Click to collapse
work on gt-i8200n to?
linklusitano said:
work on gt-i8200n to?
Click to expand...
Click to collapse
No reason why not, I'm just not able to test others
Antonyb1995 said:
No reason why not, I'm just not able to test others
Click to expand...
Click to collapse
testing
linklusitano said:
testing
Click to expand...
Click to collapse
Great let me know if it works!
EDIT: Make sure you enter the right size for the system.img file, the pre entered size using s3mini may work fine as they are very similar devices.
Antonyb1995 said:
Great let me know if it works!
EDIT: Make sure you enter the right size for the system.img file, the pre entered size using s3mini may work fine as they are very similar devices.
Click to expand...
Click to collapse
how do i run worker.txt?
linklusitano said:
how do i run worker.txt?
Click to expand...
Click to collapse
Your using Linux right?
Open a terminal and change directory to the worker folder, once there type ./worker.txt and it should run. If it doesn't issue this command chmod +x worker.txt that should fix it.
Antonyb1995 said:
Your using Linux right?
Open a terminal and change directory to the worker folder, once there type ./worker.txt and it should run. If it doesn't issue this command chmod +x worker.txt that should fix it.
Click to expand...
Click to collapse
windows 8.1
linklusitano said:
windows 8.1
Click to expand...
Click to collapse
Ah okay, If you install Cygwin you can run bash scripts in Windows.
LINK: https://www.cygwin.com/

Categories

Resources