How to Install Android Kitchen
How to Install Android Kitchen
It is compatible with Windows (Cygwin) / Linux / Mac OS
This is a tool for those who want to start
learning how to make custom ROMs, or who just want to save some time
with their ROM customization.
The kitchen will not automatically turn you
into a developer. You are not programming anything or building a ROM
from the ground up. The kitchen merely presents a user-friendly
interface to hide all the rough details. However, this may be the push
that gets you into development in the future.
A little bit of prior UNIX command-line
knowledge would be useful to get started with the kitchen, but the help
guides should be enough for a newbie. Knowledge of command lines is
always important if you ever want to get involved in Android or
development.
CODE :-
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
Advance 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
Download Kitchen from Here
How To Install In Window OS(2000, XP, Vista, 7, 8)
You have three options in Windows, so choose one (I use #3, the Wubi Linux method, as the kitchen runs fastest there):
1. Window 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.
2. Window 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!
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.
3. Window 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.
How To Install In Linux (Ubuntu recommended)
1. 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.
a. 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.
b. 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.
2. After Ubuntu is finished installing, you need to install the Sun Java JDK as well:
a. Open up an 'xterm' window (shortcut: CTRL + ALT + T)
b. If you're using a 64-bit version of Ubuntu, then type this in your xterm: sudo apt-get install ia32-libs
c. 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
d. You should get a bunch of results, but you
only need "OpenJDK Java Runtime", which should normally be the first
result. Click on "Install"
e. After installation has completed, verify Java has been installed by typing in an xterm: java -version
f. 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.
2. If you used Virtual Box on your PC to install Ubuntu, then the following steps will finish up your installation:
2.1. Install the Guest Additions
NOTE: If you followed the guide and 'cd /media/cdrom' does not exist, then type instead: cd /media/VBOX* )
2.2. Next, if you want to copy ROMs and other files between Windows and your Linux Virtual Box, then do this:
a. Create a folder on your PC that you want to be accessed from Linux. e.g. C:\temp
b. From your Ubuntu session, click on Devices --> Shared Folders. Then click on the "+" sign to add a New Share.
c. 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.
d. Open a terminal in Ubuntu and create a folder that will mirror the contents of your PC's shared folder. e.g. mkdir ~/shared
e. Then mount the reference to the PC folder to your new Ubuntu folder, e.g. sudo mount -t vboxsf pc_temp ~/shared
f. 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.
g. If you want this Ubuntu folder to be automatically created every time you reboot into Ubuntu:
I. Type: sudo vi /etc/rc.local
II. 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
III. 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.
3. 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.
How To Install In MAC OS X
1. You need OS X 10.4 (Tiger) or higher on an Intel-based Mac (PPC-based systems will have problems).
2. Ensure you have the Sun Java JDK. This
normally comes installed already on your Mac. To test, just type in a
terminal: java -version
3. 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:
a. 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!)
a.1. Note: OS X Tiger 10.4 cannot use higher than Xcode 2.5. Use this link to search for older versions
a.2. 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.
4. 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.
a. If that doesn't work, you might have to build the GNU version of 'wget':
a.1. Go to the GNU site to grab the latest tar.gz of wget (I found wget-1.12 worked best).
a.2. Go to the folder containing the extracted files, and type: ./configure; make; sudo make install
a.3. NOTE for OS X 10.8+: If "./configure" gives errors, then try instead: ./configure --with-ssl=openssl
a.4. Confirm that the system defaults to the
GNU version of wget, by opening a new terminal and typing "wget
--version" again. If you still get an error, type: sudo cp
/usr/local/bin/wget /usr/bin/wget
5. 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.
a. If that doesn't work, you might have to build the GNU version of 'sed':
a.1. Go to the GNU site to grab the latest tar.gz of sed.
a.2. Go to the folder containing the extracted files, and type: ./configure; make; sudo make install
a.3. Confirm that the system defaults to the
GNU version of sed, by opening a new terminal and typing "sed --version"
again. If you still get an error, type: sudo cp /usr/local/bin/sed
/usr/bin/sed
6. 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.
a. If that doesn't work, you might have to build the GNU version of 'od':
a.1. Go to the GNU site to grab the latest tar.gz of coreutils.
a.2. Go to the folder containing the extracted files, and type: ./configure --disable-acl; make; sudo make install
a.3. Confirm that the system defaults to the
GNU version of od, by opening a new terminal and typing "od --version"
again. If you still get an error, type: sudo cp /usr/local/bin/od
/usr/bin/od
7. Install the FUSE tools:
a. 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.
b. After the above step is completed, install fuse-ext2
c. 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.
8. 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?
Detailed instructions (for new comers):
1. Download the kitchen from the above link.
2. Then, extract the kitchen's .zip file contents to your 'user' folder.
2.1. In Cygwin, this folder would be located
under the 'home' folder of your install directory, e.g.
C:\cygwin\home\<your_windows_id>.
2.2. In Linux / OS X this would be the folder where your terminal command prompt starts at, e.g. /home/<your_login_id>.
3. Then, in this folder, create a folder called "kitchen" and put all the kitchen files and folders under there.
NOTE!! If your user folder name contains spaces
(e.g. C:\cygwin\home\sourabh\kitchen), then the kitchen will not
function properly. Instead, copy it one level up, under
C:\cygwin\home\kitchen instead.
Easy so far, right?? Some people get the above
steps wrong because they rush and then skip the instructions, and then
get stuck in the next few steps. If you've followed the above
instructions exactly how I've said so far, then you should be okay and
can proceed with the rest.
I'm making the following as newb-friendly as possible, which is why it looks longer than it should:
4. Now, when you've figure that out, open up a
command prompt (If you installed Cygwin, then click on the Cygwin
shortcut on your desktop to start it - Yes, I know it's obvious, but
some people don't know this).
5. Normally, by default, you will start at the 'user' directory (e.g. C:/cygwin/home/sourabh)
6. From the command prompt, go to the folder containing the kitchen:
6.1. e.g. if your kitchen is under your user folder like c:\cygwin\home\sourabh\kitchen, then you would type: cd kitchen.
6.2. e.g. If your kitchen is instead one level
higher like c:\cygwin\home\kitchen then you would need to type. Type: cd
../kitchen
If you read the instructions then the above
should go fine without any errors. However, if you didn't, then shame on
you Read the following (skip this section if you're already in the
correct kitchen folder):
6.3. e.g. If your kitchen is instead at an even
lower level like c:\cygwin\home\johnsmith\blah\stuff\android then you
would type: cd blah/stuff/android
6.4. In Cygwin, if you copied it under c:\some_other_folder instead, then you'd need to do: cd /cygdrive/c/some_other_folder
6.5. If you have no idea what folder you're in,
type: pwd and then compare with the kitchen folder in your file
explorer to confirm you're in the correct folder. Use the "cd" command
to move to the correct folder, e.g. "cd <path_to_kitchen_folder>"
6.6. If you are still lost, well, this is
probably not for you then... go back to iPhone (just kidding) I have
already given you a crash course in Unix commands. Go back to the
beginning and make sure you did everything right. Or just Google it.
7. To confirm you are in the correct folder,
type the following to see the kitchen files and folders: ls (that's a
lower case L and an S). You should see the file called 'menu', the
folder called 'original_update' and more.
Once you've figured out the above (NO ERRORS), then proceed:
8. When you are in the correct folder, start up the kitchen by typing: ./menu
8.1 NOTE1: If you get a 'permission denied' error, then you must type chmod +x menu and run ./menu again.
8.2 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!
8.3 NOTE3: If you get an error message about missing binaries like 'clear', read Part 2 of the FAQ for solutions.
Good? If the kitchen starts up, then you're ready to make a custom ROM! Finally.
9. Select Option 1 to set up your working
folder (the folder where your ROM is going to be created). To find a
base ROM to import into this kitchen, follow the instructions in the
section below entitled "How do I import a ROM into the kitchen?"
10. Modify whatever you'd like in the kitchen
10.1. If you want the ROM to be able to run apps that require root permissions, select the "Root" option.
10.2. You can remove unneeded apps (*.apk) from the /system/app folder of your working folder.
10.3. 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.
10.4. Optional: Read this post for some more information about the fundamentals of creating your ROM with this kitchen.
11. When you are finished modifying your ROM, just choose Build ROM.
12. 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 to add new devices that are not listed in the Supported Devices
WARNING: If your device is not listed in post
#1 of this thread, and it does NOT use a 'YAFFS'-based filesystem (e.g.
usually only low-end devices 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. If the stock ROM images for your device
contain the recovery.img file, extract its files from the kitchen menu:
Advanced --> Tools for boot image --> Extract from
boot.img/recovery.img in any folder. Then, open up its ramdisk folder,
and look for /system/etc/recovery.fstab or /etc/recovery.fstab or
similar FSTAB file location. Open this file to find the mount points.
3. 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.
NOTE: This method does not guarantee your
device will work with your custom ROM, however. Some devices may require
more steps than just the edify_defs file, but the procedure is outside
the scope of this FAQ. Ask around in the XDA sub-forum for your device
if you need further help.
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.)
1. From a shipped ROM:
1.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).
1.2 This link may help: Various devices
1.3. Please don't ask me for links, as I don't know everything or own all devices.
1.4. The shipped ROM can be found in three different formats. Identify the type you have downloaded:
a. If the shipped ROM is in a .ZIP format, then simply copy it to the kitchen's original_update folder.
b. 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!
c. OR if the shipped ROM is in an .EXE format, then do the following:
c.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.
c.2. Go to Start->Run and type: %TEMP%
c.3. When the folder opens, search for Rom.zip (use the "magnifying glass" Search button)
c.4. Copy Rom.zip to your kitchen's original_update folder
2. OR from a cooked/custom ROM:
Copy the update.zip (or equivalent ZIP file) to your kitchen's original_update folder
3. 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
Read Carefully and install. cygwin_install.txt
cygwin kitchen is a very great tool for editing and creating custom rom.
ReplyDelete