Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (I had bad english :))
Line 109: Line 109:
  
 
== Openmoko Overlay ==
 
== Openmoko Overlay ==
First, emerge layman (you need to build it with svn support, so USE="svn", maybe you should set it just local). Then add the overlay with layman -a openmoko and put source /usr/local/portage/layman/make.conf in your /etc/make.conf. At least, have a look at /usr/local/portage/layman/make.conf, and add make PORTDIR_OVERLAY look like this: PORTDIR_OVERLAY="/usr/local/portage/layman/openmoko/trunk/openmoko-target"
+
First, emerge layman (you need to build it with svn support, so USE="svn", maybe you should set it just local). Then add the overlay with layman -a openmoko and put source /usr/local/portage/layman/make.conf in your /etc/make.conf. Finally, have a look at /usr/local/portage/layman/make.conf, and add make PORTDIR_OVERLAY look like this: PORTDIR_OVERLAY="/usr/local/portage/layman/openmoko/trunk/openmoko-target"
  
 
== Binary package wishlist ==
 
== Binary package wishlist ==

Revision as of 07:14, 16 February 2009

Contents

Overview

Gentoo armv4tl-softfloat-linux-gnueabi optimalized for Openmoko (-Os -march=armv4t -mtune=arm920t) on 2008.0/arm profile (glibc based, sane bootstrapable toolchain)
(embedded uclibc/arm profile armv4tl-softfloat-linux-uclibcgnueabi in plans)

Screenshot (hosted at ImageShack)

Read first

http://www.gentoo.org/doc/en/handbook/handbook-arm.xml (Skip points 2 and 3)


Needed things


Installation

Be careful, the overlay seems to be dead, so you'll have to manually compile (please make ebuilds if you do) illume and anything openomoko-specific

  1. Partition your sd card if needed (don`t make swap partitions (but see [1]), ensure card isn't mounted):
  2.  fdisk /dev/mmcblk0
    
  3. Make ext2 or ext3 filesystem:
  4.  mkfs.ext2 /dev/mmcblk0p1
    
  5. Mount partition:
  6.  mount /dev/mmcblk0p1 /media/card
    
  7. Copy stage and portage from host to moko (e.g. on localhost):
  8.  scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
    
  9. Unpack stage and portage:
  10.  tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
     tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
    
  11. Cleanup removing tar.bz2:
  12.  rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
    
  13. Chroot:
  14.  chroot /media/card /bin/bash
    
  15. Update chroot environment:
  16.  source /etc/profile; env-update
    
  17. Set timezone:
  18.  cp /usr/share/zoneinfo/YOURZONE /etc/localtime
    
  19. Set hostname:
  20.  nano /etc/conf.d/hostname
    
  21. Remove console font changing (small is beautiful ;]):
  22.  rc-update del consolefont boot
    
  23. Setup fstab:
  24.  nano /etc/fstab
    
  25. Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines):
  26.  nano /etc/inittab
    
  27. Setup usb networking:
  28.  echo "modules=\"g_ether\"" >> /etc/conf.d/modules
     ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
     echo "config_usb0=\"192.168.0.202 netmask 255.255.255.0\"" > /etc/conf.d/net
     echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
     echo "nameserver 192.168.0.200" > /etc/resolv.conf
    
  29. Enable sshd:
  30.  rc-update add sshd default
    
  31. Change root password:
  32.  passwd
    
  33. Leave chroot:
  34.  exit
    
  35. Copy kernel.
  36.  cp /boot/uImage-2.6.24 /media/card/boot/
    
  37. Copy modules.
  38.  cp -rpf /lib/modules /media/card/lib/
    
  39. Setup uboot for booting from sd card.
  40. Reboot.
  41. Setup/emerge rest of the system.
  42. Emerging binary packages

    • Binary package sites
    http://tinderbox.dev.gentoo.org/embedded/openmoko/armv4tl-softfloat-linux-gnueabi/
    http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All
    • Add PORTAGE_BINHOST to make.conf
    e.g.
    echo "PORTAGE_BINHOST=\"http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All\"" >> /etc/make.conf
    • Update environment
    e.g.
    source /etc/profile; env-update
    • Setup install mask if you don't want compiler headers/docs etc (mask headers only if you'll be always using binary packages)
    e.g.
    export INSTALL_MASK="*.h"
    • Add the following line to make.conf to tell portage to always use binary packages.
      EMERGE_DEFAULT_OPTS="-gK"

    Alternative: Squashed Portage

    An alternative to installing a full, writable, and uncompressed portage tree directly on the microSD card, is to compress portage using SquashFS and then to mount the resulting SquashFS file (usually compressed from about 500 MB to 50 MB) at /usr/portage.

    In this case, it is also suggested to set DISTDIR to /tmp/distfiles, because the default DISTDIR (/usr/portage/distfiles) is not writable. Similarly, PKGDIR can be set to /tmp/binpkgs instead of the default /usr/portage/packages.

    See this blog post for further details. If you are lacking in extra space on your flash device, or are concerned about extraneous write-cycles to your flash memory, then you should perform all of the steps on desktop linux machine and then finally copy the resulting squashfs image to the FreeRunner.

    Openmoko Overlay

    First, emerge layman (you need to build it with svn support, so USE="svn", maybe you should set it just local). Then add the overlay with layman -a openmoko and put source /usr/local/portage/layman/make.conf in your /etc/make.conf. Finally, have a look at /usr/local/portage/layman/make.conf, and add make PORTDIR_OVERLAY look like this: PORTDIR_OVERLAY="/usr/local/portage/layman/openmoko/trunk/openmoko-target"

    Binary package wishlist

    As i'll be adding some packages to ftp above you might want to ask for some package here: GentooPackageWishList

    Overlay with moko things and more packages coming soon.
Personal tools

Overview

Gentoo armv4tl-softfloat-linux-gnueabi optimalized for Openmoko (-Os -march=armv4t -mtune=arm920t) on 2008.0/arm profile (glibc based, sane bootstrapable toolchain)
(embedded uclibc/arm profile armv4tl-softfloat-linux-uclibcgnueabi in plans)

Screenshot (hosted at ImageShack)

Read first

http://www.gentoo.org/doc/en/handbook/handbook-arm.xml (Skip points 2 and 3)


Needed things


Installation

Be careful, the overlay seems to be dead, so you'll have to manually compile (please make ebuilds if you do) illume and anything openomoko-specific

  1. Partition your sd card if needed (don`t make swap partitions (but see [1]), ensure card isn't mounted):
  2.  fdisk /dev/mmcblk0
    
  3. Make ext2 or ext3 filesystem:
  4.  mkfs.ext2 /dev/mmcblk0p1
    
  5. Mount partition:
  6.  mount /dev/mmcblk0p1 /media/card
    
  7. Copy stage and portage from host to moko (e.g. on localhost):
  8.  scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
    
  9. Unpack stage and portage:
  10.  tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
     tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
    
  11. Cleanup removing tar.bz2:
  12.  rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
    
  13. Chroot:
  14.  chroot /media/card /bin/bash
    
  15. Update chroot environment:
  16.  source /etc/profile; env-update
    
  17. Set timezone:
  18.  cp /usr/share/zoneinfo/YOURZONE /etc/localtime
    
  19. Set hostname:
  20.  nano /etc/conf.d/hostname
    
  21. Remove console font changing (small is beautiful ;]):
  22.  rc-update del consolefont boot
    
  23. Setup fstab:
  24.  nano /etc/fstab
    
  25. Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines):
  26.  nano /etc/inittab
    
  27. Setup usb networking:
  28.  echo "modules=\"g_ether\"" >> /etc/conf.d/modules
     ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
     echo "config_usb0=\"192.168.0.202 netmask 255.255.255.0\"" > /etc/conf.d/net
     echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
     echo "nameserver 192.168.0.200" > /etc/resolv.conf
    
  29. Enable sshd:
  30.  rc-update add sshd default
    
  31. Change root password:
  32.  passwd
    
  33. Leave chroot:
  34.  exit
    
  35. Copy kernel.
  36.  cp /boot/uImage-2.6.24 /media/card/boot/
    
  37. Copy modules.
  38.  cp -rpf /lib/modules /media/card/lib/
    
  39. Setup uboot for booting from sd card.
  40. Reboot.
  41. Setup/emerge rest of the system.
  42. Emerging binary packages

    • Binary package sites
    http://tinderbox.dev.gentoo.org/embedded/openmoko/armv4tl-softfloat-linux-gnueabi/
    http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All
    • Add PORTAGE_BINHOST to make.conf
    e.g.
    echo "PORTAGE_BINHOST=\"http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All\"" >> /etc/make.conf
    • Update environment
    e.g.
    source /etc/profile; env-update
    • Setup install mask if you don't want compiler headers/docs etc (mask headers only if you'll be always using binary packages)
    e.g.
    export INSTALL_MASK="*.h"
    • Add the following line to make.conf to tell portage to always use binary packages.
      EMERGE_DEFAULT_OPTS="-gK"

    Alternative: Squashed Portage

    An alternative to installing a full, writable, and uncompressed portage tree directly on the microSD card, is to compress portage using SquashFS and then to mount the resulting SquashFS file (usually compressed from about 500 MB to 50 MB) at /usr/portage.

    In this case, it is also suggested to set DISTDIR to /tmp/distfiles, because the default DISTDIR (/usr/portage/distfiles) is not writable. Similarly, PKGDIR can be set to /tmp/binpkgs instead of the default /usr/portage/packages.

    See this blog post for further details. If you are lacking in extra space on your flash device, or are concerned about extraneous write-cycles to your flash memory, then you should perform all of the steps on desktop linux machine and then finally copy the resulting squashfs image to the FreeRunner.

    Openmoko Overlay

    First, emerge layman (you need to build it with svn support, so USE="svn", maybe you should set it just local). Then add the overlay with layman -a openmoko and put source /usr/local/portage/layman/make.conf in your /etc/make.conf. Finally, have a look at /usr/local/portage/layman/make.conf, and add make PORTDIR_OVERLAY look like this: PORTDIR_OVERLAY="/usr/local/portage/layman/openmoko/trunk/openmoko-target"

    Binary package wishlist

    As i'll be adding some packages to ftp above you might want to ask for some package here: GentooPackageWishList
    Overlay with moko things and more packages coming soon.

    </div>