tag:blogger.com,1999:blog-76214297050161744692024-02-08T12:48:33.592-08:00Android on the IphoneUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7621429705016174469.post-30820775874491080022010-04-22T21:43:00.000-07:002010-04-22T21:56:30.573-07:00Install Android on Iphone Guide<object width="480" height="385"><embed src="http://www.youtube.com/v/5yO2KQHkt4A&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br /><br /><p class="MsoPlainText"><span style="'font-family:">How to install iDroid: Android on your first-generation iPhone<br />===============================</span></p><p class="MsoPlainText"><span style="'font-family:">Download links to the required files are displayed in the left hand column on this page.<br /><br />These instructions describe how to build an Android system for iPhone 2G from<br />sources. These instructions are currently just notes and are being gradually<br />worked into a more readable form. Please submit questions and suggestions for<br />clarification to #iphonelinux on irc.osx86.hu.<br /><br />The essential pieces for booting Android are:<br /><br /><span style="mso-tab-count:1"> </span>1. Linux kernel<br /><span style="mso-tab-count:1"> </span>2. Wi-Fi and touchscreen firmware<br /><span style="mso-tab-count:1"> </span>3. Boot initrd<br /><span style="mso-tab-count:1"> </span>4. Android ramdisk.img<br /><span style="mso-tab-count:1"> </span>5. Android system.img<br /><span style="mso-tab-count:1"> </span>6. Android userdata.img<br /><span style="mso-tab-count:1"> </span>7. Android cache.img<br /><span style="mso-tab-count:1"> </span>8. openiboot<br /><br />Instructions for pre-built images<br />---------------------------------<br /><br />If you have a prebuilt android.img.gz, ramdisk.img, system.img, userdata.img<br />and cache.img, you still need to follow the directions in the "Firmware"<br />section and add all the firmware files to<br /><br />/lib/firmware in android.img.gz (it's a compressed ext2 image)<br /><br />/etc/firmware in system.img (it's an uncompressed ext2 image)<br /><br />After this, you can skip down to "Installation".<br /><br />Linux kernel<br />------------<br /><br />1. Check out commit e27f17b5318851395a66cbaf1524ea89ff8f0cb9 of the<br />android-2.6.32 branch of git://android.git.kernel.org/kernel/common<br /><br />2. Apply the patches from android/kernel<br /><br />3. Fix the Makefile for your system (you may need to use Google's repo to<br />check out your own copy of the Android toolchain).<br /><br />4. Use something based on android/kernel/.config as your .config<br /><br />5. Build<br /><br />Firmware<br />--------<br /><br />These can't be redistributed due to copyright laws. The multitouch firmware<br />will need to be extracted from your ioreg tree. Install iokittools from Cydia<br />and perform ioreg -l -w 0 and pipe the result to some file. Read this file and<br />look for entries under AppleMultitouchSPI for Firmware and A-Speed Firmware.<br />These contain a simple hexadecimal encoding for the bytes of the firmware<br />files. Convert and keep "Firmware" as zephyr_main.bin and "A-Speed Firmware"<br />as zephyr_aspeed.bin.<br /><br />The firmware for the wi-fi can be found on Marvell's site at<br />http://www.marvell.com/support.html Under "Choose a platform", select "Linux<br />2.6 - Fedora" and click the Search button under the drop down box. The<br />SD-8686-* zip archive will contain the files. Rename helper_sd.bin to<br />sd8686_helper.bin and keep that and sd8686.bin.<br /><br />So, you have zephyr_main.bin, zephyr_aspeed.bin, sd8686_helper.bin, and<br />sd8686.bin.<br /><br />It's also possible to cut a more recent version of the Marvell firmware from<br />the iPhone kernel. Can someone create a firmware cutter utility for this<br />stuff?<br /><br />Boot initrd<br />-----------<br /><br />The Android initrd was created under a Debian installation of iPhone Linux<br />(which is not currently available) using the create-initrd-android.sh script.<br />However, if you read it, you can figure out generally how it's done.<br /><br />YOU WILL NEED TO COPY ALL THE FIRMWARE *.bins TO /lib/firmware on this<br />ramdisk!<br /><br />You end up with android.img.gz<br /><br />Android images<br />--------------<br /><br />First, checkout 1.6 (Donut) using Google's repo tool. Copy vendor/apple to<br />vendor/apple in their tree. Rename data/sounds/AudioPackage2.mk to<br />data/sounds/Android.mk (if you want the built-in sounds).<br /><br />Copy all the firmware *.bins to vendor/apple/firmware as well.<br /><br />Then, apply android/android.patch provided. Then, do the following to create a<br />"generic" image:<br /><br /><span style="mso-tab-count:1"> </span>. build/envsetup.sh<br /><span style="mso-tab-count:1"> </span>choosecombo<br /><span style="mso-tab-count:1"> </span>[Select device, debug, generic, engineering]<br /><span style="mso-tab-count:1"> </span>export TARGET_USERIMAGES_USE_EXT2=true<br /><span style="mso-tab-count:1"> </span>make -j4 PRODUCT-generic-eng<br /><br />Now wait forever for Android to build. You'll get ramdisk.img and system.img<br />in out/debug/target/product/generic/. Ignore the other .img files, we won't be<br />using them.<br /><br />Android ramdisk.img<br />-------------------<br /><br />Create a blank 1 MB file and make a ext2 filesystem on it. Mount it as a<br />loopback device. Rename the ramdisk.img from Android to ramdisk.img.gz. Use<br />gunzip on ramdisk.img.gz. Use cpio -i -F ramdisk.img as root with the current<br />directory in the new ext2 filesystem to extract the ramdisk files onto the<br />ramdisk.<br /><br />Apply android/init.rc.patch to init.rc<br /><br />Make a directory called /cache<br /><br />Unmount and you have your ramdisk.img<br /><br />Android system.img<br />------------------<br /><br />You can just use the system.img Android compiled.<br /><br />Android userdata.img<br />--------------------<br /><br />You can start with a perfectly empty userdata.img (as long as its properly<br />formatted). However, without the Dalvik caches, the boot will hang the first<br />couple of times until those can be generated. This is some strange timeout<br />issue.<br /><br />After the initial boot, you have to do<br /><br /><span style="mso-tab-count:1"> </span>INSERT INTO secure (name, value) VALUES ('device_provisioned', 1);<br /><br />Using sqlite3 in the database<br /><br /><span style="mso-tab-count:1"> </span>/data/data/com.android.providers.settings/databases/settings.db<br /><br />If the device is not "provisioned", it will automatically reject all incoming<br />calls. Very stupid.<br /><br />Can someone please show me how this can be made less aggravating?<br /><br />Android cache.img<br />-----------------<br /><br />This can just be an empty 50 MB ext2 filesystem.<br /><br />openiboot<br />---------<br /><br />See the instructions in the openiboot folder in the iphonelinux repo.<br /><br />Installation<br />------------<br /><br />0. Jailbreak your iPhone.<br /><br />1. Under the jailbroken environment, put ramdisk.img, system.img, ramdisk.img,<br />userdata.img, cache.img, android.img.gz, and zImage in /private/var.<br /><br />2. Follow the instructions for installing openiboot.<br /><span style="mso-tab-count:1"> </span>- Essentially:<br /><span style="mso-tab-count:2"> </span>1. sudo ./loadibec openiboot.img3<br /><span style="mso-tab-count:2"> </span>2. Use Hold button to select Console<br /><span style="mso-tab-count:2"> </span>3. Push Home button<br /><span style="mso-tab-count:2"> </span>4. sudo ./oibc<br /><span style="mso-tab-count:2"> </span>5. Type install<br /><span style="mso-tab-count:1"> </span>- loadibec and oibc are compiled for x86 Linux.<br /><span style="mso-tab-count:2"> </span>- Need libusb, pthreads, readline.<br /><br />Running<br />-------<br /><br />In the openiboot bootloader, it should be enough to select Console with Hold<br />and hold the Home button for more than two seconds to trigger the boot of<br />Android.<br /></span></p>Unknownnoreply@blogger.com1