deso

Gentoo > Install with encryption and hibernation

Specs

Format disk

doas parted -a optimal --script /dev/sdc -- \
    mklabel gpt \
    unit mib \
    mkpart primary 1 512 \
    name 1 work_efi \
    set 1 boot on \
    mkpart primary 512 -1 \
    name 2 work_rootfs

Encrypt

doas cryptsetup -y -v luksFormat /dev/sdc2
doas cryptsetup open /dev/sdc2 root

Format partitions

doas mkfs.fat -F 32 /dev/sdc1
doas mkfs.ext4 /dev/mapper/root

Mount partitions

doas mount /dev/mapper/root /mnt/gentoo
doas mkdir -p /mnt/gentoo/boot
doas mount /dev/sdc1 /mnt/gentoo/boot

Download stage3

cd /mnt/gentoo
stage3=$(curl -sSf https://ftp.halifax.rwth-aachen.de/gentoo/releases/amd64/autobuilds/latest-stage3-amd64-desktop-systemd.txt | tail -1 | cut -d " " -f1)
doas wget "http://ftp.halifax.rwth-aachen.de/gentoo/releases/amd64/autobuilds/$stage3"
doas tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner
doas mkdir -p /mnt/gentoo/etc/portage/repos.conf
doas cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

Enter chroot

doas mount --types proc /proc /mnt/gentoo/proc
doas mount --rbind /sys /mnt/gentoo/sys
doas mount --make-rslave /mnt/gentoo/sys
doas mount --rbind /dev /mnt/gentoo/dev
doas mount --make-rslave /mnt/gentoo/dev
doas chroot /mnt/gentoo /bin/bash

source /etc/profile
export PS1="(chroot) ${PS1}"
passwd
cat <<EOF > /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="-O2 -march=znver2 -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="-j30"
GENTOO_MIRRORS="https://ftp.halifax.rwth-aachen.de/gentoo/"
ACCEPT_LICENSE="*"
VIDEO_CARDS="amdgpu radeonsi"
INPUT_DEVICES="libinput"
USE="X screencast -modemmanager -bluetooth"
PORTAGE_NICENESS="19"
EOF
emerge-webrsync
eselect news read
ln -sf ../usr/share/zoneinfo/Europe/Berlin /etc/localtime
cat <<EOF > /etc/locale.gen
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
EOF
locale-gen
emerge --ask --quiet-build \
  sys-kernel/gentoo-kernel-bin \
  sys-boot/efibootmgr \
  sys-kernel/dracut \
  sys-boot/refind \
  sys-power/suspend

syste,d cryptsetup use flag firmware network machine-id setup

XXXX
fallocate -l 64GiB swapfile
chmod 600 swapfile
mkswap swapfile
swapon swapfile
XXXX
cat <<EOF > /etc/fstb
/dev/mapper/root        /               ext4 defaults 0 1
PARTLABEL=work_efi      /boot           vfat defaults 0 2
EOF
exit
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -R /mnt/gentoo
mkdir -p /etc/modprobe.d
cat <<EOF > /etc/modprobe.d/blacklist
iwlmvm
iwlwifi
EOF

https://wiki.archlinux.org/title/AMDGPU#Screen_artifacts_and_frequency_problem

cat <<EOF > /etc/udev/rules.d/30-amdgpu-pm.rules
KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="high"
EOF
emerge -j 4  x11-base/xorg-server st dwm sxhkd mpd firefox-bin rust-bin neovim xinit
 * # rc-update add qemu-binfmt
  * For systemd:
   * # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf

TODOS:

22:00 07.12.2022