How To – Create Your Own Custom ROM for Android, Part 2 – Creating Your First ROM

I. Before You Begin

1. We are assuming you have already setup the Android kitchen. If not, use our How To Setup The Kitchen procedure and then come back to this one when done.

2. We are also assuming you have already done our How To Root and How To Load a Custom ROM for your phone and have a custom recovery image.

2. This ONLY works for HTC Android devices at the moment, later versions might support others (check here for an update when it does).

3. Open the Kitchen in your Ubuntu Virtual Machine we created in the Kitchen Setup procedure by typing ./menu in the Terminal window in Ubuntu. Leave it open.

4. All of this is done INSIDE THE UBUNTU VIRTUAL MACHINE (that includes when I say “save to your computer” anywhere in here, means save to you Ubuntu Virtual Machine)!

II. Find a ROM to Dissect

There are two kinds of ROMs you can dissect to create your own custom ROM; Stock ROMs and Custom/Cooked ROMs. DsiXDA, creator of the ROM kitchen we are using, has put together a list of places to get stock ROMs for different devices and a quick how to load them into the kitchen:

From a Cooked ROM (Easiest Method):

1. Copy the update.zip (or equivalent ZIP file) to the original_update folder in the kitchen

2. Type the number for the option “Setup Working Folder from ROM” and hit enter in the Kitchen to create your working folder. (So if its number is 1, type 1 then hit enter).

From a Shipped ROM:

1. Find the shipped ROM for your device, usually from htc.com or from searching xda-developers (check the Wiki or sticky posts under your device’s sub-forum).
The links below may help:

HTC Hero
Google Nexus One
HTC Magic
HTC Tattoo
HTC Droid Eris

2a. If the shipped ROM is in a .ZIP format, then simply extract the system.img and boot.img.

2b. If the shipped ROM is in .EXE format, then do the following:

A. In Windows, run the shipped ROM’s .EXE file till it gets to the first dialog. Stop there but don’t close the window yet.
B. Go to Start->Run and type: %TEMP%
C. When the folder opens, search for Rom.zip. Then, open it with an unzip tool. If you get errors trying to open the ZIP file with WinZip or the default Windows unzip program, then use 7Zip (download from here) to extract it.
D. Extract only two files from Rom.zip: system.img and boot.img

3. Copy the two .IMG files to your kitchen’s img_files folder in your Ubuntu Virtual Machine.

4. In the Terminal window that you opened in Section I, type 1 and hit enter to create a working folder from the two .img files.

Now, that you have either the update.zip in the original_update folder of the kitchen OR the system.img and boot.img of a shipped ROM in the img_files folder of the kitchen, you are ready to play with the ROM to make it your own.

III. Tweaking the Imported ROM Using the Automated Options in the Kitchen

So this is a basic kitchen, but you can do things like, add Root support, add/remove apps from the ROM, enable saving apps to the sd card, enabling Wifi tethering, do some automatic optimizations, and a few other things automatically just by selecting the option and hitting enter. It even allows you to put in your own scripts for the ROM to run (but that’s for more advanced users who know how to create scripts of course).

1. After importing a ROM using section II, select the options you want to do to the ROM (by typing the number of the option you want into the terminal/kitchen window and hitting enter. They are all pretty self explanatory.)

2. Continue this until you have all the automated options you want in the new ROM.

IV. Adding/Removing Applications from the ROM

1. In your Ubuntu Virtual Machine, goto Places at the top. Then click on Home Folder, then the WORKING folder that was created in section II when you dissected the original ROM or img files. Then goto system > app. (Also check Data > App as .apks can be put in there as well).

2. In the app folder you will see all the .apk files for all the applications you have currently in the ROM. Simply delete the ones you do not want to remove them from the ROM.

3. To add applications, simply copy any .apk file for the applications you want to add into the app folder.

V. Repackage the ROM so it can be Flashed onto a Phone

1. Once you have done whatever changes you want, you just need to type 99 and hit enter in the kitchen/terminal for the kitchen to take the working folder you have been messing with and compile it into a flashable update.zip ROM.

2. Once it is done compiling the ROM, we can transfer it to our phone.

VIa. Setup Ubuntu to See Your Phone via USB

1. In the Virtual Box windows with Ubuntu in it, click on Devices at the top then click Install Guest Additions. (It should autostart, if it doesn’t, click on the CD that appeared on the desktop in Ubuntu and then click on Autostart.sh. It will ask you for your password you created when setting up Ubuntu, put that in and let it install).

2. Once the Guest Additions are installed, close the Virtual Box Ubuntu Window (choose to Power Down the Machine).

3. Now, open Virtual Box itself (not Ubuntu) and highlight the Ubuntu machine, then click on Settings at the top.

4. Click on USB and make sure Enable USB Controller and Enable USB 2.0 are both enabled.

5. Now plug in your Android phone (do NOT mount the SD card, just plug it in).

6. Now in the USB menu of Virtual Box, click the + symbol on the right and then select your Android Device (name may be different).

7. Once that is installed, unplug your phone.

8. Now, Start your Ubuntu Virtual Box.

9. Once Ubuntu boots up, plug in your Android phone (do not mount the memory card yet) and look for the USB symbol at the bottom (fourth icon from the left) and hover over it and wait for it to say USB Device detected and display your phone. Once that happens, mount the sd card by pulling down the notification bar on your phone and clicking mount.

10. Ubuntu should pop up your SD card on the desktop (if any prompts come up just select do nothing and click ok). We can now transfer files to the memory card of our phone.

VIb. Use RapidShare to Transfer the File from Ubuntu to Windows (if Section VIa was giving you trouble)

1. If you can’t get the USB to work in Ubuntu, then simply open a Firefox browser window, goto Rapidshare.com and upload the ROM to there.

2.Once it is done uploading, ON YOUR WINDOWS COMPUTER NOT UBUNTU, put in the link it gave you when you finished uploading it, to download it to your Windows computer so we can transfer it to your phone.

VII. Flash the ROM

5. Copy the .zip file to the root of your SD card (NOT in any folders, just on the SD card itself).

6. Unplug the phone and turn it off.

7. Turn it back on by holding down home and power (do not let go until the recovery screen comes up) to get to recovery mode (you must have a custom recovery screen to do this, if you don’t find out How To Root and Load a ROM procedure for your phone and do those first).

8. Now select Nandroid Backup to create a backup before we flash the new ROM.

9. Once the backup is done, select Wipe Data / Factory Reset in recovery mode.

10. Select flash zip from sd card and select the ROM you just put on the sd card.

11. Once it is done flashing, click reboot. Enjoy!

Enjoy! Will update this as we add more things for you to tweak 🙂 Feel free to suggest some in the meantime.

Thanks to DsiXDA for his awesome kitchen!

34 thoughts on “How To – Create Your Own Custom ROM for Android, Part 2 – Creating Your First ROM”

  1. I found that you can actually use your usb drive to copy the ROM over too, then ctrl out of ubuntu and plug the phone in and then copy over… nice…

  2. Very well done video, thank you 🙂

    Just want to advise users here, in the video where Unlockr was referring to the kitchen’s option entitled “Set up working folder from cooked ROM”, it was shown under option #11. In the recent versions of this kitchen, however, it is now under option #2.

    Also, the video shows you the easy way to transfer your ROM to your device (ie. through Rapidshare or other file-hosting service). However, if you feel this takes too much time and are willing to do some advanced stuff, there are two things you can do:

    1) Transfer the completed ROM from the OUTPUT_ZIP folder (under VirtualBox Ubuntu session) to a shared folder under Windows. Read here:
    http://forums.virtualbox.org/viewtopic.php?f=3&t=15868

    From there, you can transfer the file from Windows to your Android device.

    OR

    2) Have your Android device show up under the Virtualbox Ubuntu session when you plug it in (under the Places menu):

    http://techtooltip.wordpress.com/2008/09/22/how-to-use-host-usb-device-from-guest-in-virtual-box/

    Have fun!

  3. Ok great vid bro made a few customs. Need a bit more help were can I find out how to add wallpapers that I want to be default when they flash my rom ?

    If anyone wants fonts jusvisit my blog site http://www.androidhustler.blogspot.com and scroll down till you see g1 fonts. They will be pretty basic but should do until other flashable zip files are found

  4. let’s say i have a cynagenmod that i want as a base.
    but i also have an update.zip file that adds a specific function such as “removing apps from the main screen” or whatever

    how can i add the update to the ROM ?
    Thanks

  5. I keep getting this error.

    update.zip created, ready for signing

    Signing update.zip as signed_060610_021000.zip …
    scripts/build_rom: line 129: java: command not found

    Was not able to create signed_060610_021000.zip!

    Ensure you have a recent version of the Sun Java JDK

    Press Enter to continue

  6. Nobody else has mentioned this so I must be missing it but where it the “img_files” folder located? Can’t find it.

  7. How do i add a custom kernel to my ROM? I dont have a ROM that is using this kernel, all i have is the zip for the kernel itsself. I want this kernel to be used with the ROM automatically instead of having to flash ROM and then flash the kernel.

    1. Ok these are my Issues I am seeing

      Ensure the ROM is under the original_update folder. The format
      may be one of the following:

      – A ZIP file for a cooked ROM (e.g. update.zip)
      – A ZIP file containing *.img (e.g. rom.zip from shipped ROM)
      – boot.img + system.img (e.g. from shipped ROM or Nandroid)

      Press Enter to continue

      [: 75: 0: unexpected operator
      [: 34: DamageControl-3.5-final.zip: unexpected operator
      scripts/choose_rom: 73: file_array[1]=DamageControl-3.5-final.zip: not found
      [: 73: DamageControl-3.5-final.zip: unexpected operator

      Available ROMs:

      (1) DamageControl-3.5-final.zip

      Enter file number (0 = cancel):

  8. I get stuck at Set up working folder from ROM…please help …it keep asking me to “Enter file number” what does that mean?

  9. ok I have an other question, I have downloaded all the Customed Roms I ever tried which is like 15 or so
    When I use the Options in the Kitchen such as Set up a Folder from a Cooked rom I press Enter
    and Enter Again, all I see is bunch or errors such as Unexpected Error .. On each Rom I have in original Update Folder.

    Even when I choose one of the options Using 1 for first rom on the list I press enter and nothing happens just takes me to the main menu

    1. Themadmen,

      It could be used to help you make a ROM but the kitchen used only really works on HTC phones so it wouldn’t be able to make the actual ROM for you.

  10. I am also getting the same error as ACE is there something we are doing wrong?

    Ensure the ROM is under the original_update folder. The format
    may be one of the following:

    – A ZIP file for a cooked ROM (e.g. update.zip)
    – A ZIP file containing *.img (e.g. rom.zip from shipped ROM)
    – boot.img + system.img (e.g. from shipped ROM or Nandroid)

    Press Enter to continue

    [: 75: 0: unexpected operator
    [: 34: DamageControl-3.5-final.zip: unexpected operator
    scripts/choose_rom: 73: file_array[1]=DamageControl-3.5-final.zip: not found
    [: 73: DamageControl-3.5-final.zip: unexpected operator

    Available ROMs:

    (1) DamageControl-3.5-final.zip

    Enter file number (0 = cancel):

    if you enter 1 nothing happens an it just returns to the main menu

  11. I followed the guide, added the apks i backed up from my phone to the apps folder, flashed the rom, it booted ok but none of the apks i added installed

  12. Hey I have been searching this for a while now and can’t find my answer. I went through the kitchen no problems it made the zip and I uploaded it to rapidshare then emailed the link to myself then downloaded it. When I transfer it to my sdcard , it says “signed .zip is bad” that’s what it says in a nutshell. Yes I have made sure I removed the sdcard properly, I did it 4 times no luck. Any ideas?

  13. step VIb. Use RapidShare is a long way around. You can setup a network connection between virtual box and the real os.

  14. Maybe I’m missing something…but besides the options on the main page (0-10 and 99) and adding/deleting apps, there doesn’t seem to be too much customization possible. Maybe it’s just beyond my abilities or maybe I was expecting too much from this?

    I was expecting to download multiple roms, pick out the best parts of each one, combine them into one and have it exactly how I want it. For example, I really like the EViO rom for my EVO, but any possible customizing I can do to that rom in this kitchen, is already done. I found myself just deleting and adding .apk files to it which is pointless because all the apps I like will be downloaded from the cloud and I can use titanium backup to freeze/delete any bloatware I don’t want.

    I guess to wrap it up….
    1) Is there something I’m missing with this kitchen?
    2) Are my ideas of customizing a rom impossible without writing my own or finding and editing some code?

  15. Alan_jeddiel_17

    my question… this only works with only virtual box wiht ubuntu… becouse i have my computer already with ubuntu!!!

  16. Alan_jeddiel_17

    im having problems with the kitchen… when i go to terminal and tipe ./menu the kitchen comes up but saing that i dont have the java application installed.. wierd becouse i installed all the java steps in the thread sucesfully with no problems can you help me theunlockr… thanx in advice

  17. Hi,

    I have created my zip successfully through the android kitchen but when trying to install the rom on my HTC EVO 3D Iget error E: sdcard (error 0). installation aborted.

    What is going on??? The phone is rooted, S-OFF and running cwm. Any advice??

    I dissected the original Rogers firmware by removing the rogers boot logo and all the bloatware.

    Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.