16 2013-02-09
Setting Up The Stage

First make sure your date and time is set correctly using date MMDDhhmmYYYY. Use UTC time.

(Check the clock)
livecd gentoo # date
Mon Mar  6 00:14:13 UTC 2006

(Set the current date and time if required)
livecd gentoo # date 030600162006 (Format is MMDDhhmmYYYY)
Mon Mar  6 00:16:00 UTC 2006

Next, download a stage from one of our mirrors:

livecd gentoo # links http://www.gentoo.org/main/en/mirrors.xml
(Pick a mirror, move to the releases/x86/current-stage3/ directory,
highlight the stage3 of your choice, probably the i686 stage3, and press D to
download it)

(Or download it directly with wget without choosing a nearby mirror)
livecd gentoo # wget ftp://distfiles.gentoo.org/pub/gentoo/releases/x86/current-stage3/stage3-i686-*.tar.bz2

Go to /mnt/gentoo and unpack the stage using tar xjpf <stage3 tarball>.

livecd gentoo # time tar xjpf stage3*

real  1m14.157s
user  1m2.920s
sys   0m7.530s
Chrooting

Mount the /proc, /dev, and /sys file systems, copy over the /etc/resolv.conf file, then chroot into your Gentoo environment.

livecd usr # cd /
livecd / # mount -t proc proc /mnt/gentoo/proc
livecd / # mount --rbind /dev /mnt/gentoo/dev
livecd / # mount --rbind /sys /mnt/gentoo/sys
livecd / # cp -L /etc/resolv.conf /mnt/gentoo/etc/ 
livecd / # chroot /mnt/gentoo /bin/bash
livecd / # source /etc/profile

Fetch the latest portage snapshot from the mirrors using emerge-webrsync.

livecd / # mkdir /usr/portage
livecd / # emerge-webrsync
Set your time zone

Set your time zone information by using the correct listing in /usr/share/zoneinfo.

livecd / # ls /usr/share/zoneinfo
(Using Brussels as an example)
livecd / # cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime
livecd / # echo "Europe/Brussels" > /etc/timezone

livecd / # date
Wed Mar  8 00:46:05 CET 2006
Select your profile

Choose your profile using eselect. This is an example of the output you might see.

livecd / # eselect profile list
Available profile symlink targets:
  [1]    default/linux/x86/13.0 *
  [2]    default/linux/x86/13.0/desktop
  [3]    default/linux/x86/13.0/desktop/gnome
  [4]    default/linux/x86/13.0/desktop/kde
  [5]    default/linux/x86/13.0/server

Choose the appropriate profile. Keep in mind that default USE flags are determined based on the profile you pick.

livecd / # eselect profile set 2
Set your host name and domain name

Set your host name in /etc/conf.d/hostname and /etc/hosts. In the following example, we use mybox as host name and at.myplace as domain name. You can either edit the config files with nano or use the following commands:

livecd / # cd /etc
livecd etc # echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts
livecd etc # sed -i -e 's/hostname.*/hostname="mybox"/' conf.d/hostname
(Use defined host name and check)
livecd etc # hostname mybox
livecd etc # hostname -f
mybox.at.myplace