[KITCHEN] Android Kitchen, v0.198 [Linux / Mac / Windows]

dsixda's Android Kitchen

Compatible with Windows (Cygwin) / Linux / Mac OS X

UPDATE (JULY 11, 2012):

Ideally, I want to say that this project is now 'retired', but I'll be updating the kitchen once in a while, on my own terms, and when I need to. The reasons are, I cannot keep up anymore with the hundreds (thousands?) of different devices out there; plus, unfortunately I have permanent damage to my right wrist (this is not an excuse; it was a consequence of the work I spent on the kitchen) and cannot continue updating like I used to. On top of that, like everyone else, I have family and work obligations. So please, no more requests. if there is anything urgent, you can reach me on Twitter.

I request you to read all of post #1 -- please do not PM me about whether your device is supported or not, or whether I can do the work to research and support your device. I get asked this almost every day.

This doesn't necessarily mean the kitchen won't work anymore in the future. Please refer to the information in this post for how to get newer HTC devices (and possibly other devices) to work with the kitchen. I really hope this kitchen helps you out. If you want to, send me a tweet or hit 'Thanks' at the end of this post (or whatever else) to let me know it worked out for you. :-)


Who is this kitchen for?
  • Those who are brand new to creating custom ROMs and want an easy place to start learning
  • Those who just want to modify shipped ROMs or someone else's custom ROMs to their liking
  • Those who are confused by all those scripts and complex commands required for building and extracting

This is NOT a tool to automatically turn you into a full-fledged ROM developer. ROM development normally involves work from the ground up and involves time, research and patience. I am just giving the tools to help the average person get things done quickly from an existing base.


Code:
===================================================================
Android Kitchen - by dsixda (xda-developers.com)
===================================================================

Main Menu

1. Set up working folder from ROM
2. Add root permissions
3. Add BusyBox
4. Disable boot screen sounds
5. Add wireless tethering
6. Zipalign all *.apk files to optimize RAM usage
7. Change wipe status of ROM
8. Change name of ROM
9. Check update-script for errors
10. Show working folder information

Advanced Options

11 - Deodex files in your ROM
12 - Add task killer tweak for speed (stock ROM only)
13 - Add /data/app functionality
14 - Add Nano text editor + sysro/sysrw
15 - Add Bash (command shell)
16 - Add Apps2SD
17 - Add /etc/init.d scripts support (busybox run-parts)
18 - Add custom boot animation functionality
19 - Porting tools (experimental)
20 - Tools for boot image (unpack/re-pack/etc.)
21 - Unpack data.img
22 - Sign APK or ZIP file(s)
23 - Convert update-script or updater-script
24 - Miscellaneous optins / Plugin scripts

99. Build ROM from working folder
00. About/Update kitchen
0. Exit


This kitchen is mainly intended for HTC devices and has support for the following HTC devices:

WARNING: If your HTC device is not listed below, and it does NOT use a 'YAFFS'-based filesystem (e.g. usually the mid-range and high-end devices don't use YAFFS), do not attempt to flash a ROM that you built with this kitchen. Instead, you must do the following if your device is NOT listed:
  1. Create a file under the kitchen's /tools/edify_defs folder, with the name being the same as the value of ro.product.device (found in your device's /system/build.prop file).
  2. See the template file in the edify_defs folder to see how to set the mount points inside the file you created. Look at the other files in that folder for examples on how to do it.

Code:
HTC Aria / Liberty 

HTC Desire

HTC Desire HD / Inspire 4G

HTC Desire S

HTC Desire Z / Vision / T-Mobile G2

HTC Dream / G1

HTC Droid Eris

HTC Evo 3D

HTC Evo 4G

HTC Evo 4G LTE

HTC Evo View 4G (untested)

HTC Evo Shift 4G

HTC Flyer (untested)

HTC HD2
- Use NAND ROM method (Please follow this thread for details)

HTC Hero / G2 Touch

HTC Incredible

HTC Incredible 2

HTC Incredible S

HTC Legend

HTC Magic / myTouch 3G

HTC myTouch 3G Slide

HTC myTouch 4G / Glacier

HTC Nexus One

HTC One X
- no ROM support, but de-odexing only! (Here is the guide to de-odex)

HTC One XL

HTC Rezound

HTC Sensation

HTC Tattoo / Click

HTC Thunderbolt

HTC Wildfire / Buzz

HTC Wildfire S
There is also support for the following non-HTC devices (and perhaps more that are not mentioned here):
NOTE: If your device is not mentioned here, then I don't know the extent of its support - please don't ask.


Code:
Acer Liquid

Dell Streak 7

Huawei Ideos X6
- Please follow this thread for details

Huawei U8100/U8110/U8120/U8150/U8160/U8180/U8650

Huawei U8220 / T-Mobile Pulse

LG Ally

LG GT540 Optimus

LG Optimus 2X (P990)

LG Optimus Black
- Please follow this thread for details

LG Optimus G2X (P999)

LG P500
- Please follow this thread for details

LG Shine Plus

LG Vortex

Micromax A60

Motorola Atrix (unconfirmed)

Motorola CLIQ / CLIQ XT

Motorola Droid

Motorola Droid Bionic
- Please follow this thread for details

Motorola Milestone (unconfirmed)
- You may need to remove the boot.img before building

Samsung Galaxy Mini

Samsung Galaxy Nexus (untested, 'maguro' and 'toro' versions only)

Samsung Galaxy S (GT-I9000 and most variants)
- Please follow this thread for details

Samsung Galaxy S Plus (GT-I9001)
- Please follow this thread for details

Samsung Galaxy S2 (GT-I9100 and Exynos CPU variants)
- Please follow this thread for details

Samsung Galaxy S2 LTE (AT&T Skyrocket, T-Mobile SGH-T989 and equivalent)
- Please follow this thread for details

Samsung Galaxy S2 HD LTE (Bell SGH-I757M only)
- Please follow this thread for details

Samsung Galaxy W (GT-I8150)
- Please follow this thread for details

Samsung Nexus S / Nexus S 4G

Sony Xperia X10 / X10 Mini / X10 Mini Pro
- Build ROM without boot.img (please follow this thread for details)

Sony Xperia Neo (Nandroid backups only)
- Please follow this thread for details

ZTE Blade / Orange San Francisco

NOTE: A custom recovery menu is required to flash the ROMs!




KITCHEN DOWNLOAD AND HELP

WARNING: Before asking questions, save your time (and mine) by reading the FREQUENTLY ASKED QUESTIONS in Posts below
  • for setup instructions;
  • for problems using the kitchen
  • for ROM issues, such as your device not booting
PLEASE NOTE: This is not a 'How to Cook' tutorial thread! I cannot help you as I only write scripts and am not an expert; use the forum for those questions. Refer to this thread's FAQ for everything else. Most likely your question has already been asked more than once!


DOWNLOAD KITCHEN @ GitHub

RELEASE NOTES
HELP / FREQUENTLY ASKED QUESTIONS
LIST OF SUPPORTED DEVICES - SCROLL UP!




Support my work, buy my daughter a toy :-)




OPTIONAL: Download User-Contributed Plugins (used in Advanced Menu of Kitchen)

  1. Android Builder - by gnarlyc
    Downloads the Android open source code for use with the kitchen
  2. Application Verifier for Data Partition - by StenaviN
    Fixes issue where certain apps under /data/app folder of ROM cause force-close
  3. Update Hosts - by -Mr. X-
    Generates an ad-free 'hosts' file



Acknowledgements

Thanks to all the people who use the kitchen and also to those who voluntarily donated.

Reading and searching will always help you in this forum. I learned everything from several places, but these are the best sources:
And also thanks to all the Android developers and cooks who supplied the binaries for this kitchen. Last but not least, thanks to the custom recovery image developers, without whom the flashing of these ROMs would not be possible (Koush, Amon_RA, etc.). They all gave me the inspiration to create a kitchen!

Release Notes

Version 0.198 (July 11, 2012):
  • Major update for deodexing tools; much simpler - no more need to specify class file dependencies
  • Added updater-script support for HTC Evo 4G LTE

Version 0.197 (July 1, 2012):
  • Added 'refresh' option and improved error checking for ROMs menu list
  • In boot.img extraction option, support also recovery.img without user needing to rename it to boot.img
  • Added updater-script support for HTC One XL and Samsung Galaxy Mini, thanks to user submissions.

Version 0.196 (June 10, 2012):
  • Added definition file for SGH-I757M (Bell SGS2 HD LTE).

Version 0.195 (May 30, 2012):
  • Fixed issue where ramdisk load address was set wrong by kitchen when re-packing a boot.img for some newer devices (e.g. HTC Evo 4G LTE), which caused unbootable ROM.

Version 0.194 (May 17, 2012):
  • Display warning in Cygwin if leftover symlinks found before building ROM (this is only a Cygwin issue, where the symlinks may get corrupted when flashed). The kitchen will show the files involved and explain the actions to take.

Version 0.193 (May 5, 2012):
  • Fixed some stability issues in ICS (especially for Galaxy S2) when creating ROM from stock firmware in Cygwin
  • Remove .DS_Store files when initializing kitchen in OS X

Version 0.192 (April 14, 2012):
  • Fixed syntax issue with newer versions of Mac OS X when copying RFS files from mounted volume. Files under /system were copied to a subfolder named 'RFS' by mistake.
  • Fixed 'Resource busy' issues in OS X when unmounting RFS file system.

Version 0.191 (April 2, 2012):
  • Added check for GNU version of 'od' when kitchen starts up (Mac users - please read FAQ for help if your system fails check)
  • Fixed issue where fuse-ext2 (Mac OS X) may not run if installed under /usr/local/bin
  • Added Samsung RFS support for Mac OS X
  • Fixed issue where Samsung CSC could not be extracted in Mac OS X (ie. cache.rfs, cache.img, cache.img.ext4)

Version 0.190 (March 26, 2012):
  • Change end-of-line characters in update(r)-script to proper format when building ROM. This gets done in case a noob modified the file with non-Unix compliant editor. Prevents 'Status 6' error when flashing ROM in custom recovery.

Version 0.189 (March 24, 2012):
  • Fixed issue where system.img.ext4 and cache.img.ext4 were not removed if non-sparse (e.g. Galaxy S Plus ROMs)

Version 0.188 (February 12, 2012):
  • Added check for 'zip' and 'unzip' binaries before starting kitchen
  • Added API Level parameter in Decompile APK plugin
  • Updated help text in certain scripts to prevent more newbie confusion
  • Added updater-script mount points for Galaxy W (GT-I8150)

Version 0.187 (January 19, 2012):
  • Fixed issue where symlinks were not detected in newer RFS-based ROMs, e.g. for Samsung Infuse 4G
  • Fixed issue where system.ext4.tar and PDA.tar were shown twice in ROMs menu

Version 0.186 (January 18, 2012):
  • Fixed issue where ICS ROMs built for SGS2 had Samsung keypad not opening but displaying error
  • Added support for SGS2 Nandroid backups that use system.ext4.tar and boot.img
  • Fixed issue where flash_image/redbend_ua were not removed if zImage/modem.bin no longer present in ROM (Galaxy S2/S)

Version 0.185 (January 14, 2012):
  • Updated deodex tools to 1.3.2
  • Fixed issue where we couldn't disable boot sounds for Galaxy S2 leaked 4.0 ROMs

Version 0.184 (January 8, 2012):
  • In boot.img Tools option, when showing boot.img information, check for valid or supported boot.img before displaying info
  • Show error if user tries to extract contents of boot.img but zImage (kernel) is empty -- this is because boot.img is not in a supported format

Version 0.183 (December 24, 2011):
  • Added Samsung Galaxy Nexus updater-script support
  • Updated BusyBox to 19.3
  • Fixed issue where Zipalign may try to run on a folder that has a name that ends with 'apk'
  • Sped up removing of APK files from CSC (Samsung Galaxy S/S2/S Plus)
  • Added BusyBox run-parts support for Honeycomb/ICS


Release notes for all previous versions starting at Version 0.1 are found in the attachment below

Frequently Asked Questions - Page 1


What operating systems are supported, and how do I set them up for the kitchen?

Choose one of the installation methods based on your computer's current operating system:



1) Windows (2000, XP, Vista, 7)

You have three options in Windows, so choose one (installation is simpler if you use the Cygwin method):
  • (WINDOWS OPTION 1) Install Cygwin, which is a Unix environment for Windows. You can install a custom Cygwin that has all the required packages to run the kitchen:

    Click here for a pictorial guide to assist you with the Cygwin install (thanks to carl1961).

    1. Download and install the Java JDK for Windows 32-bit from here or directly from java.sun.com (requires an email address) (WARNING: Do not install Cygwin before the JDK!! If you already installed Cygwin, then see NOTE2 below.)
    2. Download the file dsixda_cygwin_install.zip, unzip it and follow the instructions in the "kitchen_readme.txt" file to install a customized version of Cygwin. Done!

    NOTE: If you already have an old installation of Cygwin on your PC, it may not work with the kitchen due to missing packages. Open the 'cygwin_required.txt' attachment (end of this post) to see which packages you may need to install.
    NOTE2: If you had installed Java after Cygwin, then the kitchen may have issues finding the Java executable file, which will require an edit of the .bash_profile file. See here to fix it.

  • (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 it inside 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 15GB (e.g. for Ubuntu 11.04).
    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: i915.modeset=0 xforcevesa (This worked for me, but Google it for more info!)
    3. At the login screen, while entering your password, you will notice an option at the bottom to boot into 'Ubuntu Classic'. Select this mode, as it is more convenient to use. Then, enter your password to continue.
    4. 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.
    5. 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 'xforcevesa' hack earlier on, then you'll need edit /etc/default/grub and change the line beginning with "GRUB_CMDLINE_LINUX_DEFAULT" 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 a terminal from Applications --> Accessories menu, and then type sudo vi /etc/default/grub, modify the file, then type sudo update-grub
    6. TIP: You can find your PC's Windows file system under the /host folder.


2) 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.
    • If you find that Ubuntu is running slow on your PC, then log out of Ubuntu (it's the button on the top right), click on your user ID, and then at the bottom select the menu item that allows you to change to 'Ubuntu Classic'. This minimizes the amount of graphics in the user interface and does make a difference in speed.
  • After Ubuntu is finished installing, you need to install the Sun Java JDK as well:
    1. Open an Ubuntu terminal (Applications menu --> Accessories --> Terminal) and install the Ubuntu Software Center by typing: sudo apt-get install software-center
    2. If you're using a 64-bit version of Ubuntu, you'll need to type this: sudo apt-get install ia32-libs
    3. When this is done, start it up by typing: software-center
    4. When the Software Center opens up, click on the search option in the top right (where the binoculars are) and type: java
    5. You should get a bunch of results, but you only need "OpenJDK Java 6 Runtime", which should normally be the first result. Click on "Install"
    6. After installation has completed, verify Java has been installed by typing in a terminal: java -version
    7. 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
    • 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.

3) 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 kitchen, how do I use kitchen?

Click here for another video tutorial from theunlockr.com!

  1. Download the kitchen from the first post of this thread. Then, extract the kitchen's .zip file to a folder under your home account. In Cygwin, this folder would depend on what was set for your Cygwin install directory, e.g. C:\cygwin\home\John\kitchen
    • NOTE!! If your user folder contains spaces (e.g. C:\cygwin\home\John Smith\kitchen), then the kitchen will not function properly. Instead, copy it under C:\cygwin\home\kitchen.
  2. To run, open up a command prompt (in Cygwin, click on the Cygwin shortcut on your desktop).
  3. Type the command to change to the folder containing the kitchen
    • e.g. if your kitchen is under c:\cygwin\home\John\kitchen, then you would type: cd kitchen.
    • e.g. If your kitchen is instead under c:\cygwin\home\kitchen then you would need to go up one directory level. Type: cd ../kitchen
    • e.g. If your kitchen is instead under c:\cygwin\home\John\blah\stuff\android then you would type: cd blah/stuff/android)
  4. Once you are in the correct folder, start up the kitchen by typing: ./menu
    • NOTE1: If you get a 'permission denied' error, then you must type chmod +x menu and run ./menu again.
    • NOTE2: If you get an error message about the file not being found, then it means you are not in the directory containing the kitchen!
    • NOTE3: If you get an error message about missing binaries, read Part 2 of the FAQ for solutions.
  5. Select Option 1 to set up your working folder (the folder where your ROM is going to be created). To import a ROM into this kitchen, follow the instructions in the section below entitled "How do I import a ROM into the kitchen?"
  6. Modify whatever you'd like in the kitchen
    • If you want the ROM to be able to run apps that require root permissions, select the "Root" option.
    • You can remove unneeded apps (*.apk) from the /system/app folder of your working folder.
    • If you want to add Market or non-stock apps (*.apk) to your ROM (which can be uninstalled or updated from your device later) then select the kitchen's menu option that adds "/data/app functionality". Afterwards you can copy these .apk files to the new /data/app folder of your working folder. If you put those extra apps under /system/app instead then you won't be able to update most of them through the Market.
    • Optional: Read this post for some more information about the fundamentals of creating your ROM with this kitchen.
  7. When you are finished modifying your ROM, just choose Build ROM.
  8. Your completed ROM can now be copied your SD card, ready for flashing from the recovery menu!
  • NOTE: It is always recommended to make a Nandroid backup from the recovery menu before flashing a new ROM!! The recovery menu allows you to recover from a non-bootable ROM.


How do I import a ROM into the kitchen to use as my base?
(The instructions below are for HTC devices in general. For other devices, please visit the appropriate thread.)
  • From a shipped ROM:
    1. First, 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).
      • This link may help: Various devices
      • Please don't ask me for links, as I don't know everything or own all devices. ;-)
    2. The shipped ROM can be found in three different formats. Identify the type you have downloaded:
      • If the shipped ROM is in a .ZIP format, then simply copy it to the kitchen's original_update folder.
      • OR if the shipped ROM consists of system.img and boot.img files, then copy those two files to the kitchen's original_update folder. If the ROM also includes a lib.img (found in some newer HTC ROMs), then copy that as well!
      • OR if the shipped ROM is in an .EXE format, then do the following:
        1. 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.
        2. Go to Start->Run and type: %TEMP%
        3. When the folder opens, search for Rom.zip (use the "magnifying glass" Search button)
        4. Copy Rom.zip to your kitchen's original_update folder
  • OR from a cooked/custom ROM:
    • Copy the update.zip (or equivalent ZIP file) to your kitchen's original_update folder
  • OR from a Nandroid backup (under /sdcard/nandroid) [NOT RECOMMENDED FOR NON-STOCK ROM BACKUPS]:
    • Copy the system.img and boot.img files from the backup folder to your kitchen's original_update folder
    • NOTE: The Nandroid-backup method of ROM customization is not the best method, because the kitchen may not account for various advanced options that were added outside of this kitchen (these options are in the update-script file which was in the original ROM but is not in the backup. The kitchen needs to re-create this file and 'guess' those options). However, it will support Nandroid backups that already have basic features like root, busybox and /data/app functionality.

Frequently Asked Questions - Page 2

(If you can't find your answer below, please try Google first before asking.)

QUESTION: Does the kitchen support ROMs for Device X??

See post #1. If it is not listed there then I have not done anything for it, and I have no idea about it. Keep in mind that this is primarily a kitchen for HTC devices. Most of the ROMs for non-HTC devices that are supported in the kitchen are there because they are easy to support, as their file structure is not much different from that in HTC ROMs. However, certain devices use a completely different ROM file structure, so they are currently not supported in the kitchen. I am also limited by the fact that I only own one or two Android devices at a time, which affects the extent of my testing. Finally, please don't expect me to do every Android known device known to man, as I am a busy guy with mouths to feed, like a lot of you. ;-)

QUESTION: Whenever I double-click on the 'menu' file in Linux or Mac OS X, the screen immediately closes or I get an error like "File not found."

No, do not click on the file. You were instructed to type "./menu" from the command prompt. Follow the instructions as they have been given. Please refrain from asking me this question again and again, or from requesting me to fix it - double-clicking is not how shell scripts are meant to be run!!

QUESTION: Whenever I type ./menu to start the kitchen it says "Permission denied."

Your file attributes are somehow missing the 'execute' flag. Type the command chmod 777 menu (or chmod +x menu) and try ./menu again.

QUESTION: In Cygwin whenever I type ./menu it says the 'clear' command (and/or other binaries like 'chmod') is not found.

Read this for possible solutions. For further help, open up the Cygwin pictorial guide provided in the previous post.

QUESTION: What versions of the Java JDK are supported with this kitchen?

I have successfully built ROMs using Java 5 JDK and also Java 6 JDK.



QUESTION: In the Advanced Menu's boot.img tools, why is there only an option to unpack a boot.img but not to re-pack it?

There is an option, you just need to unpack it first! Read this.

QUESTION: I flashed a ROM and when it boots, it gets stuck on the splash screen (boot loop) or goes back to recovery menu.


If you are stuck on the splash screen, the first thing to try is to wipe the cache and dalvik-cache from the recovery menu. A full wipe may also be required, although I would not recommend it until you try the suggestions below.

Debug the issue with "logcat" (you need the Android SDK to use it):
  1. Take out the battery so that the phone is turned off.
  2. Then, go to the Android SDK, change to its 'tools' folder, and type "adb logcat". It will tell you that it is waiting for a device to be detected.
  3. Plug the phone into your computer's USB port, then turn it back on and check the logcat output. When the phone gets back to the same problem, check the logcat output for any error messages (e.g. missing files). This should tell you what the true problem is, which can hopefully be fixed.
  4. If you want to direct the logcat output to a file, type instead "adb logcat > c:\logcat.txt".
  5. If you want to share the output, paste it to a site like pastebin.com. If it's not a problem with the kitchen then post it in another thread in the Chef forum, rather than in this thread.
Another thing to do is to grab the "recovery.log" file immediately after you flash the bad ROM (BEFORE the first reboot!!). This shows a log of the activity during the current recovery menu session (i.e. during the flash). This log may also show errors that were not caught when you were flashing the ROM.
  1. In Amon_RA Recovery, you can easily access this file by accessing the menu option "Other->Move recovery.log to SD", which moves it to /sdcard/recovery.log.
  2. Otherwise, you can usually find it under /tmp/recovery.log or /cache/recovery.log or /cache/recovery/last_log with ADB. Try to copy it to a location where you can view it. e.g. Type from your computer: "adb shell", followed by "cat /tmp/recovery.log > /sdcard/recovery.log". Alternatively, from your computer you can do: "adb pull /tmp/recovery.log", which will copy it to your computer.
  3. Open up recovery.log with a text editor, but don't use Notepad, because it will put everything on one line instead of multiple lines.
  4. Check recovery.log for any errors that occurred during the flashing process.
Remember, you must grab the recovery log output immediately after flashing and before you reboot. If you had rebooted afterwards, then the flashing's log information would have been cleared and you will need to flash again to get the log output.

QUESTION: After I flashed a ROM, it doesn't boot but I get 'File not found' and/or 'No such file or directory' (usually in reference to /system/bin/sh) error messages in logcat.

The /system partition was not flashed properly due to an issue on your device. This usually could mean one of the following:
  1. You ported the ROM incorrectly. If you open up the recovery log (see the instructions above) you may see the reason, such as the device running out of space or errors copying to the system partition. Sometimes this is because the ROM is too large to fit into the phone's relatively small system partition in the internal flash. In this case, remove unnecessary apps from the system folder until you manage to fit the ROM into your device.
  2. You ran a script in your updater-script/update-script but it had errors, thus halting the flashing process and leaving you with an incomplete flash.
  3. You added Apps2SD to a device that does not support it. Did you ignore the warnings in the Apps2SD screen of the kitchen? :P
An inspection of your recovery log should help you determine the exact cause.

QUESTION: I get errors in the recovery menu when I flash a ROM.


This may mean your update-script/updater-script has errors or there is an issue with how the kitchen created your ROM. Read the rest of the FAQ for potential solutions, or you may need to inspect the recovery.log to debug the issue (see above).

QUESTION: When I flash my ROM, some of my changes don't appear, e.g. Apps copied to my working folder's /data/app.


Check the recovery.log to debug the issue (see above).

QUESTION: Can you help me port a ROM? Or can you tell me if Device X's ROM can be ported to Device Y?

No, I am not an expert on porting so I cannot help you; however, there is a Porting option in the kitchen. Keep in mind though that it is not the magic solution for all devices and will not work all the time. It uses a very generic set of rules for porting, which can be seen if you open up the appropriate script files. The recovery log and logcat tool should help you debug issues with porting (see instructions above).

QUESTION: What is an update-script or updater-script file?

This is a file found under the META-INF/com/google/android folder, and specifies the operations required for flashing your ROM. It performs various file operations, such as creating file shortcuts (also known as symlinks or symbolic links), adding permissions to files, running scripts and copying files and folders. After flashing your ROM this file is not executed again.

The updateR-script is more advanced than the update-script and supports more devices. When you see someone refer to "Edify" format they are talking about the updateR-script; whereas "Amend" format refers to update-script.

The updateR-script also requires an update-binary file included with it. The update-binary contains all the binaries for the commands that the updater-script uses (e.g. set_perm, symlink, format, mount, etc.). The update-script does not need an update-binary.

Unlike the update-script, the updater-script is supported in newer versions of ClockworkMod Recovery.

QUESTION: Why do I need to convert the ROM's updater-script to an update-script when using the kitchen?

First of all, the kitchen supports updater-scripts. BUT, the problem is that the updater-script in different devices (and by different authors) may use various formatting/alignment styles, mount points, partition types and may also employ different commands for the same functionality, and thus there would be an awful lot of variations to check for every time a kitchen script is using it. Hence at the beginning, the kitchen will convert the updater-script into a universal format (e.g. I chose the update-script format) so that all the scripts of the kitchen will work on the ROM without encountering these issues. When the ROM is built, the kitchen converts it back to an updater-script with the correct syntax, and the partition details are fully restored.

If we didn't convert the updater-script then it would take A LOT OF work to overhaul the dozens of scripts to accept updater-scripts, which would really NOT make a difference in the end anyway, and would likely slow down the kitchen due to extra checks made in the updater-script. So please do not request this again and again, there is no gain in doing it. Believe me, I have spent many months and stayed up late many, many nights getting this update-script/updater-script compatibility issue working with the kitchen with all ROMs and numerous HTC and non-HTC devices.

When you build the ROM you have the option of converting it back to an updater-script, or the kitchen will convert it automatically if it decides it's necessary. The conversion back to the original updater-script is near-perfect, as I have already spent months on the implementation to get it right.

If you want to instead convert your updater-script or update-script *before* you build, then use the option found under the Advanced section of the kitchen menu.

QUESTION: I have converted my update-script to an updater-script, but after flashing I still have the original ROM on the device.

That means your updater-script did not have the proper mount points defined for the system (and/or data) partition. Refer to this post for more info. EDIT: You can now add your own mount-point definition file to the kitchen's "tools/edify_defs/" folder for when it creates the updater-script for your device.

QUESTION: My device only supports ROMs with the updater-script/update-binary files but not the update-script

If you extract a ROM that contains an updater-script, then the kitchen will ask you if it should convert it to an update-script. You *must* use an update-script while customizing the ROM, as the kitchen is not capable of modifying updater-scripts. When you are ready to build the ROM, though, you will need to convert it back to an updater-script if the device requires it. Use the option in the Advanced menu to convert update-script to updater-script, or else the kitchen will ask you to convert it while building the ROM.

QUESTION: When flashing my ROM I get the error "mount expects 4 args got 3" or similar.

This refers to the fact your mount command takes 4 parameters (e.g. ext4, EMMC, /dev/block/.., /system) and your update-binary file only checks for 3 parameters. You'll have to change the update-binary file to a compatible one, found under the /tools/update_files folder. Just copy the appropriate file and rename to update-binary. e.g. If you're going to be using MTD partitions, copy 'mtd-update-binary' to /META-INF/com/google/android as "update-binary".

QUESTION: How do I get Ubuntu to see my device with ADB?

First, download the Android SDK and copy it to a folder like ~/AndroidSDK/
Then, use the following commands:

Code:
cd ~/AndroidSDK/tools
./adb kill-server
sudo ./adb start-server
./adb devices
If you want to try Linux commands on your device, you can use the "./adb shell" command, e.g. ./adb shell reboot

QUESTION: I get the following error when flashing a ROM: E:Board does not support mtd utils.E:Failure atline 77: write_raw_image PACKAGE:boot.img BOOT:

Please see this post for the solution. In some recovery menus the boot.img cannot be flashed straight from the ROM's ZIP, so it needs to be copied first to a temporary area on your device and then flashed from there.


QUESTION: Why do you only have a few build options (Interactive/Express/Extreme) in the Build menu?

Read this. If you wanted an Express option that will sign the ROM, then read this.



QUESTION: How do I add or port a kernel to my kitchen's working folder?

Follow the instructions here.

QUESTION: I get busybox errors during flashing; e.g. "Can't chown/mod /system/xbin/busybox (No such file or directory)" or "E:Can't symlink busybox ..."

Apparently you need to upgrade your SPL, and it has nothing to do with the kitchen:

QUESTION: While flashing my ROM, I get an error about 'assert getprop ("ro.product.device")'.

Read about a solution here. You will likely need to modify your build.prop and update-script files in the kitchen and rebuild the ROM.

QUESTION: I created a ROM with root permissions, but whenever I access an app with the superuser prompt, it hangs or force-closes.

Under Settings/Applications, ensure that USB Debugging is enabled. You probably disabled it after flashing your ROM.


QUESTION: When I flash my ROM in the recovery menu, I get an error like "E:Can't open (bad)".

You may need to change your custom recovery menu. For example, see here.



QUESTION: How do I add a theme to my ROM?

I don't know, as I just write the scripts and am not a ROM theming/modding expert. Please ask in the forum but not this thread, as I cannot help you with your question. Sorry.



QUESTION: Can you add APK decompilers and other APK modding tools? Or how about PNG optimizers?

See this answer.


QUESTION: Can you give me an explanation of de-odexing?

De-odexing will take the *.odex files in your ROM and convert them into classes.dex files, which will then be zipped into their corresponding APK or JAR files. For a technical overview, read this. A short summary of why it is used is in this post.


QUESTION: Can you add an option in the kitchen to odex a de-odexed ROM?

No. I don't know how to do it with a kitchen and probably don't have the time at the moment.

There is a way to do it, but not from your computer. The odex script must be run on your device - within the Android command shell - after the de-odexed ROM has been flashed (I don't have the script, just Google it). (Here's a thread about it but the link to the script is dead.)



QUESTION: Why do some applications in the data/app folder force-close and others don't?

Probably they have native libraries which are not installed after you flash your ROM. Use the Application Verifier plugin to check such apps, and to make the required update.zip to flash after you have installed the ROM (see Plugin section in first post).



QUESTION: When we build the ROM, why can't we create a new system.img instead of a ZIP file?

Read this post.



QUESTION: What is Apps2SD and what version does the kitchen use?

There are multiple 'types' of Apps2SD -- one is the implementation found in Android 2.2+ that gives you the option of moving your apps to the SD card. Normally however, this does not move all of the app components to the SD card, and not all apps support this feature.

The other Apps2SD is sometimes referred to as "Apps2Ext" and requires an extra step by the user beforehand to format a new EXT-based partition on your SD card for the apps (normally an SD card is in FAT32 format). Unlike the 'Froyo Apps2SD', the Apps2Ext feature moves everything to the SD card, even apps that normally do not support the storage card option. The Apps2Ext version is found in the kitchen as DarkTremor's Apps2SD (by XDA user tkirton) and supports older devices that have a very limited amount of internal storage.



QUESTION: I am using Ubuntu Linux on a 64-bit Windows PC, and whenever I run 'zipalign' I get an error about "No such file or directory".

You need to install the Ubuntu package "ia32-libs".


QUESTION: Can you include an option to overwrite the ROM's existing Apps2SD with the one in the kitchen?

Answered here.

 
via

0 comments:

Post a Comment

Open Panel

Blogroll

counter