Inhaltsverzeichnis

clerie's Gentoo install Guide

Konzept

Partitionierung

/boot/efi 512MB mkfs.fat -F 32
/boot 1G mkfs.ext4
lvm / 25GB
swap RAM+2GB
/home 100%FREE

Krypto

cryptsetup luksFormat -c aes-xts-plain64 –hash sha256 -s 256 /dev/nvme0n1p3

LVM

cryptsetup luksOpen /dev/nvme0n1p3 lvm

pvcreate /dev/mapper/lvm

vgcreate vg0 /dev/mapper/lvm

lvcreate -L50G -n root vg0

lvcreate -L18G -n swap vg0

lvcreate -l 100%FREE -n home vg0

mkfs.ext4 /dev/mapper/vg0-root

mkswap /dev/mapper/vg0-swap swapon /dev/mapper/vg0-swap

mkfs.ext4 /dev/mapper/vg0-home

Partitionen einhängen

mkdir /mnt/gentoo

mount /dev/mapper/vg0-root /mnt/gentoo

mkdir /mnt/gentoo/home

mount /dev/mapper/vg0-home /mnt/gentoo/home

mkdir /mnt/gentoo/boot

mount /dev/nvme0n1p2 /mnt/gentoo/boot

mkdir /mnt/gentoo/boot/efi

mount /mnt/nvme0n1p1 /mnt/gentoo/boot/efi

cd /etc/gentoo

Gentoo laden

wget https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/releases/amd64/autobuilds/current-stage3-amd64/stage3-amd64-20200722T214503Z.tar.xz

https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/

tar xvf stage3-amd64-20200722T214503Z.tar.xz –xattrs –numeric-owner

Repos konfigurieren

mkdir etc/portage/repos.conf

cp usr/share/portage/config/repos.conf etc/portage/repos.conf/gentoo.conf

chroot vorbereiten

cp /etc/resolv.conf etc/resolv.conf

mount -t proc /proc proc mount –rbind /sys sys mount –make-rslave sys mount –rbin /dev dev mount –make-rslave dev

chrooten

chroot /mnt/gentoo /bin/bash

source /etc/profile

export PS1=„(chroot) $PS1“

Portage konfiguieren

/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C

MAKEOPTS="-j5"

GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo https://linux.rz.ruhr-uni-bochum.de/do
wnload/gentoo-mirror/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ https://ftp.halifax.
rwth-aachen.de/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/ ftp://ftp.halifax.rwth-aachen.de/gen
too/ rsync://ftp.halifax.rwth-aachen.de/gentoo/ https://ftp.fau.de/gentoo http://ftp.fau.de/gentoo ft
p://ftp.fau.de/gentoo rsync://ftp.fau.de/gentoo https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ 
http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo
/ rsync://ftp-stud.hs-esslingen.de/gentoo/"

USE=""

EMERGE_DEFAULT_OPTS="--ask --tree --quiet --verbose"

VIDEO_CARDS="intel"
INPUT_DEVICES="libinput"

Portage Dateien laden

emerge-webrsync

Profil wählen

eselect profile set „default/linux/amd64/17.1/desktop/gnome“

Locales setzen

/etc/conf.d/keymaps
keymap="de-latin1"

echo „Europe/Berlin“ > /etc/timezone

emerge –config sys-libs/timezone-data

/etc/locale.gen
en_GB ISO-8859-1
en_GB.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE.UTF-8 UTF-8

locale-gen

eselect locale list

eselect locale set X

env-update && source /etc/profile

PS1=„(chroot) $PS1“

fstab konfigurieren

blkid

/etc/fstab
UUID="FDE1-7057" /boot/efi vfat noauto,noatime 0 2
UUID="e8fb3fec-568b-45f5-879d-d19c34064940" /boot ext4 defaults 0 2
UUID="ea605252-8052-479a-a138-db0a5183de0c" / ext4 defaults 0 1
UUID="a994233d-d063-4340-a174-a0600e62151d" /home ext4 defaults 0 1
UUID="28e5ee39-6d32-46ea-82b7-b84768ad8d47" none swap sw 0 0

Genkernel und Grub

Kernel Sources laden

emerge sys-kernel/gentoo-sources emerge sys-kernel/genkernel emerge sys-fs/cryptsetup

Kernel bauen

genkernel –luks –lvm –no-zfs all

Grub bauen

echo „sys-boot/grub:2 device-mapper“ » /etc/portage/package.use/sys-boot

emerge sys-boot/grub

Grub konfigurieren

/etc/default/grub
GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID=4b9f9fb1-d23d-4344-bc8b-aabf7ec626a9 root=/dev/mapper/vg0-r
oot"

grub-install –target=x86_64-efi –efi-directory=/boot/efi

grub-mkconfig -o /boot/grub/grub.cfg

DIY Kernel

Kernel Konfig