Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Openmoko Overlay)
Line 98: Line 98:
 
:<tt>e.g.</tt> <pre>export INSTALL_MASK="*.h"</pre>
 
:<tt>e.g.</tt> <pre>export INSTALL_MASK="*.h"</pre>
 
*Add the following line to make.conf to tell portage to always use binary packages. <pre>EMERGE_DEFAULT_OPTS="-gK"</pre>
 
*Add the following line to make.conf to tell portage to always use binary packages. <pre>EMERGE_DEFAULT_OPTS="-gK"</pre>
 +
 +
== Alternative: Squashed Portage ==
 +
An alternative to installing a full, writeable, and uncompressed portage tree directly on the microSD card, is to compress portage using SquashFS and then to mount the resuling 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 writeable. Similarly, PKGDIR can be set to /tmp/binpkgs instead of the default /usr/portage/packages.
 +
 +
See [http://perpetual-notion.blogspot.com/2008/06/gentoo-on-eee-pc.html 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 ==
 
== Openmoko Overlay ==

Revision as of 21:09, 9 October 2008

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

  1. Partition your sd card if needed (don`t make swap partitions, 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, writeable, and uncompressed portage tree directly on the microSD card, is to compress portage using SquashFS and then to mount the resuling 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 writeable. 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

    Add svn://torindel.sezamkowa.net/openmoko to layman (emerge layman)

    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

  1. Partition your sd card if needed (don`t make swap partitions, 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"

    Openmoko Overlay

    Add svn://torindel.sezamkowa.net/openmoko to layman (emerge layman)

    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>