meine Gentoo success story

Nach geschätzten 20 Stunden kompilierzeit ist mein hoch optimiertes Gentoo-System nun auf dem Asus Eeepc 1201N lauffähig. Ich habe den Weg zum Erfolg dokumentiert.

mkfs.ext4 /dev/sda5
mount /dev/sda5 /mnt/
cd /mnt

# Download Stage 3 and Portage
wget ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo/releases/amd64/autobuilds/20100514/stage3-amd64-20100514.tar.bz2
wget ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo/snapshots/portage-20100605.tar.bz2

# Check for integrity
md5sum stage3-amd64-20100514.tar.bz2
md5sum portage-20100605.tar.bz2

# Unpack system
tar xvjpf stage3-amd64-20100514.tar.bz2
tar xvjf portage-20100605.tar.bz2 -C usr/

# chroot into our new system
mount -o bind /dev /mnt/dev/
mount -t proc none /mnt/proc
chroot . /bin/bash

vi etc/resolv.conf # set nameserver
env-update
emerge --sync
eselect profile list
eselect profile set 2 # Desktop System without GNOME/KDE

# We want to compile with gcc4.5 to optimize for -mtune=atom, so we need to
# install layman to add the toolchain overlay
emerge subversion
emerge layman
echo "source /usr/local/portage/layman/make.conf" >> /etc/make.conf
echo "PORTDIR_OVERLAY=\"/usr/local/portage\"" >> /usr/local/portage/layman/make.conf
layman -a toolchain
nano /etc/make.conf
add ACCEPT_KEYWORDS="~amd64" to make.conf to allow development version of gcc
mkdir /etc/portage

# Unmask gcc 4.5.0
echo "=sys-devel/gcc-4.5.0 **" >> /etc/portage/package.keywords
echo "=sys-devel/gcc-4.5.0" >> /etc/portage/packages.unmask
emerge gcc
gcc-config x86_64-pc-linux-gnu-4.5.0
env-update
source /etc/profile
emerge binutils
emerge libtool

nano /etc/make.conf
# CFLAGS="-march=native -mtune=atom -msse3 -O2 -pipe"
# CXXFLAGS="${CFLAGS}"
# MAKEOPTS="-j5"

emerge -eav system
emerge -eav world

emerge vim # i don't like nano
vi etc/locale.gen # set your locale
locale-gen

cd usr/src/
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2
tar xvf linux-2.6.34.tar.bz2
ln -s linux-2.6.34 linux
cd linux/
# configure your kernel or copy existing .config here
make; make modules; make modules_install
cp arch/x86_64/boot/bzImage /boot/linux-2.6.34
vi /etc/fstab
# configure your fstab here

# configure your bootloader. when using ubuntu 10.04 see this
# http://ubuntuforums.org/showthread.php?t=1195275

emerge dhcpcd

# We now need to boot our system to have our kernel running

# The Asus Eeepc1201N has an Nvidia Ion (Geforce 9400M) chipset, so we need
# to install the nvidia-drivers. Portage will automatically emerge the
# x.org environment for us.

emerge nvidia-drivers
emerge xf86-input-evdev # important because X.org will freeze without evdev
nvidia-xconfig

# Now install the other system essentials

# the dual-core atom isn't the fastest processor around, so we should try to
# reduce compile time as much as possible using ccache
emerge ccache

# emerge other system essentials
emerge xterm fluxbox irssi hnb alpine screen xdm xfe

# make sure that hald is running
/etc/init.d/hald start

startx

# enjoy your new optimized gentoo System

Hier meine make.conf (work in progress):
ACCEPT_KEYWORDS="~amd64"
CFLAGS="-march=native -mtune=atom -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="mmx sse sse2 gtk -qt4 -qt3 -qt3-support -xulrunner -kde xvmc threads"
MAKEOPTS="-j5"
INPUT_DEVICES="keyboard mouse evdev"
VIDEO_CARDS="nvidia"

FEATURES="ccache"
CCACHE_SIZE="2G"

source /usr/local/portage/layman/make.conf