Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gentoo:installation [2024/02/06 14:52] – willy | gentoo:installation [2025/03/13 14:49] (current) – [The fast&quick Gentoo Installation checklist] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | Why [[https:// | + | Why [[https:// |
- | When installing Gentoo Linux you have the total freedom to choose any single piece of the system, including whether to install | + | These instructions are aimed at supporting |
- | For reference, always follow | + | This is not meant to be an exustive guide, as there are plenty of good resources on the topic, specially |
+ | |||
+ | When installing Gentoo Linux you have the total freedom to choose any single piece of the system, including whether to install or not a Cron Daemon and even a logger daemon. No other distro gives you so much freedom. Moreover, while you can use SystemD and NetworkManager with Gentoo, you are **not** forced to use them, and in fact specially for small servers, they might both be unneeded. | ||
Installing Gentoo Linux is less difficult than you might think. The great [[https:// | Installing Gentoo Linux is less difficult than you might think. The great [[https:// | ||
+ | |||
===== The fast& | ===== The fast& | ||
Line 15: | Line 18: | ||
**Prerequisite**: | **Prerequisite**: | ||
- | ==== Get Ready for First Boot ==== | + | I will assume your home server has one drive dedicated to the Gentoo installation. Data, media, and other files will be stored on a separate RAID array of some kind. |
+ | |||
+ | Please do not configure that RAID array now, but read the [[gentoo: | ||
+ | |||
+ | === Get Ready for First Boot === | ||
+ | |||
+ | Burn Gentoo [[https:// | ||
- | Burn Gentoo [[https:// | + | Setup internet access from your booted |
- | Format your **root** partition on your PC harddrive | + | Format your **root** partition on your PC harddrive |
- | Once inside, | + | |
- | Create a folder | + | Mount your root folder: |
<code bash> | <code bash> | ||
- | > mkdir /mnt/gentoo | + | mount / |
</ | </ | ||
- | Download Gentoo Stage 3 tarball | + | Download |
- | * From Gentoo boot ISO, you can use <b>links</b> from text mode. | + | |
- | * You will need to setup network, if not available. See the handbook above. | + | Decompress the Stage 3, be careful to specify |
<code bash> | <code bash> | ||
- | > | + | cd / |
- | > | + | tar xvfp stage3.blah-blah.tar.zy |
- | > | + | |
</ | </ | ||
- | Prepare the chroot environment: | + | Prepare |
<code bash> | <code bash> | ||
- | > | + | cp / |
- | > modprobe efivarfs | + | modprobe efivarfs |
- | > for i in dev dev/pts sys run proc sys/ | + | for i in dev dev/pts sys run proc sys/ |
- | > chroot /mnt/gentoo /bin/bash | + | chroot /mnt/gentoo /bin/bash |
- | > mkdir /boot | + | source / |
- | > mount /dev/sda1 /boot | + | </code> |
- | </ | + | |
+ | You are now **inside** your brand new Gentoo Linux installation... But there is still a lot of work to be able to boot it. | ||
+ | |||
+ | You also need, now, to mount the boot/efi partition in side the chroot (let's assume it's **/ | ||
+ | <code bash> | ||
+ | mkdir /boot | ||
+ | mount /dev/sda1 /boot | ||
+ | </ | ||
+ | |||
+ | You need now to setup // | ||
Accept licenses, put this into < | Accept licenses, put this into < | ||
Line 51: | Line 67: | ||
</ | </ | ||
+ | It's time to populate the portage tree: | ||
+ | <code bash> | ||
+ | emerge --sync | ||
+ | </ | ||
+ | |||
+ | Configure your timezone (choose the correct one): | ||
+ | <code bash> | ||
echo " | echo " | ||
emerge --config sys-libs/ | emerge --config sys-libs/ | ||
- | / | + | </ |
+ | |||
+ | Configure your locales by editing the file **/ | ||
+ | <code bash> | ||
locale-gen | locale-gen | ||
+ | </ | ||
- | emerge --sync | + | And select your preferred profile. I would choose a plain basic profile like **default/ |
+ | <code bash> | ||
eselect profile list | eselect profile list | ||
+ | </ | ||
+ | Install and properly setup your CPU flags: | ||
+ | <code bash> | ||
+ | emerge -vp cpuid2cpuflags | ||
+ | echo "*/* $(cpuid2cpuflags)" | ||
+ | </ | ||
+ | |||
+ | Now reinstall/ | ||
+ | <code bash> | ||
emerge -uv --deep --newuse @world | emerge -uv --deep --newuse @world | ||
+ | </ | ||
- | emerge -vp vim tmux cronie | + | And it's time to install some basic stuff (pick your own! there are also many choices): |
- | emerge -vp genkernel gentoo-sources pci-utils usbutils mdadm | + | <code bash> |
+ | > | ||
+ | </ | ||
+ | Research each one and pick yours. | ||
+ | Now it's time to build the kernel: | ||
+ | <code bash> | ||
eselect kernel set 1 | eselect kernel set 1 | ||
- | |||
genkernel --mountboot --install all | genkernel --mountboot --install all | ||
+ | </ | ||
+ | Then create a user and set root password: | ||
+ | <code bash> | ||
passwd | passwd | ||
useradd user | useradd user | ||
passwd user | passwd user | ||
+ | </ | ||
- | edit /etC/conf/net | + | Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/ |
+ | <code bash> | ||
+ | vi /etc/conf/net | ||
rc-update add sshd default | rc-update add sshd default | ||
- | ln -s /etC/ | + | ln -s /et/ |
rc-update add net.xxx default | rc-update add net.xxx default | ||
+ | </ | ||
+ | Last, setup boot loader (Grub2 here): | ||
+ | <code bash> | ||
+ | grub-install --target=x86_64-efi --efi-directory=/ | ||
+ | </ | ||
+ | and then reboot. | ||
+ | === Additional settings after first boot === | ||
+ | Now, you are of course free to install whatever you want, even a fully fledged **Plasma Workspace**, | ||
- | + | A few more notes and suggestion that will be important in the future. | |
- | + | ||
A few notes to follow: | A few notes to follow: | ||
Line 96: | Line 148: | ||
===== Specific installation finalization ===== | ===== Specific installation finalization ===== | ||
+ | |||
+ | (not needed for the **external** server) | ||
You will need to create a special group called **media** which will be used to allow the different tools to access the respective data folders without compromising the security of your installation and media collection: | You will need to create a special group called **media** which will be used to allow the different tools to access the respective data folders without compromising the security of your installation and media collection: | ||
<code bash> | <code bash> | ||
- | > | + | groupadd media |
</ | </ | ||
Line 107: | Line 161: | ||
There are also a few specific tools we need to install for what comes ahead, let's do it: | There are also a few specific tools we need to install for what comes ahead, let's do it: | ||
<code bash> | <code bash> | ||
- | > | + | emerge -v sys-fs/ |
</ | </ | ||
Line 118: | Line 172: | ||
- | |||
- | |||
- | |||
- | |||
- | ====== Docker ====== | ||
- | |||
- | Refer to: [[https:// | ||
- | |||
- | emerge --ask --verbose app-containers/ | ||
- | |||
- | |||
- | rc-update add docker default | ||
- | rc-service docker start | ||
- | |||
- | user $sudo sysctl net.ipv4.ip_forward=1 | ||
- | |||
- | A more permanent change can be made with: | ||
- | FILE / | ||
- | |||
- | net.ipv4.ip_forward=1 | ||
- | |||
- | docker run --rm hello-world | ||