Skip to content

gentoo install

BHN edited this page May 31, 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. (optional) install git
    • $ emerge --sync
    • $ emerge -a dev-vcs/git
  4. manually set date time
    • $ date MMDDHHMMYYYY
    • I use tlsdate to auto update time, the package is installed in a later step
  5. download stage-3 tarball (current-stage3-amd64-systemd)
  6. 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
  7. prepare drives
    • setup lvm vg for gentoo, and then root & home lv's (SSD's)
    • setup var, tmp partitions (spindles eat r/w costs for builds)
  8. mount root to /mnt/gentoo
    • create & mount any secondary drives
      • i.e. var, tmp, home, ...
  9. unpack stage3 tarball
    • $ tar xjf ... --xattrs --numeric-owner -C /mnt/gentoo
  10. copy system config
    • os/gentoo/desktop/etc/**
    • can remove portage postsync eix script file for now
    • ignore any overlay errors for now
  11. 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. config timezone
    • `$ echo "America/Chicago" > /etc/timezone
    • $ emerge --config sys-libs/timezone-data
  7. 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 -j9 -l8 && make modules_install && make install
  8. 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
  9. initial world update for systemd
    • $ emerge -a --update --deep --with-bdeps=y --newuse @world
  10. 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
  11. 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
  12. enable any required services
    • $ systemctl enable ...<tab list>...
  13. generate initramfs
    • install genkernel-next
    • $ genkernel --install initramfs
  14. bootloader
    • first unmerge systemd & emerge systemd-boot
    • $ bootctl install
    • unmerge systemd-boot & emerge systemd
  15. set root password
    • $ passwd
  16. 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
  17. wrap up

post install

  1. fonts
    • a pain to get, so i stored them, don't sue me, is it ok?
  2. 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
  3. install required user applications/libraries
    • userapplist
      • $ emerge -a $(< userapplist)
    • eprl
      • use if packages break and you want to remove items from $ emerge --resume list
  4. move portage postsync eix script back
    • $ cp os/gentoo/desktop/etc/portage/postsync.d/eix /etc/portage/postsync.d/

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