Context and goal

See the About page for context of this post.

Before starting, get the latest archiso and create a bootable USB.

Boot archiso with secure boot enabled

  • Boot the USB with secure boot enabled
  • Use HashTool to enroll loader.efi and archiso/vmlinuz.efi to be able to boot

Installation working environment setup

  • Load Finnish keyboard layout:
    loadkeys fi

    Note: Keymaps can be found with: find /usr/share/kbd/keymaps/ -type | grep -i fi where fi is the the keymap we are looking for.

  • Use the following command to connect to wireless network:
  • Set the timezone and update the system clock:
    timedatectl set-timezone Europe/Helsinki

    Note: You can list available timezone by running: timedatectl list-timezones

Partitioning and mounting the disk

  • Erase the disk and create new partitions for EFI, swap and btrfs with gdisk:
    gdisk /dev/sda

    Make sure you are using the right disk. Usually at least on a laptop the main disk of the machine is /dev/sda. First create the partition for EFI, it should be 512M of size and type ef00 for EFI System. Next, create the 16G swap partition of type 8200 for Linux swap. The size equals to amount of ram and is used for hibernation which by default only uses 2/5 of the amount of ram, but can be increased for faster hibernation and we want to make that possible in the future. Last, create the partition for the btrfs filesystem using the rest of the disk and type 8300 which is the default type Linux filesystem.

  • Format the partition with FAT32 file system for EFI:
    mkfs.vfat -F32 /dev/sda1
  • Format the partition for Swap:
    mkswap /dev/sda2
  • Format the partition with btrfs:
    mkfs.btrfs /dev/sda3

    Note: You might need to use -f with the command above if your installing over a drive that has had a system installed on it before. If you get Device or resource busy error, reboot the system and try again. Be aware that you need to load the keymaps again and connect to wifi after reboot.

  • Create the btrfs subvolumes:
    mount /dev/sda3 /mnt
    btrfs subvolume create /mnt/root
    btrfs subvolume create /mnt/home
    btrfs subvolume list /mnt
    btrfs subvolume set-default 257 /mnt
    btrfs subvolume get-default /mnt
  • Unmount the disk, mount the subvolumes and boot partition for the installation:
    umount /mnt
    mount -o defaults,compress,subvol=root /dev/sda3 /mnt
    mkdir /mnt/boot
    mkdir /mnt/home
    mount -o defaults,compress,subvol=home /dev/sda3 /mnt/home
    mount /dev/sda1 /mnt/boot

Install Arch Linux

  • Install the Arch base and base-devel:
    pacstrap -i /mnt base base-devel
  • Mount the Swap partition so that it’s taken into consideration by genfstab:
    swapon /dev/sda2
  • Create fstab for the newly installed Arch from the current mounts of /mnt:
    genfstab -U -p /mnt >> /mnt/etc/fstab
  • Chroot into the newly installed Arch and setup basics:
    arch-chroot /mnt
    echo whitewolf > /etc/hostname
    ln -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime
  • Update pacman repositories:
    pacman -Syy
  • Install vim:
    pacman -S vim
  • Setup locale by uncommenting the wanted line fi_FI.UTF-8 and en_US.UTF-8 from the /etc/locale.gen file running locale-gen:
    vim /etc/locale.gen
    echo LANG=en_US.UTF-8 >> /etc/locale.conf
    echo LC_NUMERIC=fi_FI.UTF-8 >> /etc/locale.conf
    echo LC_TIME=fi_FI.UTF-8 >> /etc/locale.conf
    echo LC_MONETARY=fi_FI.UTF-8 >> /etc/locale.conf
    echo LC_PAPER=fi_FI.UTF-8 >> /etc/locale.conf
    echo LC_MEASUREMENT=fi_FI.UTF-8 >> /etc/locale.conf
    echo KEYMAP=fi > /etc/vconsole.conf

    Note: Tried with: localectl set-keymap fi but it failed with error: Failed to create bus connection: No such file or directory.

  • Set the root password:
  • Install systemd-boot (direct EFISTUB boot not possible with Acer V13 laptop):
    bootctl install
  • Configure Arch boot config:
    vim /boot/loader/entries/arch.conf

    and add the following:

    title     Arch Linux
    linux     /vmlinuz-linux
    initrd     /initramfs-linux.img
    options     root=/dev/sda3 rw rootflags=subvol=root
  • Create a user:
    useradd -m -G wheel aleksi
    passwd aleksi
    echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/01_wheel
  • Install Gnome and other GUI tools:
    pacman -S gnome-shell gnome-keyring gnome-terminal gnome-control-center dialog gdm networkmanager
  • Alternatively if Gnome is not used (maybe some vbox for testing?), one should enable dhcpcd to enable basic networking:
    sudo systemctl enable dhcpcd
  • Install additional packages to make bluetooth headset work:
    pacman -S bluez-utils bluez-firmware pulseaudio-bluetooth
  • Enable basic system services:
    systemctl enable gdm
    systemctl enable NetworkManager
    systemctl enable bluetooth

    Note: Select to use mesa-libgl, libx264 and xf86-input-libinput instead of the offered alternatives.

  • Exit the chroot:

Secure boot

  • Prepare by getting the signed HashTool.efi and PreLoader.efi from James Bottomley’s random Pages:
  • Move the signed HashTool.efi and PreLoader.efi into place:
    mv HashTool.efi /mnt/boot/EFI/systemd/
    mv PreLoader.efi /mnt/boot/EFI/systemd/
  • Rename the default systemd-bootx64.efi to loader.efi to work with the PreLoader.efi:
    mv /mnt/boot/EFI/systemd/systemd-bootx64.efi /mnt/boot/EFI/systemd/loader.efi
  • Add PreLoader.efi to the EFI boot list:
    efibootmgr --disk /dev/sda --part 1 --create --label "PreLoader" --loader /EFI/systemd/PreLoader.efi

    Note: You may need to use the Hash tool to enrol the /EFI/loader.efi and the /vmlinuz-linux files on first boot. Some machines also require you to manually allow EFI files to boot and add them to the EFI boot list in BIOS. In these cases adding the PreLoader.efi with efibootmgr doesn’t work and is not needed.


Reboot to the new system: