e42.uk Circle Device

 

Quick Reference

Artix Linux Installation

Artix Linux Installation

Artix is a systemd-free Linux distribution, but does recommend some other nonsense I don't like so much. This is how I installed it.

Network Setup (for installation)

Using ethernet is simple, just make sure to stop connman before setting the IP addresses :-).

To setup the WiFi network with connman (included on the LiveCD).

# ip link set up dev wlan0
RTNETLINK answers: Operation not possible due to RF-kill
# rfkill list
0: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
# rfkill unblock 1
# ip link set up dev wlan0
# connmanctl
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
- list of networks -
connmanctl> agent on
Agent registered
connmanctl> connect wifi_xxx_managed_psk
- passphrase -
Connected to wifi_xxx_managed_psk
connmanctl>

Tab completion is available for those long network names!

Update pacman database

# pacman -Sy

Partitioning Disks

I prefer to use sfdisk but it is not great when you want to edit the current partition table. So here we will use parted:

# pacman -S parted

encrypted root partition:

# cryptsetup luksFormat /dev/nvme0n1p5
# echo -n <passphrase> |cryptsetup luksOpen /dev/nvme0n1p5 encrypted -d -
# mkfs.ext4 /dev/mapper/encrypted
# mount /dev/mapper/encrypted /mnt
# mkdir /mnt/boot
# mount /dev/nvme0n1p1 /mnt/boot

Install Base System and chroot

basestrap the system (install basic utilities, in this case openrc will be the init system as in Alpine and Gentoo) and a kernel along with firmware:

# basestrap /mnt base base-devel openrc seatd-openrc iptables-nft
# basestrap /mnt mkinitcpio

Configure mkinicpio so that the encrypted root partition can be decrypted, in /etc/initcpio.conf the HOOKS line should contain encrypt:

HOOKS=(... block encrypt ...)

Now we must install the firmware and generate the cpio image

# basestrap /mnt linux-lts linux-firmware

Ensure that various required packages are available in the chroot, this step may also re-generate the /boot/initramfs-linux-lts.img file:

# basestrap /mnt cryptsetup wpa_supplicant

Generate the /etc/fstab file for the new system using UUIDs:

# fstabgen -U /mnt >> /mnt/etc/fstab
# vi /mnt/etc/fstab
- check that it is ok -
# artix-chroot /mnt

Before you forget, set the /etc/passwd and /etc/shadow entries for the root user to be empty, I forget this often and then need to reboot with the live environment!

Although the above may regenerate the file (see the output for confirmation):

==> Initcpio image generation successful

If this is not present then the image may be generated manually:

# ls /lib/modules
6.12.34-1-lts  <-- this is the kernel version
# mkinitcpio --config /etc/mkinitcpio.conf --kernel 6.12.34-1-lts --generate /boot/initramfs-linux-lts.img

Locale stuff:

# ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
# hwclock --systohc
# pacman -S neovim
# nvim /etc/locale.gen
- en_GB.UTF-8 UTF-8 and en_GB ISO-8859-1
# locale-gen

/etc/locale.conf:

export LANG="en_GB.UTF-8"
export LC_COLLATE="C"

Bootloader (I prefer syslinux over grub, in know that there are some additional features in grub that many want, by all means read about how to setup grub):

# pacman -S syslinux efibootmgr
# mkdir /boot/EFI/artix
# cp /usr/lib/syslinux/efi64/syslinux.efi /boot/EFI/artix/BOOTX64.EFI
# cp /usr/lib/syslinux/efi64/ldlinux.e64 /boot/EFI/artix/
- make sure your kernel and initramfs are in the correct locations -
- /boot/EFI/artix should be ok -
# nvim /boot/EFI/artix/extlinux.conf

Discover the UUIDs of the partitions for booting:

# lsblk --output NAME,UUID
NAME            UUID
nvme0n1
  nvme0n1p1     CAFE-BABE
  nvme0n1p5     cafebabe-cafe-babe-cafe-babecafebabe
    encrypted   e6779222-1199-1122-3344-556688779988

In the above output cafebabe-cafe-babe-cafe-babecafebabe is uuid_of_encrypted_partition and e6779222-1199-1122-3344-556688779988 is uuid_of_device_mapped which can be used to write the contents of extlinux.conf:

default artixlinux
label artixlinux
    linux vmlinuz-linux-lts
    initrd initramfs-linux-lts.img
    append cryptdevice=UUID=<uuid_of_encrypted_partition>:root:allow-discards root=UUID=<uuid_of_device_mapped> rw quiet

The allow-discards option is for LUKS1 formatted devices but as far as I can tell the argument will be passed to cryptsetup and so will work with LUKS2 formatted devices for when the allow-discards flag is not set. To verify this it would be good to look in the script that is executed in the initramfs for now though I will assume that it works ok :-P.

Configure EFI with efibootmgr:

efibootmgr --disk /dev/nvme0n1 --create --label Artix --loader \\EFI\\artix\\BOOTX64.EFI

The system should now be ready to boot! It might be worthwhile setting up the keyboard and the repository... also perhaps installing some additional software, such as busybox, dhclient, ifconfig to support default netifrc used in openrc.

Keyboard Setup

Keyboard is setup via /etc/conf.d/keymaps, for compatibility with some programmes it is a good idea to also create /etc/vconsole.conf which is a systemd thing:

# /etc/conf.d/keymaps

keymap="uk"

And for systemd (I also think this file is used by mkinitcpio), you will need terminus installed for this to work properly:

# /etc/vconsole.conf

KEYMAP=uk
FONT=ter-p16n
FONT_MAP=8859-2

Temporary setup can be performed with:

loadkeys uk

More Detail on Arch Wiki

Wireless Networking with wpa_supplicant

To configure wpa_supplicant to start at boot, from what I can tell this is not a preferred method, connman and NetworkManager probably do a better job. You have been warned.

In /etc/conf.d/net:

config_wlan0="dhcp"

In /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=/run/wpa_supplicant

network={
ssid="Network Name"
psk="PreSharedKey"
}

Configure net.wlan0 to start at boot:

# cd /etc/init.d
# ln -s net.lo net.wlan0
# rc-update add net.wlan0 default

wlan0 should be changed according to your specific system configuration.

Adding Arch Linux Repositories

Although Artix is independent of Arch they share an ancestry, as such many packages will operate perfectly well... and there are some packages that are not present in the Artix repositories that I make use of fairly often... busybox being the most important. Others being the foot terminal emulator and swayimg.

Artix Wiki - Main / Repositories

TODO: More Stuff Here

pacman -S busybox

Troubleshooting

/etc/resolv.conf

For some reason I found that /etc/resolv.conf was mounted with overlay fs which meant I could not edit it. This is by design for arch-chroot which artix-chroot was derived from. This probably does not matter if networking was configured earlier so ignore this if name resolution works. If it does not and changes are required to /etc/resolv.conf then it may be unmounted:

# umount /etc/resolv.conf
# nvim /etc/resolv.conf

Reference

Quick Links: Techie Stuff | General | Personal | Quick Reference