[GT540 Optimus Android Development] tejasjadhav:
USING DSIXDA's KITCHEN TO CREATE YOUR OWN SOFT-MODs

(THIS IS MY FIRST BIG TUTORIAL, SO PLEASE CO-OPERATE AND HELP ME MAKING THIS GUIDE BETTER!!)

DsiXDA has created an excellent Kitchen for 'cooking' custom ROMs. So first THANKS goes to DsiXDA.

GIVE CREDITS TO THE ORIGINAL DEVELOPER

I. Setup the Kitchen:

Download DsiXDA's Kitchen at https://github.com/dsixda/Android-Kitchen/archives/master. Download the 0.179 version

Get an 'original' ROM (not soft-modded). The ROM that I used in this tutorial is Pebe's CyanogenMod 7

Get JDK. It's necessary. Execute the following command in Terminal:

sudo apt-get install openjdk-7-jdk

When asked for password, enter the one which you use for logging in.

For 64-bit system, you need the ia32-libs ( sudo apt-get install ia32-libs )

Extract the contents of the dsiXDA's kitchen to a folder, say kitchen, in your Home folder (for convenience). Just inside the kitchen folder there should be the ./menu file

Open Terminal. Browse to your kitchen directory

cd ./kitchen

source ./menu

It should open up the Kitchen Menu

This is the basic setup of your Kitchen. Now move up to the next big step.

II. Actual ROM:

Copy the ROM (in my case, it is cm7_v2.zip (pebe's CM7)) and paste it in the original_update folder

Execute Kitchen (Step 5 from I). Select option '1. Setup working folder from ROM'. Another menu appears, hit ENTER. It'll show up the available ROMs list. It should display at least one ROM. In my case it was "(1) cm7_v2.zip". Enter selection number: 1. Hit ENTER. It'll prompt for changing the name, leave it, no need. Hit ENTER. It'll start extracting the ROM. In my case, it found the updater-script. It'll ask to convert the script into update-script. We want update-script at the moment, so just hit ENTER. It should say 'Finished setting the working folder!'. Hit ENTER. You'll be back to Menu.

The Menu shows various options like 'Adding Root permissions, installing busybox, etc'. You can play with them. As most of the ROMs have Root and Busybox installed, we don't need any of these features.

Now comes a bit advanced part. Select ADVANCED OPTIONS. There are various options like Deodex files, add Nano text editor, signing APKs, etc. I'll explain each of them:

Deodex: Merges ODEX and APK together. However, it's applicable for ODEXed ROMS (mostly Stock 2.1) only. Neither of GB and FroYo versions are ODEXed. So you can skip this step.

Add task killer tweak: It's a good alternative to Supercharger script. Only thing is, it isn't as versatile as Supercharger script. Leave this if you don't know anything about Task killer values like FOREGROUND APP, BACKGROUND APP, etc

Add data/app functionality: Suppose you've come across a situation that the system size reaches almost 150 MB (standard for GT540) and still you want to add some more apps, then this tweak is for you. It adds the /data/app folder. You can place apps in this folder. These apps will be directlty installed in the /data partition thus eliminating the 150MB limit.

Add Bash: Adds command-line completion in Terminal commands. Install if you want. Not needed.

Add Apps2SD: This is much primitive type of Apps2SD in which you have to create an ext partition on your SD card. Not recommended. Link2SD (app) is much better.

Add busybox run-parts: This tweak is most important one. I enables the startup scripts option, that means, scripts placed in /etc/init.d folder will get executed during the booting process. Recommended for Stock and AOSP ROMs only.

Add custom boot animation: If you want to add a custom boot animation to your ROM, then you need this. Select this option. It'll ask you to proceed, hit ENTER. A folder /data/local will be created inside the WORKING_xxxxxxx_xxxxxxx folder. Place your bootanimation.zip in that folder. Google some nice boot animations or if you want to create your own boot animations, Despotovski brothers had made a 'Boot Animation maker', check it here http://xdaforums.com/showthread.php?t=1234611

Rest all tweaks are not required for now

III. Something's Cooking!

There will be a folder named something like WORKING_xxxxx_xxxxxxxx in your kitchen folder. Open it up. It contains the actual system, boot.img file, data directory etc.

The best feature of DsiXDA is that you can easily 'browse' the system.

Open the system folder. Here you can see the apps, etc, lib, usr, etc folders.

Adding / Removing Apps: Open the apps folder. You'll see APKs of all the system apps. Try removing some apps. You can remove Dev tools, pre-installed CM themes or any other app. Add your own apps. Copy-paste your apps here. If their filenames have spaces in them (like Root Explorer.apk) remove these spaces (like RootExplorer.apk). You can also use the /data folder for adding more apps.

Adding some other stuff: The /etc folder has a lot of cool stuff too. The apns-conf.xml file contains the APNs. System can auto-detect the APN according to your carrier. I got an apns-conf.xml file which contains a huge list of APNs. Just replace the existing file.

Adding Fonts: Pick your favorite font (I like Ubuntu). Grab the .ttf file of that font. Open /fonts folder. Remove the existing DroidSans.ttf file. Copy-paste your font file in it and rename it to DroidSans.ttf.

IV. Final Steps:

Open the kitchen menu. Advanced Options → Sign all APKs

Back to main menu. '9. Check update-script for errors'.

'6. Zipalign all APKs'

'99. Build ROM'. If it shows warning regarding BOOT-EXTRACTED folder exists, select y (remove BOOT-EXTRACTED).

Select a build option → 1. Interactive Mode

Would you like to Zipalign → n (we already did that before)

It'll start making update.zip.

Add updater-script to your ROM → y (We want compatibility with ClockworkMod)

Proceed with the change → y

Sign your ROM → y

Change the name → n

Once you're back to main menu, select Exit (x)

Your ROM is located in OUTPUT_ZIP folder (It'll be a zip file)

Copy this zip file on your SD card. Reboot into Recovery. Select 'Install zip from SD card', select the ZIP file.

Reboot. See if everything works properly.

I KNOW THERE MIGHT BE ZILLIONS OF ERRORS IN THIS GUIDE. IF YOU'RE STUCK AT SOME POINT OR CANNOT UNDERSTAND SOMETHING, TELL ME. I'LL TRY TO MAKE THIS GUIDE MORE EASIER TO UNDERSTAND.

THIS IS A BASIC SOFT-MODDING GUIDE. I'M DOING SOME INVESTIGATION REGARDING THEMING AND BUILD.PROP TWEAKS. I'LL BE ADDING THESE SECTIONS LATER.