Android on Freerunner

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Android Debug Bridge)
Line 127: Line 127:
 
== Android Debug Bridge ==
 
== Android Debug Bridge ==
  
To assist in debugging and to gain shell access to the phone with Android, you can use
+
To assist in debugging and to gain shell access to the phone with Android, you can use the instructions found here: [[Android_debug_bridge]]
 
+
  [http://people.openmoko.org/sean_mcneil/adb adb]
+
 
+
You should be able to connect to the phone as long as you start it up with the USB connected to your host. I don't think it will work if you plug it in after starting. Of course, you need to setup [[USB_Networking]] (<tt>ifconfig usb0</tt> ...) on your host before connecting.
+
 
+
Some helpful commands are:
+
 
+
    ADBHOST=192.168.0.202 ./adb logcat          - like a tail -f of the android log
+
    ADBHOST=192.168.0.202 ./adb logcat -b radio  - same as above for the radio logs
+
    ADBHOST=192.168.0.202 ./adb shell            - bring up a command shell to the phone
+
    ADBHOST=192.168.0.202 ./adb kill-server      - kill the background server on the host
+
 
+
Sometimes, adb gets stuck: if you cannot to the device run "adb kill-server" before trying other commands.
+
  
 
== Known Issues ==
 
== Known Issues ==

Revision as of 10:49, 24 January 2009


Contents

Android.png

Introduction

This page is dedicated to the installation of Android on the Neo 1973 and Neo FreeRunner handsets.

You can find general informations (porting/development and day to day usage) about Android and Neo phones here : Android

Android on internal flash

Images

There are currently a few prebuild images:

Michael Trimarchi's images with latest fixes Sean McNeil images

To use the Kernel you have to either :

  • adjust your Uboot environment to support a Kernel of more then 2 MB
  • change to the Qi Bootloader. It supports 2MB kernels out of the box.

I have placed an older 2.6.26 kernel with Android support at:

   uImage-android

I have put up a jffs2 image that replaces rootfs on the Freerunner at:

  androidfs.jffs2

Installation on internal flash

As noted above, this installation requires you to wipe out the existing kernel and rootfs in NAND on your Freerunner. You also must have an SDCARD and it needs to be configured with two (2) primary partitions: First is VFAT/MSDOS (16 or 32) which acts as the /sdcard storage area for pictures, movies, music, etc. and the Second is an ext3 primary partition for use of internal Android /data area to store settings, caches, etc.

The first thing I suggest is to setup an SDCARD. You can flash the NAND first, but you must have an SDCARD with two partitions as stated before you'll be able to boot. I use a 2GB card which I have split in half. fdisk shows me:

   /dev/mmcblk0p1               1        2454      996310    6  FAT16
/dev/mmcblk0p2 2455 4908 996324 83 Linux

formatted as

   sudo mkfs.vfat /dev/mmcblk0p1
sudo mkfs.ext3 /dev/mmcblk0p2

There is no need to populate the ext3 partition at all. The VFAT partition can be populated with media content if you so desire.

With your SDCARD all set, you are ready to flash the kernel and rootfs:

   sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a kernel -D uImage-android
sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a rootfs -D androidfs.jffs2


Android on SDcard

Images

There are currently a few prebuild images: Radek Polak's SD card images (install on ext3, first partition on SD must be FAT16)

Using jffs2 images

You can also boot from the SD Card using the pre built images like so :-

  • Mount the image using this script like so
  sudo ./Mntjffs.sh freerunner-v5.jffs2 image/
  • Then copy (cp -R) the files in directory image/ to any of the first three partitions on the SD Card (if using Qi) eg cp -R /your-path/image/* /media/android/
  • cd /media/android.
  • wget http://activationrecord.net/radekp/openmoko/android/init.rc .
  • mkdir boot
  • copy the kernel here and name it uImage-GTA02.bin


Some notes about booting android from sdcard :

Setup

  • Build android from source. See koolu website for directions.
  • Use the first script in this mail (adapt to your filesystem) to stage your android install.
  • copy the contents of this directory on a ext3 partition on your sdcard.
  • add a /boot directory on your sdcard.
  • copy the uImage-android kernel (see above) and copy it inside your /boot with the exact name uImage-GTA02.bin
  • I changed the init.rc (in your root on the sd) to remove mounts that could be problematic (/data for example) :
--- 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
  • Install Qi on you NAND flash. You can still boot whatever distro you've got on internal flash using the NOR bootloader. You should try the magic file in /boot to show kernel messages.
  • boot the GTA02, and pray.

Status

Android boots and graphic UI appears (hurray) ! But, i cannot unlock my SIM so I can't tell more ;) Maybe you wanna try to remove PIN protection in your SIM (using another phone) and see what happens next.

Phyce 16:25, 1 January 2009 (UTC)

Android Debug Bridge

To assist in debugging and to gain shell access to the phone with Android, you can use the instructions found here: Android_debug_bridge

Known Issues

Suspend

  • Michael Trimarchi's images allow resume from suspend after two short presses. However, soemtimes it takes a few tries for the phone to wake up.
  • During suspend the phone seems to wake up make an audible click and go back to sleep.

Keyboard

  • A soft keyboard is provided in the newer images.
  • A new Phone.apk app provides soft buttons for answering a call and for terminating it.

Apps not Working / Partially working

  • Alarm - Can add new alarms, but details of an alarm can't be edited.
  • Music Player can't seem to play files.
  • Sim contacts import works for some people only.
  • Same for received SMS's. Come people can't read messages.

Distribution

Personal tools


Contents

Android.png

Introduction

This page is dedicated to the installation of Android on the Neo 1973 and Neo FreeRunner handsets.

You can find general informations (porting/development and day to day usage) about Android and Neo phones here : Android

Android on internal flash

Images

There are currently a few prebuild images:

Michael Trimarchi's images with latest fixes Sean McNeil images

To use the Kernel you have to either :

  • adjust your Uboot environment to support a Kernel of more then 2 MB
  • change to the Qi Bootloader. It supports 2MB kernels out of the box.

I have placed an older 2.6.26 kernel with Android support at:

   uImage-android

I have put up a jffs2 image that replaces rootfs on the Freerunner at:

  androidfs.jffs2

Installation on internal flash

As noted above, this installation requires you to wipe out the existing kernel and rootfs in NAND on your Freerunner. You also must have an SDCARD and it needs to be configured with two (2) primary partitions: First is VFAT/MSDOS (16 or 32) which acts as the /sdcard storage area for pictures, movies, music, etc. and the Second is an ext3 primary partition for use of internal Android /data area to store settings, caches, etc.

The first thing I suggest is to setup an SDCARD. You can flash the NAND first, but you must have an SDCARD with two partitions as stated before you'll be able to boot. I use a 2GB card which I have split in half. fdisk shows me:

   /dev/mmcblk0p1               1        2454      996310    6  FAT16
/dev/mmcblk0p2 2455 4908 996324 83 Linux

formatted as

   sudo mkfs.vfat /dev/mmcblk0p1
sudo mkfs.ext3 /dev/mmcblk0p2

There is no need to populate the ext3 partition at all. The VFAT partition can be populated with media content if you so desire.

With your SDCARD all set, you are ready to flash the kernel and rootfs:

   sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a kernel -D uImage-android
sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a rootfs -D androidfs.jffs2


Android on SDcard

Images

There are currently a few prebuild images: Radek Polak's SD card images (install on ext3, first partition on SD must be FAT16)

Using jffs2 images

You can also boot from the SD Card using the pre built images like so :-

  • Mount the image using this script like so
  sudo ./Mntjffs.sh freerunner-v5.jffs2 image/
  • Then copy (cp -R) the files in directory image/ to any of the first three partitions on the SD Card (if using Qi) eg cp -R /your-path/image/* /media/android/
  • cd /media/android.
  • wget http://activationrecord.net/radekp/openmoko/android/init.rc .
  • mkdir boot
  • copy the kernel here and name it uImage-GTA02.bin


Some notes about booting android from sdcard :

Setup

  • Build android from source. See koolu website for directions.
  • Use the first script in this mail (adapt to your filesystem) to stage your android install.
  • copy the contents of this directory on a ext3 partition on your sdcard.
  • add a /boot directory on your sdcard.
  • copy the uImage-android kernel (see above) and copy it inside your /boot with the exact name uImage-GTA02.bin
  • I changed the init.rc (in your root on the sd) to remove mounts that could be problematic (/data for example) :
--- 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
  • Install Qi on you NAND flash. You can still boot whatever distro you've got on internal flash using the NOR bootloader. You should try the magic file in /boot to show kernel messages.
  • boot the GTA02, and pray.

Status

Android boots and graphic UI appears (hurray) ! But, i cannot unlock my SIM so I can't tell more ;) Maybe you wanna try to remove PIN protection in your SIM (using another phone) and see what happens next.

Phyce 16:25, 1 January 2009 (UTC)

Android Debug Bridge

To assist in debugging and to gain shell access to the phone with Android, you can use the instructions found here: Android_debug_bridge

Known Issues

Suspend

  • Michael Trimarchi's images allow resume from suspend after two short presses. However, soemtimes it takes a few tries for the phone to wake up.
  • During suspend the phone seems to wake up make an audible click and go back to sleep.

Keyboard

  • A soft keyboard is provided in the newer images.
  • A new Phone.apk app provides soft buttons for answering a call and for terminating it.

Apps not Working / Partially working

  • Alarm - Can add new alarms, but details of an alarm can't be edited.
  • Music Player can't seem to play files.
  • Sim contacts import works for some people only.
  • Same for received SMS's. Come people can't read messages.

Distribution