postup inštalácie odvodený z oficiálnej dokumentácie https://wiki.gentoo.org/wiki/Handbook:AMD64
#nabootovať minimal CD
# zmeniť heslo roota
passwd
# povoliť root login cez ssh
nano /etc/ssh/sshd_config
PermitRootlogin yes
# aktivovať sshd
/etc/init.d/sshd start
# pokračovať z iného počítača
ssh root@livecd
# otestovať sieť
ping www.gentoo.org
# partitioning
parted -a optimal /dev/sda
# GPT - pozor, všetko bude vymazané
mklabel gpt
# megabajt ako jednotka zadávania kapacity
unit mib
# partition pre Grub2 boot loader (2MB)
mkpart primary 1 3
name 1 grub
set 1 bios_grub on
# boot partition (128MB)
mkpart primary 3 131
name 2 boot
# swap partition (2x toľko čo RAM - tu 8GB)
mkpart primary 131 8323
name 3 swap
# root - zvyšok disku
mkpart primary 8323 -1
name 4 rootfs
# kontrola vytvorených partitions
print
quit
# vytvorenie filesystems
# grub
mke2fs -j -T small /dev/sda1
# boot
mke2fs -j -T small /dev/sda2
# root
mkfs.ext4 /dev/sda4
# swap
mkswap /dev/sda3
swapon /dev/sda3
# namountovať vytvorené fs
mount /dev/nvme0n1p4 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda2 /mnt/gentoo/boot
# skontrolovať presný čas
date
# stiahnuť stage3
cd /mnt/gentoo
links https://www.gentoo.org/downloads/mirrors/
# overiť integritu stiahnutého stage3
gpg --verify stage3-...DIGESTS.asc
gpg --recv-keys ...
gpg --verify stage3-...DIGESTS.asc
# rozbaliť stage3
tar xvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner
# upraviť make.conf
nano -w /mnt/gentoo/etc/portage/make.conf
#
# nastaviť: CFLAGS="-march=native -O2 -pipe"
# doplniť počet jadier: MAKEOPTS="-j4"
# vybrať mirror pre budúce downloads zdrojov
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
mkdir /mnt/gentoo/etc/portage/repos.conf
cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
emerge-webrsync
emerge --sync
eselect profile list
# zmeniť profil
eselect profile set 2
emerge --ask --update --deep --newuse @world
ls /usr/share/zoneinfo
echo "Europe/Bratislava" > /etc/timezone
emerge --config sys-libs/timezone-data
nano -w /etc/locale.gen
# odkomentovať en_US UTF-8
# doplniť sk_SK UTF-8
locale-gen
eselect locale list
eselect locale set 7
env-update && source /etc/profile && export PS1="(chroot) $PS1"
emerge --ask sys-kernel/gentoo-sources
ls -l /usr/src/linux
# manual kernel configuration
emerge --ask sys-apps/pciutils
# lspci
cd /usr/src/linux
make menuconfig
# nakonfigurovanie kernelu
# kompilácia kernelu
make && make modules_install
make install
emerge --ask sys-kernel/genkernel
genkernel --install initramfs
# automat. kernel configuration
emerge --ask sys-kernel/genkernel
nano -w /etc/fstab
# odkomentárovať boot partition
/dev/sda2 /boot ext2 defaults 0 2
genkernel all
# kontrola nainštalovania kernelu a initramfs
ls /boot/*
# Configuring the modules
# List the modules that need to be loaded automatically in /etc/conf.d/modules
# To view all available modules, run the following find command
find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko' | less
# to automatically load the 3c59x.ko module (which is the driver for a specific 3Com network card family), edit the /etc/conf.d/modules file and enter the module name in it.
nano -w /etc/conf.d/modules
modules="3c59x"
#Optional: Installing firmware
emerge --ask sys-kernel/linux-firmware
nano -w /etc/fstab
# example:
/dev/sda2 /boot ext3 defaults,noatime 0 2
/dev/sda3 none swap sw 0 0
/dev/sda4 / ext4 noatime,discard 0 1
/dev/cdrom /mnt/cdrom auto noauto,user 0 0
# (iba) hostname
nano -w /etc/conf.d/hostname
nano -w /etc/conf.d/net
dns_domain_lo="homenetwork.sk"
# Configuring the network
# All networking information is gathered in /etc/conf.d/net
# A fully commented example that covers many different configurations is available in /usr/share/doc/netifrc-*/net.example.bz2.
# optional
emerge --ask --noreplace net-misc/netifrc
# wlp3s0 Centrio Wireless-N 1000 BGN
# enp0s25 82577LM
nano -w /etc/conf.d/net
config_eth0="dhcp"
Static IP:
config_eth0="192.168.1.20 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"
DHCP:
config_eth0="dhcp"
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default
nano -w /etc/hosts
127.0.0.1 tux.homenetwork.sk tux localhost
passwd
ls /usr/share/keymaps /...
nano -w /etc/conf.d/keymaps
# sk-qwertz
nano -w /etc/conf.d/hwclock
clock="local"
# system logger
emerge --ask app-admin/sysklogd
rc-update add sysklogd default
# cron daemon
emerge --ask sys-process/cronie
rc-update add cronie default
crontab /etc/crontab
# Optional: File indexing
emerge --ask sys-apps/mlocate
# Optional: Remote access
rc-update add sshd default
emerge --ask net-misc/dhcpcd
# When using BIOS
emerge --ask sys-boot/grub:2
grub-install /dev/sda
# When using UEFI
echo GRUB_PLATFORMS="efi-64" >> /etc/portage/make.conf
emerge --ask sys-boot/grub:2
grub2-install --target=x86_64-efi --efi-directory=/boot
# ak nastane chyba:
# Installing for x86_64-efi platform.
# Could not prepare Boot variable: Read-only file system
# Installation finished. No error reported.
# tak toto:
mount -o remount,rw /sys/firmware/efi/efivars
grub-mkconfig -o /boot/grub/grub.cfg
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -R /mnt/gentoo
reboot
# možno bude treba znova povoliť root login cez ssh
nano /etc/ssh/sshd_config
PermitRootlogin yes
service sshd restart
# ak je (v prípade virtuálu) príliš pomalý nábeh sshd
# (malá entropia, dlhý nábeh - inicializácia crng - až 240 sekúnd)
emerge --ask sys-apps/haveged
rc-update add haveged default
# zmazanie nepotrebných stage súborov
#
rm /stage3-*
# tešiť sa z novonainštalovaného gentoo