Gentoo from LiveDVD

Step 1: Download Gentoo DVD Image and Prepare Network

sudo su -

Static IP

ifconfig eth0 192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0 up
route add default gw 192.168.1.1
nano /etc/resolv.conf

nameserver 192.168.1.1
nameserver 8.8.8.8

Step 2: Create Disk Partitions and Filesystems

/dev/sda1 - 20M size – unformatted = BIOS boot partition /dev/sda2 – 500M size – ext2 filesystem = Boot partition /dev/sda3 - 1000M size – Swap = Swap partition /dev/sda4 - rest of space – ext4 filesystem = Root Partition

parted -a optimal /dev/sda
mklabel gpt
unit MB
mkpart primary 1 20
name 1 grub
set 1 bios_grub on
mkpart primary 21 500
name 2 boot
mkpart primary 501 1501
name 3 swap
mkpart primary 1502 -1
name 4 root
print
quit

mkfs.ext2 /dev/sda2
mkfs.ext4 /dev/sda4
mkswap /dev/sda3
swapon /dev/sda3

MBR:

parted -a optimal /dev/sda
mklabel msdos
unit MB
mkpart primary 1 500
set 1 boot on
mkpart primary 501 1501
mkpart primary 1502 -1
print
quit

mkfs.ext2 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2
swapon /dev/sda2

Step 3: Download and extract Gentoo Stage 3 Tarball

stage3-cpu-architecure-release-date.tar.bz2.

date MMDDhhmmYYYY ##(Month, Day, hour, minute and Year) cd /mnt/gentoo

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

tar xvjpf stage3-amb64-20140522.tar.bz2

Step 4: Configure Gentoo Installation

nano /mnt/gentoo/etc/portage/make.conf

CFLAGS="-O2  -pipe" 

Use the same settings for both variables

CXXFLAGS="${CFLAGS}"

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

nano /mnt/gentoo/etc/portage/make.conf
cp -L /etc/resolv.conf /mnt/gentoo/etc/

Step 5: Installing Gentoo

mount -t proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1" 

mkdir /usr/portage
emerge-webrsync

eselect profile list
eselect profile set 6   ## For KDE

ls /usr/share/zoneinfo
cp /usr/share/zoneinfo/Europe/Kiev /etc/localtime
echo "Europe/Kiev" > /etc/timezone

nano  /etc/locale.gen
#Uncomment your system locales.

locale-gen
env-update && source /etc/profile

Step 6: Installing Linux Kernel

emerge gentoo-sources
ls -l /usr/src/linux

emerge genkernel
genkernel all

Step 7: Other System Configurations

nano /etc/fstab

/dev/sda2 /boot ext2 defaults,noatime 0 2 /dev/sda4 / ext4 noatime 0 1 /dev/sda3 none swap sw 0 0

hostname

emerge dhcpcd
rc-update add dhcpcd default

emerge virtual/ssh
emerge syslog-ng
emerge cronie
emerge mlocate
rc-update add sshd default
rc-update add syslog-ng default
rc-update add cronie default

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

passwd
useradd -m -G users,wheel,audio,lp,cdrom,portage,cron -s /bin/bash phx
passwd phx

emerge sudo

Edit /etc/sudoers file and uncomment the %wheel group like in the screenshot below.

Step 8: Install System Boot Loader

emerge sys-boot/grub
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg

Done

exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/boot,/proc,}
reboot
  1. rm /stage3-*.tar.bz2
  2. emerge --sync