Now that all partitions are initialised and the base environment installed, it is time to enter our new installation environment by chrooting in it. This means that we change from the current installation environment (namely the LiveCD environment) to your installation system (namely the initialised partitions).

This chrooting is done in three steps. First we will change the root from / (on the LiveCD) to /mnt/gentoo (on your partitions) using chroot. Then we will create a new environment using env-update, which essentially creates environment variables. Finally, we load those variables into memory using source.

# chroot /mnt/gentoo /bin/bash
# env-update
Regenerating /etc/
# source /etc/profile

Congratulations! You are now inside your own Gentoo Linux environment. Ofcourse it is far from finished, which is why the installation still has some sections left :-)

Differences between Stage1, Stage2 and Stage3

Now take a seat and think of your previous steps. We asked you to select a stage1, stage2 or stage3 and warned you that your choice is important for further installation steps. Well, this is the first place where your choice defines the further steps.

Progressing from Stage1 to Stage2 Introduction to Bootstrapping

So, you want to compile everything from scratch? Okay then :-)

In this step, we will bootstrap your Gentoo system. This takes a long time, but the result is a system that has been optimized from the ground up for your specific machine and needs.

Bootstrapping means building the GNU C Library, GNU Compiler Collection and several other key system programs. The GNU Compiler Collection even has to be built twice: first with the "generic" compiler we provide, and a second time with the compiler you then just built.

Before starting the bootstrap, we list a couple of options you might or might not want.

Optional: Decreasing Compilation Time

If you want to speed up the bootstrapping, you can temporarily deselect java-support. This means that the GNU Compiler Collection and the GNU C Library will be compiled without java-support (which decreases compilation time considerably). Although this means that you wont have the GNU Java Compiler (gjc) this does not mean that your system won't be able to use java applets and other java-related stuff.

To deselect java-support temporarily, define USE="-java" before firing up the bootstrap script.

# export USE="-java"
Optional: Downloading the Sources First

If you haven't copied over all sourcecode before, then the bootstrap script will download all necessary files. It goes without saying that this only works if you have a working network connnection :-) If you want to download the sourcecode first and later bootstrap the system (for instance because you don't want to have your internet connection open during the compilation) use the -f option of the bootstrap script, which will fetch (hence the letter f) all sourcecode for you.

# cd /usr/portage
# scripts/ -f
Bootstrapping the System

Okay then, take your keyboard and punch in the next commands to start the bootstrap. Then go amuse yourself with something else, because this step takes quite some time to finish.

# cd /usr/portage
# scripts/
Progressing from Stage2 to Stage3 Introduction

If you are reading this section, then you have a bootstrapped system (either because you bootstrapped it previously, or you are using a stage2). Then it is now time to build all system packages.

All system packages? No, not really. In this step, you will build the system packages of which there are no alternatives to use. However, some system packages have several alternatives (such as system loggers) and as Gentoo is all about choices, we don't want to force one upon you.

Optional: Viewing what will be done

If you want to know what packages will be installed, execute emerge -p system. This will list all packages that will be built. As this list is pretty big, you should also use a pager like less or more to go up and down the list.

# emerge -p system | less
Optional: Downloading the sources first

If you want emerge to download the sources before you continue (for instance because you don't want the internet connection to be left open while you are building all packages) you can use the -f option of emerge which will fetch all sources for you.

# emerge -f system
This will not built the packages! Only fetch the sources.
Building the System

To start building the system, execute emerge system. Then go do something else, because this step takes a long time to complete.

# emerge system

When the building has completed, go on with the next section.