Jump to content

Gentoo 2005.1 Install Guide


Recommended Posts

I've posted this, mainly because someone was interested in it. Whilst Gentoo 2006.0 is now out, I still even use 2005.1 for building my system because I've got more control over it than the new GUI installer.

 

This guide is basically dissecting the official Gentoo documentation and using what bits are necessary. It doesn't go into great detail but you can get the idea from the notes below what is actually going on!

 

I would like to add, that the Gentoo documentation is excellent. This document assumes various settings, including static IP addressing. So for anything different to these basic notes, check the Gentoo documentation to find out more. You can find them here:

 

http://www.gentoo.org/doc/en/index.xml?cat...stall#doc_chap2

 

Network Card Configuration.

 

To configure your network card run:

 

net-setup eth0

 

complete the relevant prompts based on your configuration. For my example I used the details:

 

IP:			10.1.1.2
Subnet Mask:	255.255.255.0
Gateway:		10.1.1.1
DNS:			10.1.1.1
DNS Search:	buziaks.com

 

networking wasn't required during my install, but it could have been if I installed any apps that weren't apart of the basic CD installation.

 

Partition Configuration.

 

Partitioning will normally be completed using one of the following commands:

 

fdisk /dev/hda
fdisk /dev/sda

 

depending on IDE disks versus SCSI/SATA drives. The end letter ?€œa?€? will change if you have more than one disk, so hdb, hdc or sdb, sdc and so on. Once in here, you need to create the partitions. Press "m" for help to see the commands. Here I will assume some settings using just two partitions, the first being swap and the second just being /.

 

You will need to know how to use fdisk, so suggest you read up on this on how to create new partitions, etc, etc. However, here is my example with an empty hard disk:

 

fdisk /dev/hda
n (to create new partition)
p (primary)
1 (partition number)
press enter to accept default value of "1"
now type +1024M (creates partition of 1GB) and press enter
t (toggle partition type)
82 (change to swap)
n
p
2
press enter to accept default value
now press enter to select the default value of the end of the disk
w (to save partition info)

 

If you now do:

 

fdisk -l /dev/hda

 

you'll see two partitions. /dev/hda1 being type 82 and allocated for swap with 1GB. OK, overkill, but this is an example :P /dev/hda2 is allocated as type 83 and will be used for the / partition.

 

Now that this has been done, we need to create the filesystems:

 

ext3:		mke2fs -j
swap:		mkswap
enable swap:	swapon
reiserfs:	mkreiserfs

 

Please note, that if you type mke2fs without the ?€œ-j?€? you will just create an ext2 filesystem. The difference between the two is that ext3 has journaling, whereas ext2 doesn't. So, my commands look as follows:

 

mkswap /dev/hda1
swapon /dev/hda1
mkreiserfs /dev/hda2

 

I've assumed reiserfs for my filesystem type.

 

Installation.

 

Now the partitions have been created and formatted with a filesystem, we can now continue with installing the operating system by mounting the partitions (/ which will be on /dev/hda2):

 

mount /dev/hda2 /mnt/gentoo

 

Now install stage files, portage snapshot and distfiles:

 

uname -a (read the output for choosing the correct stage file)
ls /mnt/cdrom/stages (to view the stages available)
cd /mnt/gentoo
tar xvjpf /mnt/cdrom/stages/stage3-<subarch>-2005.1-<release>.tar.bz2
ls /mnt/cdrom/snapshot (to view the portage snapshots available)
tar -xvjf /mnt/cdrom/snapshot/portage-<date>.tar.bz2 -C /mnt/gentoo/usr
mkdir /mnt/gentoo/usr/portage/distfiles
cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/

 

Edit /etc/make.conf and add the following information:

 

-pipe (to CFLAGS="-O2 -pipe -march=i686"
MAKEOPTS="-j2" (the number is based on number of processors +1 - so this is for 1 proc)

 

your march value will be different depending on if you chose an athlon subarch or i686, etc, etc, from the stage listings.

 

CHROOT the environment for the rest of the installation:

 

mount -t proc none /mnt/gentoo/proc
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

 

The portage cache needs updating to make your following emerges quicker:

 

emerge --metadata

 

Make sure the timezone is configured correctly. For this document ?€œEurope/Warsaw?€? was being used, therefore, change this for your correct timezone:

 

ls /usr/share/zoneinfo (to choose your timezone)
ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime

 

It's very important to use lspci first and make a note of all your hardware for when it comes to compiling the kernel. The default will not have everything you require, such as network cards, etc. Make sure that ANY drivers for IDE/SCSI/SATA are NOT compiled as modules, else you'll find it hard to boot your system. Configure with * so that it's built into the kernel (monolithic). Compile and install the kernel using the following:

 

emerge gentoo-sources
emerge pciutils (so you can run lspci to see cards installed for choosing drivers)
lspci (to view the cards installed)
ls -l /usr/src/linux (to verify linux --> linux.2.6.12-gentoo-r6 for example)
cd /usr/src/linux
make menuconfig (make sure you choose all you need, especially Raid1 and Device Mapper)
make && make modules_install (to compile the kernel, will take a little while)
cp arch/i386/boot/bzImage /boot/kernel-2.6.12-gentoo-r6
cp .config /boot/config-2.6.12-gentoo-r6

 

Chances are you might need to add the network card to the kernel-2.6 file (only do this if you compiled your network card as a module (M) if you marked with a * then the module is monolithic and built into the kernel and not as a module:

 

nano -w /etc/modules.autoload.d/kernel-2.6 (now include the module)
tg3 (mine is broadcomm network card, substitute with whatever yours is)

 

Edit the /etc/fstab file, to install your partitions. My partition information is:

 

<fs>		<mountpoint>	<type>		<opts>		<dump/pass>
/dev/hda2	/		reiserfs	noatime,notail	0 1
/dev/hda1	none		swap		sw		0 0

 

Edit your hostname, domain name and configure network card:

 

nano -w /etc/conf.d/hostname

 

Change "localhost" to whatever your hostname is. Mine was set to "esprit".

 

nano -w /etc/conf.d/domainname

 

Uncomment "DNSDOMAIN" and set to your domain name. Mine was set to "buziaks.com". You don't have to do this unless you're configuring for a domain, such as with email server. So if workstation, leave as is.

 

Edit /etc/hosts for your machines hostname details to contain:

 

nano -w /etc/hosts
10.1.1.2 esprit.buziaks.com esprit (change the IP to your IP address).

 

Edit /etc/resolv.conf to contain:

 

nano -w /etc/resolv.conf
nameserver 10.1.1.1 (your DNS server address here)
search buziaks.com (your domain name here)
domain buziaks.com (your domain name here)

 

again, if not using domains, leave out the search and domain lines, you won't need them.

 

rc-update domainname default (to add to bootup)

 

Set the network card config:

 

nano -w /etc/conf.d/net (and add the following lines for network config)
config_eth0=( "10.1.1.2 netmask 255.255.255.0" )
routes_eth0=( "default gw 10.1.1.1" )

 

Now set the card to be enabled at bootup:

 

rc-update add net.eth0 default (to start at bootup)

 

Set root password:

 

passwd (supply new password when prompted and confirm)

 

Edit keymaps for keyboard layout and set timezone correctly:

 

nano -w /etc/conf.d/keymaps
change KEYMAP to US, UK or whatever your keyboard layout is.

 

nano -w /etc/conf.d/clock
change CLOCK="UTC" to local if your hardware clock is not using UTC.

 

Install necessary system tools:

 

emerge syslog-ng
emerge vixie-cron
emerge slocate
emerge reiserfsprogs
emerge openssh (if you want to administer remotely)
emerge bind-tools

rc-update add syslog-ng default
rc-update add vixie-cron default
rc-update add sshd default (if you installed openssh)

 

Install grub as boot loader:

 

emerge grub

nano -w /boot/grub/grub.conf

 

if you used similar disk setups to me, then configure as below:

 

default 0
timeout 10
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title=Gentoo Linux 2.6.12-r6
root (hd0,1)
kernel /boot/kernel-2.6.12-gentoo-r6 root=/dev/hda2 video:vesafb:mtrr,ywrap,1024x768-32@60

 

Please note, that (hd0,1) relates to /dev/hda2 or /dev/sda2. hd0,0 is equal to /dev/hda1 or /dev/sda1. hd1,0 is equal to /dev/sdb1 or /dev/hdb1. This also applies when installing grub to the MBR as below.

 

Now we install grub:

 

cp /proc/mounts /etc/mtab
grub --no-floppy (this stops hardware probe for floppy, to stop problems occurring)
root (hd0,1)
setup (hd0)
quit

 

Now the system needs to be rebooted:

 

exit
cd /
umount /mnt/gentoo/proc /mnt/gentoo
reboot

 

After rebooting, login as root, and if you wish to add a user type:

 

useradd -m -G users,wheel -s /bin/bash admin (or your username)
passwd admin (set password when prompted)

 

It's important to make sure you update the portage tree. There are two commands for this:

 

emerge --sync
emerge-webrsync (for use if your firewall blocks rsync ports)

 

After this, I recommend a full system update with:

 

emerge --update --deep world

 

normal security updates are applied with emerge --update world

a system update is done with emerge --update --deep world

 

And that should have you running with a basic gentoo system. After this, if you want gnome or kde use one of:

 

emerge gnome

 

or

 

emerge kde

 

you'll need a fast internet connection for this, as there will be a lot of packages to download. And depending on link speed, and system speed, it could take a while to compile!!!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...