Creating ISO on a USB
- Download an Artix Linux ISO Tutorial. We use Runit following Luke Smith’s recommendation.
- Format USB
- For maximum compatibility, we use FAT32.
- Use
lsblkto identify USB based on system size. Ours is located at/dev/sdc - Format the USB:
sudo mkfs.vfat /dev/sdc - Verify formatting:
sudo fsck /dev/sdb1
- Copy ISO with
dd:
1sudo dd if=$source of=$out status="progress"- Run
syncbefore removing USB.
Install Artix from ISO
Boot menu
- Insert the USB into your hardware of choice, pressing F2, F10, F11, Del, etc, in order to get into your system’s boot menu.
- Choose the USB from the boot menu. The system will now reboot into the USB.
Login
Choose regional settings, and select ISO installation.
At the login prompt enter the following login details to login as superuser:
user: root password: artix Although the artix installer advises you to login with user “artix”, I advise you login as root for privileges.
UEFI check
Determine whether you are using UEFI; run
bash ls /sys/firmware/efi/efivars If the directory is not empty, then you are running a UEFI machine,
otherwise, you can use Legacy boot loaders (we will say more later).
Create filesystem
Create filesystem: we will encrypt root partition (but not bootloaders).
Run
lsblkto determine the name of your installation drive. You probably want to choose the largest partition. We will be installing onnvme0n1. You may be installing on ‘’’sda’’’.Run
fdisk /dev/nvme0n1. 4. Enterdto delete partitions (repeatedly), if they exist. 5. Enternto create a new partition. 6. Selectpfor primary. 7. Press enter for the partition number. 8. Press enter again for the first sector. 9. For the last sector, we will make it+1G(one full gigabyte). 10. If prompted, enterYagain to remove the signature. 11. Enternagain to create another partition, and enter through all prompts. 12. Save withw. 13. Reboot if prompted (the alert message can easily be missed!!!). 14. Runninglsblk, we see that our drive now has two partitions.Format boot partition: we will use FAT32 format for maximum compatibility.
1mkfs.fat -F32 -I /dev/nvme0n1p1Encrypt root partition
1cryptsetup luksFormat /dev/nvme0n1p2Decrypt and mount root
1cryptsetup open /dev/nvme0n1p2 cryptlvm 2mkfs.btrfs /dev/mapper/cryptlvm 3mount /dev/mapper/cryptlvm /mntMount boot
1mkdir /mnt/boot 2mount /dev/nvme0n1p1 /mnt/boot
WiFi connection
1connmanctl
2enable wifi
3scan wifi
4servicesOf the wifi networks listed, choose the one you wish to connect to with
1agent on
2connect wifi_*Enter the password, then enter
1quitCheck with
1ping quantalumin.comInstall packages
Change mirror to somewhere close if desired:
1vi /etc/pacman.d/mirrorliste.g. move UK to default
Install packages
1basestrap -i /mnt base base-devel runit elogind-runit cryptsetup lvm2 lvm2-runit neovim networkmanager networkmanager-runit linux-hardened linux-hardened-headers linux-firmware
Explanation of packages
- base base-devel: TODO
- grub: boot
- os-prober: TODO necessary?
- efibootmgr: for UEFI devices (unneccessary for Legacy boot)
- runit elogind-runit: TODO
- cryptsetup lvm2 lvm2-runit: encryption
- neovim: text-editor –neovim is a rewriting of vim, which in turn is a rewriting of vi. The neovim source-code is clearer than vim, and has a large development community.
- networkmanager networkmanager-runit: wifi network manager and auto-start
- linux-hardened: (we’re installing a security hardened linux kernel)
- linux-hardened-headers: interact with the kernel
- linux-firmware: includes cryptlvmrs for proprietary hardware
Generate fstab
Generate fstab
1fstabgen -U /mnt >> /mnt/etc/fstabConfigure the base system
Begin by chroot’ing in to the system
1artix-chroot /mnt /bin/bashSet keyboard layout
Check the available layouts
1ls -R /usr/share/kbd/keymaps | grep *where * can be replaced by the layout you’re looking for
e.g. uk, or es.
Once you have chosen a layout, load it with e.g.
1loadkeys ukTo make the changes permanent post-reboot, modify the following files
TODO These files are missing. How to add them?
Configure the system clock
1ln -sf /usr/share/zoneinfo/Region/City /etc/localtimeRun hwclock to generate /etc/adjtime
1hwclock --systohcLocalisation
Uncomment the locales you desire
1nvim /etc/locale.genWe chose en_GB.UTF-8 UTF-8.
TODO difference between UTF-8 and ISO
Then generate the locales with
1locale-genRewrite
1export LANG="en_GB.UTF-8"
2export LC_COLLATE="C"TODO what is LC_COLLATE?
Hostname and hosts
Give your local host a name
1echo "desktop" > /etc/hostnameEdit the Hosts file
1127.0.0.1 localhost
2::1 localhost
3127.0.1.1 desktop.localdomain desktopEnable network manager
1ln -s /etc/runit/sv/NetworkManager /etc/runit/runsvdir/currentAdd user and set passwords
Root user password
1passwdCreate new user, and add password
1useradd -G wheel -m Henry
2passwd HenryEdit the sudoers file /etc/sudoers, uncommenting the line for the wheel group. This grants the user the privilege to run the command sudo
Autologin
Since we have already encrypted our drive, we can set autologin. Edit the following line
1GETTY_ARGS="--no-clear"as
1GETTY_ARGS="--no-clear --autologin Henry"Boot Loader
Add to the line Hooks=(...) encrypt and lvm2, in the following way
1Hooks=(...consolefont block encrypt lvm2 filesystems fsck)Build the image
1mkinitcpio -p linux-hardenedBuild bootloader (GRUB)
In this section, we install the bootloader. In order to do so, we must see the filesystems
as seen from the point-of-view of the GRUB, requiring us to exit our chroot.
1lsblk -f >> /etc/default/grub
2exit
3fstabgen -U /mnt >> /mnt/etc/fstab+++
Why did we exit?
Earlier, we logged in as root into the Artix OS installed on the USB. We then chroot‘ed into
the filesystem on the partioned drive. fstabgen is unable to see the paritioning of the drive
from inside the filesystem, and therefore requires us to exit it.
TODO perhaps include a Mermaid diagram
TODO check the vocabulary filesystem
+++
Then artix-chroot /mnt bash back into the system and go to
the bottom of the GRUB file /etc/default/grub.
We want the UUID of the encrypted and uncrypted main parition
(we don’t need the UUID of the boot partition).
Copy the UUIDS as
1GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quit cryptdevice=UUID=$UUIDCRYPT:cryplvm root=UUID=$UUIDUNENCRYPTED"where $UUIDCRYPT and $UUIDUNENCRYPTED should be replaced by
the UUID of the encrypted and unencrypted partitions, which
you copied over with >>. Delete the other text you copied
over.
Then install the GRUB. For Legacy BIOS, run
1grub-install /dev/nvme0n1For UEFI BIOS, you will have to use a different command
1grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grubFinally, create the GRUB configuration
1grub-mkconfig -o /boot/grub/grub.cfgReboot
You may now reboot your system.
If everything worked, you will be prompted for your
cryptpassword.
Try lsblk as a check.
Try echo $LANG, which should return the language configurated
Connect to the internet
Finally, connect to the internet with Network Manager
1nmcli device wifi list
2nmcli device wifi connect $SSID password $PASSWORD
3ping quantalumin.com