View source for Android on Freerunner
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android on Freerunner.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android on Freerunner.
![]() |
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |
|
This page is dedicated to the installation of Android (an Open Handset Alliance Project) on the Neo 1973 and Neo FreeRunner handsets.
You can find other information, such as porting, development and day to day usage here : Android
The Android kernel image can be more than 2MB in size. The UBoot environment that comes with your FreeRunner is only able to boot a kernel less than 2MB in size. To use a kernel larger than 2MB you need to:
The SD Card in your FreeRunner needs to be configured with two 2 primary partitions before Android will boot. First a VFAT/MSDOS (16 or 32) which acts as the '/sdcard' storage area (for pictures, movies, music, etc). Second an ext3 primary partition which Android uses as '/data' with in which it stores settings, caches, etc.
Insert the Mico SD Card from your FreeRunner into your Linux desktop then bring up a Terminal and type
$ dmesg | grep sd
You will get an output like this, in this instance we can see that the SD Card has been assigned the device name 'sde'
... sd 9:0:0:0: [sde] Attached SCSI removable disk ...
Now, as root, use 'fdisk' to partition the device.
# fdisk /dev/sde
Pressing 'p' will show you the current partitions on the SD Card 'd' will delete them and 'n' will create a new one. Create a primary partition for your media. Then another primary partition for Android to store it's data on.
On a 1Gig card I used 768MB for the first partition ('+768MB' in fdisk) and the remainder for Android data. Here is fdisk's partition output:
Device Boot Start End Blocks Id System /dev/sde1 1 769 750513+ 83 Linux /dev/sde2 770 1016 241072 83 Linux
Now all that's left to do is format the partitions with the appropriate filesystem But first hit 'w' in fdisk to write the changes to the SD Card.
Then format like this:
# mkfs.vfat -v -n and-media /dev/sde1 # mkfs.ext3 -v -L and-data /dev/sde2
That's it, you can now remove the SD card from your desktop. If you re-insert it you will have two new usb disk devices.
NOTE: After Android has booted you will only be able to access the 'data' disk as root. |
There is no need to populate the ext3 partition at all. The VFAT partition can be populated with media content (ring tones etc.) if you so desire.
NOTE: It can be worth reformatting the data partition when you upgrade the Android OS on your phone. Old settings can result in problems, wifi for example. But remember that formatting the Data partition will result in your preferences, text messages and contacts etc. being erased. |
The SD card can be formatted from within an existing 2008.x installation on your FreeRunner. SSH as root into the FreeRunner and use 'fdisk' to partition the device.
# fdisk /dev/mmcblk0
After this create the partitions as described in the step above.
To format the new vfat partition you will need dosfstools which can be downloaded from
dosfstools_2.11-r0_armv4t.ipk
Use any SCP client to copy this file to your FreeRunner and install using
opkg install dosfstools_2.11-r0_armv4t.ipk
Once the installation is complete format the partitions:
# mkfs.vfat -v -n and-media /dev/mmcblk0p1 # mkfs.ext3 -v -L and-data /dev/mmcblk0p2
NOTE: In case you are unable to format the partitions because they are already mounted for some reason you can get a list of process IDs that are using it by running:
# fuser -m /media/card
Then kill all the processes that were using the card and try formatting again.
There are no open source or free partition editors on Windows or Mac that can manage an ext3 partition. If you do not have Linux installed you can use the GParted bootable CD. This CD will boot into a graphical environment with which you can partition your SD Card. You may have to boot with the SD Card inserted for GParted to recognize it as a drive.
Next, Grab yourself the latest Android images. There are two parts you need to flash, the kernel (uImage*.bin) and the root fs (android*.jffs2). Koolu are releasing images regularly at the moment and you can get them here:
Release files (Android FreeRunner)
Koolu are not the only people working on porting Android to the FreeRunner and although collaboration is coming, there are other places to get images:
Michael Trimarchi's images, very up to date images with lot's of great development:
Michael Trimarchi's images with latest fixes
Sean McNeil has placed an older 2.6.26 kernel and root fs at:
To flash your FreeRunner, replace what ever phone stack you have on there at the moment with Android, first download dfu-util, this is the program that will flash your phone.
Once you have that installed (whether by simply downloading the binary or installing an rpm) Open up a terminal and cd to where you downloaded the images too eg.
# cd /home/joe/Downloads
Plug your FreeRunner into a USB port and boot it into the nand boot loader; Hold down the aux button and then the power button until nand appears.
NOTE: The FreeRunner will only stay in in the nand bootloader state for about 30 seconds with no activity. |
Now Flash the kernel image (you will need to be root) with this command:
# ./dfu-util -a kernel -R -D uImage-moredrivers-GTA02.bin
and finally the root fs with this one:
# ./dfu-util -a rootfs -R -D androidfs-koolu-beta3.jffs2
NOTE: './dfu-util' assumes you downloaded the binary to the same place as your images - remember to make the dfu-util binary executable! |
There are currently a few prebuild images: Radek Polak's SD card images (install on ext3, first partition on SD must be FAT16)
You can also boot from the SD Card using the pre built images like so :-
sudo ./Mntjffs.sh freerunner-v5.jffs2 image/
Some notes about booting android from sdcard :
--- filesystem/root/init.rc 2008-12-15 17:51:14.000000000 +0100 +++ phyce.init.rc 2008-12-19 15:56:25.000000000 +0100 @@ -24,7 +24,7 @@ mkdir /sqlite_stmt_journals 01777 root root mount tmpfs tmpfs /sqlite_stmt_journals size=4m - mount rootfs rootfs / ro remount + mount rootfs rootfs / rw remount write /proc/sys/kernel/panic_on_oops 1 write /proc/sys/kernel/hung_task_timeout_secs 0 @@ -38,14 +38,14 @@ # mount yaffs2 mtd@system /system ro remount # We chown/chmod /data again so because mount is run as root + defaults - mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev - chown system system /data - chmod 0771 /data +# mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev +# chown system system /data +# chmod 0771 /data # Same reason as /data above - mount yaffs2 mtd@cache /cache nosuid nodev - chown system cache /cache - chmod 0770 /cache +# mount yaffs2 mtd@cache /cache nosuid nodev +# chown system cache /cache +# chmod 0770 /cache
Most of the hardware on Freerunner seems to work on latest Android images, but not always perfectly.
If you want to see details of what is already usable, please have a look at: Android_usage
To assist in debugging and to gain shell access to the phone with Android, you can use the instructions found here: Android debug bridge