Press "Enter" to skip to content

Gentoo Install Guide

Gentoo
Gentoo-http://www.gentoo.org/
Gentoo is a distribution that has 3 different install methods. You can just install from the CDs known as stage 3. You can install the base system from CD known as stage 2 and then custom compile the rest of the OS from scratch to bring it to stage 3. This makes the system faster and more responsive but takes some time. Last is the stage 1 install where EVERYTHING is built from scratch. This makes for an EXTREMELY customized and streamlined system. However this method can take DAYS depending on the speed of your computer. A broadband connection would be recommened for a stage 2 or 1 install. Gentoo does all this with what is called Portage. you can basically type “emerge nameofprogram” and it will download, configure and compile the software for you. This makes maintaining the system very easy. Gentoo also has a great support base and is available for the MAC platform as well.


install guide
Note-The following guide is EXACTLY what I did for my install and it was adapted from the official gentoo installation handbook here.-http://www.gentoo.org/doc/en/handbook/index.xml
1. Download and burn the x86 minimal ISO and boot from the CD.

Pssst… we can write an original essay just for you.
Any subject. Any type of essay.
We’ll even meet a 3-hour deadline.


Get your price

2. You will see a boot prompt where you can choose different kernels or view other options. We’ll just hit enter since we don’t need anything special.

3. You will then see a splash screen with a purple cow and the system will boot in the background.

4. When it’s done you will have the standard linux command prompt. You will do everything for the install from here. No GUIs for you .

5. For this guide I will use an internet connection for everything. It is possible to install from CDs as well but including that info here would make it WAY too long. As such we need to maek sure networking is working correctly. To check use the “ifconfig” command. There should be an entry for eth0. If so run this command “dhcpcd eth0” that will request an ip address from the router. If you don’t see anything with ifconfig try “ifconfig -a” if there is no ethx entry then the network card did get the correct driver loaded at boot. You will have to look up what kind of network card you have and find the appropriate module (driver) and load it using the modprobe command. I had to do this myself “modprobe pcnet32” to load the correct driver. I could then run “dhcpcd eth0” to get my ip address.

6. To get the best disk performance during the installation we will set some safe settings for the hard drive. Type in the following command “hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hda” assuming /dev/hda is the disk you want to install to.

7. Now you need to partition the disk. There are alot of different partition schemes you can use. The gentoo install guide suggests 3. One for /, one for /boot and one for swap. I set mine up with 2 to keep it simple. one for / and one for swap. You will use the fdisk program to partition your drive like this “fdisk /dev/hda” you can then press “p” and enter to view the partition table use “d” to delete partitions and “n” to create new ones. I created a new partition with a capacity of 128MB on /dev/hda1 for swap and a new partiton on /dev/hda2 that used the rest fo the space for /. Don’t forget to use “t” to specify the type of partition for the swap partition it should be set to 82. When you have things the way you want hit “w” and enter to write the changes and quit.

8. Now we have to create the filesystems for the partitions. You need to knwo what type of filesystem you want first so that you use the appropriate tool. In my case I’m using reiserfs so I type in “mkreiserfs /dev/hda2” and it will format the partition, “mkswap /dev/hda1” will format the first partition as a swap partition.

9. Now we will turn on the swap partition like so “swapon /dev/hda1”
10. Now we are going to mount the / partition “mount /dev/hda2 /mnt/gentoo” and then make a boot directory “mkdir /mnt/gentoo/boot”
11. We need to check the date before we do anything else the “date” command will accomplish this. If it’s wrong “date MMDDhhmmYYYY” will fix it.

12. So now we get to download the stage 1 installation files. go to the /mnt/gentoo directory and type “links www.gentoo.org/main/en/mirrors.xml”. Welcome to command line web browsing. This will bring up the list of Gentoo mirrors in the browser. Select a mirror that is close to you then navigate to releases, then x86, then 2004.2, then stages, then x86 again, then stage1-x86-2004.2.tar.bz2. Hit d to download the file. When it’s done hit “q” to quit.

13. Now you’ll type “tar -xvjpf stage1-x86-2004.2.tar.bz2” that will extract the files from the archive.

14. Now we have to configure the build options for the system so we will run “nano -w /mnt/gentoo/etc/make.conf” “Here you set the type of system you are building for, optimizations, USE flags (later), and other build options. Mine is setup as follows
CFLAGS=”-march=athlon-xp -pipe -fomit-frame-pointer -O3″
CHOST=”i686-pc-linux-gnu”
CXXFLAGS=”$CFLAGS}”
MAKEOPTS=”-j2″
This basically says build everything optimized for the Athlon XP. -pipe and -fomit-frame-pointer are other compile options. -O3 set the optimization level to 3 which is as high as it goes. Obviously you will have to modify this to fit your particular system. when you have everything set the way you like it press ctrl+x to quit and press “y” and then enter to save.

15. To make sure you get the fastest mirrors for downloading the rest of the OS use the following command “mirrorselect -a -s4 -o | grep ‘GENTOO_MIRRORS=’ ;; /mnt/gentoo/etc/make.conf”
16. Now we will copy the DNS info fro networking before entering the new gentoo system. This is done like so “cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf”
17. We have to mount the proc filesystem as well like so “mount -t proc none /mnt/gentoo/proc”
18. Now we switch over to the new gentoo system like this. “chroot /mnt/gentoo /bin/bash” This will change our root filesystem from the CD we booted from to the hard drive with the bash shell. you need to run “env-update” and “source /etc/profile” as well.

19. Now we have to update the portage tree so that portage knows what packages are available. “emerge sync” will do this for us. If you are behind a firewall that blocks ftp traffice you can use “emerge-webrsync”. This will take some time so be patient.

20. Once that finishes you need to set your USE flags. These determine what compatibility is built when the programs are compiled. For example “-gtk -gnome qt kde” removes support for gnome and gtk and adds support for kde and QT. You set them by editing the make.conf file again. “nano -w /etc/make.conf” Mine are set as follows “USE=”-gtk -gnome qt kde alsa cd dvd cdr” So my final make.conf file looks like this.


CFLAGS=”-march=athlon-xp -pipe -fomit-frame-pointer -O3″
CHOST=”i686-pc-linux-gnu”
CXXFLAGS=”$CFLAGS}”
MAKEOPTS=”-j2″
USE=”-gtk -gnome qt kde alsa cd dvd cdr”
Save and quit nano.

21. It’s time to bootstrap the system. This will build the C compiler to build the rest of the system and some basic utilities. Go to the /usr/portage directory and type “scripts/bootstrap.sh”. Then go find something to do for a couple of hours.

22. When that finishes you are now at stage 2. We want to be at stage 3 though to get a working system. Now we will run “emerge system”. Now go find something to do for another couple of hours. Hey on the bright side this step takes less time than bootstrapping.

23. Now that that’s done we need a kernel. There a couple different options depending on what the system will be used for. We will use the gentoo-dev-sources for a standard 2.6 kernel, “emerge gentoo-dev-sources” will get the job done.

24. Now we need to make sure that /usr/src/linux points to the linux source code like this “ln -s /usr/src/linux..kernelversion /usr/src/linux”
25. Now we configure the kernel. (note-I am not going to cover the genkernel method. After all, we’re doing things the hard way so far so why stop?) cd to /usr/src/linux. Type “make menuconfig”. This will bring up the kernel configuration, here you can add and remove support for your system hardware. I cannot be much help because everyone’s system is different, I wish you the best of luck though . The only thing I can make sure you include is under
Code maturity level options —>* Prompt for development and/or incomplete code/drivers
make sure you have that selected and
File systems —>
Pseudo Filesystems —>* /proc file system support* /dev file system support (OBSOLETE)* Automatically mount at boot* Virtual memory file system support (former shm fs)
Make sure all those are enabled as well and in filesystem make sure you add support for whatever filesystem you formatted / as. When you’re done exit the configurationa nd you’ll be asked to save. Save and then type “make && make modules_install” this will build the kernel and any modules you selected and install them. When that’s done type “cp arch/i386/boot/bzImage /boot/kernel-2.6” and then “cp System.map /boot/System.map-2.6.” This will copy the kernel to the /boot directory.

26. you can now emerge drivers for other hardware you have like the ati drivers or nvidia drivers. In my case all the needed drivers are int eh kernel already so nothing else is needed.

27. Now we have to setup the /etc/fstab. This file tells linux what is mounted where and with what permissions. “nano -w /etc/fstab” will do this. This is my example
/dev/hda / reiserfs noatime,notail 1 1
/dev/hda1 none swap sw 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0
Your’s may be different depending how you setup your partitions. The general idea is like this: partition mountpoint filesystem type options dump check
28. Now we setup the networking information like so. “echo tux > /etc/hostname” replace tux with the name you want for your computer. Then type “echo homenetwork > /etc/dnsdomainname” homenetwork would be the same thing as a workgroup windows. Now we will add this information to the system startup sequence like this “rc-update add domainname default”.

29. Now we have to configure the network interface like this “nano -w /etc/conf.d/net” you are looking for the iface_eth0 entry. We will add dhcp to the end assuming you’re using dhcp on your network. The following file should explain a bit.


(For DHCP)
iface_eth0=”dhcp”
# Some network admins require that you use the
# hostname and domainname provided by the DHCP server.

# In that case, add the following to let dhcpcd use them.

# That will override your own hostname and domainname definitions.

dhcpcd_eth0=”-HD”
# If you intend on using NTP to keep your machine clock synchronized, use
# the -N option to prevent dhcpcd from overwriting your /etc/ntp.conf file
dhcpcd_eth0=”-N”
(For static IP)
iface_eth0=”192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0″
gateway=”eth0/192.168.0.1″
(For rp-pppoe)
iface_eth0=”up”
30. Once you have that modified we will have it start at boot like this “rc-update add net.eth0 default”
31. Now we have to set a root password. Type “passwd” and you’ll be asked for a new root password.

32. Optional: modify /etc/rc.conf as you see fit. This file is well commented so you know what’s going on. Modify it with nano like so “nano -w /etc/rc.conf”
33. Now we need a system logger to watch what’s going on in the system. so let’s emerge metalog “emerge metalog” when that’s done type “rc-update add metalog default” to have it start at boot.

34. Optional: you don’t need a cron daemon but it is required if you want to run a given task like say emerge sync every friday or something similar. We’ll install one just in case “emerge vixie-cron” when it’s done “rc-update add vixie-cron default” to load it at boot.

35. Now we need the file system tools, so we “emerge reiserfsprogs” to install them.

36. Now we need a boot loader. You can use either GRUB or liloo. I will use lilo as I find it easier to work with. So “emerge lilo” will get it installed. now we need to configure it by “nano -w /etc/lilo.conf”. I won’t go into depth on the configuration but the details can be found here-http://www.gentoo.org/doc/en/handbo…?part=1&chap=10
Here is my example configuration
boot=/dev/hda
prompt
timeout=50
default=gentoo
vga=normal
image=/boot/bzImage-2.6
label=gentoo
read-only
root=/dev/hda2
When you get that done and saved type “lilo” and it should install lilo. If it worked you should see something like
Added gentoo*
37. Last we need to set the timezone “ln -sf /usr/share/zoneinfo/GMT /etc/localtime” Adjust GMT to fit your area. “ls /usr/share/zoneinfo | less” should list all available timezones.

38. Now comes the scary part, rebooting and hoping it all worked! type “exit” that will bring you back to the CD. No type “reboot”. When the system reboots remove the CD from the drive. If all went well you will be greeted by lilo. select gentoo and the system should start booting. Hopefully everything goes well.

39. You should be brought to a login prompt. Login as root. Where you go from here is up to you. We want to install KDE so let’s do that.

40. Type “emerge kde” and go on vacation (well maybe not that extreme but go do something to burn some time)or something. This will take A LONG TIME.

41. When that finishes run “env-update && source /etc/profile”
42. Now run “xorgconfig” which will bring up an interactive configuration utility to configure the xwindow system that runs KDE, GNOME, and most of the other window managers.

43. When that’s done we need to make sure kde starts when we type startx so we edit /etc/rc.conf “nano -w /etc/rc.conf” at the bottom there is an entry for #XSESSION=””. Remove the the #. We need to know how kde is started. This is determined like so “ls /etc/X11/Sessions” This will show some entries depending on what’s installed, like these-Xsession fluxbox kde-3.2.2. You can see we have kde-3.2.2 so we add that to the XSESSION like this XSESSION=”kde-3.2.2″. If you want to have a graphical login add this line DISPLAYMANAGER=”kdm” now you’ll get a prett graphical login. Exit and save.

44. Now type startx and assuming yoy got everything in xorgconfig right you will see the KDE Personalizer where you will setup your language, themes, and other graphical options.

45. When that’s done you’ll see your new Gentoo desktop. Enjoy!
Install time: 28 hours 15 minutes-From stage 1
Install medium: 1 CD
Kernel version: latest available in the portage tree. testing was done on version 2.6.8
Hardware detection: Note-boot with smp kernel on the install CD as it tends to auto detect hadware better than the non smp version.

Video: detect vesa and used vesa driver which worked fine from install CD. Final detection when running from hard drive is up to you and your kernel configuration.

Hard drive: detected correctly but had to load ide-disk module to be able to partition and mount drive with non SMP kernel. SMP kernel worked correctly.

CD drive: detected correctly
USB: detected correctly by install CD. Add support to the kernel during install
Sound: detetced correctly by install CD. Add support to the kernel during install
Networking: detected correctly by SMP kernel and work automatically, non SMP kernel required the loading of the pcnet32 module to detect the network card and then had to manually pull an IP adress using dhcpcd
Partitioning: REQUIRES knowledge of linux’s fdisk and formatting tools.

Bootloader: Grub or Lilo, it’s your choice
Disk Usage: 2.3GB
Boot-command line login-40 sec
Command lin login-desktop-18sec
Mozilla start time: 7 sec
Konquerer start time: 4 sec
Comments: Although not signifigantly faster with conservative build options and use flags, gen
too does offer an AWESOME package manager and yields a fast system when built from stage 1. For those who don’t want to wait for a stage 1 install I suggest you look hard at Yoper. The apt system works nearly as well as portage and will install binaries as opposed to source/compiling and you will have a very comparable system. First time linux user should look into understanding Linux partitioning schemes and understanding how the kernel and modules work as well. Hardware detection is kind of up in the air on this one because you build the kernel yourself so YOU decide what is supported.

x

Hi!
I'm Lily

Would you like to get a custom essay? How about receiving a customized one?

Check it out