Freitag, 12. September 2008

Revive the Openmoko Neo Freerunner with USB power


This article describes, how to revive the Freerunner with USB power when the battery was fully discharged. Use at your own risk. It is possible that you damage your device. You have been warned.
Use a spare USB cable, chop off the plug on one side. A standard USB cable has red (+) and black (-) for power, white and green for data lines (these are not needed anymore). Connect the hooks from the next picture to red and black. This cable is called revival cable from now on.
Use safety hooks to connect to the power pins of the Freerunner.
Before proceeding, plug in the revival cable to an USB-port of your PC and check, that the V+ and V- go to the right hooks.
Unplug the revival cable from USB again before proceeding.
Now connect the hooks to the Freerunner. Check that the red hook goes to + and the black to - (Notice the "Do not short circu" on the battery :-)
>Plug in the revival cable again. Carefully turn the Freerunner and look at the screen, it should have started to boot now.
When the system is up, you can connect the Freerunner USB-port to the charger or to another USB-port of the PC. Notice that the red LED is on now.
Remove the revival cable, first unplug USB, then the hooks. Insert the battery and close the cabinet. You're done.

Mittwoch, 10. September 2008

Having multiple distributions on the Openmoko Neo Freerunner SD-card

work in progress ...

  1. Introduction

  2. u-boot environment

  3. The modified NAND u-boot menu.

    The source for the boot menu:

    setenv bootargs
    ${bootargs_base} ${mtdparts};
    nand read.e 0x32000000 kernel 0x200000;
    bootm 0x32000000

    mmcblk0p1 - OM2008.08:
    setenv bootargs
    ${bootargs_base} ${mtdparts}
    rootfstype=ext2 root=/dev/mmcblk0p1 rootdelay=5;
    ext2load mmc 0:1 0x32000000 uImage.bin;
    bootm 0x32000000

    mmcblk0p2 - Debian:
    setenv bootargs
    ${bootargs_base} ${mtdparts}
    rootfstype=ext2 root=/dev/mmcblk0p2 rootdelay=5;
    ext2load mmc 0:2 0x32000000 uImage.bin;
    bootm 0x32000000

    mmcblk0p3 - QTopia:
    setenv bootargs
    ${bootargs_base} ${mtdparts}
    rootfstype=ext2 root=/dev/mmcblk0p3 rootdelay=5;
    ext2load mmc 0:3 0x32000000 uImage.bin;
    bootm 0x32000000

    mmcblk0p6 - FDOM:
    setenv bootargs
    ${bootargs_base} ${mtdparts}
    rootfstype=ext2 root=/dev/mmcblk0p6 rootdelay=5;
    ext2load mmc 0:6 0x32000000 uImage.bin;
    bootm 0x32000000


    Power off:
    neo1973 power-off

    Set console to USB:
    setenv stdin usbtty;
    setenv stdout usbtty;
    setenv stderr usbtty

    Set console to serial:
    setenv stdin serial;
    setenv stdout serial;
    setenv stderr serial

    Then on 2nd thought: all this distributions run on the very same hardware - why not use the same kernel for all? Let's try this for FDOM: Replace ext2load mmc 0:6 0x32000000 uImage.bin; by nand read.e 0x32000000 kernel 0x200000;, flash the new u-boot environment, copy /lib/modules/* to /media/mmcblk0p6/lib/modules, chroot /media/mmcblk0p6 depmod and boot it - yes! Now how do I get the modules into a NAND partition?
  4. Common things for all distributions

  5. There are a few identical things I did for all distributions:
    • Copy /etc/dropbear/* to $distribution/etc/dropbear
    • Copy directory /home/root/.ssh to $distribution/home/root (resp. $distribution/root for Debian)
    • Add an entry /dev/mmcblk0 to /etc/udev/mount.blacklist
    • Remove the symlink $distribution/var/volatile/log and create a normal directory $distribution/var/log. In each $distribution/etc/syslog.conf, change the destination to file, increase ROTATESIZE and ROTATEGENS. It's not really helpful if errors occur and all messages are gone after a reboot.

  6. mmcblk0p1 - Om2008.8 - 1 GB ext2

  7. mmcblk0p2 - Debian - 1 GB ext2

  8. mmcblk0p3 - QTopia - 1 GB ext2

  9. mmcblk0p4 - an extended partition

  10. mmcblk0p5 - swap space - 512 MB

  11. # cat /proc/swaps
    Filename Type Size Used Priority
    /dev/mmcblk0p5 partition 500016 0 -1
    # free
    total used free shared buffers cached
    Mem: 126292 68516 57776 0 504 32512
    -/+ buffers/cache: 35500 90792
    Swap: 500016 0 500016

  12. mmcblk0p6 - FDOM and misc things - 4.5 GB ext2

  13. Yes, it can boot from an extended partition - but not for long. It dies with "Unable to open an initial console". I have to check system files before the next try.

    On 2nd try everything looks ok.

  14. Conclusions