Gentoo Linux 1.4_rc2 Installation InstructionsDaniel RobbinsChris HouserJerry AlexandratosGrant GoodyearJohn P. DavisPierre-Henri JondotEric StockbridgeRajiv ManglaniThese instructions step you through the process of installing Gentoo
Linux 1.4_rc2. The Gentoo Linux installation process supports various installation
approaches, depending upon how much of the system you want to custom-build from
scratch.
2.331 December 2002About the Install

This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
as many SCSI CD-ROM, assuming that your CD-ROM and BIOS both support booting.
Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the
kernel) as well as support for all SCSI devices (available as modules.) In
addition, we provide modules for literally every kind of network card that
Linux supports, as well as tools to allow you to configure your network and
establish outbound (as well as inbound) ssh connections and download
files.

To install from the build CD, you will need to have a 486+ processor and
ideally at least 64 Megabytes of RAM. (Gentoo linux has been successfully
built with 64MB of RAM + 64MB of swap space, but the build process is awfully
slow under those conditions.)

Gentoo Linux can be installed using one of three "stage" tarball files. The
one you choose depends on how much of the system you want to compile yourself.
The stage1 tarball is used when one wants to bootstrap and build the entire
system from scratch. The stage2 tarball is used for building the entire system
from scratch, except for the bootstrap part which is already performed for you.
And the stage3 tarball already contains a basic Gentoo Linux system that has
been optimized for your system.

So, how does one beging the install process? First, you'll want to decide
which one of our LiveCD ISO images to grab from
http://www.ibiblio.org/gentoo/releases/1.4_rc2/livecd/. These are
full CD images that should be burned to a CDR or CD-RW using CD burning
software. Currently, we have two types of LiveCDs. The first carries the
"gentoo-basic" label, and is approximately 40MB in size. This LiveCD is of
minimal size to allow for a initial quick download and contains a stage1
tarball that can be found in /mnt/cdrom/gentoo/ after the CD has
been booted.

The second flavor of LiveCD we currently offer is labelled "livecd-grp."
These CDs contain stage1, 2 and 3 tarballs, and also contain a set of GRP
packages optimized for a specific architecture. Using these LiveCDs, it will be
possible for you to install a fully-functional Gentoo Linux system very
quickly. The downside is that these ISO images are large -- around 600MB -- so
they can take a while to download.

If for some reason your install gets interrupted at some point, you can reboot
and restart. For example, if you have partitioned, installed the stageX tarball, and
are ready to chroot, you can restart the install if necessary. Just re-boot with the
LiveCD, then mount your drives/partitions to /mnt as normal. Basically, you can do
this at about any point during the install, just not before partitioning for obvious reasons.
If you encounter a problem with any part of the install and wish to
report it as a bug, report it to http://bugs.gentoo.org. If the bug
needs to be moved upstream to the package maintainers (ie KDE) the
developers will take care of that.

Now, let's quickly review the install process. First, we'll download, burn
and boot a LiveCD. After getting a root prompt, we'll create partitions, create
our filesystems, and extract either a stage1, stage2 or stage3 tarball. If we
are using a stage1 or stage2 tarball, we will take the appropriate steps to get
our systems to stage3. Once our systems are at stage3, we can configure them
(tweaking config files, installing a bootloader, etc) and boot them and have a
fully-functional Gentoo Linux system. Depending on what stage of the build
process you're starting from, here's what's required for installation:

Start by booting the LiveCD. If detected properly, you should see a fancy boot screen
with the Gentoo Linux logo on it. At this screen, you can hit Enter to begin the boot process,
hit F2 for help, or pass kernel boot options by typing gentoo opt1 opt2, etc.
Once you hit Enter, you'll be
greeted with a lot of text output
followed by the normal Gentoo Linux boot sequence.
You will be automatically logged in as "root" and the root password will be
set to a random string for security purposes.
You should have a root ("#") prompt on the current
console, and can also open new root consoles by pressing Alt-F2, Alt-F3 and Alt-F4.
Get back to the one you started on by pressing (you guessed it) Alt-F1.

You've probably also noticed that above your # prompt is a bunch of help text
explaining how to do things like configure your network devices and where you can find
the Gentoo Linux stage tarballs and packages on your CD.

Load Kernel Modules

If the PCI autodetection missed some of your hardware, you
will have to load the appropriate modules manually.
To view a list of all available network card modules, type ls
/lib/modules/*/kernel/drivers/net/*. To load a particular module,
type:

# modprobe pcnet32(replace pcnet32 with your NIC module)

Now, if you want to be able to access any SCSI hardware that wasn't detected
during the initial boot autodetection process, you'll need to load the appropriate
modules from /lib/modules, again using modprobe:

# modprobe aic7xxx
# modprobe sd_mod

aic7xxx supports your SCSI controller and sd_mod supports SCSI hard disks.
Support for a SCSI CD-ROMs and disks are built-in in the kernel.

If you are using hardware RAID, you'll need to load the
ATA-RAID modules for your RAID controller.

If you have a PCMCIA network card, you will need to do some additional
trickery.

To avoid problems with cardmgr, you must run it before you enter the chroot
portion of the install.

# insmod pcmcia_core
# insmod i82365
# insmod ds
# cardmgr -f

As cardmgr detects which hardware is present, your speaker should emit a
few reassuring beeps, and your PCMCIA network card should hum to life. You can
of course insert the PCMCIA card after loading cardmgr too, if that's
preferable. (Technically, you need not run
cardmgr if you know exactly which module your PCMCIA card requires.
But if you don't, loading all PCMCIA modules and see which sticks won't work,
as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
drop by. cardmgr will also unload the module(s) for any card when you
remove it).

Configuring Networking PPPoE configuration

Assuming you need PPPoE to connect to the internet, the livecd (any version) has
made things easy for you by including rp-pppoe. Use the provided adsl-setup
script to configure your connection. You will be prompted for the ethernet
device that is connected to your adsl modem, your username and password,
the IPs of your DNS servers, and if you need a basic firewall or not.

# adsl-setup
# adsl-start

If something goes wrong, double-check that you correctly typed
your username and password by looking at /etc/ppp/pap-secrets or
/etc/ppp/chap-secrets, and make sure you are using the right ethernet device.

Automatic Network Configuration

The Gentoo Linux install lets you configure a working network, allowing you to use
ssh, scp, lynx, irssi or wget as needed before even beginning the installation process.
Even if you don't need to do these things now, you should go ahead and set up networking now.
Once networking is up, Portage will be able to use your configured network once you are inside
the chroot environment (required for installing Gentoo Linux).
The simplest way to set up networking is to run our new net-setup
script.

# net-setup eth0

Of course, if you prefer, you may still set up networking manually.

Manual DHCP Configuration

Network configuration is simple with DHCP; If your ISP is not using
DHCP, skip down to the static configuration section below.

# dhcpcd eth0

Some ISPs require you to provide a hostname. To do that,
add a -h myhostname flag to the dhcpcd command line above.

If you receive dhcpConfig warnings, don't panic; the errors
are most likely cosmetic. Skip down to Network testing below.

Manual Static Configuration

We need to setup just enough networking so that we can download
sources for the system build, as well as the required localhost interface.
Type in the following commands, replacing
$IFACE with your network interface (typically eth0), $IPNUM
with your IP address, $BCAST with your broadcast address, and $NMASK
with your network mask. For the route command, replace
$GTWAY with your default gateway.

You may want to also try pinging your ISP's DNS server (found in /etc/resolv.conf),
and a website of choice, just to make sure that your packets are reaching the net, DNS name
resolution is working correctly, etc.

# ping www.some_website.com

Networking is go!

Networking should now be configured and useable. You should be able to use the included
ssh, scp, lynx, irssi and wget commands to connect to other machines on your LAN or the Internet.

Partition Configuration

Now that the kernel can see the network card and disk controllers, it's time
to set up disk partitions for Gentoo Linux.

Here's a quick overview of the standard Gentoo Linux partition layout.
We're going to create at least three partitions: a swap partition, a root
partition (to hold the bulk of Gentoo Linux), and a special boot partition.
The boot partition is designed to hold the GRUB or LILO boot loader information as well as
your Linux kernel(s). The boot partition gives us a safe place to store
everything related to booting Linux. During normal day-to-day Gentoo Linux use,
your boot partition should remain unmounted. This prevents your kernel
from being made unavailable to GRUB (due to filesystem corruption) in the event
of a system crash, preventing the chicken-and-egg problem where GRUB can't read
your kernel (since your filesystem isn't consistent) but you can't bring your
filesystem back to a consistent state (since you can't boot!)

Now, on to filesystem types. Right now, you have four filesystem options:
XFS, ext2, ext3 (journaling) and ReiserFS. ext2 is the tried and true Linux
filesystem but doesn't have metadata journaling. ext3 is the new version of
ext2 with both metadata journaling and ordered data writes, effectively
providing data journaling as well. ReiserFS is a B*-tree based filesystem
that has very good small file performance, and greatly outperforms both ext2 and
ext3 when dealing with small files (files less than 4k), often by a factor of
10x-15x. ReiserFS also scales extremely well and has metadata journaling.
As of kernel 2.4.18+, ReiserFS is finally rock-solid and highly recommended.
XFS is a filesystem with metadata journaling that
is fully supported under Gentoo Linux's xfs-sources kernel, but
is generally not recommended due to its tendency to lose recently-modified
data if your system locks up or unexpectedly reboots (due to a power failure, for instance.)

If you're looking for the most standard filesystem, use ext2. If you're looking
for the most rugged journalled filesystem, use ext3. If you're looking for a
high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are
mature and refined.
Here are our basic recommended filesystem
sizes and types:

Before creating filesystems, you may want to initialize the
beginning of your HD using dd. Doing this will ensure that your new filesystem
will not be mis-indentified by Linux's mounting code.
This can be done as follows:

At this point, create your partitions using fdisk. Note that your partitions
should be of type 82 if swap and 83 for regular filesystems (whether ReiserFS, ext2/3 or other).

cfdisk is included on the install CD, and it is considerably easier to use than
fdisk. Just type cfdisk to run it; by default, cfdisk will work with /dev/hda. If /dev/hda is not the hard disk you want to partition, give the right value to cfdisk as a parameter. For example: cfdisk /dev/hdeIf fdisk or cfdisk instruct you to do so, please reboot to allow your system to detect the
new partition configuration.If you are using RAID your partitions will be a little different. You
will have the partitions like this: /dev/ataraid/discX/partY X is
the arrays you have made, so if you only have made 1 array, then it will be
disc0.Y is the partition number as in /dev/hdaY

Once you've created your partitions, it's time to initialize
the filesystems that will be used to house our data. Initialize swap as follows:

# mkswap /dev/hda2

You can use the mke2fs command to create ext2 filesystems.

# mke2fs /dev/hda1

To create an XFS filesystem, use the mkfs.xfs command.

# mkfs.xfs /dev/hda3

You may want to add a couple of additional flags to the mkfs.xfs command: -d agcount=3 -l size=32m.
The -d agcount=3 command will lower
the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition,
so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5.
The -l size=32m command increases the journal size to 32 Mb, increasing performance.
If you are installing an XFS partition over a previous ReiserFS partition,
later attempts to mount may fail without an explicit mount -t xfs.
The solution is to zero out the partition before creating the XFS filesystem:
dd if=/dev/zero of=/dev/hdx bs=1k.

If you'd like to use ext3, you can create ext3 filesystems using mke2fs -j.

# mke2fs -j /dev/hda3

To create ReiserFS filesystems, use the mkreiserfs command.

# mkreiserfs /dev/hda3

You can find out more about using ext3 under Linux 2.4 at
http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html.
Mount Partitions

Now, we'll activate our new swap, since we may need the additional virtual memory that
provides later:

# swapon /dev/hda2

Next, we'll create the /mnt/gentoo and /mnt/gentoo/boot mountpoints,
and we'll mount our filesystems to these mountpoints.

If you are setting up Gentoo
Linux with a separate /usr or /var, these would get mounted to
/mnt/gentoo/usr and /mnt/gentoo/var, respectively.

Additionally, perform the following steps if you'd like to take advantage of your CD's set of pre-built
"GRP" packages for openoffice, KDE, GNOME and Xfree86. First, ensure that you're using the required "gentoo-grp"
CD. Then, type:

If your boot partition (the one holding the kernel) is ReiserFS, be sure to mount it
with the -o notail option so GRUB gets properly installed. Make sure
that notail ends up in your new /etc/fstab boot partition entry, too.
We'll get to that in a bit.
If you are having problems mounting your boot partition with ext2, try using
mount /dev/hXX /mnt/gentoo/boot -t ext2 Obtaining the Desired 'stage-x' Tarball

If you want to start from a stage1 tarball, then you're already set
to go; you can find the stage1 tarball in /mnt/cdrom/gentoo/.
On the other hand, if you would prefer to start from a stage2 or stage3
tarball that has been optimized for your architecture you can download it
(into /mnt/gentoo would be the simplest)
from one of the Gentoo mirror sites.

Now it's time to extract the compressed stage tarball of your choice to /mnt/gentoo.
Then, we'll chroot over to the new Gentoo Linux build installation to "enter" the new
Gentoo Linux system.

Be sure to use the p option with tar. Forgetting to do this will
cause certain files to have incorrect permissions.

If you are using the "from scratch, build everything" install method,
you will want to use the stage1-ix86-1.4_beta.tbz2 image.
If you're using one of our bigger CDs, you'll also have a choice of a stage2 and stage3 image.
These images allow you to save time at the expense of configurability (we've already chosen
compiler optimizations and default USE variables for you.)

After you execute these commands, you'll be "inside" your new Gentoo Linux environment.

Getting the Current Portage Tree using Rsync

Now, you'll need to run emerge sync. This will make sure that
you have the most current copy of the Portage tree.

# emerge sync

The Portage tree will be downloaded and stored in /usr/portage;
it's about 90Mb in size without tarballs.

Setting Gentoo optimizations (make.conf)

Now that you have a working copy of the Portage tree, people using stage1 to
install will need to bootstrap their Gentoo Linux system as follows. First
edit the file /etc/make.conf. In this file, you should set your
USE flags, which specify optional functionality that you would
like to be built into packages; generally, the defaults (an empty
or unset USE variable) are fine.
More information on USE flags can be found
here.

You also should set appropriate CHOST, CFLAGS and
CXXFLAGS settings for the kind of system that you are creating
(commented examples can be found further down in the file.) Your best friend
is man gcc to figure out what additional CFLAGS and
CXXFLAGS are available. Search for 'Optimization'.

If necessary, you can also set proxy information here if you are behind a
firewall.

# nano -w /etc/make.conf(Adjust these settings)

People who need to substantially tweak the build process should take a look at
the /etc/make.globals file. This file comprises gentoo defaults and
should never be touched. If the defaults do not suffice, then new values should
be put in /etc/make.conf, as entries in make.confoverride the entries in make.globals. If you're
interested in tweaking USE settings, look in /etc/make.profile/make.defaults.
If you want to turn off any USE settings found here, add an appropriate USE="-foo"
in /etc/make.conf (to turn off the foo USE setting.)
Starting from Stage1

The stage1 tarball is for ultimate tweakage. If you have picked this tarball,
you are most likely looking to have an uber-optimized system. Have fun, because optimization
is what Gentoo Linux is all about!

Now, it's time to start the "bootstrap" process. This process takes about two hours on
my 1200Mhz AMD Athlon system. During this time, the extracted build image will be prepped
for compiling the rest of the system. The GNU compiler suite will be built, as well as the GNU C library.
These are time consuming builds and make up the bulk of the bootstrap process.

# cd /usr/portage
# scripts/bootstrap.sh

The "bootstrap" process will now begin.

Portage by default uses /var/tmp during package building, often
using several hundred megabytes of temporary storage. If you would like to
change where Portage stores these temporary files, set a new PORTAGE_TMPDIR before
starting the bootstrap process, as follows:

# export PORTAGE_TMPDIR="/otherdir/tmp"

bootstrap.sh will build binutils, gcc, gettext,
and glibc, rebuilding binutils, gcc, and gettext
after glibc. Needless to say, this process takes a while.
Have a nice nap. Once this process completes, your system will be equivalent to a "stage2" system.

Starting from Stage2

The stage2 tarball already has the bootstrapping done for you. All that you have
to do is install the rest of the system.

The export CONFIG_PROTECT="" line ensures that any new scripts
installed to /etc will overwrite the old scripts (stored in
sys-apps/baselayout), bypassing Portage's new config file
management support. Type emerge --help config for more details.

It's going to take a while
to finish building the entire base system. Your reward is that it will be
thoroughly optimized for your system. The drawback is that you have to find a
way to keep yourself occupied for some time to come. The author suggests "Star
Wars - Super Bombad Racing" for the PS2. When this process completes, your system
will be the equivalent of a stage3 system.

Starting from Stage3

The stage3 tarball is already configured for your system. There is not much to do for this stage,
but it is a very good idea to update your system to the newest available packages.

If you have not already edited /etc/make.conf to fit your specifications,
now would be a good time to do so.

If you bind mounted /mnt/cdrom/gentoo/packages previously, you can take advantage of pre-built GRP package sets
to avoid compiling certain popular and large packages. Currently, we provide full builds of everything you need for openoffice-bin,
gnome, kde and xfree. To merge these pre-built packages, type:

# emerge --usepkgonly kde

Optionally, you can use pre-built packages combined with any updates available in your new Portage tree by typing:

# emerge --usepkg openoffice-bin

Final Steps: Timezone

At this point, you should have system that's ready for final configuration.
We'll start the configuration process by setting the timezone. By setting the timezone before building
the kernel we ensure that users get reasonable uname -a output.

Look for your timezone (or GMT if you using Greenwich Mean Time) in
/usr/share/zoneinfo. Then, make a symbolic link by typing:

# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime

You might also want to check /etc/rc.conf to make sure your timezone settings
are correct.

Final steps: kernel and system logger
If you haven't done so, please edit /etc/make.conf to your flavor.

You now need to merge Linux source ebuilds. Here are the ones we currently
offer:

ebuild

description

gentoo-sourcesOur own performance and functionality-enhanced kernel does not include XFS support.

vanilla-sourcesA stock Linux kernel source tree, just like you'd get from kernel.org

If you are configuring your own kernel, be careful with the grsecurity option. Being too aggressive with your
security settings can cause certain programs (such as X) to not run properly. If in doubt, leave it out.

Choose a kernel and then merge as follows:

# emerge sys-kernel/gentoo-sources

Once you have a Linux kernel source tree available, it's time to compile your own custom kernel.

For your kernel to function properly, there are several options that you will
need to ensure are in the kernel proper -- that is, they should be enabled and not
compiled as modules. You will need to enable the "Code maturity
level options --> Prompt for development and/or incomplete code/drivers"
option to see several of these selections.
Under the "File systems" section, be sure to enable the "Device File System" (note that
you don't need to enable the "/dev/pts file system support" option). You'll also
need to enable the "Virtual Memory Filesystem". Be sure to enable "ReiserFS" if you have
any ReiserFS partitions; the same goes for "Ext3". If you're using XFS, enable the
"SGI XFS filesystem support"
option. It's always a good idea to leave ext2
enabled whether you are using it or not. Also, most people using IDE hard drives will
want to enable the "USE DMA by default" option; otherwise, your IDE drives may perform
very poorly. Of course, remember to enable "IDE disk" support as well -- otherwise your
kernel won't be able to see your IDE disks.

If you are using hardware RAID you will need to enable a couple more options in the kernel:
For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
support for IDE RAID
controllers and Support Promise software RAID (Fasttrak(tm))

If you use PPPoE to connect to Internet, you will need the following
options in the kernel (built-in or as preferably as modules) :
"PPP (point-to-point protocol) support", "PPP support for async serial ports",
"PPP support for sync tty ports". The two compression options won't harm but
are not definitely needed, neither does the "PPP over Ethernet" option,
that might only be used by rp-pppoe when configured to do kernel mode PPPoE.

If you have an IDE cd burner, then you need to enable SCSI emulation in the
kernel. Turn on "ATA/IDE/MFM/RLL support" ---> "IDE, ATA and ATAPI Block
devices" ---> "SCSI emulation support" (I usually make it a module), then
under "SCSI support" enable "SCSI support", "SCSI CD-ROM support" and
"SCSI generic support" (again, I usually compile them as modules). If you
also choose to use modules, then echo -e "ide-scsi\nsg\nsr_mod"
>> /etc/modules.autoload to have them automatically added at boot time.

For those who prefer it,
it is now possible to install Gentoo Linux with a 2.2 kernel.
However, doing this comes at a price:
you will lose many of the nifty features that
are new to the 2.4 series kernels (such as XFS and tmpfs
filesystems, iptables, and more), although the 2.2 kernel sources can be
patched with ReiserFS and devfs support.
Gentoo linux boot scripts require either tmpfs or ramdisk support in the kernel, so
2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
It is vital that a gentoo=notmpfs flag be added to the kernel
line in /boot/grub/grub.conf for the 2.2 kernel so that a ramdisk is mounted
for the bootscripts instead of tmpfs. If you choose not to use devfs, then
gentoo=notmpfs,nodevfs should be used instead.

Your new custom kernel (and modules) are now installed. Now you need to choose a system
logger that you would like to install. We offer sysklogd, which is the traditional set
of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
to gravitate away from sysklogd (not very good performance) and towards the
newer alternatives.
If in doubt, you may want to try metalog, since it seems to be quite popular.
To merge your logger of choice, type one of the next four lines:

In the case of syslog-ng you need to create
/etc/syslog-ng/syslog-ng.conf.
See /etc/syslog-ng
for a sample configuration file.
Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
is less than helpful. When your Gentoo Linux system is up and running, you can send
metalog a USR1 signal to temporarily turn off this message buffering (meaning that
tail -f /var/log/everything/current will now work
in real time, as expected),
and a USR2 signal to turn buffering back on
again.

Now, you may optionally choose a cron package that you'd like to use.
Right now, we offer dcron, fcron and vcron. If you don't know which one to choose,
you might as well grab vcron. They can be installed as follows:

For more information on starting programs and daemons at startup, see the
rc-script guide.

Final steps: Install Additional Packages

If you need rp-pppoe to connect to the net, be aware that at this point
it has not been installed. It would be the good time to do it.

# emerge rp-pppoe

Please note that the rp-pppoe is built but not configured.
You will have to do it again using adsl-setup when you boot into your Gentoo system
for the first time.

You may need to install some additional packages in the Portage tree
if you are using any optional features like XFS, ReiserFS or LVM. If you're
using XFS, you should emerge the xfsprogs ebuild:

# emerge sys-apps/xfsprogsIf you'd like to use ReiserFS, you should emerge the ReiserFS tools:
# emerge sys-apps/reiserfsprogsIf you're using LVM, you should emerge the lvm-user package:
# emerge sys-apps/lvm-user

If you're a laptop user and wish to use your PCMCIA slots on your first
real reboot, you'll want to make sure you install the pcmcia-cs package.

# emerge sys-apps/pcmcia-cs

You will have to re-emerge pcmcia-cs after installation to get PCMCIA
to work.
Final steps: /etc/fstab

Your Gentoo Linux system is almost ready for use. All we need to do now is configure
a few important system files and install the GRUB boot loader.
The first file we need to
configure is /etc/fstab. Remember that you should use
the notail option for your boot partition if you chose to create a ReiserFS filesystem on it.
Remember to specify ext2, ext3 or reiserfs filesystem types as appropriate.

Use something like the /etc/fstab listed below, but of course be sure to replace "BOOT",
"ROOT" and "SWAP" with the actual block devices you are using (such as hda1, etc.)

Please notice that /boot is NOT mounted at boottime.
This is to protect the data in /boot from
corruption. If you need to access /boot, please mount it!
Final steps: Root Password

Before you forget, set the root password by typing:

# passwd

Final steps: /etc/hostname

Edit this file so that it contains your fully-qualified domain name on a single line,
i.e. mymachine.mydomain.com.

# echo mymachine.mydomain.com > /etc/hostname

Final steps: /etc/hosts

This file contains a list of ip addresses and their associated hostnames.
It's used by the system to resolve the IP addresses
of any hostnames that may not be in your nameservers. Here's a template for this file:

127.0.0.1 localhost
# the next line contains your IP for your local LAN, and your associated machine name
192.168.1.1 mymachine.mydomain.com mymachine

If you are on a DHCP network, it might be helpful to set localhost to your machine's
actual hostname. This will help GNOME and many other programs in name resolution.
Final Network Configuration

Add the names of any modules that are necessary for the proper functioning of your system to
/etc/modules.autoload file (you can also add any options you
need to the same line.) When Gentoo Linux boots, these modules will be automatically
loaded. Of particular importance is your ethernet card module, if you happened to compile
it as a module:

This is assuming that you are using a 3com card. Check /lib/modules/`uname -r`/kernel/drivers/net for your
card.
3c59x

Edit the /etc/conf.d/net script to get your network configured for your
first boot:

# nano -w /etc/conf.d/net
# rc-update add net.eth0 default

If you have multiple network cards you need to create additional net.ethx
scripts for each one (x = 1, 2, ...):

If you have a PCMCIA card installed, have a quick look into
/etc/init.d/pcmcia to verify that things seem all right for your setup,
then add this line to the top of /etc/init.d/ethx:

depend() {
need pcmcia
}

This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.

Final steps: Configure Basic Settings (including the international keymap setting)

# nano -w /etc/rc.conf

Follow the directions in the file to configure the basic settings.
All users will want to make sure that CLOCK is set to his/her
liking. International keyboard users will want to set the KEYMAP
variable (browse /usr/share/keymaps to see the various
possibilities).

Final steps: Configure GRUB

The most critical part of understanding GRUB is getting comfortable with how GRUB
refers to hard drives and partitions. Your Linux partition /dev/hda1 is called
(hd0,0) under GRUB. Notice the parenthesis around the hd0,0 - they are required.
Hard drives count from zero rather than "a", and partitions start at zero rather than one.
Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
cdrom players, burners, and that the same construct can be used with scsi drives.
(Normally they get higher numbers than ide drives except when the bios is configured
to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
a burner on /dev/hdc and a second hardrive on /dev/hdd, for example, and no scsi harddrive
/dev/hdd7 gets translated to (hd1,6).
It might sound tricky, and tricky it is indeed, but as we will see, grub
offers a tab completion mechanism that comes handy for those of you having
a lot of harddrives and partitions and who are a little lost in the
grub numbering scheme. Having gotten the feel for that,
it's time to install GRUB.

The easiest way to install GRUB is to simply type grub at your chrooted shell prompt:

# grub

If you are using hardware RAID this part will not work at
this time.
Skip to the section on making your grub.conf. After that we will complete the
grub setup for RAID controllers

You'll be presented with the grub> grub
command-line prompt. Now, you need to type in the
right commands to install the GRUB boot record onto your hard drive. In my example configuration,
I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
I want to type are:

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

Here's how the two commands work. The first root ( ) command tells GRUB
the location of your boot partition (in our example, /dev/hda1 or
(hd0,0) in GRUB terminology. Then, the second setup ( )
command tells GRUB where to install the
boot record - it will be configured to look for its special files at the root
( ) location that you specified. In my case, I want the boot record on the
MBR of the hard drive, so I simply specify /dev/hda (also known as (hd0)).
If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
could install GRUB to the boot record of a particular partition. In that case,
I'd specify a particular partition rather than the entire disk. Once the GRUB
boot record has been successfully installed, you can type quit to quit GRUB.
The tab completion mechanism of grub can be used from within grub,
assuming you wrote root ( and that you hit the TAB key, you would
be prompted with a list of the available devices (not only harddrives),
hitting the TAB key having written root (hd, grub would print the
available harddrives and hitting the TAB key after writing root (hd0,
would make grub print the list of partitions on the first harddrive.
Checking the syntax of the grub location with completion should really help
to make the right choice.
Gentoo Linux is now
installed, but we need to create the /boot/grub/grub.conf file so that
we get a nice GRUB boot menu when the system reboots. Here's how to do it.

To ensure backwards compatibility with GRUB, make sure to make a link from
grub.conf to menu.lst. You can do this by doing
ln -s /boot/grub/grub.conf /boot/grub/menu.lst .

Now, create the grub.conf file (nano -w /boot/grub/grub.conf), and add the following to it:

(hd0,0) should be written without any spaces inside the parentheses.
If you set up scsi emulation for an IDE cd burner earlier, then to get it to
actually work you need to add an "hdx=ide-scsi" fragment to the kernel
line in grub.conf (where "hdx" should be the device for your cd burner).

After saving this file, Gentoo Linux installation is complete. Selecting the first option will
tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
and shows you how to use GRUB to boot a bootable Windows partition.

Above, (hd0,0) should point to your "boot" partition
(/dev/hda1 in our example config) and /dev/hda3 should point to
your root filesystem. (hd0,5) contains the NT boot
loader.
The path to the kernel image is relative to the boot partition. If for example you have separated boot partition (hd0,0) and root partition (hd0,1), all paths in the grub.conf file above will become /bzImage.

If you need to pass any additional options to the kernel, simply
add them to the end of the kernel command. We're already passing one option
(root=/dev/hda3), but you can pass others as well. In particular, you can
turn off devfs by default (not recommended unless you know what you're doing) by
adding the gentoo=nodevfs option to the kernel command.

Unlike in earlier versions of Gentoo Linux, you no longer have to add
devfs=mount to the end of the kernel line to enable devfs. In rc6
devfs is enabled by default.
Final steps: Configure LILO

While GRUB may be the new alternative for most people, it is not always the best choice.
LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here's how to install
LILO if you would like to use it instead of GRUB:

The first step is to emerge LILO:

# emerge lilo

Now it is time to configure LILO. I will give you a small lilo.conf to use, and I will explain
the different parts of the file.

boot=/dev/hda tells LILO to install itself on the first hard disk on the first IDE controller.

map=/boot/map states the map file. In normal use, this should not be modified.

install=/boot/boot.b tells LILO to install the specified file as the new boot sector.
In normal use, this should not be altered. If the install line is missing, LILO will
assume a default of /boot/boot.b as the file to be used.

The existence of prompt tells LILO to show you whatever is referenced in the message line.
While it is not recommended that you remove the prompt line, if you do remove it, you can still
get a prompt by holding down the [Shift] key while your machine starts to boot.

timeout=50 sets the amount of time that LILO will wait for user input before proceeding
with booting the default line entry. This is measured in tenths of a second, with 50 as the default.

message=/boot/message refers to the screen that LILO displays to let you select the
operating system or kernel to boot.

lba32 describes the hard disk geometry to LILO. Another common entry here is linear. You should
not change this line unless you are very aware of what you are doing. Otherwise, you could put
your system in an unbootable state.

default=linux refers to the default operating system for LILO to boot from the
options listed below this line. The name linux refers to the label line below in each of the boot options.

image=/boot/vmlinuz-2.4.20 specifies the linux kernel to boot with this particular boot option.

label=linux names the operating system option in the LILO screen. In this case,
it is also the name referred to by the default line.

initrd=/boot/initrd-2.4.20.img refers to the initial ram disk image that is used at boot time
to actually initialize and start the devices that makes booting the kernel possible. The initial
ram disk is a collection of machine-specific drivers necessary to operate a SCSI card, hard drive, or any
other device needed to load the kernel. You should never try to share initial ram disks between machines.

read-only specifies that the root partition (see the root line below) is read-only and cannot be
altered during the boot process.

root=/dev/hda5 tells LILO what disk partition to use as the root partition.

Thanks to Redhat.com for this information.

After you have edited your lilo.conf file, it is time to run LILO to load the information
into the MBR:

# /sbin/lilo

LILO is configured, and now your machine is ready to boot into Gentoo Linux!

Final steps: BootdisksGRUB Bootdisks

It is always a good idea to make a boot disk the first
time you install any Linux distribution. This is a security
blanket, and generally not a bad thing to do. If you are using some kinds of hardware RAID, you may need make a GRUB boot
disk. With these types of hardware RAID,
if you try to install grub from your chrooted shell it will fail. If you are in this camp,
make a GRUB
boot disk, and when you reboot the first time you can install GRUB
to the MBR. Make your
bootdisk like this:

After rebooting, it is a good idea to run the update-modules command to create
the /etc/modules.conf file. Instead of modifying this file directly, you should
generally make changes to the files in /etc/modules.d.
Remember if you are running hardware RAID, you must
use the bootdisk for the first reboot.
then go back and install grub the way everyone else did the first
time. You are done -- congratulations!

If you have any questions or would like to get involved with Gentoo Linux development,
consider joining our gentoo-user and gentoo-dev mailing lists
(there's a "click to subscribe" link on our main page).
We also have a handy Desktop configuration guide
that will
help you to continue configuring your new Gentoo Linux system, and a useful
Portage user guide
to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
here. If you have any other questions
involving installation or anything for that matter, please check the Gentoo Linux
FAQ.
Enjoy and welcome to Gentoo Linux!

Gentoo-Stats

The Gentoo Linux usage statistics program was started as an attempt to give the developers
a way to find out about their user base. It collects information about Gentoo Linux usage to help
us in set priorities our development. Installing it is completely optional, and it would be greatly
appreciated if you decide to use it. Compiled statistics can be viewed at http://stats.gentoo.org/.

The gentoo-stats server will assign a unique ID to your system.
This ID is used to make sure that each system is counted only once. The ID will not be used
to individually identify your system, nor will it be mached against an IP address or
other personal information. Every precaution has been taken to assure your privacy in the
development of this system. The following are the things that we are monitoring
right now through our "gentoo-stats" program: