First of all, You need to download below software package including toolchain,build script,patch files. One more, Don't forget that you have to borrow a iphone from friends without your iphone because this method is dangerous. :)
iDroid: Android on your first-generation iPhone ===============================================
These instructions describe how to build an Android system for iPhone 2G from sources. These instructions are currently just notes and are being gradually worked into a more readable form. Please submit questions and suggestions for clarification to #iphonelinux on irc.osx86.hu. The essential pieces for booting Android are: 1. Linux kernel 2. Wi-Fi and touchscreen firmware 3. Boot initrd 4. Android ramdisk.img 5. Android system.img 6. Android userdata.img 7. Android cache.img 8. openiboot
Instructions for pre-built images --------------------------------- If you have a prebuilt android.img.gz, ramdisk.img, system.img, userdata.img and cache.img, you still need to follow the directions in the "Firmware" section and add all the firmware files to /lib/firmware in android.img.gz (it's a compressed ext2 image) /etc/firmware in system.img (it's an uncompressed ext2 image) After this, you can skip down to "Installation".
Linux kernel ------------ 1. Check out commit e27f17b5318851395a66cbaf1524ea89ff8f0cb9 of the android-2.6.32 branch of git://android.git.kernel.org/kernel/common 2. Apply the patches from android/kernel 3. Fix the Makefile for your system (you may need to use Google's repo to check out your own copy of the Android toolchain). 4. Use something based on android/kernel/.config as your .config 5. Build
Firmware -------- These can't be redistributed due to copyright laws. The multitouch firmware will need to be extracted from your ioreg tree. Install iokittools from Cydia and perform ioreg -l -w 0 and pipe the result to some file. Read this file and look for entries under AppleMultitouchSPI for Firmware and A-Speed Firmware. These contain a simple hexadecimal encoding for the bytes of the firmware files. Convert and keep "Firmware" as zephyr_main.bin and "A-Speed Firmware" as zephyr_aspeed.bin. The firmware for the wi-fi can be found on Marvell's site at http://www.marvell.com/support.html Under "Choose a platform", select "Linux 2.6 - Fedora" and click the Search button under the drop down box. The SD-8686-* zip archive will contain the files. Rename helper_sd.bin to sd8686_helper.bin and keep that and sd8686.bin. So, you have zephyr_main.bin, zephyr_aspeed.bin, sd8686_helper.bin, and sd8686.bin. It's also possible to cut a more recent version of the Marvell firmware from the iPhone kernel. Can someone create a firmware cutter utility for this stuff?
Boot initrd ----------- The Android initrd was created under a Debian installation of iPhone Linux (which is not currently available) using the create-initrd-android.sh script. However, if you read it, you can figure out generally how it's done. YOU WILL NEED TO COPY ALL THE FIRMWARE *.bins TO /lib/firmware on this ramdisk! You end up with android.img.gz
Android images -------------- First, checkout 1.6 (Donut) using Google's repo tool. Copy vendor/apple to vendor/apple in their tree. Rename data/sounds/AudioPackage2.mk to data/sounds/Android.mk (if you want the built-in sounds). Copy all the firmware *.bins to vendor/apple/firmware as well. Then, apply android/android.patch provided. Then, do the following to create a "generic" image: . build/envsetup.sh choosecombo [Select device, debug, generic, engineering] export TARGET_USERIMAGES_USE_EXT2=true make -j4 PRODUCT-generic-eng Now wait forever for Android to build. You'll get ramdisk.img and system.img in out/debug/target/product/generic/. Ignore the other .img files, we won't be using them.
Android ramdisk.img ------------------- Create a blank 1 MB file and make a ext2 filesystem on it. Mount it as a loopback device. Rename the ramdisk.img from Android to ramdisk.img.gz. Use gunzip on ramdisk.img.gz. Use cpio -i -F ramdisk.img as root with the current directory in the new ext2 filesystem to extract the ramdisk files onto the ramdisk. Apply android/init.rc.patch to init.rc Make a directory called /cache Unmount and you have your ramdisk.img
Android system.img ------------------ You can just use the system.img Android compiled.
Android userdata.img -------------------- You can start with a perfectly empty userdata.img (as long as its properly formatted). However, without the Dalvik caches, the boot will hang the first couple of times until those can be generated. This is some strange timeout issue. After the initial boot, you have to do INSERT INTO secure (name, value) VALUES ('device_provisioned', 1); Using sqlite3 in the database /data/data/com.android.providers.settings/databases/settings.db If the device is not "provisioned", it will automatically reject all incoming calls. Very stupid. Can someone please show me how this can be made less aggravating?
Android cache.img ----------------- This can just be an empty 50 MB ext2 filesystem.
openiboot --------- See the instructions in the openiboot folder in the iphonelinux repo.
Installation ------------ 0. Jailbreak your iPhone. 1. Under the jailbroken environment, put ramdisk.img, system.img, ramdisk.img, userdata.img, cache.img, android.img.gz, and zImage in /private/var. 2. Follow the instructions for installing openiboot. - Essentially: 1. sudo ./loadibec openiboot.img3 2. Use Hold button to select Console 3. Push Home button 4. sudo ./oibc 5. Type install - loadibec and oibc are compiled for x86 Linux. - Need libusb, pthreads, readline.
Running ------- In the openiboot bootloader, it should be enough to select Console with Hold and hold the Home button for more than two seconds to trigger the boot of Android.
Good luck.
챨리권
2010-04-23 06:30
매우 친절하게도 아이폰은 꼭 친구의 것을 빌려서 하라는 조언도 빼놓지 않으셨네요..^^
폰도 이제 vmware처럼 host os와 다수의 guest os를 돌릴수 있는날도 올것같네요.. 그게 왜 필요한지 모르겠지만, 해커들이 해킹하는덴 "재미" 이외의 이유는 옵션일뿐이겠죠..
인베인
왜필요한지 모르겠지만, --> 임베디드에서 항상 이부분을 저도 이걸 고민중입니다. 이번 캐나다에 가면 KVM을 ARM으로 포팅하여 안드로이드올린것에 대해 발표하는 발표자한테 허심탄회하게 물어볼 생각입니다.
4/23 09:11
챨리권
to. 인베인님 그걸 물어보면 그분이 이러지 않을까요..? "Do you really, really wanna know that?,, Just For Fun!"
4/23 09:49
인베인
ㅎㅎ 네 꼭 물어보고 나서 절친되고나서 다시 공유해드릴께요. 리눅스 토발즈하고도 그렇게 접근하여 같이 호주 태즈매니아서 사진찍었었습니다. ^^
4/23 10:48
그렌라간
2010-06-09 11:33
가상화를 하면 재미 말고도 이득이 있죠... 폰의 안정성을 좀 더 올릴 수 있다고나 할까요..
예를 들면 얼마전 제 아이폰에 기본으로 들어있는 사진기 어플이 말썽을 일으키더니 폰이 먹통이 되고 결국 한 10분 후에 알아서 리붓 되더군요. 혹시나 해서 집전화로 아이폰에 전화를 걸어도 수신이 안되구요. ㅡㅡ;... 만약 이 사진기가 가상화된 다른 guest os에서 돌고 있었다면 죽는 os 는 guest os 였을 거고 제가 전화를 못받는 상황은 오지 않았겠죠. 실제로 이런 연구는 많이 이루어 지고 있는 것으로 알고 있습니다. 가상화기술이 모바일에 적용된다면 그 자체로는 상품이 될 수 없지만 파생되는 효과는 대단할 것으로 생각되는군요.