Building Custom ROM[Android]

In this tutorial we will go through the installation and building a custom ROM from Source ROM’s and cooked custom ROM’s.

First to set up dsixda’s Android Kitchen v0.223.

For Windows(XP,7,8,2000)

You have three options in Windows, so choose one (I use #3, the Wubi Linux method, as the kitchen runs fastest there):

  • (WINDOWS OPTION 1) Install Cygwin, which is a Unix environment for Windows. Keep in mind, however, that the kitchen runs much slower on Cygwin than on Linux or Mac OS X, and Cygwin (because it is a Windows utility) sometimes has issues detecting symbolic links in ROMs and upper/lower case differences between files.I’ve done as much as I can to resolve some Cygwin issues in the kitchen, so most of the time it works great, but it’s not always perfect. For the kitchen, you can install a custom Cygwin that has all the required packages to run my scripts:
    1. Download and install Java JRE for Windows from this link.
    2. Go to http://www.cygwin.com to download the setup.exe. DON’T install it yet.
    3. See the attachment called ‘cygwin_install.txt‘ at the end of this post to install Cygwin and the required packages for the kitchen. It also contains instructions for making Java work within Cygwin. NOTE: You cannot run the kitchen without the packages specified in this help file!

    NOTE: If you already have an old installation of Cygwin on your PC, you might be missing some packages that are required for the kitchen to work. Open the ‘cygwin_install.txt’ attachment to see which packages you may need to install.

  • (WINDOWS OPTION 2) If you want Linux instead of Cygwin, and you want it to be installed safely (no partitions or bootup modifications), then you’ll need to download a “virtual machine” in Windows.Using virtual machine software means you don’t need to go through the trouble of creating a brand new partition or wiping out your hard drive just to install Linux. You can run itinside of Windows.NOTE: You’ll need a fast PC with lots of RAM!Click here for video tutorial from theunlockr.com to assist you with the Ubuntu Linux install.
    1. First, download and install the virtual machine software (e.g. the free VirtualBox, or pay for VMWare).
    2. Next, we’ll need to install Ubuntu Linux inside of it. Follow the instructions in the next section (“Ubuntu Linux”) for setting it up for the kitchen.
  • (WINDOWS OPTION 3) If you want Linux but think Virtual Box is too much effort to install, or it runs too slow for you, then you can try the ‘Wubi’ installer from Windows. This method will install Ubuntu Linux inside a file in your Windows operating system and will boot from it.Use this method only as a last resort, as it will modify your PC’s boot loader and may also require some hunting for video drivers if you’re not lucky. The benefit to this method is that it runs the kitchen super fast. The downside is that setting it up may require some technical expertise and Linux experience! If it’s not working out for you, just go back to Windows and run the Wubi installer again to uninstall.You can find lots more info about Wubi in YouTube and Google search. In the meantime, here is a summary of instructions:
    1. First, download and install the Wubi installer. A good size to allocate for Ubuntu would be 20 GB (e.g. for Ubuntu 12.10).
    2. When it finishes installing, the PC will reboot. Select Ubuntu from the boot selection menu.

      NOTE:
       If the screen remains blank afterwards and never shows the login screen, then you have a video driver issue. You will need to reboot, and then at the Ubuntu boot options, press ‘e’ to edit the command line. To force the generic video drivers you will need to add something like this: nomodeset (Just Google it)
    3. When you arrive at the desktop, configure your Wi-Fi connection by clicking on the seashell-shaped icon at the top right section of the screen.
    4. Follow the instructions in the next section of this FAQ (“Ubuntu Linux”) for installing Java. That should be all you need to do. I really hope this helped you out.NOTE: If you had to do the video workaround earlier on, then you’ll need to edit /etc/default/grub and change the appropriate lines so that it always boots up in this mode and so you won’t need to edit it every time in the boot menu. i.e. Open up an xterm and then type sudo vi /etc/default/grub, modify the file, then type sudo update-grub. Again, Google is your friend.
    5. TIP: You can find your PC’s Windows file system under the /host folder.

For Linux(Ubuntu Recommended)

  • Download the Ubuntu Linux CD ISO image. The latest version is here at this link. You can either install it inside a virtual machine in Windows, or by itself on a separate partition on your PC. Other Linux distributions may work (e.g. Fedora, Mint), but have not been fully tested.
    • If you’re using a virtual machine like VirtualBox to install Ubuntu, then create a New virtual machine; go to Settings, and in the Storage menu choose the Ubuntu .ISO file as the CD/DVD device. When you Start the virtual computer, it will boot from this “virtual” CD. Then you can install Ubuntu. I would recommend a virtual hard disk size of around 25GB and that you allocate about 1.5GB of your PC’s RAM to Ubuntu.
    • If you instead want to install Linux on a brand new partition on your PC, I won’t provide the details about installation — you should be able to figure this out, or use Google. But I wouldn’t recommend this method if you’re new to Linux; it may not be safe and you run the risk of messing up your other partitions if you don’t know what you’re doing.
  • After Ubuntu is finished installing, you need to install the Sun Java JDK as well:
    1. Open up an ‘xterm’ window (shortcut: CTRL + ALT + T)
    2. If you’re using a 64-bit version of Ubuntu, then type this in your xterm: sudo apt-get install ia32-libs
    3. Open up the shortcut for the Ubuntu Software Center (the ‘Ubuntu market’), click on the search option in the top right (where the binoculars are) and type: java(If you don’t have the Software Center, install it with ‘sudo apt-get install software-center’)
    4. You should get a bunch of results, but you only need “OpenJDK Java Runtime”, which should normally be the first result. Click on “Install”
    5. After installation has completed, verify Java has been installed by typing in an xterm: java -version
    6. NOTE: If you are unable to get these steps working (e.g. you have Ubuntu installed on a USB drive), then follow this old procedure.
  • If you used Virtual Box on your PC to install Ubuntu, then the following steps will finish up your installation:
    • Install the Guest Additions
      • NOTE: If you followed the guide and ‘cd /media/cdrom’ does not exist, then type instead: cd /media/VBOX* )
    • Next, if you want to copy ROMs and other files between Windows and your Linux Virtual Box, then do this:
      1. Create a folder on your PC that you want to be accessed from Linux. e.g. C:\temp
      2. From your Ubuntu session, click on Devices –> Shared Folders. Then click on the “+” sign to add a New Share.
      3. Type the Folder Path (e.g. C:\temp) and give it a Folder Name (e.g. pc_temp), and check the Make Permanent box. Click OK to close the dialogs.
      4. Open a terminal in Ubuntu and create a folder that will mirror the contents of your PC’s shared folder. e.g. mkdir ~/shared
      5. Then mount the reference to the PC folder to your new Ubuntu folder, e.g. sudo mount -t vboxsf pc_temp ~/shared
      6. If successful, then whatever you copy to your PC’s folder (e.g. C:\temp) will also be seen under the new folder (e.g. ~/shared) in Ubuntu.
      7. If you want this Ubuntu folder to be automatically created every time you reboot into Ubuntu:
        • Type: sudo vi /etc/rc.local
        • In the rc.local file you will need to insert a line before the ‘exit’ statement; this line will contain the ‘mount’ command as shown above. But this time replace the tilde (~) with /home/your_user_id, e.g. sudo mount -t vboxsf pc_temp /home/your_user_id/shared
        • If you need help with vi or any other editor, google it. You need to use ‘sudo’ (as shown in first step) before you edit a system file like rc.local.
    • OPTIONAL: If you want your Android device to show up as a USB device under Linux automatically, you need to create a USB Filter in the VirtualBox Settings. Follow the guide here.

For Mac OS X

  • You need OS X 10.4 (Tiger) or higher on an Intel-based Mac (PPC-based systems will have problems).
  • Ensure you have the Sun Java JDK. This normally comes installed already on your Mac. To test, just type in a terminal: java -version
  • Install gcc (C compiler) if you don’t have it by default. Just type ‘gcc’ to verify you have it. Otherwise, follow these instructions to obtain it:
    • It is included in the Xcode Tools package on your installation DVD (more info found in Google) or in the Mac App Store, or go to the Apple developer site to sign up and download the Xcode package (it’s big!)
      • Note: OS X Tiger 10.4 cannot use higher than Xcode 2.5. Use this link to search for older versions
      • Run the Xcode Tools installer to get gcc installed. In newer versions of Xcode you may need to go under its Preferences->Downloads option and install the Command Line Tools to get gcc.
  • Ensure you have the GNU version of wget. To verify you have the correct version, type wget –version. If this command works without error, and it mentions “GNU” in the output, then it should be good.
    • If that doesn’t work, you might have to build the GNU version of ‘wget’:
      • Go to the GNU site to grab the latest tar.gz of wget (I found wget-1.12 worked best).
      • Go to the folder containing the extracted files, and type: ./configure; make; sudo make install
      • Confirm that the system defaults to the GNU version of wget, by opening a new terminal and typing “wget –version” again. Otherwise, type: sudo cp /usr/local/bin/wget /usr/bin/wget
  • Ensure you have the GNU version of sed, as the default Mac OS X version (FreeBSD) of sed is not compatible with the kitchen. To verify you have the correct version, type sed –version. If this command works without error, and it mentions “GNU” in the output, then it should be good.
    • If that doesn’t work, you might have to build the GNU version of ‘sed’:
      • Go to the GNU site to grab the latest tar.gz of sed.
      • Go to the folder containing the extracted files, and type: ./configure; make; sudo make install
      • Confirm that the system defaults to the GNU version of sed, by opening a new terminal and typing “sed –version” again. Otherwise, type: sudo cp /usr/local/bin/sed /usr/bin/sed
  • Ensure you have the GNU version of od, as the default Mac OS X version (FreeBSD) of od is not compatible with the kitchen. To verify you have the correct version, type od –version. If this command works without error, and it mentions “GNU” in the output, then it should be good.
    • If that doesn’t work, you might have to build the GNU version of ‘od’:
      • Go to the GNU site to grab the latest tar.gz of coreutils.
      • Go to the folder containing the extracted files, and type: ./configure –disable-acl; make; sudo make install
      • Confirm that the system defaults to the GNU version of od, by opening a new terminal and typing “od –version” again. Otherwise, type: sudo cp /usr/local/bin/od /usr/bin/od
  • Install the FUSE tools:
    • If you have a 64-bit Mac system (newer), then install OSXFUSE first, and select the MacFUSE Compatibility Layer when you install it. If you have a 32-bit Mac system, install MacFUSE instead.
    • After the above step is completed, install fuse-ext2
    • Test the installation by typing “fuse-ext2” at a command prompt. If you get a “Library not loaded” error then you have an incompatible version of MacFUSE (usually because your Mac may be 64-bit and you are using an older 32-bit version). Just install the correct version.
  • If you’ve come this far and managed to complete all the steps successfully, then give yourself a pat on the back!! 

After following the setup for the operating system, how do I use the kitchen?

Summary:

  1. Download The Android Kitchen v0.223
  2. Extract it
  3. Move it to the folder C:\cygwin\home\<your user id>
  4. Double Click on cygwin terminal on the desktop.
  5. write the line ‘./menu’ without quotes and press enter.
  6. and Done!!! Kitchen is ready to cook your ROM!!!

Video Tutorial For this Post:

Part #1,Part #2,Part #3,Part #4,Part#5 


One thought on “Building Custom ROM[Android]

    ロレックス アンティーク said:
    September 11, 2013 at 4:37 am

    ブーツ メンズ 激安

Leave a comment