<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.openmoko.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Noo&amp;feedformat=atom</id>
		<title>Openmoko - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Noo&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Special:Contributions/Noo"/>
		<updated>2013-05-25T23:47:56Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.6</generator>

	<entry>
		<id>http://wiki.openmoko.org/wiki/U-Boot</id>
		<title>U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/U-Boot"/>
				<updated>2009-04-06T10:07:09Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: /* Using usbtty from Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Bootloader}}&lt;br /&gt;
&lt;br /&gt;
[[Image:GTA01-U-Boot.JPG|thumb|300px|u-boot menu on Neo1973]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|u-boot splash screen on Neo1973]]&lt;br /&gt;
&lt;br /&gt;
The bootloader used on the smartphones is called '''U-Boot'''. It takes care of device functionality until Openmoko is booted. This includes [[USB DFU]] for [[Flashing the Neo FreeRunner]], a splash screen, a boot menu, a console for [[bootloader commands]], configuration via [[bootloader environment]], and loading a [[kernel]].&lt;br /&gt;
&lt;br /&gt;
There are various [[bootloader versions]] available. Newer yet is [[Qi]].&lt;br /&gt;
&lt;br /&gt;
== Booting into U-boot ==&lt;br /&gt;
&lt;br /&gt;
* Make sure that your phone has had the battery and USB cable removed for at least 30 seconds.&lt;br /&gt;
* Hold in the AUX button on power-up to access the boot menu.&lt;br /&gt;
* Connect the Neo (ie not Debug Board) to a Linux host with the USB cable.&lt;br /&gt;
* Set the console to USB.&lt;br /&gt;
* Connect to /dev/ttyACM0 with a terminal program on the Linux host (you might need to chown uucp.uucp /dev/ttyACM0 )&lt;br /&gt;
* Note that the cdc_acm /dev/ttyACM0 access disappears as soon as the Neo boots, and is replaced by the cdc_ether usb0 network access.&lt;br /&gt;
* You're now at the bootloader prompt.&lt;br /&gt;
* Set the bootdelay uboot environment variable to -1 if you want it to always halt at the bootloader on power-up.&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
All versions of the OM smartphone use the [http://u-boot.sourceforge.net/ u-boot] bootloader.&lt;br /&gt;
&lt;br /&gt;
More information on u-boot can be found at&lt;br /&gt;
* http://www.denx.de/wiki/DULG&lt;br /&gt;
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot&lt;br /&gt;
* http://linuxdevices.com/articles/AT5085702347.html&lt;br /&gt;
&lt;br /&gt;
Additions to the vanilla u-boot already implemented include:&lt;br /&gt;
* Support for boot from NAND flash using [[S3C2410 Steppingstone]]&lt;br /&gt;
* Support for S3C2410 NAND flash&lt;br /&gt;
* Support for downloading programs via S3C2410 USB Device Controller&lt;br /&gt;
* Support to display bootup logo / status on S3C2410 Framebuffer&lt;br /&gt;
&lt;br /&gt;
However, u-boot still doesn't support many of the features that GTA01 needs, such as&lt;br /&gt;
* Support for reading kernel/initrd from SD/Transflash&lt;br /&gt;
&lt;br /&gt;
[[User:HaraldWelte|HaraldWelte]] is working on those issues, and in fact most of them have already been implemented.&lt;br /&gt;
&lt;br /&gt;
== Bootloader source code ==&lt;br /&gt;
&lt;br /&gt;
The current bootloader source can be found at http://git.openmoko.org/?p=u-boot.git;a=shortlog;h=stable .&lt;br /&gt;
&lt;br /&gt;
To get u-boot by git:&lt;br /&gt;
&lt;br /&gt;
git clone git://git.openmoko.org/git/u-boot.git openmoko/u-boot&lt;br /&gt;
&lt;br /&gt;
To build u-boot:&lt;br /&gt;
* Clone the git tree and check out the stable branch&lt;br /&gt;
* Set the CROSS_COMPILE environment variable to specify the prefix to your toolchain binaries&lt;br /&gt;
* Run &amp;quot;make gta02v5_config&amp;quot; (or gta01bv4_config, or whatever hardware revision you have)&lt;br /&gt;
* Run &amp;quot;make u-boot.udfu&amp;quot;. This will give you an image which you can install with dfu-util, or which you can upload into memory via JTAG (with a debug board)&lt;br /&gt;
&lt;br /&gt;
== Bootloader binary ==&lt;br /&gt;
&lt;br /&gt;
The latest bootloader binary builds can be found under http://downloads.openmoko.org/distro/unstable/daily/ .&lt;br /&gt;
&lt;br /&gt;
All versions of the GTA02 (Neo FreeRunner) that have been sold to the public are version 5 hardware, so look for a file with &amp;quot;gta02&amp;quot; and &amp;quot;v5&amp;quot; in the name, for example:&lt;br /&gt;
uboot-gta02v5-latest.bin&lt;br /&gt;
&lt;br /&gt;
The file should be written to the NAND flash address 0x00000000 (size 0x30000) (the first [[Partitions|partition]]).&lt;br /&gt;
&lt;br /&gt;
== Bootloader development ==&lt;br /&gt;
&lt;br /&gt;
=== QT2410 ===&lt;br /&gt;
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.&lt;br /&gt;
&lt;br /&gt;
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the &amp;quot;if 0&amp;quot; in Line 32 into a &amp;quot;if 1&amp;quot;, then recompile with &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The resulting &amp;quot;u-boot.bin&amp;quot; is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.&lt;br /&gt;
&lt;br /&gt;
=== Neo 1973 ===&lt;br /&gt;
&lt;br /&gt;
Doing bootloader development on the [[Neo 1973]] is a bit more tricky.  First, we don't have any NOR flash.  Second, there is no other way to boot _but_ from NAND.  Therefore, we also don't have a USB downloader like the QT2410.&lt;br /&gt;
&lt;br /&gt;
The main problem is:  The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM.   That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this&lt;br /&gt;
&lt;br /&gt;
=== Neo FreeRunner ===&lt;br /&gt;
{{main|Neo_FreeRunner_Memory_Mapping}}&lt;br /&gt;
&lt;br /&gt;
==== Using JTAG to boot from RAM ====&lt;br /&gt;
&lt;br /&gt;
So how can we boot from RAM? We use JTAG / OpenOCD to:&lt;br /&gt;
&lt;br /&gt;
* Reset and halt the cpu at PC=0&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target halted in ARM state due to debug request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x400000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; load_binary /space/misc/gta01/u-boot.git/board/gta01/lowlevel_foo.bin 0&lt;br /&gt;
downloaded 332 byte in 0s 21899us&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; bp 0x33f80000 4 hw&lt;br /&gt;
breakpoint added at address 0x33f80000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run the code up to the break point&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; resume&lt;br /&gt;
Target 0 resumed&lt;br /&gt;
&amp;gt; Target 0 halted&lt;br /&gt;
target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
cpsr: 0x600000d3 pc: 0x33f80000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Download the u-boot RAM image to 0x33f80000&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000&lt;br /&gt;
downloaded 135692 byte in 6s 567264us&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Resume processing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; resume&lt;br /&gt;
Target 0 resumed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)&lt;br /&gt;
&lt;br /&gt;
DRAM:  128 MB&lt;br /&gt;
NAND:  64 MiB&lt;br /&gt;
*** Warning - bad CRC or NAND, using default environment&lt;br /&gt;
&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
GTA01Bv2 #&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating bootable images ==&lt;br /&gt;
&lt;br /&gt;
U-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''.  In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin&lt;br /&gt;
gzip -9 linux.bin&lt;br /&gt;
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n &amp;quot;Kernel Image QT2410&amp;quot; -d linux.bin.gz uImage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot menu ==&lt;br /&gt;
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]&lt;br /&gt;
&lt;br /&gt;
As of the Phase-0 release, our u-boot version now features an on-screen boot menu. The items are defined by [[bootloader environment#menu|menu entries in the environment]].&lt;br /&gt;
&lt;br /&gt;
=== Accessing the boot menu ===&lt;br /&gt;
&lt;br /&gt;
You can access the boot menu by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.&lt;br /&gt;
&lt;br /&gt;
=== Using the boot menu ===&lt;br /&gt;
&lt;br /&gt;
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items.  Use the ''POWER'' button to select one item.&lt;br /&gt;
&lt;br /&gt;
== Bootloader prompt ==&lt;br /&gt;
&lt;br /&gt;
=== Accessing the bootloader prompt ===&lt;br /&gt;
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).&lt;br /&gt;
Whether the serial port or usb is used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.&lt;br /&gt;
&lt;br /&gt;
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.&lt;br /&gt;
&lt;br /&gt;
The bootloader is currently configured to wait for three seconds.  If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.&lt;br /&gt;
&lt;br /&gt;
==== Using usbtty from Linux ====&lt;br /&gt;
&lt;br /&gt;
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttyACM0. If not, check that module cdc_acm is loaded or CONFIG_USB_ACM=y (Device Drivers -&amp;gt; USB support -&amp;gt; USB Modem (CDC ACM) support). (Instructions for MacOS users are [[MacOS_X#USB_Serial|here]])&lt;br /&gt;
&lt;br /&gt;
Use your favourite terminal emulator (minicom, cu, zc, screen ...) to access it like any other serial port. Clear any modem intialisation strings (minicom).&lt;br /&gt;
&lt;br /&gt;
You can adapt the instructions for USB-serial from the [[MacOS_X#USB_Serial|Mac OS]] page.&lt;br /&gt;
If you don't have a favorite, try just &amp;quot;cu -l dev/ttyACM0&amp;quot;. It is in the taylor-uucp package, use &amp;quot;apt-get install cu&amp;quot; if it is not yet installed&lt;br /&gt;
&lt;br /&gt;
Enter Bootprompt with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cu -l /dev/ttyACM0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You might need to&lt;br /&gt;
 chown uucp.uucp /dev/ttyACM0&lt;br /&gt;
to get the necessary rights (even as root, must be done each time).&lt;br /&gt;
&lt;br /&gt;
A nice alternative for cu is Werner Almesberger's [[NeoCon|neocon]].&lt;br /&gt;
&lt;br /&gt;
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lsusb -d 1457:5119&lt;br /&gt;
Bus 005 Device 079: ID 1457:5119&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Note''': The Neo Freerunner (GTA02) has the ID 1d50:5119&lt;br /&gt;
&lt;br /&gt;
Second, let's see some more details about the available endpoints and configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lsusb -v -d 1457:5119&lt;br /&gt;
Bus 005 Device 079: ID 1457:5119&lt;br /&gt;
Device Descriptor:&lt;br /&gt;
bLength                18&lt;br /&gt;
bDescriptorType         1&lt;br /&gt;
bcdUSB               1.10&lt;br /&gt;
bDeviceClass            2 Communications&lt;br /&gt;
bDeviceSubClass         0&lt;br /&gt;
bDeviceProtocol         0&lt;br /&gt;
bMaxPacketSize0        16&lt;br /&gt;
idVendor           0x1457&lt;br /&gt;
idProduct          0x5119&lt;br /&gt;
bcdDevice            0.00&lt;br /&gt;
iManufacturer           1 Openmoko, Inc&lt;br /&gt;
iProduct                2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3&lt;br /&gt;
iSerial                 3 0000000&lt;br /&gt;
bNumConfigurations      1&lt;br /&gt;
Configuration Descriptor:&lt;br /&gt;
bLength                 9&lt;br /&gt;
bDescriptorType         2&lt;br /&gt;
wTotalLength           85&lt;br /&gt;
bNumInterfaces          3&lt;br /&gt;
bConfigurationValue     1&lt;br /&gt;
iConfiguration          4 TTY via USB&lt;br /&gt;
bmAttributes         0xc0&lt;br /&gt;
Self Powered&lt;br /&gt;
MaxPower                0mA&lt;br /&gt;
Interface Descriptor:&lt;br /&gt;
bLength                 9&lt;br /&gt;
bDescriptorType         4&lt;br /&gt;
bInterfaceNumber        0&lt;br /&gt;
bAlternateSetting       0&lt;br /&gt;
bNumEndpoints           1&lt;br /&gt;
bInterfaceClass         2 Communications&lt;br /&gt;
bInterfaceSubClass      2 Abstract (modem)&lt;br /&gt;
bInterfaceProtocol      1 AT-commands (v.25ter)&lt;br /&gt;
iInterface              6 Control Interface&lt;br /&gt;
CDC Header:&lt;br /&gt;
bcdCDC               0.6e&lt;br /&gt;
CDC Call Management:&lt;br /&gt;
bmCapabilities       0x00&lt;br /&gt;
bDataInterface          1&lt;br /&gt;
CDC ACM:&lt;br /&gt;
bmCapabilities       0x00&lt;br /&gt;
CDC Union:&lt;br /&gt;
bMasterInterface        0&lt;br /&gt;
bSlaveInterface         1&lt;br /&gt;
Endpoint Descriptor:&lt;br /&gt;
bLength                 7&lt;br /&gt;
bDescriptorType         5&lt;br /&gt;
bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
bmAttributes            3&lt;br /&gt;
Transfer Type            Interrupt&lt;br /&gt;
Synch Type               None&lt;br /&gt;
Usage Type               Data&lt;br /&gt;
wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
bInterval             255&lt;br /&gt;
Interface Descriptor:&lt;br /&gt;
bLength                 9&lt;br /&gt;
bDescriptorType         4&lt;br /&gt;
bInterfaceNumber        1&lt;br /&gt;
bAlternateSetting       0&lt;br /&gt;
bNumEndpoints           2&lt;br /&gt;
bInterfaceClass        10 CDC Data&lt;br /&gt;
bInterfaceSubClass      0 Unused&lt;br /&gt;
bInterfaceProtocol      0&lt;br /&gt;
iInterface              5 Bulk Data Interface&lt;br /&gt;
Endpoint Descriptor:&lt;br /&gt;
bLength                 7&lt;br /&gt;
bDescriptorType         5&lt;br /&gt;
bEndpointAddress     0x02  EP 2 OUT&lt;br /&gt;
bmAttributes            2&lt;br /&gt;
Transfer Type            Bulk&lt;br /&gt;
Synch Type               None&lt;br /&gt;
Usage Type               Data&lt;br /&gt;
wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
bInterval             255&lt;br /&gt;
Endpoint Descriptor:&lt;br /&gt;
bLength                 7&lt;br /&gt;
bDescriptorType         5&lt;br /&gt;
bEndpointAddress     0x83  EP 3 IN&lt;br /&gt;
bmAttributes            2&lt;br /&gt;
Transfer Type            Bulk&lt;br /&gt;
Synch Type               None&lt;br /&gt;
Usage Type               Data&lt;br /&gt;
wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
bInterval             255&lt;br /&gt;
Interface Descriptor:&lt;br /&gt;
bLength                 9&lt;br /&gt;
bDescriptorType         4&lt;br /&gt;
bInterfaceNumber        2&lt;br /&gt;
bAlternateSetting       0&lt;br /&gt;
bNumEndpoints           0&lt;br /&gt;
bInterfaceClass       254 Application Specific Interface&lt;br /&gt;
bInterfaceSubClass      1 Device Firmware Update&lt;br /&gt;
bInterfaceProtocol      1&lt;br /&gt;
iInterface              7 USB Device Firmware Upgrade&lt;br /&gt;
Device Status:     0x0001&lt;br /&gt;
Self Powered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, you can access it using your favourite terminal program.&lt;br /&gt;
&lt;br /&gt;
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to change the [[bootloader environment#console|console entries in the environment]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GTA01Bv2 # setenv stderr usbtty&lt;br /&gt;
GTA01Bv2 # setenv stdout usbtty&lt;br /&gt;
GTA01Bv2 # setenv stdin usbtty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Typical u-boot prompt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)&lt;br /&gt;
&lt;br /&gt;
DRAM:  128 MB&lt;br /&gt;
NAND:  64 MiB&lt;br /&gt;
Found Environment offset in OOB..&lt;br /&gt;
Video: 640x480x8 31kHz 59Hz&lt;br /&gt;
USB:   S3C2410 USB Deviced&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
GTA01Bv3 #&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands on the bootloader prompt ===&lt;br /&gt;
&lt;br /&gt;
:''See [[bootloader commands]].''&lt;br /&gt;
&lt;br /&gt;
=== What if I borked my bootloader environment and don't get a prompt anymore? ===&lt;br /&gt;
{{Note|This solution applies to a changed u-boot environment which prevents NAND u-boot to successfully boot.  The Debian u-boot configuration script may be a cause of this issue.}}&lt;br /&gt;
Found a solution here:&lt;br /&gt;
[[http://markmail.org/message/gqypwiohdet6x4am?q=almesberger+partition&amp;amp;page=1&amp;amp;refer=xbamkzwwsaobv7wa]]&lt;br /&gt;
&lt;br /&gt;
It works the following way:&lt;br /&gt;
* Get the devirginator:&lt;br /&gt;
svn co http://svn.openmoko.org/trunk/src/host/devirginator&lt;br /&gt;
cd devirginator&lt;br /&gt;
* Read the u-boot environment from the device:&lt;br /&gt;
dfu-util -a u-boot_env -R -U env.in&lt;br /&gt;
* Create a file that contains everything you want to change in your u-boot environment or get it by issuing the following command:&lt;br /&gt;
wget http://svn.openmoko.org/trunk/src/host/devirginator/environment.in&lt;br /&gt;
* Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo FreeRunner only, and has to come before the other options.&lt;br /&gt;
./envedit.pl -D GTA02 -i env.in -f environment.in -o env.out&lt;br /&gt;
* On my box the partition layout didn't seem to match the idea of envedit.pl, so it issued 2 warnings:&lt;br /&gt;
warning: environment is 262144 bytes, expected 16384&lt;br /&gt;
CRC error: expected 0xc33e35fc, got 0x93097bfb&lt;br /&gt;
* In this case jut add an additional argument to the command line - that has to be the 1st argument, though, and that contains the size information we got from the warning:&lt;br /&gt;
./envedit.pl -s 262144 -D GTA02 -i env.in -f environment.in  -o env.out&lt;br /&gt;
* Now the perl script should produce no more output anything but write a new u-boot_env partition that we can upload to the device by:&lt;br /&gt;
dfu-util -a u-boot_env -R -D env.out&lt;br /&gt;
&lt;br /&gt;
== Device Firmware Upgrade ==&lt;br /&gt;
&lt;br /&gt;
Our version of u-boot also implements [[USB DFU]]. This can be useful to&lt;br /&gt;
load files and kernel for quick testing.&lt;br /&gt;
&lt;br /&gt;
To find out whether your version of u-boot supports this, use the output of&lt;br /&gt;
$ lsusb -v -d 1457:5119&lt;br /&gt;
while the phone is in u-boot mode.&lt;br /&gt;
&lt;br /&gt;
If it supports DFU, you should see the following snippet towards the end of the output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Interface Descriptor:&lt;br /&gt;
bLength                 9&lt;br /&gt;
bDescriptorType         4&lt;br /&gt;
bInterfaceNumber        2&lt;br /&gt;
bAlternateSetting       0&lt;br /&gt;
bNumEndpoints           0&lt;br /&gt;
bInterfaceClass       254 Application Specific Interface&lt;br /&gt;
bInterfaceSubClass      1 Device Firmware Update&lt;br /&gt;
bInterfaceProtocol      1&lt;br /&gt;
iInterface              0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For information on how to do firmware upgrades, please see [[dfu-util]]. For neo 1973 you may see [[Flashing the Neo 1973#Actually_flashing_things_into_the_device]], and for the FreeRunner : [[Flashing the Neo FreeRunner]].&lt;br /&gt;
&lt;br /&gt;
=== Booting files over DFU ===&lt;br /&gt;
&lt;br /&gt;
To load a file at memory address 0x32000000:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dfu-util -a 0 -D fileToLoad -R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, send 'bootm 0x32000000' to u-boot or 'bootelf 0x32000000' if&lt;br /&gt;
its an elf file.&lt;br /&gt;
&lt;br /&gt;
Simple python script that can boot an ELF image - avoiding a ACM bug that breaks on large packets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
cmd1 = &amp;quot;neo backlight off\n&amp;quot;&lt;br /&gt;
cmd2 = &amp;quot;bootelf 0x32000000\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
def output(tty, str):&lt;br /&gt;
for x in str:&lt;br /&gt;
tty.write(x)&lt;br /&gt;
tty.flush()&lt;br /&gt;
&lt;br /&gt;
if len(sys.argv) == 2:&lt;br /&gt;
print &amp;quot;Loading %s...&amp;quot; % sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
loadfile = &amp;quot;dfu-util -a 0 -D %s -R&amp;quot; % sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
os.system(loadfile)&lt;br /&gt;
&lt;br /&gt;
time.sleep(3)&lt;br /&gt;
&lt;br /&gt;
tty = open(&amp;quot;/dev/ttyACM0&amp;quot;, &amp;quot;a&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
output(tty, cmd1)&lt;br /&gt;
output(tty, cmd2)&lt;br /&gt;
&lt;br /&gt;
tty.close()&lt;br /&gt;
else:&lt;br /&gt;
print &amp;quot;Usage: %s elffile&amp;quot; % sys.argv[0]&lt;br /&gt;
print &amp;quot;&amp;quot;&lt;br /&gt;
sys.exit(2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== USB connectivity problems ===&lt;br /&gt;
&lt;br /&gt;
I once got errors like this (in dmesg or /var/log/messages) on the host side while connecting the neo in u-boot:&lt;br /&gt;
&lt;br /&gt;
usb 2-1: device descriptor read/64, error -110&lt;br /&gt;
usb usb2: Controller not stopped yet!&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
hub 4-0:1.0: port 1 disabled by hub (EMI?), re-enabling...&lt;br /&gt;
usb 4-1: USB disconnect, address 2&lt;br /&gt;
&lt;br /&gt;
A possible solution is given below. Please note that if you have a usb keyboard or mouse then the command might cause trouble.&lt;br /&gt;
&lt;br /&gt;
rmmod uhci_hcd ; modprobe uhci_hcd&lt;br /&gt;
&lt;br /&gt;
Another option is to plug the FR into a different USB port on the host, preferably one on the Motherboard not the hub.&lt;br /&gt;
&lt;br /&gt;
Disconnecting the Neo's USB while powering up may prevent this problem in the future.&lt;br /&gt;
&lt;br /&gt;
== Related pages ==&lt;br /&gt;
&lt;br /&gt;
See [[Flashing the Neo 1973]] and [[Flashing the Neo FreeRunner]] for instructions on using dfu-util to install a new bootloader in your phone.&lt;br /&gt;
&lt;br /&gt;
[[Category:System Developers]]&lt;br /&gt;
[[Category:Flashing Openmoko]]&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Android_on_Freerunner</id>
		<title>Android on Freerunner</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Android_on_Freerunner"/>
				<updated>2009-04-01T10:20:29Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Android on Freerunner}}&lt;br /&gt;
&lt;br /&gt;
{|align=right&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
[[Image:Freerunner-android-01.png]]&lt;br /&gt;
= Introduction = &lt;br /&gt;
This page is dedicated to the installation of [[Android]] (an [[Open Handset Alliance]] Project) on the [[Neo 1973]] and [[Neo FreeRunner]] handsets.&lt;br /&gt;
&lt;br /&gt;
You can find other information, such as porting, development and day to day usage here : [[Android]]&lt;br /&gt;
&lt;br /&gt;
== Before you start ==&lt;br /&gt;
&lt;br /&gt;
=== Using this guide ===&lt;br /&gt;
&lt;br /&gt;
*1&lt;br /&gt;
&lt;br /&gt;
If you see a command like this, you must run it as root&lt;br /&gt;
&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
If you see one like this, you can run it as a regular user&lt;br /&gt;
&lt;br /&gt;
 $&lt;br /&gt;
&lt;br /&gt;
*2&lt;br /&gt;
&lt;br /&gt;
When you see these commands&lt;br /&gt;
&lt;br /&gt;
 adb&lt;br /&gt;
&lt;br /&gt;
 dfu-util&lt;br /&gt;
&lt;br /&gt;
it is assumed that you have them installed on your system and inside your /usr/bin. This may not be the case, you may just have downloaded the binary. If so, you need to change to the directory you downloaded the binary too then issue the same commands adding a ./ before it eg. &lt;br /&gt;
&lt;br /&gt;
 ./adb&lt;br /&gt;
&lt;br /&gt;
 ./dfu-util&lt;br /&gt;
&lt;br /&gt;
*3&lt;br /&gt;
&lt;br /&gt;
adb connects to Android but you need to have made sure you have set it up first. Make sure your FreeRunner was booted while being plugged in to a USB port. Then following run the following commands:&lt;br /&gt;
&lt;br /&gt;
 # ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
 # adb kill-server&lt;br /&gt;
 # ADBHOST=192.168.0.202 adb devices&lt;br /&gt;
&lt;br /&gt;
You should now have no trouble using adb.&lt;br /&gt;
&lt;br /&gt;
=== Registering with the GSM network ===&lt;br /&gt;
&lt;br /&gt;
Before you install Android on your FreeRunner you should check, using the operating system it came with, that your sim card will register with your network.&lt;br /&gt;
&lt;br /&gt;
The version of internal [[GSM]] [[firmware]] that comes preloaded on the FreeRunner has compatibility issues with a feature on newer [[sim]] cards. This effects [[3G]], o2 sims and possibly others. if you have one of those you will probably need to upgrade your GSM firmware to get the sim to register with the network. Doing that first means you know it's working before you install Android.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.openmoko.org/wiki/GSM/Flashing GSM/Flashing]&lt;br /&gt;
&lt;br /&gt;
To flash your GSM firmware you will need to have [[USB]] networking setup between your desktop and the OM distribution installed on your FreeRunner. However, your FreeRunner does not need internet access as you can download the GSM firmware files on your desktop PC and transfer them to your FreeRunner using [http://unixhelp.ed.ac.uk/CGI/man-cgi?scp+1 scp]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.openmoko.org/wiki/Usb_networking USB Networking]&lt;br /&gt;
&lt;br /&gt;
== Configuring the Bootloader ==&lt;br /&gt;
&lt;br /&gt;
There are two bootloaders you can use to boot Android; [http://wiki.openmoko.org/wiki/Qi Qi] and [http://wiki.openmoko.org/wiki/Uboot Uboot]. Uboot comes installed on the FreeRunner, Qi is a replacement and is thought to be superior. However there have been, and probably still are, problems when using Qi and Android so Uboot is recommended at this point.&lt;br /&gt;
&lt;br /&gt;
You can download images for them both here:&lt;br /&gt;
&lt;br /&gt;
[http://people.openmoko.org/andy/ Andy Tracking Images] (For Qi on the FreeRunner grab the image starting qi-s3c2442)&lt;br /&gt;
&lt;br /&gt;
[http://downloads.openmoko.org/distro/unstable/daily/om-gta02/20090330/ Latest Uboot]&lt;br /&gt;
&lt;br /&gt;
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 2MB in size or less. To use a kernel larger than 2MB you need to:&lt;br /&gt;
&lt;br /&gt;
* Change to the [http://wiki.openmoko.org/wiki/Qi Qi Bootloader]. It supports 2MB kernels out of the box.&lt;br /&gt;
&lt;br /&gt;
* Adjust your [[Uboot]] environment to [http://meinopenmoko.blogspot.com/2008/12/prepare-uboot-to-boot-android.html support a Kernel of more than 2 MB]&lt;br /&gt;
&lt;br /&gt;
In your Boot-prompt type:&lt;br /&gt;
 setenv bootcmd setenv bootargs \${bootargs_base} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000&lt;br /&gt;
 saveenv&lt;br /&gt;
&lt;br /&gt;
== Installing Android on the Internal Flash ==&lt;br /&gt;
&lt;br /&gt;
=== Preparing the SD Card ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== On Linux ====&lt;br /&gt;
&lt;br /&gt;
Insert the Mico SD Card from your FreeRunner into your Linux desktop then bring up a Terminal and type&lt;br /&gt;
&lt;br /&gt;
    $ dmesg | grep sd&lt;br /&gt;
&lt;br /&gt;
You will get an output like this, in this instance we can see that the SD Card has been assigned the device name 'sde'&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
    sd 9:0:0:0: [sde] Attached SCSI removable disk&lt;br /&gt;
    ...&lt;br /&gt;
    &lt;br /&gt;
Now, as root, use 'fdisk' to partition the device.&lt;br /&gt;
&lt;br /&gt;
   # fdisk /dev/sde &lt;br /&gt;
&lt;br /&gt;
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 its data on.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
       Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
    /dev/sde1               1         769      750513+  83  Linux&lt;br /&gt;
    /dev/sde2             770        1016      241072   83  Linux&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Then format like this:&lt;br /&gt;
&lt;br /&gt;
    # mkfs.vfat -v -n and-media -F 32 /dev/sde1&lt;br /&gt;
    # mkfs.ext3 -v -L and-data /dev/sde2&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
{{Note|After Android has booted you will only be able to access the 'data' partition 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.}}&lt;br /&gt;
&lt;br /&gt;
==== On FreeRunner (2008.x) ====&lt;br /&gt;
&lt;br /&gt;
The SD card can be formatted from within an existing 2008.x installation on your FreeRunner.&lt;br /&gt;
SSH as root into the FreeRunner and use 'fdisk' to partition the device.&lt;br /&gt;
&lt;br /&gt;
   # fdisk /dev/mmcblk0&lt;br /&gt;
&lt;br /&gt;
After this create the partitions as described in the step above.&lt;br /&gt;
&lt;br /&gt;
To format the new vfat partition you will need dosfstools which can be downloaded from&lt;br /&gt;
&lt;br /&gt;
    [http://members.shaw.ca/mmontour/neo/dosfstools_2.11-r0_armv4t.ipk dosfstools_2.11-r0_armv4t.ipk]&lt;br /&gt;
&lt;br /&gt;
Use any SCP client to copy this file to your FreeRunner and install using&lt;br /&gt;
&lt;br /&gt;
    opkg install dosfstools_2.11-r0_armv4t.ipk&lt;br /&gt;
&lt;br /&gt;
Once the installation is complete format the partitions:&lt;br /&gt;
&lt;br /&gt;
    # mkfs.vfat -v -n and-media /dev/mmcblk0p1&lt;br /&gt;
    # mkfs.ext3 -v -L and-data /dev/mmcblk0p2&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
    # fuser -m /media/card&lt;br /&gt;
&lt;br /&gt;
Then kill all the processes that were using the card and try formatting again.&lt;br /&gt;
&lt;br /&gt;
==== On other OS's ====&lt;br /&gt;
&lt;br /&gt;
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 [http://gparted.sourceforge.net/ 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.&lt;br /&gt;
&lt;br /&gt;
=== Downloading Android Images ===&lt;br /&gt;
&lt;br /&gt;
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). [http://www.koolu.com/ Koolu] release images and you can get them here:&lt;br /&gt;
&lt;br /&gt;
    [http://freerunner.android.koolu.com/release-files Release files (Android FreeRunner)]&lt;br /&gt;
&lt;br /&gt;
Koolu are not the only people working on porting Android to the FreeRunner and although collaboration is hopefully on the way, there are other places to get images:&lt;br /&gt;
&lt;br /&gt;
Michael Trimarchi's (panicking) images are the most up to date and functional:&lt;br /&gt;
&lt;br /&gt;
    [http://panicking.kicks-ass.org/download/ Michael Trimarchi's images with latest fixes]&lt;br /&gt;
    [http://www.fragcom.de/android/ Mirror]&lt;br /&gt;
&lt;br /&gt;
Sean McNeil has placed an older 2.6.26 kernel and root fs at:&lt;br /&gt;
&lt;br /&gt;
    [http://people.openmoko.org/sean_mcneil/ Sean McNeil images]&lt;br /&gt;
&lt;br /&gt;
=== Flashing the FreeRunner ===&lt;br /&gt;
&lt;br /&gt;
==== On Linux ====&lt;br /&gt;
&lt;br /&gt;
To flash your FreeRunner, replace what ever phone stack you have on there at the moment with Android, first download [http://wiki.openmoko.org/wiki/Dfu-util dfu-util], this is the program that will flash your phone.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
    # cd /home/joe/Downloads&lt;br /&gt;
&lt;br /&gt;
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 nor appears.&lt;br /&gt;
&lt;br /&gt;
{{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:&lt;br /&gt;
&lt;br /&gt;
    # dfu-util -a kernel -R -D uImage-moredrivers-GTA02.bin&lt;br /&gt;
&lt;br /&gt;
and finally the root fs with this one:&lt;br /&gt;
&lt;br /&gt;
    # dfu-util -a rootfs -R -D androidfs-koolu-beta3.jffs2&lt;br /&gt;
&lt;br /&gt;
{{Note|The './' part assumes you are using the binary download and that it was downloaded to the same place as your images. If you are, remember to make the dfu-util binary executable.}}If you find that dfu-util complains about there being more than one USB device available it might be because you have a webcam or some other device plugged in. If you can not remove the other device follow this procedure:&lt;br /&gt;
&lt;br /&gt;
Unplug your FreeRunner and run the command&lt;br /&gt;
&lt;br /&gt;
    # dfu-utils --list&lt;br /&gt;
&lt;br /&gt;
This will list the other connected usb devices. Now plug your FreeRunner back in and run the command again, the new device will be your FreeRunner. You can now go ahead and flash with the added command '-d FREERUNNER_DEVICE' eg.&lt;br /&gt;
&lt;br /&gt;
    # dfu-util -d 0x1d50:0x5119 -a rootfs -R -D freerunner-v13.jffs2&lt;br /&gt;
&lt;br /&gt;
== Installing Android on an SD card ==&lt;br /&gt;
&lt;br /&gt;
=== Images ===&lt;br /&gt;
&lt;br /&gt;
There are currently a few prebuilt images:&lt;br /&gt;
[http://activationrecord.net/radekp/openmoko/android/ Radek Polak's SD card images] (install on ext3, first partition on SD must be FAT16)&lt;br /&gt;
&lt;br /&gt;
=== Using jffs2 images ===&lt;br /&gt;
&lt;br /&gt;
You can also boot from the SD Card using the pre built images like so :-&lt;br /&gt;
* Mount the image using [http://wiki.openmoko.org/images/8/82/Mntjffs.sh this] script like so &lt;br /&gt;
   sudo ./Mntjffs.sh freerunner-v5.jffs2 image/&lt;br /&gt;
* 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/&lt;br /&gt;
* cd /media/android.&lt;br /&gt;
* wget http://activationrecord.net/radekp/openmoko/android/init.rc .&lt;br /&gt;
* mkdir boot&lt;br /&gt;
* copy the kernel here and name it uImage-GTA02.bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some notes about booting android from sdcard : &lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
* Build android from source. See [http://trac.koolu.org/ koolu website] for directions.&lt;br /&gt;
* Use the first script in [http://lists.openmoko.org/pipermail/community/2008-December/036982.html this mail] (adapt to your filesystem) to stage your android install.&lt;br /&gt;
* copy the contents of this directory on a ext3 partition on your sdcard.&lt;br /&gt;
* add a /boot directory on your sdcard.&lt;br /&gt;
* copy the uImage-android kernel (see above) and copy it inside your /boot with the exact name '''uImage-GTA02.bin'''&lt;br /&gt;
* I changed the init.rc (in your root on the sd) to remove mounts that could be problematic (/data for example) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- filesystem/root/init.rc	2008-12-15 17:51:14.000000000 +0100&lt;br /&gt;
+++ phyce.init.rc	2008-12-19 15:56:25.000000000 +0100&lt;br /&gt;
@@ -24,7 +24,7 @@&lt;br /&gt;
     mkdir /sqlite_stmt_journals 01777 root root&lt;br /&gt;
     mount tmpfs tmpfs /sqlite_stmt_journals size=4m&lt;br /&gt;
 &lt;br /&gt;
-    mount rootfs rootfs / ro remount&lt;br /&gt;
+    mount rootfs rootfs / rw remount&lt;br /&gt;
 &lt;br /&gt;
     write /proc/sys/kernel/panic_on_oops 1&lt;br /&gt;
     write /proc/sys/kernel/hung_task_timeout_secs 0&lt;br /&gt;
@@ -38,14 +38,14 @@&lt;br /&gt;
 #    mount yaffs2 mtd@system /system ro remount&lt;br /&gt;
 &lt;br /&gt;
     # We chown/chmod /data again so because mount is run as root + defaults&lt;br /&gt;
-    mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev&lt;br /&gt;
-    chown system system /data&lt;br /&gt;
-    chmod 0771 /data&lt;br /&gt;
+#    mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev&lt;br /&gt;
+#    chown system system /data&lt;br /&gt;
+#    chmod 0771 /data&lt;br /&gt;
 &lt;br /&gt;
     # Same reason as /data above&lt;br /&gt;
-    mount yaffs2 mtd@cache /cache nosuid nodev&lt;br /&gt;
-    chown system cache /cache&lt;br /&gt;
-    chmod 0770 /cache&lt;br /&gt;
+#    mount yaffs2 mtd@cache /cache nosuid nodev&lt;br /&gt;
+#    chown system cache /cache&lt;br /&gt;
+#    chmod 0770 /cache&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
* boot the GTA02, and pray.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Remote access to Android (adb) ==&lt;br /&gt;
&lt;br /&gt;
Although this is not technically part of installing Android it is very useful to have set up. Android Debug Bridge (adb) is a versatile tool that lets you manage the state of a device, in this case, your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
Some ways you can use adb include:&lt;br /&gt;
&lt;br /&gt;
* Run shell commands on the phone.&lt;br /&gt;
* Copy files from your desktop to the phone and Vice-versa.&lt;br /&gt;
&lt;br /&gt;
You can find out about it on the [http://developer.android.com/guide/developing/tools/adb.html Android developers page] and a page on this wiki [[Android debug bridge]]&lt;br /&gt;
&lt;br /&gt;
However if you would just like a very quick getting started guide, read on. You can download a binary from [http://people.openmoko.org/sean_mcneil/adb here]. Then if you like copy it to /usr/bin (and don't forget to make it executable).&lt;br /&gt;
&lt;br /&gt;
First you must boot Android while it is plugged in to a USB port, you can unplug it and re-plug it all you like after that but for the USB connection to work it must be connected at boot time.&lt;br /&gt;
&lt;br /&gt;
Next issue this command to set up USB networking...&lt;br /&gt;
&lt;br /&gt;
 # ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
Then this one because it helps make sure everything works nicely...&lt;br /&gt;
&lt;br /&gt;
 # adb kill-server&lt;br /&gt;
&lt;br /&gt;
Followed by this to find your phone...&lt;br /&gt;
&lt;br /&gt;
 ADBHOST=192.168.0.202 adb devices&lt;br /&gt;
&lt;br /&gt;
{{Note|Remember that if you didn't copy adb to /usr/bin you will need to run these commands from the directory you downloaded it too and put ./ in front of adb.}}Now you are free to remotely connect to your Android phone, here are a couple of commands you might find useful&lt;br /&gt;
&lt;br /&gt;
*Copy a file to your SD card:&lt;br /&gt;
&lt;br /&gt;
 # adb push YOUR_FILE /sdcard/&lt;br /&gt;
&lt;br /&gt;
*Copy a log file from your phone to your computer:&lt;br /&gt;
&lt;br /&gt;
  # adb logcat -d &amp;gt; android.log&lt;br /&gt;
&lt;br /&gt;
*If you just want to log in to the Android shell:&lt;br /&gt;
&lt;br /&gt;
 # adb shell&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== SD card won't mount ===&lt;br /&gt;
&lt;br /&gt;
There should be a /sdcard directory on your FreeRunner, for some reason this does not always get created (the command is in the 'init.rc' but does not always work). To create the correct dir on your FreeRunner and so enable your SD card, do the following.&lt;br /&gt;
&lt;br /&gt;
* Plug your FreeRunner into a USB port, boot Android and then enter these commands:&lt;br /&gt;
&lt;br /&gt;
 # ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
 # adb kill-server&lt;br /&gt;
 # ADBHOST=192.168.0.202 adb devices&lt;br /&gt;
 # adb shell mount -o remount,rw /dev/root /&lt;br /&gt;
 # adb shell&lt;br /&gt;
&lt;br /&gt;
 # mkdir /sdcard&lt;br /&gt;
 # exit&lt;br /&gt;
&lt;br /&gt;
* Then reboot your FreeRunner&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[Android|Main Android page on this wiki]]&lt;br /&gt;
* [http://digg.com/linux_unix/Video_demo_of_Freerunner_running_Android_Cupcake_Tutorial Video of usability]&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions]]&lt;br /&gt;
[[Category:Flashing Openmoko]]&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Ulm</id>
		<title>Openmoko Local Groups: Ulm</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Ulm"/>
				<updated>2008-10-24T15:02:00Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: /* Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Participants ==&lt;br /&gt;
{|border=1&lt;br /&gt;
!Name&lt;br /&gt;
!Skills&lt;br /&gt;
!Level of Interest&lt;br /&gt;
!Location&lt;br /&gt;
!Has Device&lt;br /&gt;
!Other&lt;br /&gt;
|-&lt;br /&gt;
|[[User:lokolb|Lorenz Kolb]]&lt;br /&gt;
|Embedded Engineering&lt;br /&gt;
|P1 owner&lt;br /&gt;
|Ulm&lt;br /&gt;
|[[Image: MokoBox.jpg|center]]&lt;br /&gt;
|possibly some development, not defined closer, yet&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Mark|Mark]]&lt;br /&gt;
|&lt;br /&gt;
|waiting for GTA02&lt;br /&gt;
|near Ulm&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Lollisoft|Lothar Behrens]]&lt;br /&gt;
|&lt;br /&gt;
|Got my GTA02 and be happy&lt;br /&gt;
|near Ulm (more far, Lenningen)&lt;br /&gt;
|[[Image: Moko.jpg|center]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:JubJub|Sebastian]]&lt;br /&gt;
|&lt;br /&gt;
|waiting for GTA02&lt;br /&gt;
|near Ulm (Aalen)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Noo|Manuel]]&lt;br /&gt;
|Ulm&lt;br /&gt;
|has got his GTA02:-)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|...&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Meetings, Events ===&lt;br /&gt;
Meeting language is German or English ;-)&lt;br /&gt;
{|border=1&lt;br /&gt;
!Date&lt;br /&gt;
!Location&lt;br /&gt;
!Topic&lt;br /&gt;
!Who&lt;br /&gt;
|-&lt;br /&gt;
|???&lt;br /&gt;
|...&lt;br /&gt;
|...&lt;br /&gt;
|???&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko Local Groups]]&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User:Noo</id>
		<title>User:Noo</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User:Noo"/>
				<updated>2008-10-24T15:01:22Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: New page: I'm not well in programming, i think, although i made some experiences with php, python(-django) and a little bit cpp.  My interests are in and about open-source and linux os.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I'm not well in programming, i think, although i made some experiences with php, python(-django) and a little bit cpp.&lt;br /&gt;
&lt;br /&gt;
My interests are in and about open-source and linux os.&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User:MrNoo</id>
		<title>User:MrNoo</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User:MrNoo"/>
				<updated>2008-10-24T14:59:37Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I'm not well in programming, i think, although i made some experiences with php, python(-django) and a little bit cpp.&lt;br /&gt;
&lt;br /&gt;
My interests are in and about open-source and linux os.&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User:MrNoo</id>
		<title>User:MrNoo</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User:MrNoo"/>
				<updated>2008-10-24T14:56:57Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: New page: I'm not well in programming, i think.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I'm not well in programming, i think.&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Ulm</id>
		<title>Openmoko Local Groups: Ulm</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Ulm"/>
				<updated>2008-10-24T14:55:17Z</updated>
		
		<summary type="html">&lt;p&gt;Noo: /* Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Participants ==&lt;br /&gt;
{|border=1&lt;br /&gt;
!Name&lt;br /&gt;
!Skills&lt;br /&gt;
!Level of Interest&lt;br /&gt;
!Location&lt;br /&gt;
!Has Device&lt;br /&gt;
!Other&lt;br /&gt;
|-&lt;br /&gt;
|[[User:lokolb|Lorenz Kolb]]&lt;br /&gt;
|Embedded Engineering&lt;br /&gt;
|P1 owner&lt;br /&gt;
|Ulm&lt;br /&gt;
|[[Image: MokoBox.jpg|center]]&lt;br /&gt;
|possibly some development, not defined closer, yet&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Mark|Mark]]&lt;br /&gt;
|&lt;br /&gt;
|waiting for GTA02&lt;br /&gt;
|near Ulm&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Lollisoft|Lothar Behrens]]&lt;br /&gt;
|&lt;br /&gt;
|Got my GTA02 and be happy&lt;br /&gt;
|near Ulm (more far, Lenningen)&lt;br /&gt;
|[[Image: Moko.jpg|center]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:JubJub|Sebastian]]&lt;br /&gt;
|&lt;br /&gt;
|waiting for GTA02&lt;br /&gt;
|near Ulm (Aalen)&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User:MrNoo|Manuel]]&lt;br /&gt;
|Ulm&lt;br /&gt;
|has got his GTA02:-)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|...&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Meetings, Events ===&lt;br /&gt;
Meeting language is German or English ;-)&lt;br /&gt;
{|border=1&lt;br /&gt;
!Date&lt;br /&gt;
!Location&lt;br /&gt;
!Topic&lt;br /&gt;
!Who&lt;br /&gt;
|-&lt;br /&gt;
|???&lt;br /&gt;
|...&lt;br /&gt;
|...&lt;br /&gt;
|???&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Openmoko Local Groups]]&lt;/div&gt;</summary>
		<author><name>Noo</name></author>	</entry>

	</feed>