Skip to content

gentoo install

BHN edited this page Jun 30, 2017 · 50 revisions

gentoo install

installation notes for gentoo OS

systemd, lvm, uefi

notes

  • official gentoo handbook
    • read thoroughly!
    • reference for everything gentoo!
  • this setup is for my personal desktop & laptop
    • /etc/**, /usr/**, /boot/**
      • if you decide to copy everything
        • you'll want to step through all config files and make any necessary adjustments
    • there are install steps not explicitly stated
    • your system configuration may require other steps
    • again, always reference the official gentoo handbook

prep

  1. boot system rescue cd in efi mode
  2. connect to network
    • $ nmtui
  3. manually set date time
    • $ date MMDDHHMMYYYY
    • I use tlsdate to auto update time, the package is installed in a later step
  4. download stage-3 tarball (current-stage3-amd64-systemd)
  5. verify stage-3 tarball integrity
    • $ openssl dgst -r -sha512 stage-3.tar.bz2
    • $ openssl dgst -r -whirlpool stage-3.tar.bz2
    • $ gpg --verify stage3.bz2.DIGESTS.asc
      • may need to import gpg key
  6. prepare drives
    • create a 101MB (or 200MB) fat32 partition for uefi boot
    • setup lvm vg for gentoo, and then root & home lv's (SSD's)
      • $ vgcreate gentoovg /dev/sdx
      • $ lvcreate -L 227G gentoovg -n homelv /dev/sdxx
        • i just take 100% size and subtract about 15G for a cache
      • $ lvcreate --type cache --cachemode writethrough -L 15G -n homelv_cachepool gentoovg/homelv /dev/sdx
      • $ lvcreate -L 227G gentoovg -n rootlv /dev/sdxx
      • $ lvcreate --type cache --cachemode writethrough -L 15G -n rootlv_cachepool gentoovg/rootlv /dev/sdx
    • setup var, tmp partitions (spindles eat r/w costs for builds)
  7. mount root to /mnt/gentoo
    • create & mount any secondary drives
      • i.e. var, tmp, home, ...
  8. unpack stage3 tarball
    • $ tar xjf ... --xattrs --numeric-owner -C /mnt/gentoo
  9. copy system config
    • $ wget https://github.com/borysn/dotfiles/archive/master.zip
    • $ cp -rf dotfiles-master/os/gentoo/desktop/** /mnt/gentoo
    • ignore any overlay errors for now
  10. unmount all drives using unmount script
    • $ ./mountgentoodrivesu

install

  1. remount all drives using mount script
    • $ ./mountgentoodrives
  2. chroot into gentoo install
    • $ chroot /mnt/gentoo /bin/bash
  3. check date/time is correct
  4. set hardware clock to utc
    • $ hwclock --systohc --utc
  5. config locale
    • $ nano -w /etc/locale.gen
      • uncomment en_US.UTF-8 UTF-8
    • generate locale
      • $ locale-gen
    • $ eselect locale list
      • select en_US.utf8
  6. update portage
    • sync
      • $ emerge-webrsync && emerge --sync --quiet
    • create /usr/portage/distfiles dir
      • copy jdk/jre tars (if necessary)
        • used for oracle-(jdk/jre)-bin install
  7. config timezone
    • `$ echo "America/Chicago" > /etc/timezone
    • $ emerge --config sys-libs/timezone-data
  8. initial world update for systemd
    • $ emerge -a --update --deep --with-bdeps=y --newuse @world
  9. install some packages to aide in installation process
    1. $ emerge neovim bash-completion
    • if receiving an error saying /usr/bin: file not recognized: Is a directory
      • $ unset path && source /etc/profile
  10. building the kernel
    • install gentoo sources & pciutils
      • $ emerge gentoo-sources pciutils
    • copy kernel config
    • build kernel
      • first save moved config
        • $ make menuconfig
        • load .config file
        • save & exit
      • $ make && make modules_install && make install
  11. download oracle jdk/jre
    • wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz -P /usr/portage/distfiles
    • wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jre-8u131-linux-x64.tar.gz -P /usr/portage/distfiles
  12. install required system applications/libraries
    • sysapplist
    • $ emerge -a $(< sysapplist)
      • nvidia notes
        • $ eselect opengl set nvidia
        • $ eselect opencl set nvidia
    • eprl
      • use if packages break and you want to remove items from $ emerge --resume list
  13. enable any required services
    • $ systemctl enable ...<tab list>...
  14. generate initramfs
    • install genkernel-next
    • $ genkernel --install initramfs
  15. bootloader
    • $ bootctl install
  16. intel microcode
    • $ emerge -a intel-microcode iucode_tool
    • $ ucode_tool -S --write-earlyfw=/boot/intelucode /lib/firmware/intel-ucode/*
  17. set root password
    • $ passwd
  18. add user
    • create group dev
      • $ groupadd dev
    • $ useradd -M -d /home/USERNAME -U -G dev,wheel,video,audio,docker,input,plugdev,systemd-journal,portage,docker -s /bin/zsh USERNAME
      • the above command implies you already have your home dir stored somewhere
    • set passwd
      • $ passwd USERNAME
  19. wrap up

post install

  1. set nvim as system editor
    • $ eselect editor set nvim
    • $ eselect vi set nvim
  2. fonts
    • a pain to get, so i stored them, don't sue me, is it ok?
  3. add overlays
    • $ emerge layman
    • $ layman -a ...
      • 0x4d4c betagarden dotnet fkmclane hossie petkovich steam-overlay vifino-overlay
      • check /etc/portage/repos.conf/*.conf files, and enable auto sync
  4. install required user applications/libraries
    • userapplist
      • $ emerge -a $(< userapplist)
    • eprl
      • use if packages break and you want to remove items from $ emerge --resume list

troubleshooting

things will break, use tools/docs/forums/google/irc to fix them!

  1. dmesg is great for investigating kernel/hardware issues
    • $ dmesg | grep -i error
    • $ dmesg | grep -i fail
  2. journalctl is great for investigating systemd services
    • $ journalctl -xe
  3. /var/log and cat
    • $ cd /var/log && cat ./* | less
      • all the logs!
  4. Linux debugging tools you'll love!
    • great article by Julia Evans

questions, comments, concerns?

probably want to head on over to the official gentoo handbook

Clone this wiki locally