Archlinux with Wayland
Arch Linux Important Links
Basic Setup
Load keyboard layout
loadkeys de
Perpare Disk
Partitioning
Target:
- 1G Boot Partition
- (RAM * 1.5) Swap Partition
- Root Partition
cfdisk /dev/sda
Formatting
mkfs.fat -F 32 /dev/sda1
mkswap /dev/sda2
Create encrypted ext4 root partition
cryptsetup -y -v luksFormat /dev/sda3
cryptsetup open /dev/sda2 cryptroot
mkfs.ext4 /dev/mapper/root
Mount partitions
mount /dev/mapper/cryptroot /mnt
mount --mkdir /dev/sda1 /mnt/boot
swapon /dev/sda2
Prepare pacman
Update download server
reflector --save /etc/pacman.d/mirrorlist --country Germany --protocol https
Install arch
Install base arch packages
pacstrap -K /mnt base linux linux-firmware bash nano polkit networkmanager man-db htop
Generate fstab
file with mounts for the partitions
genfstab -U /mnt >> /mnt/etc/fstab
Change into new arch install
arch-chroot /mnt
System config
Timezone
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
Make sure hardware clock is in UTC
hwclock --systohc
Adjust locale settings
nano /etc/locale.gen
# uncomment de_DE.UTF-8
# uncomment en_US.UTF-8
locale-gen
nano /etc/locale.conf
LANG=en_US.UTF-8
Set Keymap for vconsole
nano /etc/vconsole.conf
KEYMAP=de-latin1
Adjust Hostname, choose a name
nano /etc/hostname
arch-vm
Make sure initramfs is configured for encryption
nano /etc/mkinitcpio.conf
# ...
HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck)
# ...
Regenerate initramfs
mkinitcpio -P
Set root
-User Password
passwd
Bootloader
Install Grup
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
Get UUID for ROOT partition
blkid /dev/sda3 -o value | head -1
nano /etc/default/grub
GRUB_ENABLE_CRYPTODISK=y
GRUB_CMDLINE_LINUX="... rd.luks.name=<device-UUID>=cryptroot ..."
You can copy the uuid in the file by pipe it in to the file and then copy / past it with CTRL+K
CTRL+U
eg:
blkid /dev/sda3 -o value | head -1 >> /etc/default/grub
Update grub config
grub-mkconfig -o /boot/grub/grub.cfg
Reset and reboot
exit
umount -R /mnt
swapoff /dev/sda2
reboot
Setup Arch
Ensure all needed systemd services are running
systemctl enable --now NetworkManager
Add user
Install doas (sudo alternative)
pacman -S opendoas
Create config
nano /etc/doas.conf
permit persist :wheel
Create user
useradd -m -g users -G wheel,audio,input,video <username>
passwd <username>
doas nano /etc/pacman.conf
...
ParallelDownloads = 5
...
Reboot and login into newly created user
Setup sway
pacman -S sway swayidle swaylock xorg-xwayland noto-fonts kitty waybar otf-font-awesome fzf bash-completion jq network-manager-applet firefox xdg-desktop-portal-wlr pavucontrol grim slurp brightnessctl awesome-terminal-fonts ttf-font-awesome pipewire pipewire-pulse wireplumber tlp tlp-rdw smartmontools acpi ethtool reflector rsync
systemctl mask systemd-rfkill.service
systemctl mask systemd-rfkill.socket
systemctl enable --now tlp
systemctl enable --now reflector
todo: dotfiles