Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (boxes around the commands.. thought it might make everything cleaner)
Line 18: Line 18:
 
== Installation ==
 
== Installation ==
 
*Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
 
*Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
:<tt>e.g.</tt>  
+
:<tt>e.g.</tt> <pre>fdisk /dev/mmcblk0</pre>
fdisk /dev/mmcblk0
+
 
*Make ext2 or ext3 filesystem
 
*Make ext2 or ext3 filesystem
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>mkfs.ext2 /dev/mmcblk0p1</pre>
mkfs.ext2 /dev/mmcblk0p1
+
 
*Mount partition
 
*Mount partition
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>mount /dev/mmcblk0p1 /media/card</pre>
mount /dev/mmcblk0p1 /media/card
+
 
*Copy stage and portage from host to moko
 
*Copy stage and portage from host to moko
:<tt>e.g.</tt> ''[localhost]''
+
:<tt>e.g. (on localhost)</tt> <pre>scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card</pre>
scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
+
 
*Unpack stage and portage
 
*Unpack stage and portage
:<tt>e.g.</tt>
+
:<tt>e.g.</tt>  
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
+
<pre>
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
+
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
 +
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
 +
</pre>
 
*Cleanup removing tar.bz2
 
*Cleanup removing tar.bz2
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2</pre>
rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
+
 
*Chroot
 
*Chroot
:<tt>e.g.</tt>  
+
:<tt>e.g.</tt> <pre>chroot /media/card /bin/bash</pre>
chroot /media/card /bin/bash
+
 
*Update chroot environment
 
*Update chroot environment
:<tt>e.g.</tt>  
+
:<tt>e.g.</tt> <pre>source /etc/profiles; env-update</pre>
source /etc/profiles; env-update
+
 
*Set timezone
 
*Set timezone
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>cp /usr/zoneinfo/YOURZONE /etc/localtime</pre>
cp /usr/zoneinfo/YOURZONE /etc/localtime
+
 
*Set hostname
 
*Set hostname
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>nano /etc/conf.d/hostname</pre>
nano /etc/conf.d/hostname
+
 
*Remove console font changing (small is beautiful ;])
 
*Remove console font changing (small is beautiful ;])
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>nano /etc/conf.d/consolefont</pre> (hash consolefont= line)
nano /etc/conf.d/consolefont (hash consolefont= line)
+
 
*Setup fstab
 
*Setup fstab
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>nano /etc/fstab</pre>
nano /etc/fstab
+
 
*Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
 
*Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>nano /etc/inittab</pre>
nano /etc/inittab
+
 
*Setup usb networking
 
*Setup usb networking
:<tt>e.g.</tt>
+
:<tt>e.g.</tt>  
ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
+
<pre>
echo "config_usb0=( \"192.168.0.202 netmask 255.255.255.0\" )" > /etc/conf,d/net
+
ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
+
echo "config_usb0=( \"192.168.0.202 netmask 255.255.255.0\" )" > /etc/conf,d/net
echo "nameserver 192.168.0.200" > /etc/resolv.conf
+
echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
 +
echo "nameserver 192.168.0.200" > /etc/resolv.conf
 +
</pre>
 
*Enable sshd
 
*Enable sshd
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>rc-update add sshd default</pre>
rc-update add sshd default
+
 
*Change root password
 
*Change root password
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>passwd</pre>
passwd
+
 
*Leave chroot
 
*Leave chroot
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>exit</pre>
exit
+
 
*Copy kernel
 
*Copy kernel
 
*Copy modules
 
*Copy modules
Line 81: Line 70:
 
== Emerging binary packages ==
 
== Emerging binary packages ==
 
*Add PORTAGE_BINHOST to make.conf
 
*Add PORTAGE_BINHOST to make.conf
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>echo "PORTAGE_BINHOST=http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All" >> /etc/make.conf</pre>
echo "PORTAGE_BINHOST=http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All" >> /etc/make.conf
+
 
*Update environment
 
*Update environment
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>source /etc/profiles; env-update</pre>
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)
 
*Setup install mask if you don't want compiler headers/docs etc (mask headers only if you'll be always using binary packages)
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>export INSTALL_MASK="*.h"</pre>
INSTALL_MASK="*.h"
+
 
*Emerge packages with -kG
 
*Emerge packages with -kG
:<tt>e.g.</tt>
+
:<tt>e.g.</tt> <pre>emerge -kG syslog-ng</pre>
emerge -kG syslog-ng
+
  
  

Revision as of 01:51, 4 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)


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/profiles; env-update
  • Set timezone
e.g.
cp /usr/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

  • 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)


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. [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/profiles; env-update
  • Set timezone
e.g.
cp /usr/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

  • 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.
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.