This guide presumes your computer is x86_64 & has UEFI, but details on what to do for BIOS are given.
UEFI was made to try (& failed) to prevent people from installing GNU/Linux.
Preparation
Download Artix Linux (runit), then download Rufus. Artix is an Arch-based Linux distro but without systemd. This means it will boot faster. Rufus can flash the install image to a USB drive, which we will then boot from to actually install Artix onto the computer.
Partitions
Make the partitions:
fdisk /dev/sda
Then (if there’s no previous partition on the disk,
ignore entering d):
d # Deletes prior partition. No going back. Do this until no partitions are left.
n # Creates new partition. Press enter three times, then enter:
+1G
n # Creates second partition. Just press enter through the rest.
w # Write changes.
Format the first partition, encrypt & format the second. If the password is lost, so is all the data (it can be changed later):
mkfs.fat -F32 /dev/sda1
fatlabel /dev/sda1 ESP
cryptsetup luksFormat /dev/sda2
cryptsetup open /dev/sda2 main
mkfs.btrfs /dev/mapper/main
Change mkfs.fat -F32 to mkfs.ext4 & skip fatlabel
if using BIOS instead of UEFI.
Mount partitions:
mount /dev/mapper/main /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
Internet
If you cannot use ethernet, then use WiFi. The Artix
installer has vim available, so open the WPA
supplicant conf with it:
vim /etc/wpa_supplicant/wpa_supplicant.conf
Enter interactive mode (press i), & type this:
ctrl_interface=/run/wpa_supplicant
update_config=1
Then press ESC, :, & enter wq (write & quit). See
below for some more basic vim controls.
Now make sure rfkill is not active, start the WPA
supplicant, & open its CLI:
rfkill unblock wifi
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli
Enter the following (replace NETWORK with the name of
your WiFi network, displayed after scan_results, &
PASSWORD with its password):
scan
scan_results
add_network
set_network 0 ssid "NETWORK"
set_network 0 psk "PASSWORD"
enable_network 0
save_config
quit
Now start dhcpcd, & you should connect to your Wifi:
dhcpcd
Installation
After connecting to the internet, install the base packages:
basestrap /mnt base runit elogind-runit linux linux-firmware grub networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit efibootmgr
Omit efibootmgr if using BIOS instead of UEFI.
Configuration
Change root into the new system:
artix-chroot /mnt bash
Set time zone, replace Region/City with your region &
city (i.e America/New_York):
ln -s /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
Open locale.gen in vim:
vim /etc/locale.gen
Then uncomment (delete the #) for your locale, e.g.
en_US.UTF-8.
The basics of vim are: i to enter insert (typing)
mode, : to run commands, in this case :w to write
(save), & :q to quit (exit). ESC to escape any
mode (insert, command, visual) to enter another or input
a command (i.e. :wq).
You can press / to search for your locale.
Generate the locale:
locale-gen
Open /etc/locale.conf in vim:
vim /etc/locale.conf
Then type in:
export LANG="en_US.UTF-8" # Change this to your locale.
export LC_COLLATE="C"
Name the computer, replace NAME with what you want
to name it:
echo "NAME" >/etc/hostname
Open /etc/hosts with vim:
vim /etc/hosts
Input this, replace NAME with the previous name:
127.0.0.1 localhost
::1 localhost
127.0.1.1 NAME.localdomain NAME
Enable the network manager at boot:
ln -s /etc/runit/sv/NetworkManager /etc/runit/runsvdir/current
Set the root (/) password. You can make it the same as
the encryption password, or different:
passwd
Autodecrypt
Open /etc/mkinitcpio.conf in vim:
vim /etc/mkinitcpio.conf
Edit the HOOKS= line at the bottom (press G) to read:
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block encrypt lvm2 filesystems fsck)
Re-run mkinitcpio, exit the system, generate the
filesystem table, & output the mount points:
mkinitcpio -p linux
exit
fstabgen -U /mnt >>/mnt/etc/fstab
lsblk -f >>/mnt/etc/default/grub
Change root into the system again & open
/etc/default/grub in vim:
artix-chroot /mnt bash
vim /etc/default/grub
Delete the mess at the bottom (G), except for the
UUIDs. Copy those (yy) & paste them (p) at the top
(gg) below the line GRUB_CMDLINE_LINUX_DEFAULT=.
Then change it to read (sda2 standing for its UUID, &
main for its UUID):
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet cryptdevice=UUID=sda2:cryptlvm root=UUID=main"
Set the bootloader:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
Run grub-install /dev/sda if using BIOS instead of
UEFI.
Completion
Shutdown, remove the USB drive, & on reboot you should be at a login prompt for a new Artix Linux installation:
exit
reboot
Post-Installation
Login as root & run:
curl -LO larbs.xyz/larbs.sh
sh larbs.sh
This will automate making a user, &c.