Jump to content
Sign in to follow this  
Thiseas

666 Lines On Installing Gentoo (Ver. 2)

Recommended Posts

====================================================================================================

================================[ 666 lines to Install Gentoo ]=====================================

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[ by Thiseas ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[Feb 15 2010]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-[revised @ Apr 24 2011]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

/////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

MESSAGE FROM THE AUTHOR:

THIS GUIDE WILL SHOW YOU HOW TO INSTALL A GENTOO DISTRIBUTION IN A VIRTUAL MACHINE (SUCH AS VMWARE).

I WRITE THIS USING THE LIVE ISO install-x86-minimal-20110419.iso

YOU CAN DOWNLOAD IT FROM HERE: http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/

I TEST IT ON A VMWARE WORKSTATION VERSION 7.x. I SUPPOSE THAT IT WILL WORK ON ANY VIRTUAL MACHINE

SOFTWARE SUCH AS VIRTUAL BOX, SANDBOX ETC.

THE DOCUMENT BELOW IS JUST A COPY/PASTE FROM THE ORIGINAL GENTOO DOCUMENTATION WITH SOME ADDITIONS

OF MINE, WRITTEN IN UPPER CASE LETTERS. I JUST TRY TO KEEP ONLY THE REQUIRED STEPS IN ORDER TO SET

UP THE ENVIRONMENT ON A x86 32bit BOX.

AFTER FINISHING THIS, YOU WILL HAVE A FULL WORKING TEXT MODE ENVIRONMENT.

THE PURPOSE OF WRITTING THIS IS THAT I WANT TO GIVE YOU A STRAIGHT FOWRWARD METHOD OF INSTALLING THE

BASIC GENTOO DISTRIBUTION. AFTER THIS, YOU CAN DO A LOT OF WORK TO DO BY YOURSELF. FOR EXAMPLE,

YOU CAN INSTALL THE X-WINDOW SYSTEM OF YOU CHOICE i.e. XFCE, KDE, GNOME etc.

YOUR ACTUAL READING (AFTER INSTALLING THE SYSTEM) SHOULD BE STARTED FROM HERE:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=12

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////////////////////////////////

->Partition Scheme

Partition Filesystem Size Description

-------------------------------------------------

/dev/sda1 ext2 32M Boot partition

/dev/sda2 (swap) 512M Swap partition

/dev/sda3 ext3 Rest Root partition

____________________________________________________________________________________________________

->Using fdisk:

# fdisk /dev/sda

The following parts explain how to create the example partition layout described

previously, namely:

 

Partition Description

---------------------------

/dev/sda1 Boot partition

/dev/sda2 Swap partition

/dev/sda3 Root partition

____________________________________________________________________________________________________

->Delete all existing partitions!! (warning - all data will be lost)

Command (m for help): d

Partition number (1-4): 1

 

REPEAT THE ABOVE FOR ALL ACTIVE PARTITION.

WARNNING ALL EXISTING DATA ON VM DISK WILL BE LOST!!!!

____________________________________________________________________________________________________

->Creating the Boot Partition

We first create a small boot partition. Type n to create a new partition, then p

to select a primary partition, followed by 1 to select the first primary

partition. When prompted for the first cylinder, hit enter. When prompted for

the last cylinder, type +32M to create a partition 32 Mbyte in size and set its

bootable flag.

____________________________________________________________________________________________________

->Creating the Swap Partition

Let's now create the swap partition. To do this, type n to create a new

partition, then p to tell fdisk that you want a primary partition. Then type 2

to create the second primary partition, /dev/sda2 in our case. When prompted for

the first cylinder, hit enter. When prompted for the last cylinder, type +512M

to create a partition 512MB in size. After you've done this, type t to set the

partition type, 2 to select the partition you just created and then type in 82

to set the partition type to "Linux Swap".

____________________________________________________________________________________________________

->Creating the Root Partition

Finally, let's create the root partition. To do this, type n to create a new

partition, then p to tell fdisk that you want a primary partition. Then type 3

to create the third primary partition, /dev/sda3 in our case. When prompted for

the first cylinder, hit enter. When prompted for the last cylinder, hit enter to

create a partition that takes up the rest of the remaining space on your disk.

After completing these steps, typing p should display a partition table that

looks similar to this:

 

Command (m for help): p

Disk /dev/sda: 30.0 GB, 30005821440 bytes

240 heads, 63 sectors/track, 3876 cylinders

Units = cylinders of 15120 * 512 = 7741440 bytes

 

Device Boot Start End Blocks Id System

/dev/sda1 * 1 14 105808+ 83 Linux

/dev/sda2 15 81 506520 82 Linux swap

/dev/sda3 82 3876 28690200 83 Linux

____________________________________________________________________________________________________

->Saving the Partition Layout

To save the partition layout and exit fdisk, type w.

Command (m for help): w

____________________________________________________________________________________________________

-> Creating Filesystems

Applying a filesystem on a partition

# mke2fs /dev/sda1

# mke2fs -j /dev/sda3

____________________________________________________________________________________________________

->Activating the Swap Partition

mkswap is the command that is used to initialize swap partitions:

-Creating a Swap signature

# mkswap /dev/sda2

-Activating the swap partition

# swapon /dev/sda2

____________________________________________________________________________________________________

->Mounting

Now that your partitions are initialized and are housing a filesystem, it is

time to mount those partitions. Use the mount command. Don't forget to create

the necessary mount directories for every partition you created. As an example

we mount the root and boot partition:

# mount /dev/sda3 /mnt/gentoo

# mkdir /mnt/gentoo/boot

# mount /dev/sda1 /mnt/gentoo/boot

____________________________________________________________________________________________________

->Place the Gentoo Installation Files on the partitions

Downloading the Stage Tarball

Go to the Gentoo mountpoint at which you mounted your filesystems (most likely

/mnt/gentoo):

# cd /mnt/gentoo

and

# links http://www.gentoo.org/main/en/mirrors.xml

FIND

GREECE

Gentoo.gr

Press enter and then select releases, then x86, then current-stage3

(a stage1 or stage2 tarball are not supported anymore).

 

Download the stage3-i686-.tar.bz2 stage3 archive (selecting it and press D).

____________________________________________________________________________________________________

->Unpacking the Stage Tarball

Now unpack your downloaded stage onto your system. We use tar to proceed as it

is the easiest method:

# tar xvjpf stage3-*.tar.bz2

Make sure that you use the same options (xvjpf). The x stands for Extract,

the v for Verbose to see what happens during the extraction process

(optional), the j for Decompress with bzip2, the p for Preserve permissions

and the f to denote that we want to extract a file, not standard input.

____________________________________________________________________________________________________

->Installing Portage

Go to

# links http://www.gentoo.org/main/en/mirrors.xml

Pick a mirror close to you and open the snapshots/ directory.

There, download the latest Portage snapshot (portage-latest.tar.bz2) by

selecting it and pressing D.

____________________________________________________________________________________________________

->Extracting the Portage snapshot

# tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr

____________________________________________________________________________________________________

->Configuring the Compile Options

# nano -w /mnt/gentoo/etc/make.conf

CFLAGS="-O2 -march=i686 -pipe"

# Use the same settings for both variables

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

 

When you define the CFLAGS and CXXFLAGS, you should combine several optimization

flags. The default values contained in the stage3 archive you unpacked should be

good enough. The following example is just an example:

With MAKEOPTS you define how many parallel compilations should occur when you

install a package. A good choice is the number of CPUs in your system plus one,

but this guideline isn't always perfect.

____________________________________________________________________________________________________

->Selecting mirrors to download the sources

 

In order to download source code quickly it is recommended to select a fast

mirror. Portage will look in your make.conf file for the GENTOO_MIRRORS

variable and use the mirrors listed therein.

 

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

 

Find your country and select it (pressing spacebar). It is advisable to select

all rows (i.e. mirrors) containing your country. Then, press enter to update

the /mnt/gentoo/etc/make.conf.

 

________________________________________________________________________________

->Synchronizing with the server

A second important setting is the SYNC setting in make.conf. This variable

contains the rsync server you want to use when updating your Portage tree

(the collection of ebuilds, scripts containing all the information Portage

needs to download and install software). Although you can manually enter a

SYNC server for yourself, mirrorselect can ease that operation for you:

 

# mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf

 

Find your country and select it (pressing spacebar) then press enter to update

the /mnt/gentoo/etc/make.conf.

 

After running mirrorselect it is adviseable to double-check the settings in

/mnt/gentoo/etc/make.conf !

____________________________________________________________________________________________________

->Copy DNS Info

One thing still remains to be done before we enter the new environment and that

is copying over the DNS information in /etc/resolv.conf. You need to do this to

ensure that networking still works even after entering the new environment.

/etc/resolv.conf contains the nameservers for your network.

 

# cp -L /etc/resolv.conf /mnt/gentoo/etc/

____________________________________________________________________________________________________

->Mounting the /proc and /dev Filesystems

Mount the /proc filesystem on /mnt/gentoo/proc to allow the installation to use

the kernel-provided information within the chrooted environment, and then mount-

bind the /dev filesystem.

To Mount /proc and /dev :

 

# mount -t proc none /mnt/gentoo/proc

# mount -o bind /dev /mnt/gentoo/dev

____________________________________________________________________________________________________

->Entering the new Environment

Now that all partitions are initialized and the base environment installed, it

is time to enter our new installation environment by chrooting into it. This

means that we change from the current installation environment (Installation CD

or other installation medium) to your installation system (namely the

initialized partitions).

This chrooting is done in three steps. First we will change the root from / (on

the installation medium) to /mnt/gentoo (on your partitions) using chroot. Then

we will create a new environment using env-update, which essentially creates

environment variables. Finally, we load those variables into memory using

source.

 

# chroot /mnt/gentoo /bin/bash

# env-update

>>> Regenerating /etc/ld.so.cache...

# source /etc/profile

# export PS1="(chroot) $PS1"

 

Congratulations! You are now inside your own Gentoo Linux environment. Of course

it is far from finished, which is why the installation still has some sections

left :-)

____________________________________________________________________________________________________

Configuring Portage

____________________________________________________________________________________________________

->Updating the Portage tree

You should now update your Portage tree to the latest version. emerge --sync

does this for you.

# emerge --sync

(If you're using a slow terminal like some framebuffers or a serial

console, you can add the --quiet option to speed up this process:)

# emerge --sync --quiet

____________________________________________________________________________________________________

->Choosing the Right Profile

First, a small definition is in place.

A profile is a building block for any Gentoo system. Not only does it specify

default values for USE, CFLAGS and other important variables, it also locks the

system to a certain range of package versions. This is all maintained by the

Gentoo developers.

You can see what profile you are currently using with the following command:

# eselect profile list

 

Available profile symlink targets:

[1] default/linux/x86/10.0 *

[2] default/linux/x86/10.0/desktop

[3] default/linux/x86/10.0/server

 

The default profile will provide you with a Linux 2.6-based system. This is the

recommended default, but you have the option of choosing another profile too.

There are also desktop and server subprofiles available for some architectures.

Running eselect profile list will show all available profiles.

After viewing the available profiles for your architecture, you can use a

different one if you wish:

# eselect profile set 2

____________________________________________________________________________________________________

->Configuring the USE variable

USE is one of the most powerful variables Gentoo provides to its users. Several

programs can be compiled with or without optional support for certain items. For

instance, some programs can be compiled with gtk-support, or with qt-support.

Others can be compiled with or without SSL support. Some programs can even be

compiled with framebuffer support (svgalib) instead of X11 support (X-server).

 

# nano -w /etc/make.conf

add

USE="-gtk -gnome qt3 qt4 kde dvd alsa cdr"

 

->Optional: glibc Locales

You will probably only use one or maybe two locales on your system. You can

specify locales you will need in /etc/locale.gen.

Opening /etc/locale.gen

# nano -w /etc/locale.gen

 

The following locales are an example to get both English (United States)

with the accompanying character formats (like UTF-8).

Specify your locales

en_US ISO-8859-1

en_US.UTF-8 UTF-8

 

Greek users can also add the folloowing lines:

el_GR ISO-8859-7

el_GR.UTF-8 UTF-8

____________________________________________________________________________________________________

->Configuring the Kernel

____________________________________________________________________________________________________

->Timezone

You first need to select your timezone so that your system knows where it is

located. Look for your timezone in /usr/share/zoneinfo, then copy it to

/etc/localtime. Please avoid the /usr/share/zoneinfo/Etc/GMT* timezones as their

names do not indicate the expected zones. For instance, GMT-8 is in fact GMT+8.

Setting the timezone information

# ls /usr/share/zoneinfo

# cp /usr/share/zoneinfo/Europe/Athens /etc/localtime

____________________________________________________________________________________________________

->Installing the Sources

->Choosing a Kernel

The core around which all distributions are built is the Linux kernel. It is the

layer between the user programs and your system hardware.

For x86-based systems we have gentoo-sources (kernel source patched for extra features).

Choose your kernel source and install it using emerge.

Installing a kernel source

# emerge gentoo-sources

 

Now it is time to configure and compile your kernel source. You can use

genkernel for this, which will build a generic kernel as used by the

Installation CD.

____________________________________________________________________________________________________

->Using genkernel

Now that your kernel source tree is installed, it's now time to compile your

kernel by using our genkernel script to automatically build a kernel for you.

genkernel works by configuring a kernel nearly identically to the way our

Installation CD kernel is configured. This means that when you use genkernel to

build your kernel, your system will generally detect all your hardware at boot-

time, just like our Installation CD does. Because genkernel doesn't require any

manual kernel configuration, it is an ideal solution for those users who may not

be comfortable compiling their own kernels.

Now, let's see how to use genkernel. First, emerge the genkernel ebuild:

# emerge genkernel

 

Next, copy over the kernel configuration used by the Installation CD to the

location where genkernel looks for the default kernel configuration:

Copying over the Installation CD kernel config

# zcat /proc/config.gz > /usr/share/genkernel/arch/x86/kernel-config

 

Now, compile your kernel sources by running genkernel all. Be aware though, as

genkernel compiles a kernel that supports almost all hardware, this compilation

will take quite a while to finish!

# genkernel all

 

Once genkernel completes, a kernel, full set of modules and initial root disk

(initrd) will be created. We will use the kernel and initrd when configuring a

boot loader later in this document. Write down the names of the kernel and

initrd as you will need it when writing the bootloader configuration file. The

initrd will be started immediately after booting to perform hardware

autodetection (just like on the Installation CD) before your "real" system

starts up.

 

Checking the created kernel image name and initrd

# ls /boot/kernel* /boot/initramfs*

/boot/kernel-genkernel-x86-2.6.36-gentoo-r8

/boot/initramfs-genkernel-x86-2.6.36-gentoo-r8

____________________________________________________________________________________________________

->7.e. Kernel Modules - NOT USED

Configuring the Modules

 

You should list the modules you want automatically loaded in

/etc/modules.autoload.d/kernel-2.6. You can add extra options to the modules too

if you want.

To view all available modules, run the following find command. Don't forget to

substitute "" with the version of the kernel you just compiled:

 

Viewing all available modules

# find /lib/modules// -type f -iname '*.o' -or -iname '*.ko' | less

 

For instance, to automatically load the 3c59x.ko module, edit the kernel-2.6

file and enter the module name in it.

Editing /etc/modules.autoload.d/kernel-2.6

# nano -w /etc/modules.autoload.d/kernel-2.6

3c59x

____________________________________________________________________________________________________

->Creating /etc/fstab

/etc/fstab uses a special syntax. Every line consists of six fields, separated

by whitespace (space(s), tabs or a mixture). Each field has its own meaning:

* The first field shows the partition described (the path to the device file)

* The second field shows the mount point at which the partition should be mounted

* The third field shows the filesystem used by the partition

* The fourth field shows the mount options used by mount when it wants to

mount the partition. As every filesystem has its own mount options, you are

encouraged to read the mount man page (man mount) for a full listing.

Multiple mount options are comma-separated.

* The fifth field is used by dump to determine if the partition needs to be

dumped or not. You can generally leave this as 0 (zero).

* The sixth field is used by fsck to determine the order in which

filesystems should be checked if the system wasn't shut down properly. The

root filesystem should have 1 while the rest should have 2 (or 0 if a

filesystem check isn't necessary).

 

Important: The default /etc/fstab file provided by Gentoo is not a valid fstab

file. You have to create your own /etc/fstab.

# nano -w /etc/fstab

 

Let us take a look at how we write down the options for the /boot partition.

This is just an example, if you didn't or couldn't create a /boot, don't copy

it.

In our default x86 partitioning example, /boot is usually the /dev/sda1

partition, with ext2 as filesystem. It needs to be checked during boot, so we

would write down:

An example /boot line for /etc/fstab

/dev/sda1 /boot ext2 defaults 1 2

 

Some users don't want their /boot partition to be mounted automatically to

improve their system's security. Those people should substitute defaults with

noauto. This does mean that you need to manually mount this partition every time

you want to use it.

Add the rules that match your partitioning scheme and append rules for your CD-

ROM drive(s), and of course, if you have other partitions or drives, for those

too.

Now use the example below to create your /etc/fstab:

A full /etc/fstab example

 

/dev/sda1 /boot ext2 defaults,noatime 1 2

/dev/sda2 none swap sw 0 0

/dev/sda3 / ext3 noatime 0 1

/dev/cdrom /mnt/cdrom auto noauto,user 0 0

proc /proc proc defaults 0 0

shm /dev/shm tmpfs nodev,nosuid,noexec 0 0

 

auto makes mount guess for the filesystem (recommended for removable media as

they can be created with one of many filesystems) and user makes it possible for

non-root users to mount the CD.

To improve performance, most users would want to add the noatime mount option,

which results in a faster system since access times aren't registered (you don't

need those generally anyway).

Double-check your /etc/fstab, save and quit to continue.

____________________________________________________________________________________________________

->8.b. Networking Information

____________________________________________________________________________________________________

->Host name, Domainname, etc

One of the choices the user has to make is name his/her PC. This seems to be

quite easy, but lots of users are having difficulties finding the appropriate

name for their Linux-pc. To speed things up, know that any name you choose can

be changed afterwards. For all we care, you can just call your system tux and

domain homenetwork.

 

Code Listing 2.1: Setting the host name

# nano -w /etc/conf.d/hostname

(Set the HOSTNAME variable to your host name)

HOSTNAME="tux"

 

____________________________________________________________________________________________________

->Configuring your Network

Before you get that "Hey, we've had that already"-feeling, you should remember

that the networking you set up in the beginning of the Gentoo installation was

just for the installation. Right now you are going to configure networking for

your Gentoo system permanently.

 

# nano -w /etc/conf.d/net

 

Add the folowing lines:

#Define your domain

dns_domain_lo="homenetwork"

 

#To use DHCP, define config_eth0:

#Automatically obtaining an IP address for eth0

config_eth0=( "dhcp" )

____________________________________________________________________________________________________

->Automatically Start Networking at Boot

To have your network interfaces activated at boot, you need to add them to the

default runlevel.

Code Listing 2.8: Adding net.eth0 to the default runlevel

# rc-update add net.eth0 default

 

____________________________________________________________________________________________________

->Writing Down Network Information

You now need to inform Linux about your network. This is defined in /etc/hosts

and helps in resolving host names to IP addresses for hosts that aren't resolved

by your nameserver. You need to define your system. You may also want to define

other systems on your network if you don't want to set up your own internal DNS

system.

 

Opening /etc/hosts

 

# nano -w /etc/hosts

 

Filling in the networking information

 

(This defines the current system)

127.0.0.1 tux.homenetwork tux localhost

 

(Define extra systems on your network,

they need to have a static IP to be defined this way.)

192.168.0.5 jenny.homenetwork jenny

192.168.0.6 benny.homenetwork benny

 

____________________________________________________________________________________________________

->System Information

 

Gentoo uses /etc/rc.conf for general, system-wide configuration. Open up

/etc/rc.conf and enjoy all the comments in that file :)

 

Code Listing 3.2: Opening /etc/rc.conf

 

# nano -w /etc/rc.conf

 

When you're finished configuring /etc/rc.conf, save and exit.

 

As you can see, this file is well commented to help you set up the necessary

configuration variables. You can configure your system to use unicode and define

your default editor and your display manager (like gdm or kdm).

 

Gentoo uses /etc/conf.d/keymaps to handle keyboard configuration. Edit it to

configure your keyboard.

 

Code Listing 3.3: Opening /etc/conf.d/keymaps

 

# nano -w /etc/conf.d/keymaps

 

Take special care with the KEYMAP variable. If you select the wrong KEYMAP, you

will get weird results when typing on your keyboard.

 

When you're finished configuring /etc/conf.d/keymaps, save and exit.

 

Gentoo uses /etc/conf.d/clock to set clock options. Edit it according to your needs.

 

Code Listing 3.4: Opening /etc/conf.d/clock

 

# nano -w /etc/conf.d/clock

 

If your hardware clock is not using UTC, you need to add CLOCK="local" to the

file. Otherwise you will notice some clock skew.

 

You should define the timezone that you previously copied to /etc/localtime so

that further upgrades of the sys-libs/timezone-data package can update

/etc/localtime automatically. For instance, if you used the GMT timezone, you

would add TIMEZONE="GMT"

 

When you're finished configuring /etc/conf.d/clock, save and exit.

 

For example you can set:

TIMEZONE="Europe/Athens"

 

____________________________________________________________________________________________________

->Installing Necessary System Tools

 

Installing a system logger

# emerge syslog-ng

# rc-update add syslog-ng default

 

Installing a cron daemon

# emerge vixie-cron

# rc-update add vixie-cron default

(Only if you have chosen dcron or fcron) # crontab /etc/crontab

 

____________________________________________________________________________________________________

->Networking Tools

If you don't require any additional networking-related tools

(such as ppp or a dhcp client) continue with Configuring the Bootloader.

 

Installing a DHCP Client

If you require Gentoo to automatically obtain an IP address for your network

interface(s), you need to install dhcpcd (or any other DHCP client -- see

Modular Networking for a list of available DHCP clients). If you don't do this

now, you might not be able to connect to the internet after the installation.

 

Installing dhcpcd

# emerge dhcpcd

 

____________________________________________________________________________________________________

->Configuring the Bootloader

(video=uvesafb:mtrr:3,ywrap,[email protected])

____________________________________________________________________________________________________

->Installing GRUB

To install GRUB, let's first emerge it:

Code Listing 2.1: Installing GRUB

# emerge grub

Although GRUB is now installed, we still need to write up a configuration file

for it and place GRUB in our MBR so that GRUB automatically boots your newly

created kernel. Create /boot/grub/grub.conf with nano (or, if applicable,

another editor):

 

Code Listing 2.2: Creating /boot/grub/grub.conf

# nano -w /boot/grub/grub.conf

 

default 0

timeout 30

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

 

title Gentoo Linux 2.6.31-r6

root (hd0,0)

kernel /boot/kernel-genkernel-x86-2.6.31-gentoo-r6 root=/dev/ram0 real_root=/dev/sda3

initrd /boot/initramfs-genkernel-x86-2.6.31-gentoo-r6

 

____________________________________________________________________________________________________

->Default: Setting up GRUB using grub-install

 

To install GRUB you will need to issue the grub-install command. However, grub-

install won't work off-the-shelf since we are inside a chrooted environment. We

need to create /etc/mtab which lists all mounted filesystems. Fortunately,

there is an easy way to accomplish this - just copy over /proc/mounts to

/etc/mtab, excluding the rootfs line if you haven't created a separate boot

partition. The following command will work in both cases:

 

Code Listing 2.5: Creating /etc/mtab

# grep -v rootfs /proc/mounts > /etc/mtab

 

Now we can install GRUB using grub-install:

Code Listing 2.6: Running grub-install

# grub-install --no-floppy /dev/sda

 

IGNORE ANY ERROR MESSAGE YOU GET FROM VIRTUAL MACHINE.

 

____________________________________________________________________________________________________

->Set the root password

 

# passwd

 

Enter two times the root password of your choice.

 

____________________________________________________________________________________________________

-> Rebooting the System

Exit the chrooted environment and unmount all mounted partitions. Then type in

that one magical command you have been waiting for: reboot.

 

Code Listing 4.1: Unmounting all partitions and rebooting

 

# exit

cdimage ~# cd

cdimage ~# umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo

cdimage ~# reboot

 

IN VIRTUAL MACHINE, PROPABLY YOU WILL GET SOME ERROR MESSAGES.

IGNORE THEM!

IF THE SYSTEM DOES NOT reboot TRY 'POWER OFF' VIRTULA MACHINE AND THEN 'POWER ON'.

THE SYSTEM WILL BOOT

ENTER AS root AND USE THE PASSWORD THAT YOU ENTER ABOVE (WHEN YOU USED THE 'passwd' COMMAND).

____________________________________________________________________________________________________

->User Administration

Adding a User for Daily Use

 

Working as root on a Unix/Linux system is dangerous and should be avoided as

much as possible. Therefore it is strongly recommended to add a user for day-to-

day use.

 

The groups the user is member of define what activities the user can perform.

The following table lists a number of important groups you might wish to use:

 

Group Description

------- ---------------------------------------------------------------------------

audio be able to access the audio devices

cdrom be able to directly access optical devices

floppy be able to directly access floppy devices

games be able to play games (NOT EXIST IN THE CURRENT INSTALLATION)

portage be able to use emerge --pretend as a normal user

usb be able to access USB devices

plugdev Be able to mount and use pluggable devices such as cameras and USB sticks

(NOT EXIST IN THE CURRENT INSTALLATION)

video be able to access video capturing hardware and doing hardware acceleration

wheel be able to use su

 

For instance, to create a user called john who is member of the wheel, users and

audio groups, log in as root first (only root can create users) and run useradd:

 

Adding a user for day-to-day use

Login: root

Password: (Your root password)

 

# useradd -m -G users,wheel,audio -s /bin/bash john

# passwd john

Password: (Enter the password for john)

Re-enter password: (Re-enter the password to verify)

 

If a user ever needs to perform some task as root, they can use su - to

temporarily receive root privileges. Another way is to use the sudo package

which is, if correctly configured, very secure.

____________________________________________________________________________________________________

->11.b. Disk Cleanup

Removing tarballs

Now that you've finished installing Gentoo and rebooted, if everything has gone

well, you can remove the downloaded stage3 tarball and Portage snapshot from

your hard disk. Remember that they were downloaded to your / directory.

 

Code Listing 2.1: Removing the stage3 tarball

# rm /stage3-*.tar.bz2*

Code Listing 2.2: Removing the Portage snapshot

# rm /portage-latest.tar.bz2*

 

Congratulations! You now have a working Gentoo system.

___________________________________________________________________________________________________

Share this post


Link to post
Share on other sites
Sign in to follow this  

×