everest-web/install.html

178 lines
9.9 KiB
HTML
Raw Normal View History

2022-06-21 13:49:11 -04:00
<!DOCTYPE html>
<html>
<head>
2022-06-28 18:44:37 -04:00
<title>Everest Linux - Installation Handbook</title>
2022-06-21 13:49:11 -04:00
<link type="text/css" rel="stylesheet" href="css/everest.css"/>
</head>
<body>
2022-06-28 18:44:37 -04:00
<ul>
2022-09-01 12:57:33 -04:00
<li><a href="index.html">Home</a></li>
2022-06-28 18:44:37 -04:00
<li><a href="about.html">About</a></li>
<li><a href="install.html">Handbook</a></li>
<li><a href="https://git.everestlinux.org/EverestLinux/glacier-pkgs">Packages</a></li>
<li><a href="download.html">Downloads</a></li>
2022-10-30 17:52:41 -04:00
<li><a href="https://git.everestlinux.org">Git</a></li>
2022-06-28 18:44:37 -04:00
</ul>
<img src="img/banner-hb.jpg" alt="banner-hb"/>
2022-06-21 13:49:11 -04:00
<h1>Installation Handbook</h1>
2022-10-30 17:52:41 -04:00
<p>This guide will go into depth on how to install Everest Linux.</p>
<p>If you nedd assistance, feel free to reach out on IRC (#everestlinux), or Discord.</p>
2022-06-21 13:49:11 -04:00
<h2>Prerequisites</h2>
2022-10-30 17:52:41 -04:00
<p>The following steps will be used to complete the installation:</p>
2022-10-31 09:11:42 -04:00
<p> - Set up the environment by creating proper mountpoints, users, and partitions</p>
2022-10-30 17:52:41 -04:00
<p> - Download the Everest Linux rootfs image</p>
<p> - Unpack the rootfs image onto the previously set up mountpoint</p>
<p> - Chroot into the new system</p>
<p> - Set up Glacier</p>
<p> - Install system software</p>
<p> - Install the Linux kernel</p>
<p> - Set up init scripts/services</p>
<p> - Reboot the system</p>
<p><i>Note: Everest is highly flexible, and every aspect of the system can be changed.</i></p>
<p><i>If you are changing anything, it is assumed you know exactly what you're doing.</i></p>
<p>Commands prefixed with <code><mark>(user)$</mark></code> should be run as an unprivileged user.</p>
2022-10-18 10:39:26 -04:00
<p>Commands prefixed with <code><mark>(root)#</mark></code> should be run as the root user.</p>
2022-06-28 18:44:37 -04:00
<p>Commands prefixed with <code><mark>(chroot)#</mark></code> should be run as the root user inside the chroot environment.</p>
2022-10-31 09:11:42 -04:00
<h2>Set up the environment</h2>
2022-10-30 17:52:41 -04:00
<p>Our environment needs to be set up correctly before any other steps can proceed.</p>
<p>Create the system mountpoint:</p>
<p><code><mark>(root)# mkdir -v /mnt/everest</mark></code></p>
<p>Assign the system mounpoint a variable for ease of use:</p>
<p><code><mark>(root)# export EVEREST=/mnt/everest</mark></code></p>
2022-10-31 09:11:42 -04:00
<p>Create any necessary partitions:</p>
<p>/boot - 256MB</p>
<p>(optional) swap - RAM * 2</p>
<p>/ - rest of the drive</p>
<p>Mount the root partition to the system mountpoint:</p>
2022-11-02 11:11:06 -04:00
<p><code><mark>(root)# mount /dev/sdX /mnt/everest</mark></code></p>
2022-10-31 09:11:42 -04:00
<p>Create the boot directory:</p>
<p><code><mark>(root)# mkdir -pv /mnt/everest/boot</mark></code></p>
<p>Mount the boot partition:</p>
<p><code><mark>(root)# mount /dev/sdX /mnt/everest/boot</mark></code></p>
<p>Our system is now set up for the installation.</p>
<h2>Downloading the Everest image</h2>
<p>An Everest Image is an uncomplete root filesystem image which provides a strong base to build off of.</p>
<p>Each image has slight differences to others, some differences may include:</p>
<p> - The init system</p>
<p> - The standard C library</p>
<p> - The architecture</p>
<p>Images are designated in the following ways:</p>
<p>everestlinux-X.X.X-INIT-ARCH(if not x86)-img.tar.xz</p>
<p>For instance, an image targeting x86_64, with the busybox init system would be called:</p>
<p>everestlinux-1.0.0-busybox-img.tar.xz</p>
<p>An image targeting arm64, with systemd would be called:</p>
<p>everestlinux-1.0.0-systemd-aarch64-img.tar.xz</p>
<p>Other designations may be used, such as:</p>
<p> - no_multilib</p>
<p>Ensure you download the correct image for your system. For most users, images targeting</p>
<p><strong>x86_64</strong> with the <strong>busybox</strong> init system are what you should use.</p>
<p>To get the image to our destination as easily as possible, use wget</p>
<p><code><mark>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/everestlinux-X.X.X-INIT-img.tar.xz</mark></code></p>
<p>With the image downloaded, the system can now be installed.</p>
<h2>Unpacking the Image</h2>
<p>The image can now be unpacked into the system mountpoint.</p>
2022-12-30 23:40:17 -05:00
<p>Ensure the image is located in <p><code><mark>/mnt/everest</mark></code></p></p>
<p>then run the following command to unpack it:</p>
2022-10-31 09:11:42 -04:00
<p><code><mark>(root)# tar -xpvf everestlinux-img.tar.xz --xattrs-include='*.*' --numeric-owner</mark></code></p>
<p>The following 2 options are very important. Without them, some binaries may refuse to run due to incorrect file ownership.</p>
<h2>Chrooting into the new installation</h2>
<p>Our system is now in a partially working state.</p>
<p>If we were to simply call it a day and try to boot into the system now, it would not be possible.</p>
<p>Many parts of the system are missing, including a bootloader and kernel.</p>
<p>Chrooting allows us to access the system and modify it, without actually booting into it.</p>
<p>Before chrooting, we must mount some partitions.</p>
<p>Chroot into the system:</p>
<p><code><mark>(root)# everest-chroot /mnt/everest</mark></code></p>
<p>This program will check the following:</p>
<p> - /mnt/everest exists</p>
<p> - /bin/sh exists</p>
<p>Once in the chroot environment, run the following commands:</p>
<p><code><mark>(chroot)# export PS1="(chroot) ${PS1}" && source /etc/profile</mark></code></p>
<p>We are now fully set up for the rest of the installation.</p>
<h2>Set up Glacier</h2>
<p>Glacier is the package manager for Everest. It must be installed into the new system.</p>
<p>Download the Glacier release tarball:</p>
<p><code><mark>(chroot)# wget RELEASE_TARBALL</mark></code></p>
<p>Unpack the tarball and run the installation:</p>
<p><code><mark>(chroot)# tar xpvf glacier-release-X.X.X.tar.xz && glacierX.X.X/INSTALL.sh</mark></code></p>
2022-12-01 08:57:11 -05:00
<p>This script will check for the following, and make corrections if necessary:</p>
<p> - The C library is installed</p>
<p> - The C library headers are installed</p>
<p> - The C compiler is installed</p>
<p> - GNU Binutils are installed</p>
<p> - GNU Make is installed</p>
<p> - Python is installed</p>
2022-12-30 23:40:17 -05:00
<p>Edit <p><code><mark>/etc/make.conf</mark></code></p></p>
<p>and change any settings you wish.</p>
2022-10-31 09:11:42 -04:00
<h2>Install the Linux kernel</h2>
<p>The kernel can now be installed.</p>
2022-11-02 11:11:06 -04:00
<p>Install the linux-firmware package, which provides firmware for some devices:</p>
<p><code><mark>(chroot)# glacier -f linux-firmware</mark></code></p>
2022-10-31 09:11:42 -04:00
<p>Use Glacier to download the source tree:</p>
<p><code><mark>(chroot)# glacier -f linux</mark></code></p>
<p>Find the kernel source tree in <p><code><mark>/usr/src/linux</mark></code></p>
2022-11-02 11:11:06 -04:00
<p><i>Note: Alternatively, you can download a new kernel from kernel.org</i></p>
<p>Clean the kernel source tree:</p>
<p><code><mark>(chroot)# make mrproper</mark></code></p>
<p>Configure the kernel:</p>
<p><code><mark>(chroot)# make menuconfig</mark></code></p>
<p><i>Note: Recommended options for configuration are not provided. It is up to the user to decide what they want to enable.</i></p>
<p>Compile the kernel:</p>
<p><code><mark>(chroot)# make && make modules_install</mark></code></p>
<p>Copy the kernel image to /boot:</p>
<p><code><mark>(chroot)# make install</mark></code></p>
<p>(Optional) Build an initramfs</p>
<p>On some systems, an initramfs (initial ram filesystem) is required to boot properly.</p>
<p>Do some research and decide whether you need - or want - an initramfs.</p>
<p>Install dracut:</p>
<p><code><mark>(chroot)# glacier -f dracut</mark></code></p>
<p>Build an initramfs:</p>
<p><code><mark>(chroot)# dracut</mark></code></p>
<h2>Configure the system</h2>
<p>Some components of the system must be configured before we can boot.</p>
<p>Create an fstab file.</p>
<p>An example of a properly formatted fstab is below:</p>
<p>/dev/sda1 /boot vfat defaults,noatime 0 2</p>
<p>/dev/sda2 none swap sw 0 0</p>
<p>/dev/sda3 / ext4 noatime 0 1</p>
2022-12-30 23:40:17 -05:00
<p>Enable system services, such as a cron daemon, logger, etc:</p>
<p><code><mark>(chroot)# esv start cronie chronyd sysklogd # for busybox init</mark></code></p>
<p><code><mark>(chroot)# systemctl enable --now cronie chronyd sysklogd # for systemd</mark></code></p>
<p>Other things you might want to configure are:</p>
<p> - /etc/doas.conf</p>
<p> - /etc/inittab</p>
<h2>Configure the bootloader</h2>
<p>Our system needs one more component before it can be booted into: the bootloader</p>
<p>For busybox init users, GRUB is the recommended bootloader.</p>
<p>For systemd users, systemd-boot is the recommended bootloader.</p>
<p><strong>GRUB</strong></p>
<p>Install the GRUB package:</p>
<p><i>Note: GRUB is split into 2 packages, grub-bios and grub-uefi.</i></p>
<p><i>Ensure you install the correct package.</i></p>
<p><code><mark>(chroot)# glacier -f grub-{bios,uefi}</mark></code></p>
<p>Install GRUB:</p>
<p><code><mark>(chroot)# grub-install /dev/sdX # for BIOS</mark></code></p>
<p><code><mark>(chroot)# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub # for UEFI</mark></code></p>
<p>Create a GRUB configuration file:</p>
<p><code><mark>(chroot)# grub-mkconfig -o /boot/grub/grub.cfg</mark></code></p>
<p><strong>systemd-boot</strong></p>
<p><i>Note: systemd-boot only supports UEFI.</i></p>
<p><i>Use GRUB if your system is incompatible with UEFI.</i></p>
<p>Systemd-boot is included with systemd.</p>
<p>Install systemd-boot:</p>
<p><code><mark>(chroot)# bootctl install</mark></code></p>
<p>Edit /boot/loader/loader.conf and create a boot entry at /boot/loader/entries/everest.conf</p>
<h2>Finishing the Installation</h2>
<p>Every component of the system has been configured, and we can now boot into it.</p>
<p>Exit the chroot environment:</p>
<p><code><mark>(chroot)# exit</mark></code></p>
<p>Unmount all partitions from /mnt/everest:</p>
<p><code><mark>(root)# umount -R /mnt/everest</mark></code></p>
<p>Power off the system:</p>
<p><code><mark>(root)# poweroff</mark></code></p>
<p>Ensure you remove the installation media or you will not boot into the new system.</p>
<h2>Post-installation</h2>
<p>A base Everest system is pretty minimal. Most users will need to configure extra components,</p>
<p>such as a window manager, sound, or networking.</p>
<p>See page: <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/General-Recommendations">General Recommendations</a></p>