Gentoo Linux

editor's picture

Gentoo Linux System Configuration

 

Overview

Gentoo is a highly configurable Linux meta distribution. The canonical website with documentation is at http://www.gentoo.org/

Here are the set of steps to follow to install and also the various configuration files


Gentoo installation

LiveCD boot options

boot: gentoo-nofb nofirewire noevms nolvm2 nox nosata nosmp nodmraid noapic acpi=off


"we are setting up a desktop environment on the laptop"

# check the harddisk
hdparm -tT /dev/hda

# enable DMA on the disk
hdparm -d 1 /dev/hda

# test and setup networking
net-setup eth0
dhcpcd    eth0


#setup the partition
/dev/hda1    256M    /boot    ext3      primary boot partition
/dev/hda2   2048M    swap     swap      primary
/dev/hda3   rest     /        reiserfs  root partition

# packages to install
emerge sys-fs/reiserfsprogs

# format the file systems
mkfs.ext3     /dev/hda1
mkfs.reiserfs /dev/hda3

mkswap /dev/hda2
swapon /dev/hda2

# mount the partitions
mount /dev/hda3   /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1  /mnt/gentoo/boot

# change dir
cd /mnt/gentoo

# download stage 3
# checksum
md5sum -c stage3-i686-2007.tar.bz2

tar jxf stage3-i686-2007.tar.bz2

# make sure you are in dir /mnt/gentoo
cd /mnt/gentoo

# download packaged portage.tar.bz2

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


# edit options
nano /mnt/gentoo/etc/make.conf

CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

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

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

# make sure that the entries above are fine

# mount filesystems
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev

# chroot the system
chroot /mnt/gentoo  /bin/bash

env-update

source /etc/profile

export PS1="(chroot) $PS1"

# update the portage tree IMPORTANT !
emerge --sync

# update portage
emerge portage
emerge gentoolkit

# check the profile
ls -FGg  /etc/make.profile

# USE flags
# check default USE settings in make.defaults
# override/add USE flags in /etc/make.conf

nano /etc/locale.gen

en_US        ISO-8859-1
en_US.UTF-8  UTF-8

locale-gen

# update the timezone information
ls /usr/share/zoneinfo
cp /usr/share/zoneinfo/GMT  /etc/localtime

# get tools
emerge pciutils
emerge gentoo-sources

# linux kernel build
cd /usr/src/linux
make menuconfig

make
make modules_install

cp arch/i386/boot/bzImage  /boot/kernel-2.6.23-gentoo-r3

ls /boot/kernel*

# kernel modules
find /lib/modules/2.6.23-gentoo-r3/ -type f -iname '*.o' -or -iname '*.ko'

# add any modules in the file
nano /etc/modules.autoload.d/kernel-2.6

# create fstab entry
nano /etc/fstab

/dev/hda1   /boot    ext3      defaults,noatime  1  2
/dev/hda2   none     swap      sw                0  0
/dev/hda3   /        reiserfs  noatime           0  1


# setup hostname
nano /etc/conf.d/hostname
HOSTNAME="matrix"

# issue string
nano /etc/issue
(delete strong .\O)

# configure networking

nano /etc/conf.d/net

config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"

rc-update  add net.eth0 default
rc-update  add sshd     default

nano /etc/hosts

# set root password
passwd


nano /etc/conf.d/keymaps
KEYMAPS="us"

nano /etc/conf.d/clock
CLOCK="local"

# get package
emerge dhcpcd

# emerge app-admin/logrotate (optional)

# get logger
emerge syslog-ng
rc-update add  syslog-ng  default

rc-update show

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

# make sure that mtab entry looks like

/dev/hda3  /             reiserfs  rw,noatime,notail         0 0
proc       /proc         proc      rw,nosuid,nodev,noexec    0 0
sysfs      /sys          sysfs     rw,nosuid,nodev,noexec    0 0
udev       /dev          tmpfs     rw,nosuid                 0 0
devpts     /dev/pts      devpts    rw,nosuid,mode=0620,gid=5 0 0
shm        /dev/shm      tmpfs     rw,noexec,nosuid,nodev    0 0
/dev/hda1  /boot         ext3      rw,noatime                0 0
usbfs      /proc/bus/usb usbfs     rw,noexec,nosuid,devmode=0664,devgid=85 0 0

(gid=5 means tty, verify it in /etc/group)


# grub setup and installation

# partition mapping to grub terminology

/dev/hda1 :: (hd0,0)  /boot
/dev/hda2 :: (hd0,1)  swap
/dev/hda3 :: (hd0,2)  /

# pull in the grub package
emerge grub

# create a grub.conf file
nano /boot/grub/grub.conf

default 0
timeout 10

title=gentoo 2.6.23-r3
root (hd0,0)
kernel /boot/kernel-2.6.23-gentoo-r3 root=/dev/hda3

# install grub
grub --no-floppy
 
 grub> root (hd0,0)
 grub> setup (hd0)
 grub> quit


# set the root passwd
passwd

# exit chrooted environment

exit

cd

umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo

reboot

(remove the bootable CD)

when the system comes up, you are now booted into your shiny new system.


# adding user accounts
useradd -m -G wheel,audio,cdrom,video,usb,users saifi
passwd saifi 


/etc/make.conf


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

CXXFLAGS="-O2 -march=i686 -pipe"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="i686-pc-linux-gnu"

# mmbsk
MAKEOPTS="-j2"

GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirror.datapipe.net/gentoo http://mirror.mcs.anl.gov/pub/gentoo/ "

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

## mmbsk
FEATURES="ccache parallel-fetch userfetch"

## mmbsk ccache
CCACHE_DIR="/var/tmp/ccache"
CCACHE_SIZE="5G"

## mmbsk for X11
INPUT_DEVICES="keyboard mouse synaptics"

## mmbsk
##USE="X kde sdl kdeenablefinal yahoo irc midi alsa nptl -gnome -arts jpeg png svg tiff xpm gif truetype fontconfig opengl wmf xml zlib nsplugin postgres doc sqlite3 mysql tcl tk threads qt3 gtk emacs"

USE="X kde qt4 sdl yahoo irc midi alsa nptl -gnome -arts jpeg png svg tiff xpm gif truetype fontconfig opengl wmf xml zlib nsplugin postgres sqlite3 mysql tcl tk threads emacs mailwrapper"

## you may need to remove USE gtk doc in some cases.

## mmbsk for KDE
LINGUAS="en"

## mmbsk
VIDEO_CARDS="i810 v4l vesa vga"
 


Portage configuration settings for the various packages.

/etc/portage/package.keywords

sys-devel/gcc ~x86
sys-apps/915resolution ~x86
net-wireless/bcm43xx-fwcutter ~x86
mail-mta/ssmtp ~x86
app-office/taskjuggler ~x86
media-gfx/graphviz ~x86
 


 

/etc/portage/package.use

dev-lang/python                 tk
app-editors/jasspa-microemacs      nanoemacs docs
app-editors/emacs                  -xpm -alsa doc
app-editors/vim                    -acl -gpm -nls -perl -python cscope ctags
dev-util/cscope                    emacs
app-emulation/qemu-softmmu         kqemu alsa sdl
sys-devel/gcc                      -fortran
media-libs/libsdl                  xv opengl X
dev-lang/erlang                    doc emacs hipe kpoll odbc smp tk java
www-client/elinks                  -gpm -ipv6 -perl
dev-java/sun-jdk                   odbc examples nsplugin
media-video/mplayer                win32codecs quicktime mmx mmxext sse sse2 ssse3 3dnow 3dnowext a52 dts dvd aalib libcaca directfb fbcon svga X opengl sdl xv aac live mp3 quicktime real theora vorbis v4l v4l2 rtc dvb alsa amrnb amrwb x264 xanim xvid encode
app-crypt/pinentry                 qt4
app-text/poppler-bindings          qt4
x11-base/xorg-x11                  v4l dri sdl
x11-base/xorg-server        kdrive
x11-libs/qt:3                      opengl
x11-libs/qt:4                      examples odbc mng
x11-libs/cairo                     directfb test glitz xcb
media-gfx/imagemagick              X bzip2 perl zlib djvu doc fontconfig fpx graphviz gs hdri jbig jpeg jpeg2k lcms nocxx openexr png q32 q8 svg tiff truetype wmf xml
dev-util/kdevelop                  -fortran perl -python cvs haskell java php ruby sql subversion
media-libs/gd                      fontconfig jpeg png truetype xpm
media-gfx/graphviz                 jpeg nls perl png python -doc examples -gnome -gtk java ruby tcl tk
app-text/djvu                      qt4 threads
dev-db/postgresql                  pg-intdatetime test
dev-db/libpq                       pg-intdatetime test
dev-lang/swig                      tcl
mail-filter/procmail               mbox -selinux
x11-themes/gtk-engines-qtcurve     mozilla
app-emacs/emacs-jabber             sasl
dev-lang/gprolog                   doc examples
app-office/openoffice-bin          java
app-emulation/wine                 samba
net-wireless/ndiswrapper           usb
net-im/skype                       qt-static
media-gfx/gwenview                 -doc
media-gfx/exiv2                    -doc
sys-apps/qtparted                  jfs ntfs reiserfs xfs
media-gfx/inkscape                 inkjar lcms mmx postscript
www-client/opera                   qt-static
sys-fs/fuse                        doc
media-sound/audacity               flac mp3 vorbis id3tag ladspa libsamplerate soundtouch twolame
dev-util/git                       curl cvs subversion
app-misc/freemind -doc
dev-lang/php                       berkdb bzip2 cli crypt doc gdbm iconv ipv6 mysql ncurses nls pcre postgres readline reflection session spl ssl threads truetype unicode xml xpm zlib apache2 bcmath calendar cgi ctype curl curlwrappers filter flatfile ftp gd hash inifile json mhash odbc pcntl pdo sharedext simplexml soap sockets sqlite tidy tokenizer wddx xmlreader xmlrpc xmlwriter xsl yaz zip
app-editors/scite                  lua
mail-mta/qmail                  mailwrapper
dev-util/strace            aio
app-text/opensp            -nls -doc
net-analyzer/nmap        lua -gtk doc
kde-base/krec            encode vorbis mp3
kde-base/arts             mp3
media-libs/flac         -doc ogg sse
x11-misc/xvidcap         -doc
media-libs/libtheora        encode
dev-python/pyqt         -doc
media-sound/mp3splt             vorbis
x11-libs/wxGTK                     unicode
net-p2p/amule                      nls gtk -stats remote upnp unicode
net-analyzer/wireshark             gtk
app-text/kchmviewer        gif
dev-libs/chmlib            gif
mail-filter/spamassassin sqlite qmail tools doc
net-irc/ircii -ipv6
dev-libs/boost doc debug tools
dev-lang/swi-prolog debug doc java odbc
media-video/ffmpeg a52 aac amr encode mmx ogg theora v4l vorbis x264 xvid test
dev-util/mercurial bash-completion cvs darcs git gpg subversion
media-libs/sdl-mixer mikmod mp3 vorbis
net-analyzer/snort dynamicplugin flexresp flexresp2 gre inline perfprofiling prelude reach snortsam timestats react sguil
net-firewall/iptables extensions
media-gfx/pstoedit    plotutils
 


 

Comments

Post new comment

CAPTCHA
Thank you for using Captcha to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.