<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml,v 1.36 2005/06/12 09:31:11 fox2mike Exp $ -->

<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">

<guide link="/doc/en/gentoo-x86-quickinstall.xml">
<title>Gentoo Linux x86 Quick Install Guide</title>
<author title="Author">Steven Wagner</author>
<author title="Editor">
  <mail link="swift@gentoo.org">Sven Vermeulen</mail>
</author>

<abstract>
The Quick install guide covers all details of the install process in a 
non-verbose manner. Users should already have prior experience with 
installing Gentoo Linux if they want to follow this guide.
</abstract>

<license/>

<version>1.29</version>
<date>2005-06-12</date>

<chapter>
<title>Quick Install Guide</title>
<section>
<body>

<p>
The installation ISOs are on the <uri link="/main/en/mirrors.xml">Gentoo
Mirrors</uri>. Detailed descriptions of the different CDs are
available in the <uri link="http://store.gentoo.org">Gentoo
Store</uri>. A universal CD contains everything you need to install Gentoo Linux
quickly and without a connection to the Internet. A Package CD is optional and
contains pre-compiled packages such as KDE, GNOME, OpenOffice,
Mozilla, Evolution and more.
</p>

<p>
Boot from the Universal CD. Press &lt;F1&gt; and/or &lt;F2&gt; to
see what boot options are available. Press &lt;ENTER&gt; at the bootscreen to 
continue with the default kernel. You'll eventually receive a prompt.
</p>

<pre caption="Initial settings">
# <i>date</i> (Make sure your time and date is correct. If wrong, set it with  <i>date MMDDhhmmCCYY</i>)
# <i>modprobe module_name</i> <comment>(Optional - Load any necessary modules)</comment>
# <i>net-setup eth0</i> <comment>(Configure the network)</comment>
# <i>fdisk /dev/hda</i> <comment>(Partition your drive)</comment>
</pre>

<p>
The recommended setup is a 64 meg boot volume with ext2, a swap partition 
twice the size of your available RAM, and the rest for your root partition 
using ReiserFS.
</p>

<p>
Initialise your partitions using <c>mke2fs</c> (Ext2), <c>mke2fs
-j</c> (Ext3), <c>mkreiserfs</c> (ReiserFS), <c>mkfs.xfs</c> (XFS),
<c>mkfs.jfs</c> (JFS) and <c>mkswap</c> (swap partition). For instance:
<c>mke2fs -j /dev/hda3</c>.
</p>

<p>
Continue by mounting the partitions and extracting the appropriate stage
file.
</p>

<warn>
For ext3 partitions, you need to specify <c>mount -t ext3</c> explicitly. This 
is due to a bug in the e2fsprogs package.
</warn>

<pre caption="Preparing the Installation">
(Activate the swap partition)    # <i>swapon /dev/hdax</i>
(Mount the root partition)       # <i>mount /dev/hdax /mnt/gentoo</i>
(Create the boot mountpoint)     # <i>mkdir /mnt/gentoo/boot</i>
(Mount the boot partition)       # <i>mount /dev/hdax /mnt/gentoo/boot</i>
(Go to the mountpoint)           # <i>cd /mnt/gentoo</i>
(Extract a stage tarball...)     # <i>tar -xvjpf /mnt/cdrom/stages/stage&lt;your stage&gt;.tar.bz2</i>
(<comment>or</comment> download the latest tarball...) 
                                 # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
(    ... and extract)            # <i>tar -xvjpf stage&lt;your stage&gt;.tar.bz2</i>
(Optional: unpack a portage tree)# <i>tar -xvjf /mnt/cdrom/snapshots/portage-*.tar.bz2 \
                                   -C /mnt/gentoo/usr</i>
(Optional: copy over distfiles)  # <i>cd /mnt/gentoo/usr/portage; mkdir distfiles;</i>
                                 # <i>cp /mnt/cdrom/distfiles/* distfiles/</i>
(Select a mirror)                # <i>mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' \
                                   &gt;&gt; /mnt/gentoo/etc/make.conf</i>
(Copy over nameserver information)
                                 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
(Mount the proc filesystem)      # <i>mount -t proc none /mnt/gentoo/proc</i>
(Chroot into the new environment)# <i>chroot /mnt/gentoo /bin/bash</i>
(Load the necessary variables)   # <i>env-update; source /etc/profile</i>
(Network-only, non-GRP: update Portage)
                                 # <i>emerge --sync</i>
</pre>

<p>
Now we go onto setting our profile and installing Gentoo. A profile is a 
building block for any Gentoo system. Not only does it specify default values 
for CHOST, CFLAGS and other important variables, it also locks the system to a 
certain range of package versions. This is all maintained by the Gentoo 
developers.
</p>

<pre caption = "Installing Gentoo">
(Verify current profile)          # <i>ls -l /etc/make.profile</i>
(Change ONLY IF REQUIRED or if you want a 2.4 kernel)   
                                  # <i>ln -snf /usr/portage/profiles/default-linux/x86/2005.0/2.4 /etc/make.profile</i>
(Change USE, CFLAGS and CXXFLAGS. Stage1 can also change CHOST)  
                                  # <i>nano -w /etc/make.conf</i>
(Stage1 only: bootstrap system)   # <i>cd /usr/portage; scripts/bootstrap.sh</i>
(Stage1, Stage2 only: install base system. Use --emptytree if you modified USE flags. Else --newuse will do. 
 One of these options is a must. )
                                  # <i>emerge --emptytree system</i> <comment>OR</comment> <i>emerge --newuse system</i>
</pre>

<p>
Next we set up the necessary information:
</p>

<pre caption = "Setting up Configuration Files">
(Set timezone information) # <i>ln -sf /usr/share/zoneinfo/<comment>&lt;path to time zone file&gt;</comment> /etc/localtime</i>
(Edit fstab file)          # <i>nano -w /etc/fstab</i>
</pre>

<p>
Use the following as a <e>template</e> (don't copy verbatim) for
<path>/etc/fstab</path>:
</p>

<pre caption="/etc/fstab">
# &lt;fs&gt;          &lt;mountpoint&gt;    &lt;type&gt;          &lt;opts&gt;                  &lt;dump/pass&gt;
/dev/hdax       /boot           ext2            defaults,noatime        1 2
/dev/hdax       none            swap            sw                      0 0
/dev/hdax       /               reiserfs        noatime                 0 1
/dev/cdroms/cdrom0 /mnt/cdrom   auto            noauto,user             0 0
none            /proc           proc            defaults                0 0
none            /dev/shm        tmpfs           nodev,nosuid,noexec     0 0
</pre>

<p>
Continue by installing the Linux kernel:
</p>

<pre caption="Installing the Kernel">
(Install the kernel sources)    # <i>emerge <comment>&lt;kernel-package-here&gt;</comment></i>
(Configure your kernel using genkernel...) 
                                # <i>emerge genkernel; genkernel --udev --menuconfig all</i>
(<comment>or</comment> (1) manually build your kernel)
                                # <i>cd /usr/src/linux; make menuconfig;</i>
(   (2) Include VM fs, /proc fs)
(   (3) Compile your kernel) 
           (for a 2.6 kernel)   # <i>make &amp;&amp; make modules_install</i>   
           (for a 2.4 kernel)   # <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
(   (4) Copy over the kernel)   # <i>cp arch/i386/boot/bzImage /boot; cp System.map /boot</i>
</pre>

<p>
Now install other tools you might want:
</p>

<pre caption = "Install important system tools">
(Install system logger; choice: sysklogd, metalog, msyslog, syslog-ng) 
                                          # <i>emerge syslog-ng </i>
(Have the systemlogger automatically started at boot)
                                          # <i>rc-update add syslog-ng default</i>
(Install cron daemon; choice: vixie-cron, dcron, fcron)                
                                          # <i>emerge vixie-cron</i>
(Have the cron daemon automatically started at boot)                   
                                          # <i>rc-update add vixie-cron default</i>   
(genkernel users only: install *plug)     # <i>emerge coldplug hotplug</i>
(genkernel users only: have coldplug automatically started at boot)     
                                          # <i>rc-update add coldplug boot</i>
(Non-ext2,ext3 users only; choice: reiserfsprogs, xfsprogs, jfsutils)  
                                          # <i>emerge reiserfsprogs</i>
(Optional: install DHCP client)           # <i>emerge dhcpcd</i> 
(Domain name init script)                 # <i>rc-update add domainname default</i>
</pre>

<p>
If you need specialised kernel ebuilds, now is a good time to install them:
</p>

<pre caption = "Install Specialised Kernel Ebuilds">
# <i>emerge pcmcia-cs</i> (or <i>nforce-net</i>, <i>nforce-audio</i>, <i>e100</i>, <i>e1000</i>, <i>ati-drivers</i>, <i>rp-pppoe</i>)
# <i>VIDEO_CARDS="yourcard" emerge x11-drm</i>   (for ATI Radeon up to 9200, Rage128, 
                                            Matrox, Voodoo and other cards)
</pre>

<p>
Finalise the settings for your Gentoo system:
</p>

<pre caption = "Finalise the Configuration Settings">
(Set root password)          # <i>passwd</i>
(Create a user)              # <i>useradd your_user -m -G users,wheel,audio -s /bin/bash</i>
(Set password for that user) # <i>passwd your_user</i>
(Set the system hostname)    # <i>echo mymachine &gt; /etc/hostname</i>
(Set the system domainname)  # <i>echo mydomain.com &gt; /etc/dnsdomainname</i>
(Set the hostsfile, ex:"127.0.0.1 localhost mymachine")  
                             # <i>nano -w /etc/hosts</i>
(Configure basic system settings; follow comments)       
                             # <i>nano -w /etc/rc.conf</i>
</pre>

<pre caption = "Set up Networking">
(Setup networking; dhcp-users should set iface_eth0="dhcp")      
                              # <i>nano -w /etc/conf.d/net</i>
(List modules to be loaded at startup)
                              # <i>nano -w /etc/modules.autoload.d/kernel-<comment>&lt;version&gt;</comment></i>
(Non-PCMCIA only: start networking automatically at boot)        
                              # <i>rc-update add net.eth0 default</i>
(Only if you have multiple network interfaces:)
   (1) Create initscripts for each interface)                    
                              # <i>ln -s /etc/init.d/net.eth0 /etc/init.d/net.ethx</i>
   (2) Automatically start at boot if no PCMCIA)
                              # <i>rc-update add net.ethx default</i>
(PCMCIA only: verify /etc/conf.d/pcmcia and load PCMCIA at boot) 
                              # <i>rc-update add pcmcia default</i>
</pre>

<p>
Now install a bootloader.
</p>

<pre caption="Install and configure GRUB">
# <i>emerge grub</i>
# <i>grub</i>
grub&gt; <i>root (hd0,0)</i>
grub&gt; <i>setup (hd0)</i>
grub&gt; <i>quit</i>
# <i>nano -w /boot/grub/grub.conf</i>
default 0
timeout 15
splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux
  root (hd0,0)
  <comment># genkernel users:</comment>
  kernel /kernel-<comment>&lt;kernel version&gt;</comment> root=/dev/ram0 init=/linuxrc real_root=/dev/hda3 ramdisk=8192 udev
  initrd /initrd-<comment>&lt;kernel version&gt;</comment>
  <comment># non-genkernel users:</comment>
  kernel /kernel-<comment>&lt;kernel version&gt;</comment> root=/dev/hda3 udev
</pre>

<pre caption="Install and configure LILO">
# <i>emerge lilo</i>
# <i>nano -w /etc/lilo.conf</i>
boot=/dev/hda
prompt
timeout=50
default=gentoo

image=/boot/kernel-<comment>&lt;kernel version&gt;</comment> 
  label=gentoo
  read-only
  <comment># genkernel users:</comment>
  append="init=/linuxrc real_root=/dev/hda3 ramdisk=8192 udev"
  root=/dev/ram0
  initrd=/boot/initrd-<comment>&lt;kernel version&gt;</comment>
  <comment># non-genkernel users:</comment>
  append="udev"
  root=/dev/hda3

# <i>/sbin/lilo</i>
</pre>

<p>
Now unmount all partitions and reboot into your new system:
</p>

<pre caption="Finishing off and installing GUI">
(Exiting the chroot)         # <i>exit</i>
                             # <i>cd /</i>
(Unmounting partitions)      # <i>umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo</i>
(Reboot; Remove the universal CD from the tray) 
                             # <i>reboot</i>
(After booting:)
(ADSL-users only)            # <i>adsl-setup</i>
(GRP-users only)
  (1) Mount Package CD       # <i>mount /dev/cdrom /mnt/cdrom</i>  
  (2) Copy over packages     # <i>mkdir /usr/portage/packages</i>
                             # <i>cp -a /mnt/cdrom/* /usr/portage/packages/</i>
  (3) Install extra software # <i>USE="bindist" emerge -k xorg-x11 gnome kde mozilla openoffice-bin</i>
  (4) Configure your Xserver # <i>/usr/X11R6/bin/xorgconfig</i>
</pre>

<p>
You can get more information from the <uri link="/doc/en/index.xml">Gentoo
Documentation</uri>.
</p>

</body>
</section>
</chapter>	
</guide>
