These are the steps to create a basic Android 2.2 ROM using the 64-bit Linux OS. I was using a CDMA HTC Hero in this example, the same steps will apply to other devices as well, you’ll just need the Kernel source or a suitable boot.img from your phone.
Theres plenty of ROMs out there available for download, but I’d rather make my own so I know exactly what I have on my phone.
Download these tools and place them in ~/bin
imagetools.zip (unzip scripts/extract-ramdisk.pl,extract-kernel.pl,mkbootimg,mkbootfs)
unyaffs (source: http://code.google.com/p/unyaffs/downloads/list)
Modify your path (place this in ~/.bashrc if you’d like):
export PATH=$PATH:~/bin:~/bin/scripts
If using ubuntu Linux, install these packages using apt-get, otherwise do it manually:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind lib32readline5-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32z-dev
Create a working directory:
mkdir ~/android
cd ~/android
Download the Android source code:
curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo
repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
export PATH=$PATH:~/android/prebuilt/linux-x86/arm-eabi-4.4.0/bin/
. build/envsetup.sh
Choose your build target:
lunch
Compile the Android source:
make -j24 #Using 24 virtual CPUs, the build takes 5 minutes, you can probably remove this option.
Download the HTC Hero kernel source v2.6.29: http://developer.htc.com/
Extract the kernel source and build the Kernel:
tar -zxvf heroc-2.6.29-bc0d2cff.tar.gz
cd heroc-2.6.29-bc0d2cff
export ARCH=arm
export KERNEL_DIR=~/android/heroc-2.6.29-bc0d2cffexport CROSS_COMPILE=arm-eabi-
make menuconfig
make -j24 #Using 24 virtual CPUs, the build takes 30 seconds, you can probably remove this option.
Create and update.zip that can be flashed from recovery mode:
cd ~/android
mkdir -p update/system
cd update/system
unyaffs ~/android/out/target/product/generic/system.img
cd ..
mkdir -p META-INF/com/google/android
Download this update-script and save as: “~/android/update/META-INF/com/google/android/update-script”.
Now you’ll need a Kernel image (boot.img) to boot from.
mkbootimg –kernel ~/android/heroc-2.6.29-bc0d2cff/arch/arm/boot/zImage –ramdisk ~/android/out/target/product/generic/ramdisk.img –cmdline “no_console_suspend=1 console=null” -o ~/android/update/boot.img –base 0×19200000
Generate an unsigned update.zip:
zip -r update-unsigned.zip system META-INF boot.img
Generate a signed update.zip
java -jar ../out/host/linux-x86/framework/signapk.jar ../build/target/product/security/testkey.x509.pem ../build/target/product/security/testkey.pk8 update-unsigned.zip update.zip
This will leave you with an update.zip which you can flash from recovery.
You should now have a basic Android 2.2 OS. You’ll want to add custom device drivers, WLAN module, and other Apps to get the device working fully.
留言列表