Menu

Checklist for installing Gentoo 1.4 on an i686

    1. Obtain Gentoo and burn it to CD
      QND Gentoo.org
    2. Boot from Gentoo LiveCD, Disc 1
      QND Gentoo.org
    3. Set system data (and time)
      QND Gentoo.org
    4. Create partitions
      QND Gentoo.org
    5. Make filesystems QND
      Gentoo.org
    6. Mount filesystems QND
      Gentoo.org
    7. QND Extract the base system
      Make sure you are in the /mnt/gentoo directory, which is the mountpoint of your root filesystem:

      cd /mnt/gentoo
    8. Now, extract the Stage 3 base system tarball into the current directory:
      tar xvjpf /mnt/cdrom/stages/stage3-i686-*.tar.bz2
    9. Extract the Portage snapshot tarball into the usr/ directory:
      tar xvjf /mnt/cdrom/snapshots/portage-*.tar.bz2 -C usr
    10. Copy the distribution and GRP (Gentoo binary packages) files into your new Portage directory:
      cp -R /mnt/cdrom/distfiles usr/portage/distfiles
      cp -a /mnt/cdrom/packages usr/portage/packages
      

If you would like more information on this step, Gentoo.org

    1. QND Build a chroot jail
    2. Create a chroot jail for your new Gentoo system (yes, believe it or not, you almost have a fully functional system built in the /mnt/gentoo directory):
      chroot /mnt/gentoo /bin/bash
    3. Update your environment (to completely immerse yourself in the Matrix):
      env-update
      source /etc/profile

If you would like more information on this step, Gentoo.org

    1. QND Set your time zone
      Make a symbolic link (AKA symlink AKA soft link) from the zoneinfo file that correctly describes your time zone to /etc/localtime:

      ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

      if you are in North America’s Eastern Standard Time zone. If you are in Ireland, you want to use zoneinfo/Eire; if in Japan, zoneinfo/Japan; if in California, zoneinfo/America/Los_Angeles; if in Bulgaria, zoneinfo/Europe/Sofia; and so on. You should be able to figure it out. 🙂

If you would like more information on this step, Gentoo.org

    1. QND Create your /etc/fstab
      /etc/fstab tells Linux all it needs to know about your filesystems. Open it

      nano -w /etc/fstab

      and edit it (Nano is the GNU clone of Pico, if that helps you; Emacs / Readline style movement generally works; look at the bottom line of Nano for a quick keystroke reference) to look like this:

      # /etc/fstab: static file system information.
      #
      # noatime turns off atimes for increased performance (atimes normally aren't
      # needed; notail increases performance of ReiserFS (at the expense of storage
      # efficiency).  It is safe to drop the noatime options if you want and to 
      # switch between notail and tail freely.
      
      # <fs>           <mount point> <type>   <opts>          <dump/pass>
      
      # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
      
      /dev/hda1        /boot         ext2        noauto          1 1
      /dev/hda3        /             reiserfs    defaults        0 0
      /dev/hda5        /opt          xfs         defaults        0 0
      /dev/hda6        /tmp          xfs         defaults        0 0
      /dev/hda7        /usr          xfs         defaults        0 0
      /dev/hda8        /var          xfs         defaults        0 0
      /dev/hda9        /home         xfs         defaults        0 0
      
      /dev/hda2        none          swap        sw              0 0
      
      /dev/cdroms/cdrom0 /mnt/cdrom  iso9660     noauto,ro,user  0 0
      
      none             /proc         proc        defaults        0 0

If you have a utility / diagnostics / whatever partition, remember to increment the partition number (and skip the dreaded hda4)!

If you would like more information on this step, Gentoo.org

    1. QND Compile a kernel
    2. This will be your first experience with emerge, which is the program used for manipulating Portage, the Gentoo package system. We will emerge (AKA install) the binary xfs-sources kernel:
      emerge -k xfs-sources

      The -k switch is what tells Portage to use a binary package as opposed to the preferred default source packages. (Though actually, the “binary” kernel package is not much different from the “source” one.)

    3. For some reason, some part of the GRP install seems to create a boot symlink to /boot in the /boot directory, which has the unfortunate result of creating an infinitely deep directory structure. Said foppery will prevent genkernel from installing the kernel. Kill the symlink:
      rm /boot/book
    4. Now, emerge the genkernel script and use it to compile and install your kernel:
      emerge -k genkernel
      genkernel

When genkernel finishes, make sure you have the following files in /boot:

/boot/System.map-version
/boot/kernel-version
      where

version

      is the Linux kernel version (e.g.

2.4.20

      ) plus the Gentoo kernel name (in this case

xfs

      ) and the Gentoo ebuild release (e.g

r3

      ). If these files do not exist, you will have to install the kernel manually:
version=`ls -1 /usr/src/ | grep linux- | awk -F'linux' '{ print $2 }'`
cp /usr/src/linux/System /boot/System.map$version
cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel$version

If you would like more information on this step, Gentoo.org

    1. QND Install a system logger and cron daemon
      You will install the most standard system logger, sysklogd, and cron daemon, vcron:

      emerge -k sysklogd vcron

      After the packages are installed, add them to the default run-level:

      rc-update add sysklogd default
      rc-update add vcron default

If you would like more information on this step, Gentoo.org

    1. QND Install all other necessary packages
    2. Since you have reiserfs and XFS filesystems, you should install the tools for both:
      emerge -k reiserfsprogs xfsprogs
    3. And if you are installing on a laptop, you will want to install the pcmcia-cs package and add it to the boot run-level:
      emerge -k pcmcia-cs
      rc-update add pcmcia boot

      (this will involve a compile–a binary package is not distributed on the LiveCD).

If you would like more information on this step, Gentoo.org

    1. QND

      14.) Set root’s password

      If you forget to set a password for the root account, you will not be able to login to your box! Do it now:

      passwd root

      Enter a good password, then enter it again for verification.

If you would like more information on this step, Gentoo.org

    1. QND Network setup
      If you are on a LAN, or are connected to the Internet by an Ethernet NIC (e.g. you have a cable or DSL modem), you will want to configure your network settings. If you dial up to the Internet, skip ahead to the next step.
    2. Set your hostname and domain name:
      echo 'hostname.domain.tld' >/etc/hostname
      echo 'domain.tld' >/etc/dnsdomainname
    3. Add at least one nameserver to your /etc/resolve.conf:
      echo 'nameserver 123.456.789.1' >/etc/resolv.conf
      echo 'nameserver 123.456.789.2' >>/etc/resolv.conf

      Please note that in the first step, you are truncating your /etc/resolv.conf, and in the second, you are appending to it (>> versus >)!

    4. Now, configure your primary Network Interface Card (NIC) by entering:
      nano -w /etc/conf.d/net

      Edit the file to look something like this (note that you only need to edit the lines coloured red):

      # /etc/conf.d/net:
      # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $
      
      # Global config file for net.* rc-scripts
      
      # This is basically the ifconfig argument without the ifconfig $iface
      #
      iface_eth0="192.168.4.209 broadcast 192.168.4.255 netmask 255.255.255.0"
      #iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"
      
      # For DHCP set iface_eth? to "dhcp"
      # For passing options to dhcpcd use dhcpcd_eth?
      #
      #iface_eth0="dhcp"
      #dhcpcd_eth0="..."
      
      # For adding aliases to a interface
      #
      #alias_eth0="192.168.0.3 192.168.0.4"
      
      # NB:  The next is only used for aliases.
      #
      # To add a custom netmask/broadcast address to created aliases,
      # uncomment and change accordingly.  Leave commented to assign
      # defaults for that interface.
      #
      #broadcast_eth0="192.168.0.255 192.168.0.255"
      #netmask_eth0="255.255.255.0 255.255.255.0"
      
      
      # For setting the default gateway
      #
      gateway="eth0/192.168.4.254"
      

      In the iface_eth0="192.168.4.209 broadcast 192.168.4.255 netmask 255.255.255.0" line, replace 192.168.4.209 with your IP address. Replace 192.168.4.255 with your broadcast address (which is usually just your IP address, except the number after the third dot is 255). If you know that you are not in a class C (or its CIDR equivalent, */24) network, replace 255.255.255.0 with your network mask. If you do not know these settings, consult your ISP, sysadmin, or local networking guru.

If you would like more information on this step, Gentoo.org

    1. QND Setup bootloader
    2. You will need to install a bootloader (in this case, GRUB) in order to boot into Linux:
      emerge -k grub
    3. Now, enter
      nano -w /boot/grub/grub.conf

      to create a GRUB configuration file. Edit it to look like this:

      default 0
      timeout 10
      splashimage=(hd0,0)/grub/splash.xpm.gz
      
      title=Gentoo 1.4 (Linux version)
      root (hd0,0)
      kernel (hd0,0)/kernel-version root=/dev/hda3
      initrd (hd0,0)/initrd-version

      where version is the Linux kernel version (e.g. 2.4.20) plus the Gentoo kernel name (in this case xfs) and the Gentoo ebuild release (e.g r3); i.e. the output of:

      version=`ls -1 /usr/src/ | grep linux- | awk -F'linux' '{ print $2 }'`

If you have a utility / diagnostics / whatever partition, you should change (hd0,0) to (hd0,1)!

The Gentoo instructions for this step (see below) have you enter (hd0,0)/boot instead of just (hd0,0)/. In my experience, GRUB cannot find any files prefixed with /boot. This makes sense in that (hd0,0) refers to the /boot partition, and is probably why the /boot/boot infinite symlink is created. What a kludge!

    1. To invoke the GRUB shell (one of the big reasons why it is the best bootloader, period), enter:
      grub --no-floppy

      You will be presented with a prompt:

          GNU GRUB  version 0.93  (640K lower / 3072K upper memory)
      
       [ Minimal BASH-like line editing is supported.  For the first word, TAB
         lists possible command completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]
      
      grub>

      To tell GRUB that your boot partition is the first partition (or second, if you have a utility / diagnostics / whatever partition) of the first hard drive, enter:

      root (hd0,0)

If you have a utility / diagnostics / whatever partition, you should change (hd0,0) to (hd0,1)!

GRUB will report:

 Filesystem type is ext2fs, partition type 0x83

To install GRUB onto the Master Boot Record (MBR) of your first hard drive, enter:

setup (hd0)

GRUB will report:

 Checking if "boot/grub/stage1" exists... yes
 Checking if "boot/grub/stage2" exists... yes
 Checking if "boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.

To exit GRUB, enter:

quit

If you would like more information on this step, Gentoo.org

    1. QND Install XFree86
      If you are installing Gentoo on a server, you probably do not want to install X. Skip to the next step.QND

Using Portage and GRP, installing XFree86 is a simple as entering:

emerge -k xfree
      Again, the

-k

      flag tells

emerge

      to use binary packages when available.

If you would like more information on this step, Gentoo.org

    1. QND Stage a jail-break and reboot! Viva la revolucion!
      To escape from the chroot jail, enter:

      exit

      or hit Ctrl+d.

Unmount all of your filesystems:

cd /
for i in /mnt/gentoo/*; do
  umount /mnt/gentoo/$i;
done
umount -l /mnt/gentoo
      and reboot:
reboot

Make sure to remove the bootable CD as soon as you are able (i.e. right after the machine resets). If all is well, you will see a slick GRUB menu that will wait 10 seconds, then boot into your new Gentoo Linux system!

If you would like more information on this step, Gentoo.org

    1. QND Install useful software packages
      Login to the system with the root password that you set in Step 14QND.
    2. Insert the Gentoo LiveCD, Disc 2 into your CD-ROM drive and enter:
      cp /mnt/cdrom/packages/All/* usr/portage/packages/All/
      

      which will copy around 450MB worth of binary packages onto your hard drive. Don’t worry, it is only temporary. 🙂

    3. Install a decent editor, vim, and sudo a package that lets you run commands with root privileges without having to be root (so you can avoid the onset of carpal tunnel due to typing su - a thousand times a day):
      emerge -k vim sudo gentoolkit

If you are installing Gentoo on a server, you are done. Create some user accounts and away you go! You should skip the rest of the steps in this guide.

    1. Now, install the window manager of your choice:
      • GNOME
        emerge -k gnome

        Open /etc/rc.conf in a text editor (e.g. nano or vim) and find the line:

        #DISPLAYMANAGER="xdm"

        Add a new line right below it:

        DISPLAYMANAGER="gdm"

        and save and exit the file.

      • GNOME
        emerge -k kde

        Open /etc/rc.conf in a text editor (e.g. nano or vim) and find the line:

        #DISPLAYMANAGER="xdm"

        Add a new line right below it:

        DISPLAYMANAGER="kdm"

        and save and exit the file.

    2. To install the Mozilla web browser, enter:
      emerge -k mozilla
    3. Generate an XFree86 configuration file:
      cd /etc/X11
      XFree86 -configure
      mv ~/XF86Config.new ./XF86Config-4

      Open the newly created /etc/X11/XF86Config-4 file in the editor of your choice (e.g. nano or vim) and find the lines:

      Section "Screen"
              Identifier "Screen0"

      Add a new line right beneath them:

      DefaultDepth    16

      for 16 million colours, or:

      DefaultDepth    24

      for 24 million colours.

Save the file and exit.

  1. To have X start automatically on boot, enter:
    rc-update add xdm default
  2. To start XFree86, using either GNOME or KDE, enter:
    /etc/init.d/xdm start

    If all is well, you should be presented with a graphical login screen. Voila, you have installed Gentoo with XFree86!