[Tutorial] How to port cf-root to other i9003 Firmwares [23/02/2012] - Samsung Galaxy SL i9003

Tutorial for Porting Cf-root To Newer Firmware's
There were quite a few requests for a tutorial to create ginger bread cf-root. So here it is folks.
Big Thanks to skin1980 for helping me out.
Credits:
Chainfire for the cf-root.
Skin1980 for porting it to Samsung Galaxy SLCD.
Prerequisites:
Any Linux. Basic knowledge of linux is mandatory.
Tools for Unpacking and Packing images.
Base Samsung Galaxy SLCD Gingerbread Cf-root.
Samsung Galaxy SLCD Gingerbread Firmware ROM for cf-root creation.
Downloads & Setup
Any Linux: For this tutorial I am using Linux Mint KDE. You are free to use the Linux of your choice. Ideal starting point for downloading and installing Linux would be Distrowatch.com.
Tools for unpacking and packing images: These are sets of tools that allow you to unpack and pack boot images. Basically one requires just a few tools to achieve.
Link to Download: cfroot-tools.zip - 19 KB.
Download and exatract it into your home folder. It will create a cfroot-tools folder under home folder. Go to the folder and execute the following comand:
Code:
chmod +x *
Base Cf-root: Download any latest cf-root from this Link. Extract the normalboot.img from the cf-root tar file.
normalboot.img: Require normalboot.img extracted from downloaded Gb ROM.
Hex editor: You will require and Hex Editor. I am using bless hex editor. You can use any one which you are comfortable or the one available under your linux distribution.
Open terminal window and enter the following commands:
Code:
[FONT=Microsoft Sans Serif][SIZE=2]cd
[/SIZE][/FONT][FONT=Microsoft Sans Serif][SIZE=2]gedit ~/.bashrc[/SIZE][/FONT]
You can use any editor of your choice. The main purpose is to set the tools path. At the bottom of this file, add the following lines:
Code:
PATH=$HOME/cfroot-tools:$PATH
export PATH
Save and close the file.
Logoff from linux and login again for the new path to take effect.
The Actual Process
For the purpose of tutorial, I am going to use XXKPQ cf-root as the base and DDKP3 for creating new one.
Create a folder called “cfroot” with out the quotes under home.
Go to the created folder and create two more folders: DDKP3 and XXKPQ.
Now copy the normalboot.img extracted from XXKPQ cf-root and copy it into the XXKPQ folder. Next copy the normalboot.img fromDDKP3 firmware and copy it into DDKP3 folder.
Now go to the cfroot-tools folder under HOME and copy the decom.sh and recom.sh into XXKPQ and DDKP3 folders.
The above steps can be accomplished by the below code. Open command window and type the following:
Code:
cd
mkdir ~/cfroot
mkdir ~/cfroot/XXKPQ
mkdir ~/cfroot/DDKP3
cd ~/cfroot/XXKPQ
cp ~/cfroot-tools/*.sh .
chmod +x *.sh
cd ~/cfroot/DDKP3
cp ~/cfroot-tools/*.sh .
chmod +x *.sh
You need to press enter after each command.
From terminal window, first to change directory to XXKPQ, type the following commands:
Code:
cd ~/cfroot/XXKPQ
./decom.sh
After the execution of the above command, the following files and folders will be created:
normalboot.img-base
normalboot.img-cmdline
normalboot.img-pagesize
normalboot.img-ramdisk.gz => Ramdisk
normalboot.img-zImage => Kernel
Click to expand...
Click to collapse
Apart from these files, a folder called ramdisk will be created, into which the contents of normalboot.img-ramdisk.gz would have been extracted.
Now once more from the terminal window execute the following command:
Code:
cd ~/cfroot/DDKP3
./decom.sh
Also make note of the following values, which are shown, when the decom.sh script is executed.
Code:
BOARD_KERNEL_BASE 81800000
BOARD_PAGE_SIZE 00001000
Now under DDKP3 folder, edit the recom.sh file. Replace the value after --base with the value after BOARD_KERNEL_BASE. Replace the value after --pagesize with value after BOARD_PAGE_SIZE. Save the file.
Now we can switch to file manager. It will be easier to work using a file manager from here on. Open the XXKPQ/ramdisk and DDKP3/ramdisk folders separately in file manager.
Copy the folders res & sbin from base cf-root (XXKPQ in our case) and paste into DDKP3/ramdisk folder. Overwrite all when prompted.
Copy all the files under XXKPQ/ramdisk (in the root) to DDKP3/ramdisk.
From XXKPQ/ramdisk/lib/modules/2.6.35.7/kernel/ copy the fs folder into DDKP3/ramdisk/lib/modules/2.6.35.7/kernel/.
At this point of time, we no longer require the XXKPQ folder. So we can close the file manager window browsing XXKPQ folder.
Now comes the tricky and critical part. This must be done very carefully. We need to edit the .ko files using a hex editor.
Under the kernel/crypto/ folder, there is a pcbc.ko file, edit it using an hex editor. Search for 2.6.35.7 using find option in the editor. Now note down the six digit numbers starting immediately after 2.6.35.7-CL. In our case the magic number is 882023. Close the file and the editor.
Now we open the kernel/fs/ folder in the file manager.
Now open the mbcache.ko file in the hex editor. Search for 2.6.35.7 again. As we can see that the six digits after 2.6.35.7-CL is not 882023. In our case it is 709629. We need to change 709629 to 882023 and save the file. Different editors provide for different methods of editing. In my case I can just simply click on starting number that is 7 and start typing 882023 and save the file.
Now you need to do the same for two more files under kernel/fs/jbd2/ and kernel/fs/ext4/.
Now go back to ramdisk folder. Under ramdisk/sbin/boot/ there is a file called install.sh. We are now going to edit this file. This not important that you edit this file.
Edit the first line and replace XXKPQ with DDKP3.
Similarly under the “# Once be enough”, there is another XXKPQ which is to be replace with DDKP3.
Now save this file.
Now back to command prompt and execute the following commands:
Code:
cd ~/cfroot/DDKP3
./recom.sh
Executing the above script recreates the normalboot.img-ramdisk.gz, the normalboot.img and create DDKP3-CFROOT-16-02-2012.tar.
The DDKP3-CFROOT-16-02-2012.tar is the cf-root for DDKP3 and can be flashed using ODIN as Pda file.
*
Thats it folks. Hope my effort is worthwhile and benefits some of you.
*
Additional Links:
A text file Create Custom Rom (though not for our phone but is quite useful all the same) - Found it while searching google. Don't know who created it. But here is the link. Create_Custom_Rom.txt - 5 KB
The link to tools zip mentioned in the above text file. tools.tar.gz - 49 MB

Script to uncompress and compress UC Kernel
uc_decom.sh - 258 b
uc_recom.sh - 382 b

10 Chars ......

For Future Use

Whoa! This is huge! Awesomr work man! Thanks.
Edit - No offence meant, but it would be appropriate if the title is How to "port" or similar. Since it ws "created" by ChainFire and we just porting it.

ganeshbiyer is good, very patient, did not think that my trouble!
Has been helping me! Am very grateful!

great job! & i already translate it into chinese^^
and a problem:
after i run the script "decom.sh",it display following words:
[[email protected] xxkpq]# ./decom.sh
./decom.sh: line 5: unpackbootimg: command not found
gunzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] xxkpq]#
help me please~what's going on?

cRainin said:
great job! & i already translate it into chinese^^
and a problem:
after i run the script "decom.sh",it display following words:
[[email protected] xxkpq]# ./decom.sh
./decom.sh: line 5: unpackbootimg: command not found
gunzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] xxkpq]#
help me please~what's going on?
Click to expand...
Click to collapse
unpackbootimg must be in the path.
also it must be executable.

ganeshbiyer said:
unpackbootimg must be in the path.
also it must be executable.
Click to expand...
Click to collapse
sorry,i paste the wrong code. my problem is this:
[[email protected] XXKPQ]$ ./decom.sh./decom.sh: /home/chenyu/cfroot-tools/unpackbootimg: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
gzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] XXKPQ]$

cRainin said:
sorry,i paste the wrong code. my problem is this:
[[email protected] XXKPQ]$ ./decom.sh./decom.sh: /home/chenyu/cfroot-tools/unpackbootimg: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
gzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] XXKPQ]$
Click to expand...
Click to collapse
Need to install the missing file ld-linux.so.2
Sent from my GT-I9003 using xda premium

Thank you Ganeshbiyer! this is the tutorial for which send multiple private messages and never answered .. Thanks again, nowI can make a version for Gingerbread UBKPD.
goodbye

Yeah ganesh! A superb work..well done bro

thanks bhaiya....

Thanks for the tutorial buddy

Hope it has been useful.

_
Release all PERFECT! I had no problem in making the entire guide .. BUT ... when flashing in ODIN, and says that when it failed to finish.
I knew that I would be so easy, so I started to analyze both folders (my UBKPD and XXKPQ) and did not get that at the root of KPD I have 12 files and only 11 KPQ. The 12th file executable type KPD called RECOVERY. This file should remove it before using recom.sh?
Thanks again for the guide. goodbye
Edit2:
Well, my little patience led me to delete that file and then went back to RECOVERY recom.sh run and throw me error that could not erase normalboot.img and did not understand, but looking at the files in the root, not the size you normalboot.img was higher than the stock then replace the stock normalboot (+5 mb), run again and finally he created recom.sh cf.root, I flash with ODIN successfully without any problem in these +30 minutes.
Thanks (again).
Now I have as including UV & OC (freqmax 1100MHz is very good speed and would think you do not need more with this phone)

maybe a stupid question:
would it work with other phones as well? natually with the files of the other phone and not with the 9003 files

fabsau said:
maybe a stupid question:
would it work with other phones as well? natually with the files of the other phone and not with the 9003 files
Click to expand...
Click to collapse
Well you can always try

thanks for your reply
I will try it soon^^
wait for my next reply
greetings fabsau

i do it all at this tutorial and it create .tar fine without trouble.. i flash with odin also no problem happen.. but while device open.. at boot logo get stuck or freeze at long time.. why it happen???
i confuse with this line:-
-Copy the folders res & sbin from base cf-root (XXKPQ in our case) and paste into DDKP3/ramdisk folder. Overwrite all when prompted.
-Copy all the files under XXKPQ/ramdisk (in the root) to DDKP3/ramdisk.
-From XXKPQ/ramdisk/lib/modules/2.6.35.7/kernel/ copy the fs folder into DDKP3/ramdisk/lib/modules/2.6.35.7/kernel/
Click to expand...
Click to collapse
why do not copy all the file in ramdisk n skip copy file inside the ramdisk folder.. it is difference?? please tell me if i do a mistake.

Related

How to make a ROM

Hey XDA
This might be a dumb question, but i dont know where else to ask
I would like to try and make my own ROM for my magic, but i have no idea about where to start, so i was wondering if someone knew of a guide, or some other form of "getting startet" thingy?
And what about apps, how do you make them?
Does it require a Linux machine, or can it be done in windows?
Per
I'm interested in this as well , guys nobody wants to share with us your knowledge??
I too would like to know.
bump
I would like to know also. A quick guide or write-up would be supper nice.
Not to burst anyone's bubble but I seriously doubt a quick write-up would explain the steps on to creating your own ROM or how to write apps. If you really want to learn, I would suggest you take some programing classes at your local community college.
cptandroid said:
Not to burst anyone's bubble but I seriously doubt a quick write-up would explain the steps on to creating your own ROM or how to write apps. If you really want to learn, I would suggest you take some programing classes at your local community college.
Click to expand...
Click to collapse
A quick write up doesn't explain it, but equally going to college isn't applicable to rom cooking either.
All the information you need is on the Internet, have a look in this link where the basics are explained, and use google to fill in the blanks ...
http://www.johandekoning.nl/index.php/2009/06/07/building-android-15-build-environment/
The documentation in ASOP recommends Ubuntu for your dev machine (http://source.android.com/download) so familiarity with Linux is essential, also knowing how to use git will save you some time.
Also use the resources in the Dream section in this site. It's been around much longer than the Magic and most dev topics are already covered in a lot more detail than in Sapphire rom development. Above all I think you need a lot of time on your hands and understanding wifes/girlfriends etc as a lot of reading is necessary!
You basically need a Linux distro to be able to do the most modding. Here are the port tools:
http://www.4shared.com/file/122118622/fd190fe1/PortTools.html
Here's a nice quide that you can use as reference:
1. Download the original Nandroid backup of the Rogers-Wiped from Skittleguy (http://forum.xda-developers.com/showpost.php?p=4029461&postcount=4).
2. Unzip Rogers-Wiped.zip and move boot.img to a directory called "Org".
3. Download nk02ion_r4_LITE-signed.zip and upzip it to a directory called "nk02".
4. Move boot.img out of the nk02ion_r4_LITE-signed directory into a directory called "temp".
5. Open your Terminal window and navigate to your "temp" directory.
6. Unpack the boot image inside the "temp" directory :
Execute : $unpack-H.pl boot.img
This should give you 2 new files : boot.img-kernel and boot-img-ramdisk.gz
7. Remove boot.img and boot.img-kernel from the "temp" directory by doing :
Execute : $rm boot.img
Execute : $rm boot.img-kernel
You should now have only one file called boot.img-ramdisk.gz in your temp directory.
8. Navigate to the "org" directory.
9. Unpack the boot image inside the "org" folder :
Execute : $unpack-H.pl boot.img
This should give you 2 new files : boot.img-kernel and boot-img-ramdisk.gz
10. Move the boot.img-kernel file from the "org" directory to the "temp" directory.
Execute : $mv boot.img-kernel ../temp/
11. Remove the "org" directory
12. Navigate to the "temp" direcory
You should now have 2 files inside the "temp" directory, boot.img-kernel and boot.img-ramdisk.gz
13. Create a directory called boot.img-ramdisk inside the "temp" directory :
Execute : $mkdir boot.img-ramdisk
14. Move inside the newly created boot.img-ramdisk directory :
Execute : $cd boot.img-ramdisk
14. Unzip the boot.img-ramdisk.gz file :
Execute : $gunzip -c ../boot.img-ramdisk.gz | cpio -i
15. Check that the ramdisk is unpacked :
Execute : $ls -l
You should now see a bunch of files
16. Remove the boot.img-ramdisk.gz file inside the boot.img-ramdisk directory :
Execute : $rm boot.img-ramdisk.gz
17. Navigate to the temp folder and also delete the boot.img-ramdisk.gz file :
Execute : $rm boot.img-ramdisk.gz
You should now have 1 file called boot.img-kernel and 1 directory called boot.img-ramdisk inside the "temp" folder
18. Repack the kernel and ramdisk to a boot.img file :
Execute : $repack-H.pl boot.img-kernel boot.img-ramdisk boot.img
You should now have a new boot.img inside the "temp" directory.
19. Move the boot.img file to the nk02 directory :
Execute : $mv boot.img ../nk02/
20. Remove the "temp" folder.
21. Navigate to the nk02 folder and check that you have 1 boot.img file and 2 directories (META-INF and system)
22. Zip the boot.img and the 2 directories into an nk02.zip file
Execute : $zip -r nk02.zip *
23. Sign the nk02.zip file :
Execute : $java -jar signapk.jar testkey.x509.pem testkey.pk8 nk02.zip update.zip
24. Push update.zip to your SDcard :
Execute : adb push update.zip /sdcard/update.zip
25. Boot the device in fastboot mode.
27. $fastboot boot recovery-RAv1.0H.img
28. Select "Wipe data/factory reset"
29. Select "Apply sdcard:update.zip"
30. Select "Reboot system now"
31. Enjoy nk02ion_r4_LITE on your HTC branded Magic.
Click to expand...
Click to collapse
The above guide shows you how to modify the boot.img and how to sign the updates. That's a good start...
ok this is a dumb question i imagine but how to i sign a zip file? i have already made my rom but it wont work because it says its not signed
thejesster said:
ok this is a dumb question i imagine but how to i sign a zip file? i have already made my rom but it wont work because it says its not signed
Click to expand...
Click to collapse
Here is the thread where signing is explained.
I am no expert, but I managed to use this to modify other ROM's (Adding wallpaper, ringtones and removing apps etc.)
Signing made easy thread

[HOWTO][TUT] Create a Custom ROM for Samsung Galaxy i9003

Hey there,
This is a guide on How to create a ROM
For boot sound, boot animation and themeing
Installing cygwin and Setting the kitchen up!
Finalizing , de-odexing, additional option and packing the ROM
Things you will need
-Cygwin
-Android Kitchen
-Patience
-Base ROM
--All files attached at the end--
-MagicISO
PS-> WIndows 7 users set the UAC level to minimum until you finish the whole thing. And also, make sure that nothing wxcept the META-INF folder in your ROM ins capital in letters! Just a small obseravtion in my third ROM! =P
First of all, let us extract the ROM files:
As you can see, In the folder of the XXKPH ROM, you have a system.rfs file. Copy that out to a seperate folder. In case, of any other base ROM, you can find it in the PDA file.
Now use MagicISO in order to extract the system.rfs into a seperate folder!
After that, you may find something with folders like, : app, vendor,etc,media and xbin.
Adding your apps!
Step 2
You are done with the first step!
Now, rename the folder where you have extracted system.rfs to “System” (without quotes) and move it to another folder. Call the new folder as “Custom FW”. Now create a folder called data, in which you create a sub-folder “app”. All the apps what you want to be pre-installed and can be deleted by the user go in here. (only .apk format). If you want apps which the user can not un-install, put the .apk in system/app.
Step 3
You may want to add custom boot sound and some themes,right? Okay! So here is the method.
Cutom Boot sound
First, navigate to /system/etc and find PowerOn.wav. This will enable you to change the boot sound. Replace it with a short tone of .wav format only. Now you,have changed the boot sound
To change the boot animation
1) Download the bootanimation and samsungani file attached below.
2) Put them in the /system/bin folder and replace the existing files there
3) Now download any boot animation, and rename the bootanimation to “sanim.zip”.
4) Now, navigate to /system/media and replace the “ODEanim” with “sanim.zip”
You are done with the bootanimation change
TO change the theme
Just replace the framework-res.apk and twframework-res.apk in the /system/framework folder
Installing Cygwin
Installing the Cygwin and Setting up the Kitchen
Download the Cygwin files attached below. Extract the zip to a folder. Now, you can see 3 icons, a read-me,a setup, and a folder. Choose the setup. Here You will choose install from local directory. Next, Navigate to the the folder of extraction of cygwin and choose the folder Cygwin_packages inside the cygwin extraction folder. Wait for some time. Then, You will come across a list of file. Click the 2-circle-arrows,untill, it displays “install”
After the procedure is complete, run the batch file. Now, minimise it and extract the android kitchen.
Keep it in some location like C:\Kitchen
Now, open the batch file window and type
cd C:\Kitchen
Wait for some time and then when the location the changed, type
./menu
As this is a HTC kitchen, you can't use all the features,
Now, go back to the folder “custom FW” and create a zip ( I repeat zip and NOT rar) of all the folder in the “Custom FW”. After that is done, navigate to the kitchen folder (C:\Ktichen) and palce the .zip in the “original_update” folder
Come back to the Cygwin Batch window. Now you select 1 (i.e. the first option and press enter.
Then, again press 1 twice!
Now after this is done, you can also use option 2 (rooting). You can change the ROM's name using option 8.
Step 5
De-odexing the FW.
In the batch window, choose option 0 and then choose 1.
Using this you can de-odex your FW.
Next, choose 99 to build and pack you ROM
And you are done with the custom ROM
---------------------------------------------------
Thanks to @sakindia123
Extracting and odin build
Code:
xvf ODIN_FILE.tar.md5
NOTE:.md5 is optional
Rebuilding
Code:
$ tar -H ustar -c amss boot.img csc.rfs recovery.img system.rfs >ODIN_FILE.tar
$ md5sum -t ODIN_FILE.tar >>ODIN_FILE.tar (signing the file)
$ mv ODIN_FILE.tar ODIN_FILE.tar.md5
Of course,u Have to put the name of ur file in place of ODIN_FILE
Mounting rfs(on linux)
Code:
mkdir system_mount
$ mount -o loop system.rfs system_mount
$ cp /folder/application.apk system_mount/app/ (adding aplications)
$ rm system_mount/app/application.apk (removing applications)
$ cp /folder/application.apk system_mount/app/application.apk (replacing aplications)
$ umount system_mount
Regards,
Rohan Mallya! =D
The essential files!
For the Kitchen ( thanks to dsixida)
For cygwin
Remeber to thank and vote in the POLL!!
Custom booting files ( one you have to replace for the bootanimation before you add sanim.zip!)(samsungani and bootanimation files)
MagicISO
Credits -.-
Misledz
Ganaboy
ronhoover88
Namaless
Vivek
Erahgon
Very informative posts. I hope this will lead to more ROM for our cellphone.
More things! ☻☻
You can zipalign and sign the ROM in HTC Android Kitchen itself! While COmpiling your ROM, Just select the interactive method! You can do it all there!
If you want to changes the build date and all, you can open the build.prop(present in /system folder) and change the values!
Reserved for future
If I may ask, do you have a source link for this or is it from you?
I typed it WHOLE? So..?? I did not get you well?
No worries, it's just I like to read the comments which are usually a good complement for every tut/info, so if it were from elsewhere I would have been happy to read them, that's all
can i use this port the miui rom?
r u sure u hav not copied this from elsewhere....bcoz the boot ani thing is wrong......i9003 has different format.....(i mayb wrong)
What boot ini,sak? Elaborate please??
You could also use the link below
http://forum.xda-developers.com/showthread.php?t=1168916
Sent from my GT-I9003 using XDA App
@ronhoover88 I went through it now. But, I think you cant use that meta-inf folder, the kernel adn the root script from that guide..If you feel this is thread is a WASTE OF TIME..Please tell me..I will make an attempt to delete it!
You dont have to delete...you have put a lot of effort...what i feel is, its better if you have created a rom using this guide and got it working...
Sent from my GT-I9003 using XDA App
Dude combined all this info in a single post
Sent from my GT-I9003 using XDA Premium App
The bootanimation thing is totally from vivek's thread..try it! It woooorks!

[FULL HOW-TO][!DEV] How to Make a ROM --Explained In every Step-- ALMOST!!

.:Index:.
Basic Needs and Extraction of ROM (.rfs)
Editing your ROM and Removing and addition of System Apps
Custom Boot Animation And Boot Sound
nstalling the Cygwin and Setting up the Kitchen
Cygwin Basics and De-Odexing Firmware
Extracting and odin build
.: Downloads :.
What You Need?
->Cygwin
-> DSIXda Kitchen
-> A windows/ Linux environment.
-> MagicISO
-> Base ROM --NOT CUSTOM ROM-- --AN OFFICIAL ROM--
*Dont take works of Developers of Custom ROM. Develop your OWN custom ROM*
You can find ALL official Firmwares(ROMS) here**
->7Zip
Basic Thing.
Extraction of RFS.
Well, THis is the First thing you should do.
Here are the steps:
-> Download a Firmware of your choice from the above link.
-> If you Firmware is in .zip format, be sure to extract the FW to a folder.
-> In the folder, you should find a PDA file ( The file which use put in the PDA place when you flash using ODIN)
-> Install 7-Zip if you dont have it, if you have it...Proceed to next step
->Right Click on the PDA file and open the archive using 7-zip.
-> Now, you can see a file named "system.rfs" or "factoryfs.rfs" or "systemFS.rfs", just copy the file to your C:\ (YOU CAN COPY IT ANYWHERE. I am taking C:\ as my base location)
Part II - Extracting RFS
-> Download and Open MagicISO.
->Click on File-> Open and browse to the place where you have your extracted system.rfs or factoryfs.rfs or systemfs.rfs.
-> Now, you should be able to see many folders like lib,system,xBin,vendor,etc.
-> Copy ALL the folders to your desired location. Be sure to put all of them in a folder called system. For example, In C:\ , create a folder called ROM and create a sub-folder called "system" and put the files there.
In my case, The Extraction is placed at C:\ROM\system
------------------------------------------------------------------------------
END OF STEP 1
Step 2-> Editing your ROM and Removing and addition of System Apps
First, Go to the folder where you extracted the ROM and then go to \System\App.
Here, you can find ALL the applications which are un-installable by the user.
So, If you want to REMOVE apps, you can remove them and their .odex's. But, be sure, For what apps you are planning to keep, DONT REMOVE THE ODEXES.
------
If you want to add up apps, just copy the .apk of that app and put it to \system\app. But, the User can not uninstall this app.
For any Theme changes, replace the Framework-res.apk in the \system\framework.
For Status Bar Changes, replace the systemui.apk in the \system\app.
Do Not Change Anything in xBin and Vendor folder.
On changing stuff there, your ROM will not boot.
-----
If you want to put apps which the user can un-install, here's how to do it.
-> Go to your BASE FOLDER. In my case C:\ROM
-> Create a folder called Data and a sub-folder called \data\app.
-> Put ALL your .apks in here. On doing so, the user of the ROM can un-install the app.
------
Just copy the META-INF folder of any other ROM and put it in your base folder. (C:\ROM in my Case)
Custom Boot Animation And Boot Sound
Cutom Boot sound
First, navigate to /system/etc and find PowerOn.wav. This will enable you to change the boot sound. Replace it with a short tone of .wav format only. Now you,have changed the boot sound
To change the boot animation
1) Download the bootanimation and samsungani file attached in the Downloads Section
2) Put them in the /system/bin folder and replace the existing files there
------------->>>> The Above two steps are not needed<<<<------------------ Only if the bootanimation does not work, use these files >>>>>>>>>-----------<<<<<<<<
3) Now download any boot animation, and rename the bootanimation to “sanim.zip”.
4) Now, navigate to /system/media and replace the “ODEanim” with “sanim.zip”
You are done with the bootanimation change
----------------------------------------------------
nstalling the Cygwin and Setting up the Kitchen
Download the Cygwin files attached below. Extract the zip to a folder. Now, you can see 3 icons, a read-me,a setup, and a folder. Choose the setup. Here You will choose install from local directory. Next, Navigate to the the folder of extraction of cygwin and choose the folder Cygwin_packages inside the cygwin extraction folder. Wait for some time. Then, You will come across a list of file. Click the 2-circle-arrows,untill, it displays “install”
After the procedure is complete, run the batch file. Now, minimise it and extract the android kitchen.
Keep it in some location like C:\Kitchen
Now, open the batch file window and type
cd C:\Kitchen
Wait for some time and then when the location the changed, type
./menu
As this is a HTC kitchen, you can't use all the features,
Now, go back to the base folder (C:\ROM in my case) and create a zip (Recomended to use Winzip) ( I repeat zip and NOT rar) of all the folder in the “Bse Folder”(C:\ROM in my case). After that is done, navigate to the kitchen folder (C:\Ktichen) and palce the .zip in the “original_update” folder.
P.S- Here's one of the amazing Threads on how to setup cygwin. (Credits to ajay8055) http://forum.xda-developers.com/showthread.php?t=1532660
Come back to the Cygwin Batch window. Now you select 1 (i.e. the first option and press enter.
Then, again press 1 twice!
Now after this is done, you can also use option 2 (rooting). You can change the ROM's name using option 8.
De-odexing the FW.
In the batch window, choose option 0 and then choose 1.
Using this you can de-odex your FW.
Next, choose 99 to build and pack you ROM.
You are now Done with the custom ROM and can find your build in the Output_zip folder of the Kitchen (C:\Kitchen in my case)
WARNINGS::
-> IF you are asked to add a fake boot.img, choose yes.
-> If you are asked to change updater-script to update-script, choose NO.
For EXPERIENCED DEVS and LINUX USERS.
No n00b Post
Extracting and odin build
xvf ODIN_FILE.tar.md5
NOTE:.md5 is optional
Rebuilding
Code:
$ tar -H ustar -c amss boot.img csc.rfs recovery.img system.rfs >ODIN_FILE.tar
$ md5sum -t ODIN_FILE.tar >>ODIN_FILE.tar (signing the file)
$ mv ODIN_FILE.tar ODIN_FILE.tar.md5
Of course,u Have to put the name of ur file in place of ODIN_FILE
Mounting rfs(on linux)
Code:
mkdir system_mount
$ mount -o loop system.rfs system_mount
$ cp /folder/application.apk system_mount/app/ (adding aplications)
$ rm system_mount/app/application.apk (removing applications)
$ cp /folder/application.apk system_mount/app/application.apk (replacing aplications)
$ umount system_mount
:: DOWNLOADS ::
-> Cygwin
-> MagicISO
-> Kitchen
-> Custom Booting Files
You can do the following withthe kitchen.
Please dont try anything else, else, you will get bored of seeing the Same boot-animation again and again!
-> Zip-Align
-> Dis-Able bootscreen sounds
-> Add Root Permissions
->Change name of ROM
->Deodex files in your ROM
->Add Apps2SD
->Add custom boot animation functionality
->Build ROM from working folder (Duh )
Last one reservation please!
I don't find word to express my feelings thank-you
Sent from my GT-S5670 using xda premium
Mr.Oug said:
I don't find word to express my feelings thank-you
Sent from my GT-S5670 using xda premium
Click to expand...
Click to collapse
You're Welcome
Firstly, thanks a lot for this!!! Will surely try it out when my exams get over!!!
And there are a lot of additional stuff that you didn't cover, hopefully you will add them...
(Like kernal development, do you know about it??)
a.cid said:
Firstly, thanks a lot for this!!! Will surely try it out when my exams get over!!!
And there are a lot of additional stuff that you didn't cover, hopefully you will add them...
(Like kernal development, do you know about it??)
Click to expand...
Click to collapse
I have No idea of the Kernel Development!
Total n00b there!
I know only about Themes and ROM's!
And, A BIT of .apks
http://forum.xda-developers.com/showthread.php?t=1186409
found this for kernel dev
If the file is not a .zip and a .tar.md5 file, where will I find the .rfs file?
Please help
Thanks for the Link!
Will Post it in the OP!
rgshah3 said:
If the file is not a .zip and a .tar.md5 file, where will I find the .rfs file?
Please help
Click to expand...
Click to collapse
Just Open the .ta.md5 file using 7-Zip and you can find a file named System.rfs / systemfs.rfs / factoryfs.rfs
bangalorerohan said:
Thanks for the Link!
Will Post it in the OP!
Click to expand...
Click to collapse
The kernel development guide is for galaxy 3 which uses zImage while galaxy fit doesn't! So this guide is quite useless
Aah!
Never knew about a device also called Galaxy 3
bangalorerohan said:
I have No idea of the Kernel Development!
Total n00b there!
I know only about Themes and ROM's!
And, A BIT of .apks
Click to expand...
Click to collapse
dude, i appreaciate for the work, bt fit has a low internal memory, for that we need app2sd working which further needs ext4 partition !!
so this guide willnt be complete without that ,
i saw the same guide on Galaxy SL forums by you only,
n before posting the Custom Booting file (if same as G-SL's) u must check it on Fit, because that might cause a boot loop !!

[FULL-HOWTO][DEV] Make Your Own CWM-Flashable Custom ROM -Edited on 14th Jan!

Code:
THIS TUTORIAL IS MEANT FOR DEVELOPERS.
NOOBS WHO ARE TRYING THIS OUT,
BE READY TO RISK YOUR BRAINS.
AND, THIS METHOD CAN HARM YOUR PHONE. ON WRONG BUILDING OF ROMS,
YOU MAY BE STUCK ONTO A BOOT-LOOP.
ALWAYS, HAVE A NANDROID BACKUP FOR SAFETY!
FEEL FREE TO ASK QUESTIONS. AND, YOUR WARRANTY IS NOW OFFICIALLY VOID. CONGRATS.
What You Need?
->Cygwin
-> DSIXda Kitchen
-> A windows/ Linux environment.
-> MagicISO
-> Base ROM --NOT CUSTOM ROM-- --AN OFFICIAL ROM--
*Dont take works of Developers of Custom ROM. Develop your OWN custom ROM*
->7Zip
Basic Thing.
Extraction of RFS.
Well, THis is the First thing you should do.
Here are the steps:
-> Download a Firmware of your choice from the above link.
-> If you Firmware is in .zip format, be sure to extract the FW to a folder.
-> In the folder, you should find a PDA file ( The file which use put in the PDA place when you flash using ODIN)
-> Install 7-Zip if you dont have it, if you have it...Proceed to next step
->Right Click on the PDA file and open the archive using 7-zip.
-> Now, you can see a file named "system.rfs" or "factoryfs.rfs" or "systemFS.rfs", just copy the file to your C:\ (YOU CAN COPY IT ANYWHERE. I am taking C:\ as my base location)
Part II - Extracting RFS
-> Download and Open MagicISO.
->Click on File-> Open and browse to the place where you have your extracted system.rfs or factoryfs.rfs or systemfs.rfs.
-> Now, you should be able to see many folders like lib,system,xBin,vendor,etc.
-> Copy ALL the folders to your desired location. Be sure to put all of them in a folder called system. For example, In C:\ , create a folder called ROM and create a sub-folder called "system" and put the files there.
In my case, The Extraction is placed at C:\ROM\system
P.S-> You Just finished Step 1
Step 2-> Editing your ROM and Removing and addition of System Apps
First, Go to the folder where you extracted the ROM and then go to \System\App.
Here, you can find ALL the applications which are un-installable by the user.
So, If you want to REMOVE apps, you can remove them and their .odex's. But, be sure, For what apps you are planning to keep, DONT REMOVE THE ODEXES.
------
If you want to add up apps, just copy the .apk of that app and put it to \system\app. But, the User can not uninstall this app.
For any Theme changes, replace the Framework-res.apk in the \system\framework.
For Status Bar Changes, replace the systemui.apk in the \system\app.
Do Not Change Anything in xBin and Vendor folder.
On changing stuff there, your ROM will not boot.
-----
If you want to put apps which the user can un-install, here's how to do it.
-> Go to your BASE FOLDER. In my case C:\ROM
-> Create a folder called Data and a sub-folder called \data\app.
-> Put ALL your .apks in here. On doing so, the user of the ROM can un-install the app.
------
Just copy the META-INF folder of any other ROM and put it in your base folder. (C:\ROM in my Case)
Custom Boot Animation And Boot Sound
Cutom Boot sound
First, navigate to /system/etc and find PowerOn.wav. This will enable you to change the boot sound. Replace it with a short tone of .wav format only. Now you,have changed the boot sound
To change the boot animation
1) Download the bootanimation and samsungani file attached in the Downloads Section
2) Put them in the /system/bin folder and replace the existing files there
------------->>>> The Above two steps are not needed<<<<------------------ Only if the bootanimation does not work, use these files >>>>>>>>>-----------<<<<<<<<
3) Now download any boot animation, and rename the bootanimation to “sanim.zip”.
4) Now, navigate to /system/media and replace the “ODEanim” with “sanim.zip”
You are done with the bootanimation change
Installing the Cygwin and Setting up the Kitchen
Download the Cygwin files attached below. Extract the zip to a folder. Now, you can see 3 icons, a read-me,a setup, and a folder. Choose the setup. Here You will choose install from local directory. Next, Navigate to the the folder of extraction of cygwin and choose the folder Cygwin_packages inside the cygwin extraction folder. Wait for some time. Then, You will come across a list of file. Click the 2-circle-arrows,untill, it displays “install”
After the procedure is complete, run the batch file. Now, minimise it and extract the android kitchen.
Keep it in some location like C:\Kitchen
Now, open the batch file window and type
cd C:\Kitchen
Wait for some time and then when the location the changed, type
./menu
As this is a HTC kitchen, you can't use all the features,
Now, go back to the base folder (C:\ROM in my case) and create a zip (Recomended to use Winzip) ( I repeat zip and NOT rar) of all the folder in the “Bse Folder”(C:\ROM in my case). After that is done, navigate to the kitchen folder (C:\Ktichen) and palce the .zip in the “original_update” folder.
Come back to the Cygwin Batch window. Now you select 1 (i.e. the first option and press enter.
Then, again press 1 twice!
Now after this is done, you can also use option 2 (rooting). You can change the ROM's name using option 8.
De-odexing the FW.
In the batch window, choose option 0 and then choose 1.
Using this you can de-odex your FW.
Next, choose 99 to build and pack you ROM.
You are now Done with the custom ROM and can find your build in the Output_zip folder of the Kitchen (C:\Kitchen in my case)
WARNINGS::
-> IF you are asked to add a fake boot.img, choose yes.
-> If you are asked to change updater-script to update-script, choose NO.
Awesome
Sent from my SGH-T959V using XDA App
For EXPERIENCED DEVS and LINUX USERS.
No n00b Post
Extracting and odin build
xvf ODIN_FILE.tar.md5
NOTE:.md5 is optional
Rebuilding
Code:
$ tar -H ustar -c amss boot.img csc.rfs recovery.img system.rfs >ODIN_FILE.tar
$ md5sum -t ODIN_FILE.tar >>ODIN_FILE.tar (signing the file)
$ mv ODIN_FILE.tar ODIN_FILE.tar.md5
Of course,u Have to put the name of ur file in place of ODIN_FILE
Mounting rfs(on linux)
Code:
mkdir system_mount
$ mount -o loop system.rfs system_mount
$ cp /folder/application.apk system_mount/app/ (adding aplications)
$ rm system_mount/app/application.apk (removing applications)
$ cp /folder/application.apk system_mount/app/application.apk (replacing aplications)
$ umount system_mount
:: Downloads ::
Cygwin
MagicISO
Kitchen (Thanks to dsiXDA)
--
Optional
Custom booting Files
Reserved.......
--For the Future!
Last one!
Press The THANKS!
Thank you for writing this but wrong section. Guides should go in the general section. You could probably ask for it to be stickied.
Kool. Is to understand lol well if u understand the basic. I try other devs Rom for base but of course all credit goes to them. Its just fun to experiment sometime
Sent from my SGH-T959V using xda premium
Funny i just linked you like yesterday in general forum haha
Sent from my SGH-T959V using xda premium
ericmpanda said:
Funny i just linked you like yesterday in general forum haha
Click to expand...
Click to collapse
Maybe it should have stayed there and just linked to the one in the general forum in the wiki.
Oh well.
ericmpanda said:
Funny i just linked you like yesterday in general forum haha
Sent from my SGH-T959V using xda premium
Click to expand...
Click to collapse
I did not quite get you? :-/
Sent from my I9100 using XDA Premium App
bangalorerohan said:
I did not quite get you? :-/
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1441619
bhundven said:
http://forum.xda-developers.com/showthread.php?t=1441619
Click to expand...
Click to collapse
Bahaha! Lol!
Thats what i was like at first i thought you stole it then checked the original I saw and it was you lol
Sent from my SGH-T959V using xda premium
bangalorerohan can you please upload the kitchen and all files again in a pack since megaupload got out of you know bussiness i dont really know which versions i should use in order to follow your guide .
and Thanks for your guide man :3

(How to) unpack/repack boot.img using terminal apk

This is a tutorial I've decided to put together as I'm learning to compile kernels. It will cover unpacking and repacking a boot.img and/or recovery.img, and also touch on unpacking the ramdisk after we have unpacked the boot.img This tutorial will only focus on executing this on a android device using the terminal emulator app but of course you could use these tools on a PC in a adb shell.
This would not be possible without the hard work of xda member @Modding.MyMind. I am not responsible for anything you do to your device by using these tools.
What you will need
1. Android device
2. Have root
3. Have busybox installed (1.23.1 is recommended)
4. Terminal Emulator app
5. Root Explorer app
6. Your devices boot.img and/or recovery.img
7. mkbootimg_tools-master.zip (download below)
https://www.dropbox.com/s/fiat0zrf2f533uq/mkbootimg_tools-master.zip?dl=0
DIRECTIONS
1. Let's pull the boot.img we are going to work with using dd. Open your terminal and type su > press enter. Type dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/sdcard/boot.img > press enter and now you should see a file on your sdcard called boot.img
2. Place the zip file on the root of your internal sdcard and extract it. You will see a folder called mkbootimg_tools-master and inside that folder you will see 2 folders. One called ARM and one called README.md Now we are going to copy the ARM folder to data/local/tmp and paste it inside of the tmp folder.
3. Now we need to go the ARM folder that you just copied inside tmp and set the permissions to 0777 (rwxrwxrwx) and also set the same permissions for each file inside the ARM folder.
4. Now go inside the ARM folder and copy the bash file to system/xbin and set the permission to chmod 0755 (rwxr-xr-x)
5. Ok now copy the boot.img file that we pulled onto your sdcard inside the ARM folder and leave the permissions for that file 0666 (rw-rw-rw-)
6. Open up your terminal emulator app and type su > press enter
7. Now we are going to change directories to the ARM folder which we want to be in by typing cd data/local/tmp/ARM > press enter
########################################
Now to unpack your boot.img
1. Type ./mkboot boot.img bootfolder > press enter and you will see the magic happen. It will automatically create a folder called bootfolder which is your project folder and you can name it whatever you like but I like to call it bootfolder and if I was unpacking a recovery.img I would call it recoveryfolder
2. So now you have your unpacked boot.img.
3. Now go to your terminal and type cd bootfolder > and press enter. We are going into your bootfolder now because that is where your ramdisk.gz is located and we are now going to decompress your ramdisk by typing gunzip -dc ramdisk.gz | cpio -i > and press enter and it will decompress your ramdisk for you.
4. So now you have unpacked a boot.img and also learned how to decompress your ramdisk.
########################################
How to decompress a ramdisk in lzma format
1. ./mkboot recovery.img workfolder
2. cd workfolder/ramdisk
3. Now type lzma -dc ../ramdisk.lzma | cpio -i; strings *.ko
4. Now you will have your lzma compressed ramdisk inside your workfolder
#######################################
Now we are going to repack your boot.img
1. In your terminal type cd .. > and press enter so you will move back 1 directory into your ARM folder.
2. Now to repack you are going to type ./mkboot bootfolder boot.img > and press enter and that will repack your boot.img for you
*wherever you saw me type a > don't ever type that as I was just showing that you are done the command or syntax and your are ready to press enter
Source code https://github.com/ModdingMyMind/mkbootimg_tools/commit/6c44267b4a8a43504c870678c68df6a31b8e2f18
Screenshot - https://www.dropbox.com/s/se171tzgnf6wp0q/Screenshot_2015-03-12-02-49-50.png?dl=0
Screenshot - https://www.dropbox.com/s/5bzt8p6l2ltosl6/Screenshot_2015-03-12-02-50-04.png?dl=0
Thanks to @leonardoafa for being a great help & friend
How different is it for a recovery image file please?
Is the same, just put your recovery.img in the ARM folder and you might want to call your project folder something different than bootfolder (ex; recoveryfolder) so you don't get confused or forget
Oh yes, however ramdisk folder is empty when you use only a recovery image. Less content of course.
image45 said:
Oh yes, however ramdisk folder is empty when you use only a recovery image. Less content of course.
Click to expand...
Click to collapse
When i use twrp everything is working perfect. Your ramdisk is probably in a lzma format I'm guessing
As you can see im inside of my ramdisk folder, which is inside my recoveryfolder
https://www.dropbox.com/sc/ffyy2ndrkl57hn4/AACV__FpJuScCvIvErx2WFffa
@image45 i added how to decompress a ramdisk in lzma format to the op
Nice guide :good:
Yes very detailed, thank you.
@skulldreamz
Hi my friend, do you still want to learn about scripts.
Please go to telegram app.
Thanks
@image45 can you sendme your image that uses a lzma compressed ramdisk. The project supports lzma so there should be no need to decompress it manually however, if the project is not doing what it should already be doing then I need to debug the script, find the culprit, make my fix, and push the changes to my github. Would be greatly appreciated. Thanks.
app
Hy,
I use this app for long time to open boot.img and extract ramdisk.
The app asked then if you want open the ramdisk also.
Only click on your boot.img and in 4 sec its open.
Second function is to pack a boot.img.
Very simple to use, also for beginners.
konsolen said:
Hy,
I use this app for long time to open boot.img and extract ramdisk.
The app asked then if you want open the ramdisk also.
Only click on your boot.img and in 4 sec its open.
Second function is to pack a boot.img.
Very simple to use, also for beginners.
Click to expand...
Click to collapse
It only decompresses gzip ramdisks. Doesn't support other types unless you modify the ramdisk.sh script used inside the apk. It also doesn't support images with dt binaries which is more common nowadays. I use to use this a long time ago but to say it simple, it is outdated and lacks support.
However, if it works then I say use it. Especially if the person isn't comfortable with command lines.
Very helpful thx
Thanks
Sent from my SAMSUNG-SGH-I747 using Tapatalk
I see this is an older thread but tried it on my Nexus 6p. When I repacked boot it was significantly smaller in size. It also has the warning of non standard address. Anything I should do or be aware of?
Fe Mike said:
I see this is an older thread but tried it on my Nexus 6p. When I repacked boot it was significantly smaller in size. It also has the warning of non standard address. Anything I should do or be aware of?
Click to expand...
Click to collapse
Try using mkboot....
https://github.com/xiaolu/mkbootimg_tools
The Sickness said:
Try using mkboot....
https://github.com/xiaolu/mkbootimg_tools
Click to expand...
Click to collapse
Thank you, bare with me as Im fairly new to this. Just to be clear, when i go to link there is the ARM folder that has all the same stuff in it or the single mkboot file thats 9.46mb in size? Not sure how to download just the mkboot file. When i click it, it just opens up the code. Do i copy and paste the code?
Fe Mike said:
Thank you, bare with me as Im fairly new to this. Just to be clear, when i go to link there is the ARM folder that has all the same stuff in it or the single mkboot file thats 9.46mb in size? Not sure how to download just the mkboot file. When i click it, it just opens up the code. Do i copy and paste the code?
Click to expand...
Click to collapse
You have to clone the source using "git clone" in your terminal. Which means you need to be on Linux
The Sickness said:
You have to clone the source using "git clone" in your terminal. Which means you need to be on Linux
Click to expand...
Click to collapse
Ok, I was able to clone using cygwin. But i was reading in the forums that the size of extracted boot from phone will not be the same as it being repacked. So I used original files from this post and and just extracted, unpacked, and repacked. Then just flashed img thru twrp and everthing went well. Thank you for your response.
SHM said:
It only decompresses gzip ramdisks. Doesn't support other types unless you modify the ramdisk.sh script used inside the apk. It also doesn't support images with dt binaries which is more common nowadays. I use to use this a long time ago but to say it simple, it is outdated and lacks support.
However, if it works then I say use it. Especially if the person isn't comfortable with command lines.
Click to expand...
Click to collapse
Why haven't you made something like this, he's just using someone else's tools, please MMM, you're the man

Categories

Resources