Search:  
Gentoo Wiki

HOWTO_Newbie_Guide_to_Stage1_NPTL_Install

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

STAGE 1 INSTALLS ARE NO LONGER SUPPORTED. THIS IS A VERY DEPRECATED GUIDE THAT HAS BEEN RETIRED SINCE LATE 2006. IT NO LONGER WORKS. USE AT YOUR OWN RISK

Heavily based on :forum guide by: --ali3nx, eMail, fractoon 's guide by: --Fractoon and the gentoo handbook

Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article



TESTING

I am currently testing my own installation to see where I made some mistakes. I've found three errors to date. So please, DO NOT TRY THIS GUIDE UNTIL IT IS FINISHED, or at least wait until it is no longer considered to be under development and an announcement has been made in the forums.

Thanks a lot for your interest in this. Come back in a few days, it should be done.

Pierre-Andre.

Credits and Thanks

First, I'd like to thank the wonderful Gentoo developers, and anyone currently or who has worked on Gentoo in the past, thank you all for making such a great product. Also, a big thanks goes to the Gentoo community, without all of you, the Gentoo experience just wouldn't be the same. You are the ones who motivate me while writing this install guide, for others to follow in my footsteps.

And also to everyone who wrote a FAQ, a wiki, an article in the idea to help others where they themselves had troubles thank you. This article is heavily based on a few articles:

Fractoon's Dedicated Build (which I think it really is great. So much information is found there, this person must have put alot of energy and time into this. Really worth looking at, I'm aiming at filling in the gap I've found in Fractoon's Build. So expect about the same results, but I'm trying to save you the trouble to look elsewhere to find some missing bits. And I'll of course add in my own comments, thoughts and so on. )

The Gentoo Developer's handbook (Another great sources of information.)

Introduction

I wanted to be able to install gentoo more easily, by finding myself a way of installing things and doing things, and I've quite successfully found it. It may not be the best, again I'm no programmer or anything, but I think I've gathered some good bits of informations I could find in the wiki, forums and on the net.

If this is your first installation of Gentoo, you are probably nervous and feeling weird. I've had that feeling on my first install too, even tho I was quite acustomized to installing linux in general on some other distros. But Gentoo is overwhelming at first. It scares you. But if you're not afraid of typing, and obviously, I'm not! :) Then gentoo is for you. But again, Gentoo is hard at the beginning, you need to setup almost everything yourself, but in the end it pays. How it pays? Well you have a system that you can say you built yourself, to your tastes, that it *will* perform faster than any other linux distro around, assuming you follow a good guide like the one I followed, or mine :) And you also get to know your system better in the process, and you'll be in a fast evolving environment, always on the cutting edge (sure cutting edge means bugs sometimes, but I didn't have many), and when I say fast, it is fast, often when you have a problem, it will get fixed so much faster than with closed source software, but the way portage works, it brings the latest software to your doorstep (not to mention additional portage overlays which will open up a world of bleeding-edge software to your fingertips), literaly. You'll be amazed at how easy it is to install your favorite app soon! Anyway, enough with the praises, and let's get our hands dirty!

This install is guaranteed to compile and work well and fast on a p4 arch, provided that you use my make.conf. Some of you may argue about the mtune and mmmx msse cflags, but I really had the feeling that march was adding them properly.. and I have a point. When I bootstrap my system with march=pentium4 and mtune=pentium4, right at the beginning, sandbox complains about an unknown cflags, which is mtune.. if I change it to mcpu it works, and if I remove it, it also works.. but if march provided it, it wouldn't work. Then I'd have to remove march.. but anyway, so what I did is, use all my cflags except mtune for bootstrap, after bootstrap, I added back mtune=pentium4, and it went all well for everythingelse. So, maybe you should try them too, cause they works real good on my computer as of yet. And it's not little to say, because i've installed my whole system without a hitch, an abort. (well at least not related to cflags,cxxflags,ldflags... apart from mtune mentioned with sandbox.

Goals to achieve

My first and foremost goal is to have a top notch running system. I didn't buy a $2000 computer to have it run at average speed. So the goal here is to make the OS start as fast as possible (through the means of initing), start programs as fast as it can, and compile fast too.

Then I want everything on my system that can work on Gentoo to work, and work well.

The specs:

Satellite P30-JC1

CPUMobile Pentium 4 HT 3.2 Ghz
RAM512 MB DDR 333 Mhz
HDD80 GB 4200 rpm
VIDEOMobility Radeon 9700 (pro) 128 MB with 17" widescreen with "true-brite" 1440x900@60
USB3 ports (1 seem to be 2.0, and two others 1.0, but gotta confirm this)
13941 port (i don't have any firewire device, so can't really test this now)
5in1ENE Card reader (same here, gonna have to ask a friend to bring his camera over)
INPUTBuilt-in keyboard with media keys, built-in Alps Touchpad, and Logitech USB MX1000 laser mouse
GAMELogitech Dual Action analog game controller
CAMLogitech Quickcam pro 4000
NETRealtek 8139C 10/100, Atheros 5212 a/b/g WLAN (linux sees this, but supposed to be a b/g wireless
MODEMBuilt-in 56K (soft) modem
SOUNDAgain, supposed to be realtek, but linux sees ATI, from the IXP 150 chipset.. but afaik it's a realtek ac97

And for sure, it's a laptop, so i want the power management to work optimal.

Status after installation:

CPU:Working fine with cpufreqd, need a way to detect if on a/c or battery at bootup
RAM:Is definately fine after all those days compiling... :)
HDD:Working fine with laptop-mode-tools, again, same as CPU for bootup.
VIDEO:Works fine in 1440x900 and having few ati related problems. TV-out should work, and dual monitors does. DPMS works fine.
USB:Works fine in true plug and play with udev/dbus/(gnome-volume-manager or kde mediamanager) with joystick, usb drives, usb stick, camera, mx1000
1394:Have yet to test this out, but seems to work.
5in1:Same thing
INPUT:Touchpad working well with synaptics drivers, mx1000 has mx1000 configuration disabled in xorg.conf, using ImPS/2 driver for now, gotta figure how to map buttons properly.
GAME:Working well, didn't do too much apart from choosing Joystick in kernel, and compile it in. Whenever I plug my joystick it works.
NET:Ethernet works as expected, DHCP or static, I'm using static, Wireless has yet to be tested.. but configuration seems to work, although I really didn't look too much, as I dont have a wireless and none in range
MODEM:Odd enough, seems to works, the driver is loaded, but didn't tested it, would probably have to put ppp into kernel for it to work fine on dialup tho.
SOUND:Works fine, don't use arts in kde tho, or you'll run into problems, there seems to be some bug related with latest alsa and arts.. I have -arts in my make.conf

So with that in mind let's begin our journey into this fantastic world that is Linux, and more specifically Gentoo!

Step 1 : Getting the Gentoo LiveCD Installation CD

Aim your browser (hopefully Firefox! :) ) to gentoo's mirror list, select a mirror, browse to /releases/x86/2005.0/installcd/ and download either the Universal CD or the minimal one. Since we are going for a complete build from stage1, you can download the Minimal if you want to save on download time or bandwith, or if you are 56k! (even tho you might as well wait the time to download the universal, and do an offline install, it's going to be better that way imo). I have downloaded myself the universal CD because anyway it didn't took too long to download, and I can always start a stage3 install on a friend's computer later on! And I have the base package on the CD too, they are outdated, but it can always be useful.

Once you have the .iso image, it's time to burn it to a cdrom or dvd if cds aren't available to you (i didn't had cds, so I burned it on a dvd, i should have added stuff to it and make an all purpose DVD, but I'm gonna do this later, I wanted to get to the install as quick as I could! So if you are using Windows, you can use nero to burn the image, or your favorite recording software, as long as it supports .iso image burning. If you are using already a flavor of linux or already gentoo, you probably know which program to use, so no need here! Hints: k3b, gtoaster, graveman...

Once it is burned, reboot and be sure that your computer is booting on cdrom. If you have a convenient boot menu that you can show up during boot, no need to go into the BIOS, but if you have to go into the BIOS, press DEL when the computer is showing CPU speed, memory etc... early on. It might also be F1 or F2. Then find the places in your BIOS to change boot option and make sure that CDROM is before the harddrive.

Step 2 : Booting the freshly burned CD and configure the network.

When you see an uninviting prompt waiting for some commands (after you booted of the cd) it's normal, Gentoo doesnt have any installation script, you gotta perform it by yourself, which is nice, cause you can really have your system how you like it. Type in gentoo and press enter (i add acpi=on just to be sure that acpi works, but I dunno if it's really necessary). Look at the pretty graphics because you wont see many graphics for the next few hours! (could be days too :) ) Or press esc if you want to see what's going on! See already the difference.. Windows doesn't let you see what's going on during boot.. with Linux you can have a text only bootup, a graphical one, and at any time can see what's still going on.

Then you'll get a nice little prompt asking for your commands!

Chances are that Gentoo already recognized your router (if you have one, but i'll assume most of you are going to have one!) and got itself an IP address and configured everything for you. Tho you may not want DHCP and configure your network by using static IP. (Easier to open ports afterward in the router to allow filesharing, games, etc...)

If you want to see if Gentoo recognized the network card properly, you can type in lspci | grep net and you'll see which adapter it recognized. Then if you want to see it's configuration, type in ifconfig.

To configure manually the adapter, type in:

ifconfig eth0 x.x.x.x broadcast x.x.x.x netmask x.x.x.x up

where x.x.x.x is a valid IP address, example on my system looks like

ifconfig eth0 192.168.2.162 broadcast 192.168.2.255 netmask 255.255.255.0 up

To explain a little what this command do, ifconfig is the program name to configure all network adapter related settings. eth0 is the name of the adapter you want to configure, in this case, eth mean ethernet and 0 is the first (and only, in this case) adapter. you could have wlan0 for wireless lan too. Or eth1 for the second ethernet controller. broadcast x.x.x.x is the broadcast IP address, usually it's going to be the first three group of number (192.168.2 in this case) and 255 as the last one. The network mask will be in most cases 255.255.255.0. And up means to bring the interface up, or on!

then issue the following command to set up the gateway

route add default gw (ip address of your router)

in my case it was:

route add default gw 192.168.2.1

Then we need to set up DNS resolution. Type in

nano /etc/resolv.conf

and make sure that only one dns appear and point to your router too. In my case it is:

nameserver 192.168.2.1

then try to ping an address like:

ping www.google.com


if you see some response coming in, with some milliseconds number, it means that everything is okay. If it responds time out, it means something is wrong somewhere, check back the steps we did before, and make sure everything is right, so far!

Step 3 : Disk Partitioning

Now is the time to either go ahead or turn back! If you are coming from Windows, you are probably used to see your hard drive called C: and/or named my stuff or whatever. Under linux, things are a little different. There is no drive letter. You may wonder how you access your drives then, they become part of the directory structure. So you could add that external USB drive or key right in your home directory, or in fact, wherever it fits your need!

Also in Linux, often you are going to see drives with more than one partition, and most of the time, more than two too. At the bare minimum, you will have two. One for swap partition (another difference here, swap isn't in a file, but rather on a whole partition, and could be and should be on another drive if you have more than one, for optimal speed) and one for the whole system, called root. But most people tend to put their boot partition alone, so anything can't happen to those critical file under normal system operation, that would be until you mount it by yourself. Another partition worth keeping alone is the home directory. Where you are going to store most of your personal and some program files in. So it may be useful to be able to keep this partition if you ever need to reinstalled Gentoo, or another linux for example.

So fire up fdisk to start partitioning your disk. A quick fdisk primer:

type in p, (and press enter as always :) ) to get a listing of the current partitions.

d, deletes a partition
n, creates a partition
t, change the type of the filesystem
w, writes the changes to the drive (this is point of no return!)

so with that in mind, first type in p to list the partition you currently have. Chances are if you are running windows, you are going to only have one partition. Then you are pretty much out of luck, you'll need to erase this partition along with the data and everything on it. So be sure to back everything you want to keep first before continuing here.

Or if you are able to use Partition Magic and resize your partition, you could also keep Windows, but this step wont get covered here.

If you only have one partition, type in d to delete a partition, enter 1 for the first partition, and you'll be left with a blank drive. Then create the first partition, we'll call it boot later, so press n at the prompt, enter 1 for the first partition, and p for primary partition. Then press enter when asked for the beginning sector, then after type in +100M to get that partition a size of one hundred megabytes. It's not large, but large enough for it's purpose!

Then, repeat the same steps and create another one, this time enter +1G to give the next partition one gigabyte in size.

Then press the letter t, enter 2, then 82 to set the partition for swap use. Then repeat the process and create a third partition, but this time we'll create an extended partition. So press n, choose extended, then press enter twice to set it to maximum available size. Then type in n again to create the next partition, the root partition or / as we call it. Then you can either set it's size to fill in the available space you created in the extended partition, or set it a size. It's up to you if you want to separate your home drive from the rest of the system. Repeat again to create it. Then you can either set it's size to fill in the available space you created in the extended partition, or set it a size. It's up to you if you want to separate your home drive from the rest of the system. Repeat again to create a home partition if you want one.

Once you are finished, type in p (or any time you want in fact) to see the current listing of partition, once you are happy with the results, type in w to write the changes to disk.

Now you have your partitions, now what? We need to initialize them (format them) and give them a filesystem. Under windows there isn't too much choice again.. NTFS or FAT. And most likely you would be using NTFS if it's a clone, or FAT if it's a brand name... I dont know why but brands like compaq like to set the Windows filesystem to FAT. I dunno why, but really should be NTFS. Under linux there are many more choices. But we'll list the main ones here:

EXT2Linux original file system, which is very reliable, but tends to be slow. Also, if a power outrage arrive, you can be knee deep in s... so try to stay away from ext2, and choose a more recent filesystem.
EXT3Same as EXT2 but with journaling option. Now you should be a whole lot more safer when power outrage arrives. A good choice, but not the fastest.
ReiserFSA new kid on the block :) (Well not so new anymore) But a very good journaling filesystem (journaling means that everything that happens on the disk is written in some sort of agenda.. so if something happens and the data weren't transfered or written in time, chances are when you'll reboot, things are going to sort themselves out when the disk check will be running. It's gonna go back into the "agenda" and replay the transaction that didn't happenned. Is very good with small file, so on Gentoo, it should be a must as there are lots and lots of small file, specially in portage.
JFSI never tried it myself, but people says it's much better than anything else for a laptop and power saving. The filesystem should allow 30% more battery because or less intense usage.

To actually initialize the disk using one of the wanted filesystem (or you could choose one different for every partition but not really recommanded! One good filesystem to choose is ReiserFS, the only things that nag me from ReiserFS is the little longer startup time at boot time than let say ext3, but again if you crash, you'll be happy to have Reiser, it's much quicker to recover than ext3!

so you would type:

mkfs.ext3 /dev/hda1

(be sure to replace hda1 with the partition you actually want to format! This is just the syntax!)

mkfs.reiserfs /dev/hda1
mkfs.jfs /dev/hda1 and so on... :)

To initialize the swap you type in:

mkswap /dev/hda1 (again replace with your actual swap partition!)
swapon /dev/hda1

Step 4 : Mounting

Now that we have our linux partitions ready, we need to mount them in the livecd filesystem to be able to start the installation.

So type in:

mount /dev/hda1 /mnt/gentoo (replace hda1 by the actual root partition)
cd /mnt/gentoo

then create the appropriate directory for each of the partition you intend to mount on the filesystem. On mine I did a boot partition (100M), a root partition (35GB), a swap partition (1GB), and a home partition (filling the rest of the little 80GB in my laptop). So i needed to do :

mount /dev/hda7 /mnt/gentoo
cd /mnt/gentoo
mkdir boot
mkdir home
mount /dev/hda5 /mnt/gentoo/boot
swapon /dev/hda6
mount /dev/hda8 /mnt/gentoo/home

We are going to improve the hard disk and cdrom settings to improve and maximize disk performance. Issue the following command:

hdparm -c1d1u1m16 /dev/hda
hdparm -c1d1u1 /dev/hdc

Step 5 : Set date and start building the directory structure

In linux, the system time is very important. And especially during compile.. if you have clock problem, you may end up having compile problems afterwards, so make sure your time is right! Type in date to see the current date and time.

Then if it needs to be changed to let say may 17th 2005, 11h00am, you'd do, date 051711002005. (0517 being may, 17, 1100 being 11h00am, 2300 would have been 11h00pm, and 2005, well ! :) )

Getting the stage tarball

I've read in the developer's guide that it's recommended going from the stage1-x86 tarball instead of already pre-customized pentium3, 4, athlon, etc.. version. So we are going to listen to fellow developers here and download the file stage1-x86-2005.0.tar.bz2. Fire up the browser links to gentoo's mirrors list and download from a mirror the file we need. (it's going to be in /releases/x86/2005.0/stages/x86/ directory) It's small isn't it for a full blown desktop OS? It's because you are only downloading the files required to build yourself your OS. So you are going to download the source code for each and every program that lies on your computer, and compile it for your particular computer! So don't worry, even if it's under 20M it's okay!

Now that you have your tarball ready, extract it to /mnt/gentoo (what will be your future root directory). Use the following commands to untar the archive.

cd /mnt/gentoo
tar jxvpf stage1*.tar.bz2

(this is supposing that the tarball is in /mnt/gentoo, if not, specify the path, probably in /root if you downloaded it from links)

To mount the /proc and switch over the current /dev to our new install

mount -t proc none /mnt/gentoo/proc  (this is to mount the proc filesystem)
mount -o bind /dev/ /mnt/gentoo/dev (this is to mount the dev filesystem)

To select some good mirrors to add automatically to make.conf, dont be afraid to pick a few, cause sometimes it might prove useful!

mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

To inform our future installation of the dns server we specified earlier, if you skip this part, you wont have a working network when you reboot later, so be sure to do it, as i've already forgotten to do it sometime, and took me a few minutes to figure the problem.


My /etc/resolv.conf (contains one line only)

File: /etc/resolv.conf
nameserver 192.168.2.1

Step 6 : Chrooting

At this point you may you to do this:

lspci > /mnt/gentoo/hardware.txt
lsmod >> /mnt/gentoo/hardware.txt

because I'm not sure if at kernel build time if we have those tools available, so you should do that now to ensure you have the proper info for later...

Look attentively in hardware.txt to know what to modify in the kernel .config later on. If you know already your hardware, it's little of interest then.

Chrooting is the process of changing the root directory from one installation to another. This can prove useful in a number of ways, but we'll use it to install Gentoo on your computer. If you noticed, up till now, we were using the filesystem provided when you booted the livecd, after this command, you'll be inside you're own filesystem, the one we created in the steps earlier!

So go ahead and type:

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

To update the environment variables to let the system know that everything has changed now.

echo "sys-libs/glibc userlocales" >> /etc/portage/package.use

To compile later on only the language(s) you selected.

emerge --sync

To download the current portage tree. You should see the portage tree as a big database of program, you carry the database, but not the actual file, so each time you emerge something, you'll download it from the internet. For more information on portage please see the portage introduction.

Step 7 : Make.conf

Here is a copy of my actual make.conf for you to use, if you have a Pentium 4, then I think you should keep the settings I've included in it, as it runs really good on a P4, if you have another arch, you may want to try changing the march to yours, and try it with those settings. Anyway, you're free to do what you want in either case, so!

Make sure CHOST is set to i686-pc-linux-gnu. if it's set to i386 NPTL support won't be built! Check NPTL for more info.

You may want to check the article here.

File: /etc/make.conf
# **********************************************************************
# /etc/hosts - Edited 21st May, 2005 - Pierre-Andre Leclair  -
#              Taken from bsodmike and modified by me.
# **********************************************************************

USE="a52 aac acpi async bonobo bzip2 cardbus cdparanoia divx4linux dpms dvd \
     dvdr dvdread exif fame ffmpeg flac ftp gimp gkrellm glitz glut gmail \
     gmailtimestamps gtkhtml hal imlib2 javascript joystick kdeenablefinal \
     kerberos matroska mmx moznocompose moznoirc moznomail mozsvg mpc mpeg4 \
     mplayer msn nptl nptlonly openal pic pcmcia sharedmem sse sse2 stream svg \
     svgz sysfs theora threads transcode unicode usb userlocales v4l vcd \
     wifi win32codecs wxwindows xml xosd xpm xvid -arts -cups gstreamer"


### CHANGE THIS if you dont have a i686 platform
CHOST="i686-pc-linux-gnu"

### CHANGE THIS if you dont have a pentium 4, if you have pentium m, put
#pentium-m, if you have athlon put athlon-xp. If you have other
#than p4 cpu, you may want to check those particular flags: -march -mtune
#-mmmx -msse -mfpmath which you should probably use only 387 as parameter,
#and I guess you could try with #the rest.  I think there is a -m3dnow.
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
CFLAGS="-march=pentium4 -mtune=pentium4 -O3 -fomit-frame-pointer \
        -fprefetch-loop-arrays -pipe -mmmx -msse -mfpmath=sse,387 -ffast-math \
        -momit-leaf-frame-pointer"

CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
#-fvisibility=hidden"

LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"

### Here tells portage to use newer and unstable package (they aren't that bad :)
# Maybe just dont choose it for a server!
ACCEPT_KEYWORDS="~x86"
PORTAGE_TMPDIR=/var/tmp
#
# PORTDIR is the location of the portage tree. This is the repository
#     for all profile information as well as all ebuilds. This directory
#     itself can reach 200M. WE DO NOT RECOMMEND that you change this.
PORTDIR=/usr/portage
#     itself can reach 200M. WE DO NOT RECOMMEND that you change this.
PORTDIR=/usr/portage
#
# DISTDIR is where all of the source code tarballs will be placed for
#     emerges. The source code is maintained here unless you delete
#     it. The entire repository of tarballs for gentoo is 9G. This is
#     considerably more than any user will ever download. 2-3G is
#     a large DISTDIR.
DISTDIR=${PORTDIR}/distfiles
#
# PKGDIR is the location of binary packages that you can have created
#     with '--buildpkg' or '-b' while emerging a package. This can get
#     upto several hundred megs, or even a few gigs.
PKGDIR=${PORTDIR}/packages
#
# PORT_LOGDIR is the location where portage will store all the logs it
#     creates from each individual merge. They are stored as YYMMDD-$PF.log
#     in the directory specified. This is disabled until you enable it by
#     providing a directory. Permissions will be modified as needed IF the
#     directory exists, otherwise logging will be disabled.
PORT_LOGDIR=/var/log/portage
#
# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
#     concern that they will be deleted by rsync updates. Default is not
#     defined.
PORTDIR_OVERLAY=/usr/local/portage

# Fetching files
# ==============
#
# If you need to set a proxy for wget or lukemftp, add the appropriate "export
# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if
# all users on your system should use them.
#
# Portage uses wget by default. Here are some settings for some alternate
# downloaders -- note that you need to merge these programs first before they
# will be available.
#
# Default fetch command (5 tries, passive ftp for firewall compatibility)
FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
#
# Using wget, ratelimiting downloads
#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
#
# Lukemftp (BSD ftp):
#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
#
# Prozilla (turbo downloader)
#FETCHCOMMAND='/usr/bin/proz --no-getch -s ${URI} -P ${DISTDIR}'
#
# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval.
# The list is a space seperated list which is read left to right. If you use
# another mirror we highly recommend leaving the default mirror at the end of
# the list so that portage will fall back to it if the files cannot be found
# on your specified mirror. We _HIGHLY_ recommend that you change this setting
# to a nearby mirror by merging and using the 'mirrorselect' tool.

#
# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages.
# The list is a single extry specifying the full address of the directory
# serving the tbz2's for your system. Running emerge with either '--getbinpkg'
# or '--getbinpkgonly' will cause portage to retrieve the metadata from all
# packages in the directory specified, and use that data to determine what will
# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please
# consult the man pages and 'emerge --help' for more information.
#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/"
#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/"

# Synchronizing Portage
# =====================
#
# Each of these settings effects how Gentoo synchronizes your Portage tree.
# Synchronization is handled by rsync and these settings allow some control
# over how it is done.
#
#
# SYNC is the server used by rsync to retrieve a localized rsync mirror
#     rotation. This allows you to select servers that are geographically
#     close to you, yet still distribute the load over a number of servers.
#     Please do not single out specific rsync mirrors. Doing so places undue
#     stress on particular mirrors.  Instead you may use one of the following
#     continent specific rotations:
#
#   Default:       "rsync://rsync.gentoo.org/gentoo-portage"
#   North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage"
#   South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage"
#   Europe:        "rsync://rsync.europe.gentoo.org/gentoo-portage"
#   Asia:          "rsync://rsync.asia.gentoo.org/gentoo-portage"
#   Australia:     "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.eliteitminds.com/gentoo-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"

# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
#     a current portage tree before it exits with an error. This allows
#     for a more successful retrieval without user intervention most times.
RSYNC_RETRIES="3"
#
# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
#     on a connection. Most users will benefit from this setting as it will
#     reduce the amount of 'dead air' they experience when they run across
#     the occasional, unreachable mirror. Dialup users might want to set this
#     value up around the 300 second mark.
RSYNC_TIMEOUT=180

# Advanced Features
# =================
#
# MAKEOPTS provides extra options that may be passed to 'make' when a
#     program is compiled. Presently the only use is for specifying
#     the number of parallel makes (-j) to perform. The suggested number
#     for parallel makes is CPUs+1.

### Yeah 5 is a little more than 2+1.. but again I've seens this on the net
### for a P4 3.2 HT which I happen to have, if you dont have an HT processor
### then maybe you should lower this number to 1-2 I dunno, or check on the
### net to be sure which number you can use for your processor.
###      vvvvv
MAKEOPTS="-j5"

#
# PORTAGE_NICENESS provides a default increment to emerge's niceness level.
#     Note: This is an increment. Running emerge in a niced environment will
#     reduce it further. Default is unset.
#PORTAGE_NICENESS=3
#
# AUTOCLEAN enables portage to automatically clean out older or overlapping
#     packages from the system after every successful merge. This is the
#     same as running 'emerge -c' after every merge. Set with: "yes" or "no".
#     This does not affect the unpacked source. See 'noclean' below.
AUTOCLEAN="yes"
#
# FEATURES are settings that affect the functionality of portage. Most of
#     these settings are for developer use, but some are available to non-
#     developers as well.
#
#  'autoaddcvs'  causes portage to automatically try to add files to cvs
#                that will have to be added later. Done at generation times
#                and only has an effect when 'cvs' is also set.
#  'buildpkg'    causes binary packages to be created of all packages that
#                are merged.
#  'ccache'      enables ccache support via CC.
#  'cvs'         feature for developers that causes portage to enable all
#                cvs features (commits, adds) and all USE flags in SRC_URI
#                will be applied for digests.
#  'digest'      autogenerate a digest for packages.
#  'distcc'      enables distcc support via CC.
#  'fixpackages' allows portage to fix binary packages that are stored in
#                PKGDIR. This can consume a lot of time. 'fixpackages' is
#                also a script that can be run at any given time to force
#                the same actions.
#  'keeptemp'    prevents the clean phase from deleting the temp files ($T)
#                from a merge.
#  'keepwork'    prevents the clean phase from deleting the WORKDIR.
#  'noauto'      causes ebuild to perform only the action requested and
#                not any other required actions like clean or
#  'noclean'     prevents portage from removing the source and temporary files
#                after a merge -- for debugging purposes only.
#  'nostrip'     prevents stripping of binaries.
#  'notitles'    disables xterm titlebar updates (which contain status info).
#  'sandbox'     enable sandbox-ing when running emerge and ebuild
#  'strict'      causes portage to react strongly to conditions that
#                have the potential to be dangerous -- like missing or
#                incorrect Manifest files.
#  'userpriv'    allows portage to drop root privleges while it is compiling
#                as a security measure, and as a side effect this can remove
#                sandbox access violations for users.
#  'usersandbox' enables sandboxing while portage is running under userpriv.
#                unpack -- for debugging purposes only.
#FEATURES="sandbox ccache distcc"
FEATURES="sandbox ccache"
#
# CCACHE_SIZE sets the space use limitations for ccache. The default size is
#     2G, and will be set if not defined otherwise and ccache is in features.
#     Portage will set the default ccache dir if it is not present in the
#     user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache
#     (/var/tmp/ccache), and for regular use the default is /root/.ccache.
#     Sizes are specified with 'G' 'M' or 'K'.
#     '4G' for 4 gigabytes, '4096M' for 4 gigabytes, etc... Default is 2G
CCACHE_SIZE="2G"
#
# DISTCC_DIR sets the temporary space used by distcc.
#DISTCC_DIR="${PORT_TMPDIR}/.distcc"
#
# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates
#     the portage tree. Specific chucks of the tree may be excluded from
#     consideration. This may cause dependency failures if you are not careful.
#     The file format is one pattern per line, blanks and ';' or '#' lines are
#     comments. See 'man rsync' for more details on the exclude-from format.
#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes

GENTOO_MIRRORS="http://gentoo.osuosl.org/ \
                ftp://cs.ubishops.ca/pub/gentoo \
                ftp://gentoo.risq.qc.ca/ \
                ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo \
                http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ \
                ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ \
                ftp://ftp.ussg.iu.edu/pub/linux/gentoo \
                http://gentoo.seren.com/gentoo \
                http://gentoo.chem.wisc.edu/gentoo/ \
                ftp://gentoo.chem.wisc.edu/gentoo/ \
                http://gentoo.mirrors.pair.com/ \
                ftp://gentoo.mirrors.pair.com/ \
                http://gentoo.ccccom.com \
                ftp://gentoo.ccccom.com \
                http://gentoo.mirrors.tds.net/gentoo \
                ftp://gentoo.mirrors.tds.net/gentoo \
                http://gentoo.netnitco.net \
                ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/ \
                http://mirror.espri.arizona.edu/gentoo/ \
                http://mirror.clarkson.edu/pub/distributions/gentoo/ \
                http://mirrors.acm.cs.rpi.edu/gentoo/ \
                ftp://ftp.ndlug.nd.edu/pub/gentoo/ \
                http://open-systems.ufl.edu/mirrors/gentoo \
                http://gentoo.llarian.net/ \
                ftp://gentoo.llarian.net/pub/gentoo \
                http://gentoo.binarycompass.org \
                http://gentoo.mirrored.ca/ \
                ftp://gentoo.mirrored.ca/ \
                http://mirror.datapipe.net/gentoo \
                http://mirror.datapipe.net/gentoo \
                http://gentoo.eliteitminds.com \
                http://gentoo.cs.lewisu.edu/gentoo/ \
                ftp://linux.cs.lewisu.edu/gentoo/ \
                http://prometheus.cs.wmich.edu/gentoo \
                http://modzer0.cs.uaf.edu/public/gentoo/ \
                http://mirror.usu.edu/mirrors/gentoo/ \
                ftp://mirror.usu.edu/mirrors/gentoo/ \
                http://lug.mtu.edu/gentoo \
                http://mirror.phy.olemiss.edu/mirror/gentoo"

Step 8 : Bootstrapping

In order to start building your system from what you currently have, the process that takes you from stage1 to stage2 is called bootstrapping, because a new toolchain is compiled for the system. Here is the command in the order you've got to type them.

env-update
source /etc/profile
emerge --oneshot --nodeps gcc-config
USE="-* build bootstrap" emerge linux-headers # The bootstrap script does this step.
cd /usr/portage
scripts/bootstrap.sh
emerge libperl # This should be pulled in with 'emerge -e system'
emerge python # This should be pulled in with 'emerge -e system'
emerge -e system
emerge syslog-ng xinetd grub hotplug coldplug vixie-cron reiserfsprogs sysfsutils udev dhcpcd
emerge --nodeps acpid ntp
rc-update add syslog-ng default
rc-update add net.eth0 default
rc-update add vixie-cron default
rc-update add xinetd default
rc-update add hotplug default
rc-update add coldplug default
rc-update add acpid default

To update your clock automatically using the Network time protocol, we'll add the ntp client to boot time (actually default runlevel)

rc-update add ntp-client default

Then we'll want to synchronize the clock too, so type in

ntpdate -b -u pool.ntp.org

Now we'll emerge gentoo-sources (which is the source file of the linux kernel, patched by the gentoo developers, this kernel is what was known as the gentoo-dev-sources, or developers sources, they have merged it into gentoo-sources, so if you are seeing people on little older webpage saying I'm running on gentoo-dev-sources 2.6.5 or whatever, it doesn't exists anymore, it's in gentoo-sources.. so as i'm writing, I have gentoo-sources-2.6.11-r7, r8 is out, but broken ati driver with it... I always liked ati better before in windows... but now i really do hate them, their drivers is driving me crazy, and they don't do much about it, anyway, i won't rant against ati here, it's not the point, but anyway!

So type in:

emerge gentoo-sources # Using the -1 option will stop it from being pulled in during world updates when you don't plan on updating your kernel.


After it's finished we'll set the local timezone, type this

rm /etc/localtime

then type

ls /usr/share/zoneinfo

and see what's there. I live in montreal, quebec, canada, which happens to be located in America/Montreal in that dir so having located my file I will now recreate a symlink to /etc/localtime using:

ln -s /usr/share/zoneinfo/America/Montreal /etc/localtime

Kernel configuration

Now we'll configure the kernel, if you want you can use my kernel.config (recommended) and modify the appropriate section for your hardware

Here is my kernel .config: Click here (externalised in sub-article to reduce size)


Once you have my .config in your /usr/src/linux dir, type in:

make oldconfig (to be sure you dont miss anything if you are using a newer kernel)
make menuconfig

Check more importantly those settings as recommended in the developer's guide

  1. Processor type and features - mainly be concerned with your cpu type here
  2. ATA/ATAPI/MFM/RLL support for storage controllers
  3. Networking support - NIC Device drivers are your main concern Use Modules =]
  4. Character devices - agpgart and agp chipset type, dri driver ( if required)
    • Note that if your using an nvidia videocard it's best to leave the character devices as-is
  5. Sound support ~>> Advanced Linux Sound Architecture ~~> Pci devices
    • Set the correct driver module for your soundcard here. use a module as the alsa-utils package demands that modules be present for your system to use the startup script correctly
  6. USB support - Three primary items to be concerned with here...
    • If you have usb2 add the EHCI module as <m> the output recieved from lspci is important here as you cannot have both ohci AND uhci both included. you much choose one or the other and add it as a module
    • EHCI HCD (USB 2.0) support
    • OHCI HCD support
    • UHCI HCD (most Intel and VIA) support
Note: I dont know if it's ati related or what, but if my sound driver (snd-atiixp snd-atiixp-modem) are compiled into the kernel, and I use a bootsplash, often if I don't press esc to see what's happenning, I'll get into KDE or Gnome, and have no sound... If I press ESC like before ALSA load the drivers, I'll have sound. I've found a workaround to this, because it was very annoying. (And I've always had that problem before, not just on this install) By compiling the sound driver as modules and loading them in /etc/modules.autoload.d/kernel-2.6 it's working just fine, even if I let the splash go all the way to gdm. So you might as well do the same thing to avoid problems later on. Just dont forget to put your sound driver into the kernel-2.6 file.

Time to compile the kernel now.

You should be in the directory /usr/src/linux, if not go there, and type:

make
make modules_install
make install

Setup /etc/conf.d/rc

Then we'll modify a few system variables to configure it for your system. And also to work for udev.

Look after those settings in /etc/conf.d/rc:

RC_VOLUME_ORDER="evms lvm dm"
RC_DEVICES="udev"
RC_DEVICE_TARBALL="no"

Change those settings listed above. For volume order, I saw RAID first, and obviously, dont have raid, so removed it... probably helps a bit at startup?


Here is my rc to serve as example:

File: /etc/conf.d/rc
# /etc/conf.d/rc: Global config file for the Gentoo RC System
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/rc,v 1.20.2.7 2005/05/17 00:12:03 vapier Exp $

# This is the number of tty's used in most of the rc-scripts (like
# consolefont, numlock, etc ...)

RC_TTY_NUMBER=11

# Set to "yes" if you want the rc system to try and start services
# in parallel for a slight speed improvement.

RC_PARALLEL_STARTUP="no"

# RC_NET_STRICT_CHECKING allows some flexibility with the 'net' service.
# The following values are allowed:
#  none  - The 'net' service is always considered up.
#  no    - This basically means that at least one net.* service besides net.lo
#          must be up.  This can be used by notebook users that have a wifi and
#          a static nic, and only wants one up at any given time to have the
#          'net' service seen as up.
#  lo    - This is the same as the 'no' option, but net.lo is also counted.
#          This should be useful to people that do not care about any specific
#          interface being up at boot.
#  yes   - For this ALL network interfaces MUST be up for the 'net' service to
#          be considered up.

RC_NET_STRICT_CHECKING="no"

# RC_VOLUME_ORDER allows you to specify, or even remove the volume setup
# for various volume managers (MD, EVMS2, LVM, DM, etc).  Note that the are
# stopped in reverse order.

RC_VOLUME_ORDER="evms lvm dm"

# RC_USE_FSTAB allows you to override the default mount options for the
# standard /proc, /sys, /dev, and /dev/pts mount points.  Note that this
# is the new way for selecting ramfs/tmpfs/etc... for udev mounting.

RC_USE_FSTAB="no"

# RC_FORCE_AUTO tries its best to prevent user interaction during the boot and
# shutdown process.  For example, fsck will automatically be run or volumes
# remounted to create proper directory trees.  This feature can be dangerous
# and is meant ONLY for headless machines where getting a physical console
# hooked up is a huge pita.

RC_FORCE_AUTO="no"

# Use this variable to control the /dev management behavior.
#  auto   - let the scripts figure out what's best at boot
#  devfs  - use devfs (requires sys-fs/devfsd)
#  udev   - use udev (requires sys-fs/udev)
#  static - let the user manage /dev

RC_DEVICES="udev"

# UDEV OPTION:
# Set to "yes" if you want to save /dev to a tarball on shutdown
# and restore it on startup.  This is useful if you have a lot of
# custom device nodes that udev does not handle/know about.

RC_DEVICE_TARBALL="no"


#
# Controlling start-stop-daemon behavior
#
# NOTE: most of these are not in use yet!!
#

# Set to "yes" if stop-daemon() should always retry killing the
# service if it fails the first time.

RC_RETRY_KILL="yes"


# Set the amount of seconds stop-daemon() should wait between
# retries.  $RC_RETRY_KILL should be set to "yes".

RC_RETRY_TIMEOUT=1


# Set the amount of times stop-daemon() should try to kill
# a service before giving up.  $RC_RETRY_KILL should be set to "yes".

RC_RETRY_COUNT=5


# Set to "yes" if stop-daemon() should fail if the service
# is marked as started, but not actually running on stop.

RC_FAIL_ON_ZOMBIE="no"


#
# Internal configuration variables
#
# NB:  These are for advanced users, and you should really
#      know what you are doing before changing them!
#


# rc-scripts dep-cache directory
#
# NOTE:  Do not remove the next line, as its needed by the baselayout ebuild!
#
#  svcdir="/var/lib/init.d"

svcdir="/var/lib/init.d"


# Should we mount $svcdir in a ram disk for some speed increase
# for slower machines, or for the more extreme setups ?

svcmount="no"


# FS type that should be used for $svcdir.  Note that you need
# $svcmount above set to "yes" for this to work ...  Currently
# tmpfs, ramfs, and ramdisk are supported (tmpfs is the default).

svcfstype="tmpfs"


# Size of $svcdir in KB.  Note that ramfs doesn't support this
# due to kernel limitations.

svcsize=2048

Setting Up Hostnames and Domainnames

Recent baselayout changes have adjusted how hostnames and domainnames are set in gentoo linux with ~x86 based hosts. The following examples will show which files need to be edited.

Setting the primary hostname

Open the following file (/etc/conf.d/hostname) in nano or your preferred console based editor changing the localhost variable for what suits your personal taste or requirements.


Mine is set to:

File: /etc/conf.d/hostname
 
# /etc/conf.d/hostname
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/hostname,v 1.2.4.1 200$

# Set to the hostname of this machine
HOSTNAME="toshiba"

  

Then open up /etc/conf.d/domainname and add a domain name if you need

File: /etc/conf.d/domainname
 
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/domainname,v 1.1.4.1 2$

# When setting up resolv.conf, what should take precedence?
# If you wish to always override DHCP/whatever, set this to 1.
OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
# properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).
#
DNSDOMAIN="homeip.net"

# This only set what /bin/hostname returns.  If you need to setup NIS, meaning
# what /bin/domainname returns, please see:
#
#   http://www.linux-nis.org/nis-howto/HOWTO/
#
#NISDOMAIN=""


  

I chose homeip.net because I'm using dyndns.org's services. I dunno if it really is useful, but when I set up two computer in the same homeip.net, and setup hosts, i can use only the hostname to reach other computers. Like then I had serverp4.homeip.net, I could ssh serverp4 and it would go there. Anyway, I'm really not sure about the necessity of this, as it doesn't affect the internet since I dont really have a homeip.net domaine.. anyway, just to tell you.

Now open up /etc/hosts file, should use nano -w here (-w is to prevent wrapping... you should always use that option in configuration file since wrapping in config file is bad$ here what mine look like

File: /etc/hosts
 
# /etc/hosts:  This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12$
#

127.0.0.1       toshiba.homeip.net toshiba localhost.localdomain localhost

  


Basically beside 127.0.0.1 you put what you put in hostname and domainname here (toshiba.homeip.net, this is the merge of the two actually) then only the hostname, then localhost.localdomain then localhost.

If you have any modules to load at boot time put them in /etc/modules.autoload.d/kernel-2.6 file... you can do that like this:

echo foo >>/etc/modules.autoload.d/kernel-2.6

substitute "foo" with your correct module name

I built my audio driver as modules, and need to load them in that file (they are the only modules that I need to load manually, every others will load by themselves..)

here is mine:

File: /etc/modules.autoload.d/kernel-2.6
 
# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/modules.autoload.d/kernel-2.6$
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you'd like to load when the system
# starts into this file, one per line.  Comments begin with # and
# are ignored.  Read man modules.autoload for additional details.

# For example:
# 3c59x
snd-atiixp
snd-atiixp-modem


Take a look at /etc/conf.d/net to make sure the appropriate settings are there for when we reboot, once modified, mine looks like:

File: /etc/conf.d/net
 
# /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.2.162 broadcast 192.168.2.255 netmask 255.255.255.0"
#iface_ath0="dhcp"
#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.2.1"


Basically, you need to check iface_eth0, (if you are using dhcp, use "dhcp" if not, use something like my line "192.168.x.x broadcast 192.168.x.255 netmask 255.255.255.0"

Step 9 : Completing the installation

Ok by now, your system should be bootstrapped, which means that stage1 is done. Now we have to configure two things before we can successfully log into our own install when we'll reboot soon. We need to configure the grub bootloader, (we'll use grub as it's the most common bootloader, but you could use lilo as well if you'd want to, but it wont get covered here) and configure fstab (probably for short of filesystem table) which is basically just a text file describing your current partition scheme, dont make an error here, or you could well be faced with an unbootable system and would require some more things to be done to fix it, I'll probably add in a section later to cover that, but I'll leave that off for now.

Configuring the grub bootloader

Type in:

cd /boot/grub
nano grub.conf.sample

And we'll begin editing the sample file that is shipped with grub, you'll probably want to delete the first block which is hurd, keep the second, and delete all the others after GNU/Linux, or maybe keep DOS/Windows to be able to boot to windows if you still have it left somewhere lying in a dark corner of your harddrive, probably all tidy, full of viruses, spyware, and what not... things will be different soon, we promise! :)

You'll need to change the parameters to the root option which is by default (hd1,0) to your actual /boot partition. Now this is where grub could confuse you, it doesn't use the hda scheme that's used in linux, it uses another scheme, probably used elsewhere too, but I dunno. So if you are using hda1 as your /boot partition, or if you went the easy way and created the first partition root, and second swap, then it's going to be hd0,0 which basically mean first hard drive in the system, primary master, and first partition on that drive.

Now i'll explain my case, you'll understand better. I have windows on hda1, first drive and first partition, I have created an extended partition right after this one, cause I anyway I would have had more than 5 partitions anyway and you can't only have 4 primary partitions. So i have hda1 windows, and no hda2,3,4, then hda5 is my boot, hda6 my swap, hda7 my root, hda8 my home. Then to make all that work in grub, I only need to know two things, my boot, and root. But again somewhere you could get confused, the first option after title, which actually describe what will be written in your grub menu, is root, but actually mean root of grub, that would be boot if you have a separate boot partition, if you don't, then it's root. Since hda1 is hd0,0, my boot (hda5) is hd0,4, so change yours accordingly. Then the parameter root for the kernel option line, you need to point to your actual root (/) directory. But here you use the actual hda scheme used in linux. So here I put root=/dev/hda7.

Now save the file, (type CTRL-X) and answer Y to save it, then erase .sample, and answer Y to change the filename.

Mine for reference (already posted near initng but for ease of accessibility i'm going to include it here again)

File: /boot/grub/grub.conf
#
# Sample boot menu configuration file
#

# Boot automatically after 30 secs.
timeout 30

# By default, boot the first entry.
default 0

splashimage=(hd0,4)/grub/splash.xpm.gz

# Fallback to the second entry.
fallback 1

# For booting GNU/Linux
title  GNU/Linux
root (hd0,4)
kernel /vmlinuz root=/dev/hda7
#initrd /initrd.img

# For booting GNU/Linux
title  Gentoo 2.6.11-r7 Splash
root (hd0,4)
kernel /vmlinuz root=/dev/hda7 video=vesafb:ywrap,mtrr,1024x768-16@60 splash=silent,theme:livecd-2005.0
initrd /splash-livecd-1024

# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
rootnoverify (hd0,0)
makeactive
chainloader  +1
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos

# Change the colors.
title Change the colors
color light-green/brown blink-red/blue

Configuring fstab

Type in:

cd /etc
nano fstab

Now things might be scary if you are seeing this file for the first time, and you should really be anyway, cause it's this file that's going to make your system boot or not, so be careful here! Check twice.

You'll need to change the first entry where BOOT is, to your actual boot partition, in my case i erased BOOT, replaced with hda5, changed the filesystem from ext2 if I remember the defaults, to ReiserFS, and if you use Reiser for your boot, you need to add notail to your options, and I also added noatime to maximize speed. Actually since I'm using all reiserfs partition I added notail and noatime to each hard drive partition, not cdroms tho. Then change the rest of the file accordingly to your actually partition number. Once your are done, save the file and exit.


My fstab for reference:

File: /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda5               /boot           reiserfs        noauto,noatime,notail   1 2
/dev/hda7               /               reiserfs        noatime,notail          0 1
/dev/hda6               none            swap            sw                      0 0
/dev/hda8               /home           reiserfs        noatime,notail          0 0
/dev/cdroms/cdrom0      /mnt/cdrom      auto            noauto,ro,user          0 0
#/dev/fd0               /mnt/floppy     auto            noauto                  0 0

# NOTE: The next line is critical for boot!
none                    /proc           proc            defaults                0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs           defaults                0 0

Now you can make the changes we made earlier with hdparm permanent by modifying it's config file and adding it to boot runlevel.

So type in

nano /etc/conf.d/hdparm

then add

disc0_args="-c1d1u1m16"
cdrom0_args="-c1d1u1"

comment out the last one for all drive, as it will be redundant anyway, or delete the line.

Save the file and exit.

My /etc/conf.d/hdparm:

File: /etc/conf.d/hdparm
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-conf.d.3,v 1.2 2004/09/06 02:17:08 swegener Exp $

# You can either set hdparm arguments for each drive using hdX_args,
# discX_args, cdromX_args and genericX_args, e.g.
#
disc0_args="-c1d1u1m16"
# disc1_args="-d1"
cdrom0_args="-c1d1u1"

# or, you can set hdparm options for ALL drives using all_args, e.g.
#
#all_args="-d1"

Now type:

rc-update add hdparm boot


Don't forget this step, set the root password before we reboot. type in:

passwd

and enter your password, and confirm it by entering it again.

Now you may also want to create yourself a user account, cause using root to do your general stuff, is not recommended. In fact things real bad can happen using the root account not properly. Keep yourself using the user account to do everything, and the root or su is better, cause you wont forget as easy you are using root, then you exit back to your user.

So type in:

useradd yourname -m -g users -G audio,cron,wheel,portage,games,usb,video,cdrw,cdrom

and then set your account a password with passwd yourname and repeat the steps you did for root.

Exit the chroot environnement, unmount partitions and we're off to reboot!

exit
exit
cd ~/
umount /mnt/gentoo/boot
umount /mnt/gentoo/home
umount /mnt/gentoo/proc
umount /mnt/gentoo/dev
umount /mnt/gentoo
swapoff /dev/hda6
shutdown -r now

And we're off! Now it's a good time to see if you did understand me well or not, and cross your finger that everything goes as planned! After the reboot you should see a lovely prompt waiting for a username, type in root and your password, cause we'll have some more thing to do!

At this point, you have a working basic Gentoo install. You still have to emerge a lot of things and compile a whole more bunch of different program to end up having all the functionality you're looking after. Let say you don't have a cd-burner, who doesn't these days, but maybe you are? :) Then you sure dont need all the stuff to support it, so no need to install it.

In gentoo, it's possible to install only what you really want, of course, provided you KNOW what you want.. the problem is the choice. Which program will I like better. So you'll emerge a few music players, try them, and unemerge the one you dont want. (At least, that's what I did, and for a whole bunch of different things, this was how I tried stuff). And for that, I've found some really great tools to help you do just that. It's just weird that I didn't heard about those tools before, in the forums, of wiki whatever. I didn't knew portage had some graphical tools to help you emerge program, until I looked in app-portage.

There is quite a few applications that will do that. I tried them all, and the one that looked more promising is Kuroo, but unfortunately, it was very buggy for me. I've found another one that's almost as good, which is Guitoo, and a lot less buggy. There's also Kentoo, but never been able to run it. I've look into the .desktop, and it seems to really be a KDE application, you start it with kcmlaunch or something like that, I dont remember, and passing the module name kentoo, but it didn't worked for me, maybe because I didn't had KDE installed, but I had all the library to run other KDE apps, so wonder why it wasn't working. The sad thing is, I couldn't find a gtk based tools, only kde. So you'll have to use KDE, or at least have the library.

And there is Portagemaster, which is in java. So it should run on just about anything! You've got to have java installed to run this one. When you'll choose one that fits your liking, then it's easy to browse the portage tree and emerge a bunch of stuff to try. Kuroo easily queue in package, where in guitoo, it's a bit more complicated and a whole lot less useful, you've got to pretend emerge, then append to queue to queue the package without installing it, there is no context menu option to do just that, as in Kuroo. Portagemaster doesn't support this as of yet and I dont know for Kentoo.

Step 10: Getting from there to having a full blown desktop

So, you probably are eager to see some graphics coming out of this, right? At this point, me too! So let's work toward having a working X server and a lightweight window manager for a start.

Step 10.1: Installing some command line utilities

We'll first begin by installing a few good command line utility.

type in:

emerge bash-completion bash-completion-config

This will install bash-completion, a tools that nobody should be without.. press tab and automatically fills in a whole bunch of different stuff, try it. And config is to add program to the compatibility of bash-completion. You could symlink manually, but this is easier to manage.

emerge -n eix gentoolkit
update-eix

This will install the fastest search tool for portage available, it's instantaneous!, and gentoolkit, two essentials tools. (small primer on eix, -s to search package, -S to search description, and both as fast, run update-eix before tho. If you want the old qpkg tool type in:

ln -s /usr/share/doc/gentoolkit/deprecated/qpkg/qpkg /usr/sbin/qpkg)

Now to enable this for your user account, go in your home, edit .bashrc, and uncomment the last line, which was added by bash-completion. If you want to add it also to your root account, you should copy that line to the end of /etc/bash/bashrc.

emerge slocate
updatedb

This is the locate tool, again very useful, dont forget to run updatedb first. It's gonna add itself as a cron job daily. But if you want to locate stuff that you just installed, you'll need to updatedb first, then locate.

Just to be sure that everything went well, and everything is linked properly, at this point, it should be all clear, and no problem should get detected. Should you be prompted to remove package, examine the list carefully, and if it's a few packages, remove them, then revdep-rebuild, if there is lots of package, I guess something must be wrong, be careful, you might want to search the web.

emerge --depclean -va

Step 10.2: Building the X Server

Now we'll start building an X server so we can enjoy some graphics while continuing the install. So type in:

emerge xorg-x11 -va

Check at the package list that Xorg would install, and press y to accept. Go have yourself a coffee, sit back and relax! (this is a very small compilation if we compare it to kde. Wait till we emerge it! :) )

Step 10.2.1: Install/Configure graphics and sound drivers

Then we'll emerge ati-drivers and ati-drivers-extra

emerge ati-drivers ati-drivers-extra

Again take your time, cause qt is in the dependency (if you selected it in your use as I did).

Note: Nvidia users would at this point emerge nvidia-kernel and nvidia-glx.

Now we are going to install the text browser links, always useful to have it, and I'm already starting to miss it! So let's emerge it!

emerge links

then you might wanna do:

chmod +s /usr/bin/links2

to enable links in svga mode ;)

If you choose to compile your sound driver into the kernel, you'll still want to emerge alsa-utils to be able to set the mixer and also restore the volume on login.

emerge alsa-utils
rc-update add alsasound boot
amixer set Master 85% unmute
amixer set PCM 80% unmute
alsactl store

If you compiled your sound drivers as modules like I suggested earlier, then you need to load them at bootup. This is done by adding the modules name of your sound driver to the file /etc/modules.autoload.d/kernel-2.6

Here is mine:

File: /etc/modules.autoload.d/kernel-2.6
# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/modules.autoload.d/kernel-2.6$
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you'd like to load when the system
# starts into this file, one per line.  Comments begin with # and
# are ignored.  Read man modules.autoload for additional details.

# For example:
# 3c59x
snd-atiixp
snd-atiixp-modem

Ok now you should have sound every reboot, and your mixer should always be restored. You wonder why those precise value have been entered? The sound driver in Linux, seems more powerful than the driver in windows, so if I set PCM (i've experienced this on other sound card too, not just my integrated ati sound, or realtek whatever) to more than 80%, distortion starts to show up, but the Master control can be raised to 100% while PCM is still 80%... So your mileage may vary, but if you experience poor sound quality, try to lower your PCM value, and after play with the Master control, your speakers controls, and if a laptop, the volume control on the laptop.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Newbie_Guide_to_Stage1_NPTL_Install"

Last modified: Wed, 13 Feb 2008 17:58:00 +0000 Hits: 31,952