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

Keine Kommentare: