-
Notifications
You must be signed in to change notification settings - Fork 2
gentoo install
BHN edited this page Jun 30, 2017
·
50 revisions
installation notes for gentoo OS
systemd, lvm, uefi
-
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
- if you decide to copy everything
- there are install steps not explicitly stated
- your system configuration may require other steps
- again, always reference the official gentoo handbook
-
- boot system rescue cd in efi mode
- connect to network
$ nmtui
- manually set date time
$ date MMDDHHMMYYYY
- I use tlsdate to auto update time, the package is installed in a later step
- download stage-3 tarball (current-stage3-amd64-systemd)
-
gentoo mirrors
- US -> OSSU -> releases -> amd64 -> autobuilds
-
gentoo mirrors
- 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
- 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)
- mount root to /mnt/gentoo
- create & mount any secondary drives
- i.e. var, tmp, home, ...
- create & mount any secondary drives
- unpack stage3 tarball
$ tar xjf ... --xattrs --numeric-owner -C /mnt/gentoo
- 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
- unmount all drives using unmount script
$ ./mountgentoodrivesu
- remount all drives using mount script
$ ./mountgentoodrives
- chroot into gentoo install
$ chroot /mnt/gentoo /bin/bash
- check date/time is correct
- set hardware clock to utc
$ hwclock --systohc --utc
- config locale
-
$ nano -w /etc/locale.gen
- uncomment
en_US.UTF-8 UTF-8
- uncomment
- generate locale
$ locale-gen
-
$ eselect locale list
- select en_US.utf8
-
- 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
- copy jdk/jre tars (if necessary)
- sync
- config timezone
- `$ echo "America/Chicago" > /etc/timezone
$ emerge --config sys-libs/timezone-data
- initial world update for systemd
$ emerge -a --update --deep --with-bdeps=y --newuse @world
- install some packages to aide in installation process
$ emerge neovim bash-completion
- if receiving an error saying
/usr/bin: file not recognized: Is a directory
$ unset path && source /etc/profile
- 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
- first save moved config
- install gentoo sources & pciutils
- 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
- install required system applications/libraries
- sysapplist
-
$ emerge -a $(< sysapplist)
-
nvidia notes
$ eselect opengl set nvidia
$ eselect opencl set nvidia
-
nvidia notes
-
eprl
- use if packages break and you want to remove items from
$ emerge --resume
list
- use if packages break and you want to remove items from
- enable any required services
$ systemctl enable ...<tab list>...
- generate initramfs
- install genkernel-next
$ genkernel --install initramfs
- bootloader
$ bootctl install
- intel microcode
$ emerge -a intel-microcode iucode_tool
$ ucode_tool -S --write-earlyfw=/boot/intelucode /lib/firmware/intel-ucode/*
- set root password
$ passwd
- 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
- create group dev
- wrap up
- exit chroot
- unmount all drive using unmount script
- reboot
- set nvim as system editor
$ eselect editor set nvim
$ eselect vi set nvim
- fonts
- 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
- install required user applications/libraries
-
userapplist
$ emerge -a $(< userapplist)
-
eprl
- use if packages break and you want to remove items from
$ emerge --resume
list
- use if packages break and you want to remove items from
-
userapplist
things will break, use tools/docs/forums/google/irc to fix them!
-
dmesg is great for investigating kernel/hardware issues
$ dmesg | grep -i error
$ dmesg | grep -i fail
-
journalctl is great for investigating systemd services
$ journalctl -xe
-
/var/log and cat
-
$ cd /var/log && cat ./* | less
- all the logs!
-
-
Linux debugging tools you'll love!
- great article by Julia Evans
probably want to head on over to the official gentoo handbook