rewrite installation guide

This commit is contained in:
Liam Waldron 2023-03-29 11:38:07 -04:00
parent 04b7b2250f
commit 705f1ba41d
4 changed files with 509 additions and 353 deletions

View File

@ -46,6 +46,7 @@ html {
}
.file {
font-family: monospace;
background-color: #0F0F0F;
border-left-style: solid;
border-left-color: MediumSeaGreen;
@ -56,6 +57,29 @@ html {
color: white;
}
.kernel {
font-family: monospace;
background-color: #0F0F0F;
border-left-style: solid;
border-left-color: SlateBlue;
border-width: 4px;
border-radius: 2px;
padding: 4px;
width: 50%;
color: white;
}
.warning {
background-color: #330000;
border-left-style: solid;
border-left-color: #e60000;
border-width: 4px;
border-radius: 2px;
padding: 4px;
width: 50%;
color: #e60000;
}
fhead {
background-color: #0F0F0F;
border-left-style: solid;
@ -67,6 +91,28 @@ fhead {
color: MediumSeaGreen;
}
khead {
background-color: #0F0F0F;
border-left-style: solid;
border-left-color: SlateBlue;
border-width: 4px;
border-radius: 2px;
padding: 6px;
width: 50%;
color: Slateblue;
}
warnhead {
background-color: #330000;
border-left-style: solid;
border-left-color: #e60000;
border-width: 4px;
border-radius: 2px;
padding: 6px;
width: 50%;
color: #e60000;
}
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a{font-size: 18px;}
@ -95,19 +141,19 @@ wiki {
border-color: Tomato;
}
file {
/* file {
border-style: solid;
border-width: 1px;
border-width: 4px;
border-radius: 2px;
padding: 2px;
border-color: black;
}
} */
h2 {
border-left-style: solid;
border-color: #4a86e8ff;
padding-left: 4px;
border-width: 8px;
border-left-width: 6px;
border-radius: 5px;
color: #e6e6e6;
}
@ -128,7 +174,7 @@ hr.dotted {
border-top: 3px dotted #bbb;
}
p {
/* p {
color: #e6e6e6;
}

View File

@ -19,168 +19,294 @@
<!-- Rest of page -->
<div class="main">
<h2>Installation Handbook</h2>
<p>This is the official installation guide for Everest Linux.</p>
<p>Using unofficial guides is not recommended as they may be</p>
<p>out of date.</p>
<p>Simply following this guide blindly is a great way to end up</p>
<p>with a broken installation. Ensure you have a rough idea of</p>
<p>what each command does.</p>
<p>If you need assistance, reach out on IRC (#everestlinux) or Discord.</p>
<p>This guide is the official installation handbook for Everest Linux.</p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Using unofficial guides is not recommended, as they may be outdated, or unreliable. The official guide is located at https://www.everestlinux.org/install.</p>
</div>
<p></p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Simply copy and pasting commands from this guide won't cut it, and you'll most likely end up with a broken installation. Ensure you know what each command does.</p>
</div>
<p></p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Everest is not for the faint of heart. If you have never touched Linux in your life, Everest is most certainly not for you. Check out https://linuxmint.com if you want a great Linux experience that works out of the box.</p>
</div>
<p></p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Everest at its current state is highly experimental. Install at your own risk.</p>
</div>
<p>If you need assistance, reach out to us on IRC (libera.chat, #everestlinux) or Discord.</p>
<h2>Prerequisites</h2>
<p>The following steps will be used to complete the installation:</p>
<p> - Set up the environment</p>
<p> - Download the Everest Linux system image</p>
<p> - Unpack the system image</p>
<p> - Chroot into the new system</p>
<p> - Install desired programs</p>
<p> - Install the Linux kernel
<p> - Set up init scripts/services</p>
<p> - Reboot the system</p>
<i>Note: Everest is highly flexible.</i>
<i>If you are changing anything in this guide, it is assumed</i>
<i>you know exactly what to do.</i>
<p>Run <code>(user)$</code> commands as an unprivileged user.</p>
<p>Run <code>(root)#</code> commands as the root user.</p>
<p>Run <code>(chroot)#</code> commands inside the chroot environment.</p>
<p>The following steps are required to complete an installation:</p>
<ol>
<li>Set up the build environment</li>
<li>Download a system image</li>
<li>Unpack the system image</li>
<li>Change root into the new system</li>
<li>Install programs</li>
<li>Install the Linux kernel</li>
<li>Set up init scripts and services</li>
<li>Install the bootloader</li>
<li>Reboot the system</li>
</ol>
<i>Note that Everest is highly flexible. That being said, it is up to you to make modifications yourself.</i>
<p>Run commands prefixed with <code>(user)$</code> as an unprivileged user.</p>
<p>Run commands prefixed with <code>(root)#</code> as the root user.</p>
<p>Run commands prefixed with <code>(chroot)#</code> inside the chroot environment.</p>
<h2>Set up the environment</h2>
<p>Our environment needs to be set up correctly for the installation.</p>
<p>Create the system mountpoint:</p>
<p>Everest needs a proper environment set up in order to install correctly.</p>
<p>A system mountpoint is where the new system's root (/) will be. Where you put this doesn't matter, as the host system used to build the system won't be included</p>
<p>in the final installation. In this example, we will use /mnt/everest.</p>
<p>Create a system mountpoint:</p>
<code>(root)# mkdir -pv /mnt/everest</code>
<p>Although it may not be used, assign the system mountpoint a variable:</p>
<code>(root)# export SYS_MNT=/mnt/everest</code>
<p>Partition your drive:</p>
<p>A variable pointing to the system mountpoint may be useful in the future, as it will save you a bit of typing.</p>
<p>Create a variable for the system mountpoint:</p>
<code>(root)# SYS_MNT=/mnt/everest</code>
<p>Partitions must be created on the drive you wish to install Everest to. The typical partition layout on an Everest system may differ from othet distributions.</p>
<p>The typical layout is:</p>
<table>
<tr>
<th>Mount point</th>
<th>Type</th>
<th>Suggested size</th>
</tr>
<tr>
<td>/mnt/everest/boot</td>
<td>EFI system partition (esp)</td>
<td>No smaller than 256 MB, no larger than 1 GB</td>
</tr>
<tr>
<td>/mnt/everest/usr</td>
<td>/usr</td>
<td>No smaller than 25 GB</td>
</tr>
<tr>
<td>/mnt/everest</td>
<td>Root filesystem</td>
<td>Remainder of the drive</td>
</tr>
<table>
<p>Partition the target drive:</p>
<code>(root)# cfdisk /dev/sdX</code>
<p>A valid filesystem is required on the drive.</p>
<p>Most filesystems should work, however ensure the system has the corresponding package for whatever filesystem you choose.</p>
<p>For example, if XFS is used, when installing the system:</p>
<code>(chroot)# gpkg -f world/xfsprogs</code>
<p>In this example, Ext4 will be used.</p>
<p>Create a filesystem:</p>
<code>(root)# mkfs.ext4 /dev/root</code>
<p></p>
<code>(root)# mkfs.ext4 /dev/usr</code>
<p>The EFI system partition (esp) must be formatted as FAT32.</p>
<code>(root)# mkfs.vfat -F32 /dev/boot</code>
<p>Mount the root partition to the system mountpoint:</p>
<code>(root)# mount /dev/sdX /mnt/everest</code>
<p>If needed, create the boot directory:</p>
<code>(root)# mkdir -pv /mnt/everest/boot</code>
<p>Mount the boot partition:</p>
<code>(root)# mount /dev/sdX /mnt/everest/boot</code>
<h2>Downloading the Everest system image</h2>
<p>An Everest system image is an incomplete root filesystem, which</p>
<p>provides a strong base to build off of</p>
<p>Not all system images are the same. Some differences are:</p>
<p> - The init system</p>
<p> - The standard C library</p>
<p> - The architecture</p>
<p> - SELinux support</p>
<p> - Multilib support</p>
<p>Ensure you download the image you want. Migrating in the future</p>
<p>is not officially supported or even recommended.</p>
<p>Download an image with <code>wget</code>:</p>
<code>(user)$ wget SYSTEM_IMAGE_LINK</code>
<code>(root)# mount /dev/root /mnt/everest</code>
<p>Some additional directories may need to be created.</p>
<p>Create extra needed directories:</p>
<code>(root)# mkdir /mnt/everest/boot</code>
<p></p>
<code>(root)# mkdir /mnt/everest/usr</code>
<p>Mount the remaining partitions:</p>
<code>(root)# mount /dev/boot /mnt/everest/boot</code>
<p></p>
<code>(root)# mount /dev/usr /mnt/everest/usr</code>
<p>Create remaining directories on /usr with mkusrskel:</p>
<code>(root)# mkusrskel -d /mnt/everest/usr</code>
<h2>Downloading a system image</h2>
<p>An Everest system image provides an incomplete root filesystem which users can build a system off of. Users should be careful of which</p>
<p>image they choose, as switching in the future is trivial, time consuming, and requires rebuilding a lot of packages. It's a lot better</p>
<p>to get it right the first time, rather than trying to get it right later.</p>
<p>Do some thorough planning to ensure you get the right system image. For instance, ask yourself a few questions, such as:</p>
<ol>
<li>Do I need 32 bit libraries?</li>
<li>Will I be using proprietary software that cannot be recompiled?</li>
<li>Do I require a specific C library for my hardware setup?</li>
<li>Do I want to set up NSA Security Enhanced Linux (SELinux)</li>
<li>Do I want an init system other than Busybox's built in init configured out of the box?</li>
</ol>
<p>Downloading a system image that is severely out of date is not recommended. Many programs, such as the kernel or SSL library will be vulnerable to attacks.</p>
<p>Download a system image with wget:</p>
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE.tar.xz</code>
<h2>Unpacking the system image</h2>
<p>The system image can now be unpacked.</p>
<p>Ensure the system image is located under the system mountpoint.</p>
<p>Note that a simple <code>tar -xvf</code> will cause errors with</p>
<p>permissions. Therefore, a few extra flags are needed.</p>
<p>Now that a system image has been downloaded, we can unpack it.</p>
<p>Ensure the system image is inside the system mountpoint, otherwise you may run into trouble.</p>
<p>Since a Linux root filesystem is complex, and many different files need to be owned by certain users, or have certain permissions, simply running `tar xf` will</p>
<p>result in a broken image. A couple extra flags are needed to preserve these permissions in the unpacked image.</p>
<p>Unpack the system image:</p>
<code>(root)# tar -xpvf SYSTEM_IMAGE --xattrs-include='*.*' --numeric-owner</code>
<p>This will ensure all file ownership is compliant.</p>
<h2>Chrooting into the new installation</h2>
<p>The system is in a partially working state.</p>
<p>If we were to call it a day and reboot now, it wouldn't be possible.</p>
<p>Many critical parts of the system are missing, including the</p>
<p>bootloader and kernel. Chrooting allows us to make modifications</p>
<p>to the target system, without actually booting into it.</p>
<p>Before chrooting, additional filesystems must be mounted.</p>
<p>Mount these filesystems:</p>
<code>(root)# mount --types proc /proc /mnt/everest/proc</code>
<p></p>
<code>(root)# mount --rbind /sys /mnt/everest/sys</code>
<p></p>
<code>(root)# mount --make-rslave /mnt/everest/sys</code>
<p></p>
<code>(root)# mount --rbind /dev/ /mnt/everest/dev</code>
<p></p>
<code>(root)# mount --make-rslave /mnt/everest/dev</code>
<p></p>
<code>(root)# mount --bind /run /mnt/everest/run</code>
<p></p>
<code>(root)# mount --make-slave /mnt/everest/run</code>
<p>Chroot into the system:</p>
<code>(root)# chroot --userspec=0:0 /mnt/everest /bin/sh</code>
<p>Change the shell prompt to avoid confusion:</p>
<code>(chroot)# export PS1="(chroot) ${PS1}" && source /etc/profile</code>
<h2>Install programs</h2>
<p>Any programs you wish to install should be installed now.</p>
<p>This is because the Linux kernel takes multiple hours to compile.</p>
<p>See <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/General-Recommendations">General Recommendations</a> for ideas. Note that some</p>
<p>programs assume the system is installed, so use caution.</p>
<p>If this command was run correctly, you shouldn't need to edit any permissions manually.</p>
<h2>Chrooting into the system mountpoint</h2>
<p>Although we have a relatively complete root filesystem at this point, many essential programs are still missing. These include the kernel and bootloader. Without these,</p>
<p>the system is unable to boot. At this point, we must chroot into the new system. This will allow us to complete the system without booting.</p>
<p>Chroot into the new system:</p>
<code>(root)# everest-chroot /mnt/everest</code>
<p>Change the shell prompt to differentiate the two environments:</p>
<code>(chroot)# echo "export PS1='(chroot) ${PS1}'" >> /etc/profile && source /etc/profile</code>
<h2>Install packages</h2>
<p>Any programs you wish to install, such as display servers, login managers, and desktop environments, should be installed now. The kernel can take multiple</p>
<p>hours to compile on some hardware.</p>
<p>Glacier manages packages on the system, and it allows users to install, or 'merge' their own. It is recommended to get familiar with this system.</p>
<wiki>See: <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/Introduction-to-Glacier">Introduction to Glacier</a></wiki>
<h2>Install the Linux kernel</h2>
<p>The most important part of the system, the kernel, is ready to be installed.</p>
<p>Install the linux-firmware package, which provides device firmware:</p>
<code>(chroot)# glacier -f linux-firmware</code>
<p>The most important part of the system, the kernel, which allows hardware to communicate with software, is ready to be installed.</p>
<p>If needed, merge the linux-firmware package, which provides device firmware:</p>
<code>(chroot)# gpkg -f world/linux-firmware</code>
<p>At this stage, you can decide which kernel you want to install. In Everest's package repository, many prebuilt kernels are available, as well as the</p>
<p>source code, should you wish to compile your own.</p>
<p><strong>Option 1: Custom kernel</strong></p>
<p>Compiling a custom kernel is the recommended option for most users, as it allows the most control.</p>
<p>Download the kernel's source tree:</p>
<code>(chroot)# glacier -f linux</code>
<p>Change directory to the kernel's source tree:</p>
<code>(chroot)# cd /usr/src/linux</code>
<p>Ensure the kernel source tree is clean:</p>
<code>(chroot)# gpkg -f world/linux</code>
<p>The source tree will be located under /usr/src/linux.</p>
<p>Inside /usr/src/linux, ensure the source tree is completely clean by running the following:</p>
<code>(chroot)# make mrproper</code>
<p>The kernel must be configured before it is compiled.</p>
<p> Users installing systemd should enable IPv6 in the kernel configuration:</p>
<khead><strong>KERNEL: </strong> Enbable support for IPv6</khead>
<div class="kernel">
<p>Networking support ---></p>
<p>&nbsp&nbsp&nbsp&nbsp&nbsp&nbspNetworking options ---></p>
<p>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<*> The IPv6 protocol [CONFIG_IPV6]</p>
</div>
<p> Recommended options are not provided - it is up to you to configure the kernel for your setup.</p>
<p>Configure the kernel:</p>
<code>(chroot)# ARCH="your-arch-here" make defconfig && make menuconfig</code>
<p>Compile the kernel:</p>
<code>(chroot)# make && make modules_install</code>
<p>Install the kernel:</p>
<code>(chroot)# make install</code>
<p>On some systems, an initial RAM filesystem (initramfs)</p>
<p>may be needed to ensure proper booting.</p>
<p>If you want an initramfs, install dracut:</p>
<code>(chroot)# glacier -f dracut</code>
<code>(chroot)# export EVEREST_ARCH="$(echo $MACHTYPE)"</code>
<p></p>
<code>(chroot)# ARCH=$EVEREST_ARCH make defconfig</code>
<p></p>
<code>(chroot)# ARCH=$EVEREST_ARCH make menuconfig</code>
<p>Once the kernel is configured, compile it:</p>
<code>(chroot)# make && make modules install</code>
<p><strong>Option 2: Distribution kernel</strong></p>
<p>For those who do not wish to configure a custom kernel, or likewise do not have the time or system resources to do so, a distribution kernel</p>
<p>provides a binary kernel. However, there are a couple of pitfalls to this option:</p>
<ol>
<li>Distribution kernels are not fine tuned to your system, they are generic and bloated</li>
<li>Distribution kernels are managed by their respective development teams, who must be relied upon for fixes</li>
<li>Distribution kernels deprive the user of the experience gained by configuring and compiling a custom kernel</li>
</ol>
<p>Everest offers many distribution kernels, some notable ones include:</p>
<ol>
<li>linux-everest</li>
<li>linux-zen</li>
<li>linux-hardened</li>
</ol>
<p>Install a distribution kernel:</p>
<code>(chroot)# gpkg -f world/linux-{everest,zen,hardened}</code>
<h2>Build an initramfs</h2>
<p>Depending on your system, an initramfs may be required. For example, users of distribution kernels will ALWAYS need to build an initramfs,</p>
<p>while those who configured and compiled their own will usually not need one.</p>
<p>To build an initramfs, you will need dracut. Install dracut:</p>
<code>(chroot)# gpkg -f world/dracut</code>
<p>Build an initramfs:</p>
<code>(chroot)# dracut</code>
<h2>Configure the system</h2>
<p>Some components of the system mus be configured.</p>
<p>Create <code>/etc/fstab</code>.</p>
<p>Enable system services, such as a cron daemon, logger, etc:</p>
<code>(chroot)# /etc/init.d/{cronie,chronyd,sysklogd} start</code>
<p></p>
<code>(chroot)# systemctl enable --now cronie chronyd sysklogd</code>
<p>Set the timezone:</p>
<code>(chroot)# ln -svf /usr/share/zoneinfo/Region/City /etc/localtime</code>
<p>Configure the locale:</p>
<code>(chroot)# echo "LANG=en_US.UTF-8" > /etc/locale.conf</code>
<p>Set the system hostname:</p>
<code>(chroot)# echo "my_hostname" > /etc/hostname</code>
<p>Other things you might want to configure are:</p>
<p> - /etc/doas.conf or /etc/sudoers</p>
<p> - /etc/inittab</p>
<h2>Configure the bootloader</h2>
<p>One more critical component is needed: the bootloader</p>
<p>While any bootloader can be installed, this guide recommends</p>
<p><code>systemd-boot</code> and <code>grub</code>.</p>
<p>For systemd-boot/gummiboot:</p>
<p>Install the standalone package for systemd-boot if systemd is not installed:</p>
<code>(chroot)# glacier -f gummiboot</code>
<p>Install the bootloader:</p>
<code>(chroot)# bootctl install</code>
<p>Edit <code>/boot/loader/loader.conf</code> to your liking.</p>
<p>Create a boot entry at <code>/boot/loader/entries/everest.conf</code>.</p>
<p>For GRUB:</p>
<p>Install the GRUB package that corresponds to your system:</p>
<code>(chroot)# glacier -f grub-bios</code>
<p></p>
<code>(chroot)# glacier -f grub-uefi</code>
<p>Install GRUB:</p>
<code>(chroot)# grub-install /dev/sdX # for BIOS</code>
<p></p>
<code>(chroot)# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub # for UEFI</code>
<p>Create a GRUB configuration file:</p>
<code>(chroot)# grub-mkconfibg -o /boot/grub/grub.cfg</code>
<h2>Finishing the installation</h2>
<p>Every component of the system has been configured, and we can now</p>
<p>boot into it.</p>
<p>Exit the chroot environment:</p>
<code>(chroot)# exit</code>
<p>Unmount all partitions from the system mountpoint:</p>
<code>(root)# umount -R /mnt/everest</code>
<p>Power off the system:</p>
<code>(root)# poweroff</code>
<p>Ensure you remove the installation media or you</p>
<p>will not boot into the new system.</p>
<h2>Post installation</h2>
<p>A base Everest system is very minimal.</p>
<p>Most users will want to configure extra components, such as a window</p>
<p>manager, or sound. See: <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/General-Recommendations">General Recommendations</a> for more info.</p>
<p>Now that the kernel is installed, various other parts of the system should be configured.</p>
<p>Create /etc/fstab, which provides the system with information about mounted filesystems.</p>
<p>For example, on a system with a root, /usr, and boot partition, /etc/fstab will look like this:</p>
<fhead><strong>FILE:</strong> /etc/fstab</fhead>
<div class="file">
<p>/dev/sda1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp/&nbsp&nbsp&nbsp&nbsp&nbsp&nbspext4&nbsp&nbsp&nbsp&nbsp&nbsp&nbspnoatime&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp0 1</p>
<p>/dev/sda2&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp/usr&nbsp&nbsp&nbsp&nbsp&nbsp&nbspext4&nbsp&nbsp&nbsp&nbsp&nbsp&nbspnoatime&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp0 1</p>
<p>/dev/sda3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp/boot&nbsp&nbsp&nbsp&nbsp&nbsp&nbspvfat&nbsp&nbsp&nbsp&nbsp&nbsp&nbspdefaults,noatime&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp0 2</p>
</div>
<p>System services that some may find helpful, such as a cron daemon or logging daemon, should be set up now.</p>
<p>On systems using systemd:</p>
<code>(chroot)# systemctl enable cronie chronyd sysklogd</code>
<p>On systems without a service manager, all services under /etc/init.d will be initialied by rcS.</p>
<p>The system's timezone is read from /etc/localtime, which is a symlink.</p>
<p>In case timezone information is missing from /usr/share/zoneinfo, install it:</p>
<code>(chroot)# gpkg -f world/tzdata</code>
<p>Create /etc/localtime:</p>
<code>(chroot)# ln -sv /usr/share/zoneinfo/<i>Region</i>/<i>City</i> /etc/localtime</code>
<p>The hostname assigns a name to the system. This can be changed at any time.</p>
<p>Set the hostname:</p>
<code>(chroot)# echo <i>hostname</i> > /etc/hostname</code>
<p>Or, on systemd:</p>
<code>(chroot)# hostnamectl hostname <i>hostname</i></code>
<p>A network connection is very important, and there are multiple ways to set one up.</p>
<warnhead><strong>WARNING:</strong></warnhead>
<div class="warning">
<p>Ensure your network is fully set up before proceeding with any other steps. It's better to get it right the first time, rather than trying to fix it later.</p>
</div>
<p>First, ensure the desired network interface is not blocked by rfkill:</p>
<code>(chroot)# rfkill</code>
<p>If the network interface is blocked:</p>
<code>(chroot)# rfkill unblock <i>interface</i></code>
<p>The network can now be configured.</p>
<p><strong>Option 1: Busybox networking</strong></p>
<p>Busybox includes networking tools that can quickly configure the network.</p>
<p>On a busybox system, the network can be set up with one simple command:</p>
<code>(chroot)# ifup</code>
<p>rcS will also run this command at boot time.</p>
<p><strong>Option 2: dhcpcd and wpa_supplicant</strong></p>
<p>On systems without Busybox, dhcpcd can be used. This is another very simple solution.</p>
<p>Install dhcpcd:</p>
<code>(chroot)# gpkg -f world/dhcpcd</code>
<p>Install wpa_supplicant:</p>
<code>(chroot)# gpkg -f world/wpa_supplicant</code>
<p>rcS will start dhcpcd at boot time.</p>
<p><strong>Option 3: NetworkManager</strong></p>
<p>NetworkManager is recommended on systems using systemd as the init system.</p>
<p>NetworkManager should be fairly easy and straightforward to set up for most.</p>
<p>Install NetworkManager:</p>
<code>(chroot)# gpkg -f world/networkmanager</code>
<p>Enable and start NetworkManager:</p>
<code>(chroot)# systemctl enable --now NetworkManager</code>
<p>The /etc/hosts file is used to resolve IP addresses not resolved by the DHCP server.</p>
<fhead><strong>FILE:</strong> /etc/hosts</fhead>
<div class="file">
<p>127.0.0.1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsplocalhost</p>
<p>::1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsplocalhost</p>
<p>127.0.1.1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsplocaldomain <i>hostname</i></p>
</div>
<p>The root password is extremely important, as it controls access to the root user, the most powerful user on the system.</p>
<p>Ensure your chosen root password is strong enough where it cannot be guessed easily.</p>
<p>Set the root password:</p>
<code>(chroot)# passwd</code>
<p>If remote access is desired on the system, install sshd:</p>
<code>(chroot)# gpkg -f world/sshd</code>
<p>Using the root account for daily use is not recommended. Create an unprivileged user:</p>
<code>(chroot)# adduser USERNAME</code>
<p>A privilege elevation program is recommended for most users. The most popular choices are sudo and doas, with doas being recommended for most users.</p>
<p>Install doas:</p>
<code>(chroot)# gpkg -f world/doas</code>
<p>Create /etc/doas.conf:</p>
<fhead><strong>FILE:</strong> /etc/doas.conf</fhead>
<div class="file">
<p>permit USER as root</p>
</div>
<h2>Configure the bootloader</h2>
<p>Now that the system is correctly configured and the kernel is installed, the final step can proceed - installing the bootloader. Without a bootloader, the system</p>
<p>will be unable to load the Linux kernel upon boot. This guide only mentions GRUB, however note that other bootloaders are supported.</p>
<p>Merge GRUB for BIOS:</p>
<code>(chroot)# gpkg -f world/grub-bios</code>
<p>Merge GRUB for UEFI:</p>
<code>(chroot)# gpkg -f world/grub-efi</code>
<p>Install GRUB for BIOS:</p>
<code>(chroot)# grub-install /dev/sda</code>
<p>Install GRUB for UEFI:</p>
<code>(chroot)# grub-install --target=x86_64-efi --efi-directory=/boot</code>
<p>For GRUB to work correctly, a configuration file must be created. Create one now:</p>
<code>(chroot# grub-mkconfig -o /boot/grub/grub.cfg</code>
<h2>Exit chroot</h2>
<p>The system has been finished. If everything is done to your liking, you can now exit the chroot environment.</p>
<code>(chroot)# exit</code>
<p>Unmount all mounted partitions:</p>
<code>(root)# umount -l /mnt/everest/dev/{shm,pts}</code>
<p></p>
<code>(root)# umount -R /mnt/everest</code>
<p>Reboot the system:</p>
<code>(root)# reboot</code>
<p>Ensure the installation medium is removed, or else you will not boot into the new system, rather back into the installation medium.</p>
<h2>Conclusion</h2>
<p>If all went well, Everest should boot up with no problems.</p>
<p>Remove the system image from /:</p>
<code>(root)# rm /everestlinux-*.tar.*</code>
<p>With the installation out of the way, you now have a minimal Linux environment to play around in, and to build around.</p>
<p>Thank you for installing Everest Linux!</p>
</div>

View File

@ -1,202 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Everest Linux - Install</title>
<link type="text/css" rel="stylesheet" href="css/everest.css"/>
</head>
<body>
<!-- Navbar -->
<div class="sidenav">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="install.html">Install</a>
<a href="https://git.everestlinux.org/EverestLinux/glacier-pkgs">Packages</a>
<a href="download.html">Downloads</a>
<a href="https://git.everestlinux.org/EverestLinux/wiki">Wiki</a>
<a href="https://git.everestlinux.org">Git</a>
</div>
<!-- Rest of page -->
<div class="main">
<h2>Installation Handbook</h2>
<p>This guide is the official installation handbook for Everest Linux.</p>
<p>Using unofficial guides is not recommended, as they may be outdated, or unreliable. The official guide is located at https://www.everestlinux.org/install.</p>
<p>Simply copy and pasting commands from this guide won't cut it, and you'll most likely end up with a broken installation. Ensure you know what each command does.</p>
<p>If you need assistance, reach out to us on IRC (libera.chat, #everestlinux) or Discord.</p>
<h2>Prerequisites</h2>
<p>The following steps are required to complete an installation:</p>
<ol>
<li>Set up the build environment</li>
<li>Download a system image</li>
<li>Unpack the system image</li>
<li>Change root into the new system</li>
<li>Install programs</li>
<li>Install the Linux kernel</li>
<li>Set up init scripts and services</li>
<li>Install the bootloader</li>
<li>Reboot the system</li>
</ol>
<i>Note that Everest is highly flexible. That being said, it is up to you to make modifications yourself.</i>
<p>Run commands prefixed with <code>(user)$</code> as an unprivileged user.</p>
<p>Run commands prefixed with <code>(root)#</code> as the root user.</p>
<p>Run commands prefixed with <code>(chroot)#</code> inside the chroot environment.</p>
<h2>Set up the environment</h2>
<p>Everest needs a proper environment set up in order to install correctly.</p>
<p>A system mountpoint is where the new system's root (/) will be. Where you put this doesn't matter, as the host system used to build the system won't be included</p>
<p>in the final installation. In this example, we will use /mnt/everest.</p>
<p>Create a system mountpoint:</p>
<code>(root)# mkdir -pv /mnt/everest</code>
<p>A variable pointing to the system mountpoint may be useful in the future, as it will save you a bit of typing.</p>
<p>Create a variable for the system mountpoint:</p>
<code>(root)# SYS_MNT=/mnt/everest</code>
<p>Partitions must be created on the drive you wish to install Everest to. The typical partition layout on an Everest system may differ from othet distributions.</p>
<p>The typical layout is:</p>
<table>
<tr>
<th>Mount point</th>
<th>Type</th>
<th>Suggested size</th>
</tr>
<tr>
<td>/mnt/everest/boot</td>
<td>EFI system partition (esp)</td>
<td>No smaller than 256 MB, no larger than 1 GB</td>
</tr>
<tr>
<td>/mnt/everest/usr</td>
<td>/usr</td>
<td>No smaller than 25 GB</td>
</tr>
<tr>
<td>/mnt/everest</td>
<td>Root filesystem</td>
<td>Remainder of the drive</td>
</tr>
<table>
<p>Partition the target drive:</p>
<code>(root)# cfdisk /dev/sdX</code>
<p>A valid filesystem is required on the drive.</p>
<p>Most filesystems should work, however ensure the system has the corresponding package for whatever filesystem you choose.</p>
<p>For example, if XFS is used, when installing the system:</p>
<code>(chroot)# gpkg -f world/xfsprogs</code>
<p>In this example, Ext4 will be used.</p>
<p>Create a filesystem:</p>
<code>(root)# mkfs.ext4 /dev/root</code>
<p></p>
<code>(root)# mkfs.ext4 /dev/usr</code>
<p>The EFI system partition (esp) must be formatted as FAT32.</p>
<code>(root)# mkfs.vfat -F32 /dev/boot</code>
<p>Mount the root partition to the system mountpoint:</p>
<code>(root)# mount /dev/root /mnt/everest</code>
<p>Some additional directories may need to be created.</p>
<p>Create extra needed directories:</p>
<code>(root)# mkdir /mnt/everest/boot</code>
<p></p>
<code>(root)# mkdir /mnt/everest/usr</code>
<p>Mount the remaining partitions:</p>
<code>(root)# mount /dev/boot /mnt/everest/boot</code>
<p></p>
<code>(root)# mount /dev/usr /mnt/everest/usr</code>
<p>Create remaining directories on /usr with mkusrskel:</p>
<code>(root)# mkusrskel -d /mnt/everest/usr</code>
<h2>Downloading a system image</h2>
<p>An Everest system image provides an incomplete root filesystem which users can build a system off of. Users should be careful of which</p>
<p>image they choose, as switching in the future is trivial, time consuming, and requires rebuilding a lot of packages. It's a lot better</p>
<p>to get it right the first time, rather than trying to get it right later.</p>
<p>Do some thorough planning to ensure you get the right system image. For instance, ask yourself a few questions, such as:</p>
<ol>
<li>Do I need 32 bit libraries?</li>
<li>Will I be using proprietary software that cannot be recompiled?</li>
<li>Do I require a specific C library for my hardware setup?</li>
<li>Do I want to set up NSA Security Enhanced Linux (SELinux)</li>
<li>Do I want an init system other than Busybox's built in init configured out of the box?</li>
</ol>
<p>Downloading a system image that is severely out of date is not recommended. Many programs, such as the kernel or SSL library will be vulnerable to attacks.</p>
<p>Download a system image with wget:</p>
<code>(user)$ wget https://git.everestlinux.org/EverestLinux/everest/raw/branch/main/releases/SYSTEM_IMAGE.tar.xz</code>
<h2>Unpacking the system image</h2>
<p>Now that a system image has been downloaded, we can unpack it.</p>
<p>Ensure the system image is inside the system mountpoint, otherwise you may run into trouble.</p>
<p>Since a Linux root filesystem is complex, and many different files need to be owned by certain users, or have certain permissions, simply running `tar xf` will</p>
<p>result in a broken image. A couple extra flags are needed to preserve these permissions in the unpacked image.</p>
<p>Unpack the system image:</p>
<code>(root)# tar -xpvf SYSTEM_IMAGE --xattrs-include='*.*' --numeric-owner</code>
<p>If this command was run correctly, you shouldn't need to edit any permissions manually.</p>
<h2>Chrooting into the system mountpoint</h2>
<p>Although we have a relatively complete root filesystem at this point, many essential programs are still missing. These include the kernel and bootloader. Without these,</p>
<p>the system is unable to boot. At this point, we must chroot into the new system. This will allow us to complete the system without booting.</p>
<p>Chroot into the new system:</p>
<code>(root)# everest-chroot /mnt/everest</code>
<p>Change the shell prompt to differentiate the two environments:</p>
<code>(chroot)# echo "export PS1='(chroot) ${PS1}'" >> /etc/profile && source /etc/profile</code>
<h2>Install packages</h2>
<p>Any programs you wish to install, such as display servers, login managers, and desktop environments, should be installed now. The kernel can take multiple</p>
<p>hours to compile on some hardware.</p>
<p>Glacier manages packages on the system, and it allows users to install, or 'merge' their own. It is recommended to get familiar with this system.</p>
<wiki>See: <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/Introduction-to-Glacier">Introduction to Glacier</a></wiki>
<h2>Install the Linux kernel</h2>
<p>The most important part of the system, the kernel, which allows hardware to communicate with software, is ready to be installed.</p>
<p>If needed, merge the linux-firmware package, which provides device firmware:</p>
<code>(chroot)# gpkg -f world/linux-firmware</code>
<p>At this stage, you can decide which kernel you want to install. In Everest's package repository, many prebuilt kernels are available, as well as the</p>
<p>source code, should you wish to compile your own.</p>
<p><strong>Option 1: Custom kernel</strong></p>
<p>Compiling a custom kernel is the recommended option for most users, as it allows the most control.</p>
<p>Download the kernel's source tree:</p>
<code>(chroot)# gpkg -f world/linux</code>
<p>The source tree will be located under /usr/src/linux.</p>
<p>Inside /usr/src/linux, ensure the source tree is completely clean by running the following:</p>
<code>(chroot)# make mrproper</code>
<p>The kernel must be configured before it is compiled. Recommended options are not provided - it is up to you to configure the kernel for your setup.</p>
<p>Configure the kernel:</p>
<code>(chroot)# export EVEREST_ARCH="$(echo $MACHTYPE)"</code>
<p></p>
<code>(chroot)# ARCH=$EVEREST_ARCH make defconfig</code>
<p></p>
<code>(chroot)# ARCH=$EVEREST_ARCH make menuconfig</code>
<p>Once the kernel is configured, compile it:</p>
<code>(chroot)# make && make modules install</code>
<p><strong>Option 2: Distribution kernel</strong></p>
<p>For those who do not wish to configure a custom kernel, or likewise do not have the time or system resources to do so, a distribution kernel</p>
<p>provides a binary kernel. However, there are a couple of pitfalls to this option:</p>
<ol>
<li>Distribution kernels are not fine tuned to your system, they are generic and bloated</li>
<li>Distribution kernels are managed by their respective development teams, who must be relied upon for fixes</li>
<li>Distribution kernels deprive the user of the experience gained by configuring and compiling a custom kernel</li>
</ol>
<p>Everest offers many distribution kernels, some notable ones include:</p>
<ol>
<li>linux-everest</li>
<li>linux-zen</li>
<li>linux-hardened</li>
</ol>
<p>Install a distribution kernel:</p>
<code>(chroot)# gpkg -f world/linux-{everest,zen,hardened}</code>
<h2>Build an initramfs</h2>
<p>Depending on your system, an initramfs may be required. For example, users of distribution kernels will ALWAYS need to build an initramfs,</p>
<p>while those who configured and compiled their own will usually not need one.</p>
<p>To build an initramfs, you will need dracut. Install dracut:</p>
<code>(chroot)# gpkg -f world/dracut</code>
<p>Build an initramfs:</p>
<code>(chroot)# dracut</code>
<h2>Configure the system</h2>
<p>Now that the kernel is installed, various other parts of the system should be configured.</p>
<p>Create /etc/fstab, which provides the system with information about mounted filesystems.</p>
<p>For example, on a system with a root, /usr, and boot partition, /etc/fstab will look like this:</p>
<fhead><strong>FILE:</strong> /etc/fstab</fhead>
<div class="file">
<p>/dev/sda1 / ext4 noatime 0 1</p>
<p>/dev/sda2 /usr ext4 noatime 0 1</p>
<p>/dev/sda3 /boot vfat defaults,noatime 0 2
</div>
<p>System services that some may find helpful, such as a cron daemon or logging daemon, should be set up now.</p>
<p>On systems using systemd:</p>
<code>(chroot)# systemctl enable cronie chronyd sysklogd</code>
<p>On systems without a service manager, all services under /etc/init.d will be initialied by rcS.</p>
<p>The system's timezone is read from /etc/localtime, which is a symlink.</p>
<p>In case timezone information is missing from /usr/share/zoneinfo, install it:</p>
<code>(chroot)# gpkg -f world/tzdata</code>
<p>Create /etc/localtime:</p>
<code>(chroot)# ln -sv /usr/share/zoneinfo/<i>Region</i>/<i>City</i> /etc/localtime</code>
</div>

186
install.html.old Normal file
View File

@ -0,0 +1,186 @@
<!DOCTYPE html>
<html>
<head>
<title>Everest Linux - Install</title>
<link type="text/css" rel="stylesheet" href="css/everest.css"/>
</head>
<body>
<!-- Navbar -->
<div class="sidenav">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="install.html">Install</a>
<a href="https://git.everestlinux.org/EverestLinux/glacier-pkgs">Packages</a>
<a href="download.html">Downloads</a>
<a href="https://git.everestlinux.org/EverestLinux/wiki">Wiki</a>
<a href="https://git.everestlinux.org">Git</a>
</div>
<!-- Rest of page -->
<div class="main">
<h2>Installation Handbook</h2>
<p>This is the official installation guide for Everest Linux.</p>
<p>Using unofficial guides is not recommended as they may be</p>
<p>out of date.</p>
<p>Simply following this guide blindly is a great way to end up</p>
<p>with a broken installation. Ensure you have a rough idea of</p>
<p>what each command does.</p>
<p>If you need assistance, reach out on IRC (#everestlinux) or Discord.</p>
<h2>Prerequisites</h2>
<p>The following steps will be used to complete the installation:</p>
<p> - Set up the environment</p>
<p> - Download the Everest Linux system image</p>
<p> - Unpack the system image</p>
<p> - Chroot into the new system</p>
<p> - Install desired programs</p>
<p> - Install the Linux kernel
<p> - Set up init scripts/services</p>
<p> - Reboot the system</p>
<i>Note: Everest is highly flexible.</i>
<i>If you are changing anything in this guide, it is assumed</i>
<i>you know exactly what to do.</i>
<p>Run <code>(user)$</code> commands as an unprivileged user.</p>
<p>Run <code>(root)#</code> commands as the root user.</p>
<p>Run <code>(chroot)#</code> commands inside the chroot environment.</p>
<h2>Set up the environment</h2>
<p>Our environment needs to be set up correctly for the installation.</p>
<p>Create the system mountpoint:</p>
<code>(root)# mkdir -pv /mnt/everest</code>
<p>Although it may not be used, assign the system mountpoint a variable:</p>
<code>(root)# export SYS_MNT=/mnt/everest</code>
<p>Partition your drive:</p>
<code>(root)# cfdisk /dev/sdX</code>
<p>Mount the root partition to the system mountpoint:</p>
<code>(root)# mount /dev/sdX /mnt/everest</code>
<p>If needed, create the boot directory:</p>
<code>(root)# mkdir -pv /mnt/everest/boot</code>
<p>Mount the boot partition:</p>
<code>(root)# mount /dev/sdX /mnt/everest/boot</code>
<h2>Downloading the Everest system image</h2>
<p>An Everest system image is an incomplete root filesystem, which</p>
<p>provides a strong base to build off of</p>
<p>Not all system images are the same. Some differences are:</p>
<p> - The init system</p>
<p> - The standard C library</p>
<p> - The architecture</p>
<p> - SELinux support</p>
<p> - Multilib support</p>
<p>Ensure you download the image you want. Migrating in the future</p>
<p>is not officially supported or even recommended.</p>
<p>Download an image with <code>wget</code>:</p>
<code>(user)$ wget SYSTEM_IMAGE_LINK</code>
<h2>Unpacking the system image</h2>
<p>The system image can now be unpacked.</p>
<p>Ensure the system image is located under the system mountpoint.</p>
<p>Note that a simple <code>tar -xvf</code> will cause errors with</p>
<p>permissions. Therefore, a few extra flags are needed.</p>
<p>Unpack the system image:</p>
<code>(root)# tar -xpvf SYSTEM_IMAGE --xattrs-include='*.*' --numeric-owner</code>
<p>This will ensure all file ownership is compliant.</p>
<h2>Chrooting into the new installation</h2>
<p>The system is in a partially working state.</p>
<p>If we were to call it a day and reboot now, it wouldn't be possible.</p>
<p>Many critical parts of the system are missing, including the</p>
<p>bootloader and kernel. Chrooting allows us to make modifications</p>
<p>to the target system, without actually booting into it.</p>
<p>Before chrooting, additional filesystems must be mounted.</p>
<p>Mount these filesystems:</p>
<code>(root)# mount --types proc /proc /mnt/everest/proc</code>
<p></p>
<code>(root)# mount --rbind /sys /mnt/everest/sys</code>
<p></p>
<code>(root)# mount --make-rslave /mnt/everest/sys</code>
<p></p>
<code>(root)# mount --rbind /dev/ /mnt/everest/dev</code>
<p></p>
<code>(root)# mount --make-rslave /mnt/everest/dev</code>
<p></p>
<code>(root)# mount --bind /run /mnt/everest/run</code>
<p></p>
<code>(root)# mount --make-slave /mnt/everest/run</code>
<p>Chroot into the system:</p>
<code>(root)# chroot --userspec=0:0 /mnt/everest /bin/sh</code>
<p>Change the shell prompt to avoid confusion:</p>
<code>(chroot)# export PS1="(chroot) ${PS1}" && source /etc/profile</code>
<h2>Install programs</h2>
<p>Any programs you wish to install should be installed now.</p>
<p>This is because the Linux kernel takes multiple hours to compile.</p>
<p>See <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/General-Recommendations">General Recommendations</a> for ideas. Note that some</p>
<p>programs assume the system is installed, so use caution.</p>
<h2>Install the Linux kernel</h2>
<p>The most important part of the system, the kernel, is ready to be installed.</p>
<p>Install the linux-firmware package, which provides device firmware:</p>
<code>(chroot)# glacier -f linux-firmware</code>
<p>Download the kernel's source tree:</p>
<code>(chroot)# glacier -f linux</code>
<p>Change directory to the kernel's source tree:</p>
<code>(chroot)# cd /usr/src/linux</code>
<p>Ensure the kernel source tree is clean:</p>
<code>(chroot)# make mrproper</code>
<p>Configure the kernel:</p>
<code>(chroot)# ARCH="your-arch-here" make defconfig && make menuconfig</code>
<p>Compile the kernel:</p>
<code>(chroot)# make && make modules_install</code>
<p>Install the kernel:</p>
<code>(chroot)# make install</code>
<p>On some systems, an initial RAM filesystem (initramfs)</p>
<p>may be needed to ensure proper booting.</p>
<p>If you want an initramfs, install dracut:</p>
<code>(chroot)# glacier -f dracut</code>
<p>Build an initramfs:</p>
<code>(chroot)# dracut</code>
<h2>Configure the system</h2>
<p>Some components of the system mus be configured.</p>
<p>Create <code>/etc/fstab</code>.</p>
<p>Enable system services, such as a cron daemon, logger, etc:</p>
<code>(chroot)# /etc/init.d/{cronie,chronyd,sysklogd} start</code>
<p></p>
<code>(chroot)# systemctl enable --now cronie chronyd sysklogd</code>
<p>Set the timezone:</p>
<code>(chroot)# ln -svf /usr/share/zoneinfo/Region/City /etc/localtime</code>
<p>Configure the locale:</p>
<code>(chroot)# echo "LANG=en_US.UTF-8" > /etc/locale.conf</code>
<p>Set the system hostname:</p>
<code>(chroot)# echo "my_hostname" > /etc/hostname</code>
<p>Other things you might want to configure are:</p>
<p> - /etc/doas.conf or /etc/sudoers</p>
<p> - /etc/inittab</p>
<h2>Configure the bootloader</h2>
<p>One more critical component is needed: the bootloader</p>
<p>While any bootloader can be installed, this guide recommends</p>
<p><code>systemd-boot</code> and <code>grub</code>.</p>
<p>For systemd-boot/gummiboot:</p>
<p>Install the standalone package for systemd-boot if systemd is not installed:</p>
<code>(chroot)# glacier -f gummiboot</code>
<p>Install the bootloader:</p>
<code>(chroot)# bootctl install</code>
<p>Edit <code>/boot/loader/loader.conf</code> to your liking.</p>
<p>Create a boot entry at <code>/boot/loader/entries/everest.conf</code>.</p>
<p>For GRUB:</p>
<p>Install the GRUB package that corresponds to your system:</p>
<code>(chroot)# glacier -f grub-bios</code>
<p></p>
<code>(chroot)# glacier -f grub-uefi</code>
<p>Install GRUB:</p>
<code>(chroot)# grub-install /dev/sdX # for BIOS</code>
<p></p>
<code>(chroot)# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub # for UEFI</code>
<p>Create a GRUB configuration file:</p>
<code>(chroot)# grub-mkconfibg -o /boot/grub/grub.cfg</code>
<h2>Finishing the installation</h2>
<p>Every component of the system has been configured, and we can now</p>
<p>boot into it.</p>
<p>Exit the chroot environment:</p>
<code>(chroot)# exit</code>
<p>Unmount all partitions from the system mountpoint:</p>
<code>(root)# umount -R /mnt/everest</code>
<p>Power off the system:</p>
<code>(root)# poweroff</code>
<p>Ensure you remove the installation media or you</p>
<p>will not boot into the new system.</p>
<h2>Post installation</h2>
<p>A base Everest system is very minimal.</p>
<p>Most users will want to configure extra components, such as a window</p>
<p>manager, or sound. See: <a href="https://git.everestlinux.org/EverestLinux/wiki/wiki/General-Recommendations">General Recommendations</a> for more info.</p>
</div>