Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Installation: Replace <pre><tt> with wikitext, use oredered list, remove "e.g." before each cmd.)
Line 19: Line 19:
  
 
== Installation ==
 
== Installation ==
*Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
+
<ol>
:<tt>e.g.</tt> <pre>fdisk /dev/mmcblk0</pre>
+
<li>Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted): </li>  
*Make ext2 or ext3 filesystem
+
  fdisk /dev/mmcblk0
:<tt>e.g.</tt> <pre>mkfs.ext2 /dev/mmcblk0p1</pre>
+
 
*Mount partition
+
<li>Make ext2 or ext3 filesystem: </li>  
:<tt>e.g.</tt> <pre>mount /dev/mmcblk0p1 /media/card</pre>
+
  mkfs.ext2 /dev/mmcblk0p1
*Copy stage and portage from host to moko
+
 
:<tt>e.g. (on localhost)</tt> <pre>scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card</pre>
+
<li>Mount partition: </li>  
*Unpack stage and portage
+
  mount /dev/mmcblk0p1 /media/card
:<tt>e.g.</tt>
+
 
<pre>
+
<li>Copy stage and portage from host to moko (e.g. on localhost): </li>
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
+
  scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
+
 
</pre>
+
<li>Unpack stage and portage: </li>  
*Cleanup removing tar.bz2
+
  tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
:<tt>e.g.</tt> <pre>rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2</pre>
+
  tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
*Chroot
+
 
:<tt>e.g.</tt> <pre>chroot /media/card /bin/bash</pre>
+
<li>Cleanup removing tar.bz2: </li>  
*Update chroot environment
+
  rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
:<tt>e.g.</tt> <pre>source /etc/profile; env-update</pre>
+
 
*Set timezone
+
<li>Chroot: </li>  
:<tt>e.g.</tt> <pre>cp /usr/share/zoneinfo/YOURZONE /etc/localtime</pre>
+
  chroot /media/card /bin/bash
*Set hostname
+
 
:<tt>e.g.</tt> <pre>nano /etc/conf.d/hostname</pre>
+
<li>Update chroot environment: </li>  
*Remove console font changing (small is beautiful ;])
+
  source /etc/profile; env-update
:<tt>e.g.</tt> <pre>nano /etc/conf.d/consolefont</pre> (hash consolefont= line)
+
 
*Setup fstab
+
<li>Set timezone: </li>  
:<tt>e.g.</tt> <pre>nano /etc/fstab</pre>
+
  cp /usr/share/zoneinfo/YOURZONE /etc/localtime
*Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
+
 
:<tt>e.g.</tt> <pre>nano /etc/inittab</pre>
+
<li>Set hostname: </li>  
*Setup usb networking
+
  nano /etc/conf.d/hostname
:<tt>e.g.</tt>
+
 
<pre>
+
<li>Remove console font changing (small is beautiful ;]): </li>  
ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
+
  nano /etc/conf.d/consolefont (hash consolefont= line)
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
+
<li>Setup fstab: </li>  
echo "nameserver 192.168.0.200" > /etc/resolv.conf
+
  nano /etc/fstab
</pre>
+
 
*Enable sshd
+
<li>Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines): </li>  
:<tt>e.g.</tt> <pre>rc-update add sshd default</pre>
+
  nano /etc/inittab
*Change root password
+
 
:<tt>e.g.</tt> <pre>passwd</pre>
+
<li>Setup usb networking: </li>  
*Leave chroot
+
  ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
:<tt>e.g.</tt> <pre>exit</pre>
+
  echo "config_usb0=( \"192.168.0.202 netmask 255.255.255.0\" )" > /etc/conf.d/net
*Copy kernel
+
  echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
*Copy modules
+
  echo "nameserver 192.168.0.200" > /etc/resolv.conf
*Setup uboot for booting from sd card
+
 
*Reboot
+
<li>Enable sshd: </li>  
*Setup/emerge rest of the system
+
  rc-update add sshd default
 +
 
 +
<li>Change root password: </li>  
 +
  passwd
 +
 
 +
<li>Leave chroot: </li>  
 +
  exit
 +
 
 +
<li>Copy kernel. </li>
 +
<li>Copy modules. </li>
 +
<li>Setup uboot for booting from sd card. </li>
 +
<li>Reboot. </li>
 +
<li>Setup/emerge rest of the system. </li>
  
 
== Emerging binary packages ==
 
== Emerging binary packages ==

Revision as of 09:54, 16 September 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.  nano /etc/conf.d/consolefont (hash consolefont= line)
    
  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.  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. Copy modules.
  37. Setup uboot for booting from sd card.
  38. Reboot.
  39. Setup/emerge rest of the system.
  40. 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/profiles; 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"
    • Emerge packages with -kG
    e.g.
    emerge -kG syslog-ng


    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

  • Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
e.g.
fdisk /dev/mmcblk0
  • Make ext2 or ext3 filesystem
e.g.
mkfs.ext2 /dev/mmcblk0p1
  • Mount partition
e.g.
mount /dev/mmcblk0p1 /media/card
  • Copy stage and portage from host to moko
e.g. (on localhost)
scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
  • Unpack stage and portage
e.g.
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
  • Cleanup removing tar.bz2
e.g.
rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
  • Chroot
e.g.
chroot /media/card /bin/bash
  • Update chroot environment
e.g.
source /etc/profile; env-update
  • Set timezone
e.g.
cp /usr/share/zoneinfo/YOURZONE /etc/localtime
  • Set hostname
e.g.
nano /etc/conf.d/hostname
  • Remove console font changing (small is beautiful ;])
e.g.
nano /etc/conf.d/consolefont
(hash consolefont= line)
  • Setup fstab
e.g.
nano /etc/fstab
  • Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
e.g.
nano /etc/inittab
  • Setup usb networking
e.g.
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
  • Enable sshd
e.g.
rc-update add sshd default
  • Change root password
e.g.
passwd
  • Leave chroot
e.g.
exit
  • Copy kernel
  • Copy modules
  • Setup uboot for booting from sd card
  • Reboot
  • Setup/emerge rest of the system

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/profiles; 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"
  • Emerge packages with -kG
e.g.
emerge -kG syslog-ng


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.