Skip to content

Instructions to install Arch Linux on a Dell laptop.

Notifications You must be signed in to change notification settings

kifbv/arch-linux-dell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Notes to myself on how to install Arch Linux.

Instructions below mostly from the Arch Linux Installation Guide.

Tested on Dell XPS13 (9360).

Preparation

Prepare a bootable USB stick with the Arch image on it:

  1. download the latest Arch Linux ISO image and its signature from the Arch Linux Downloads page
  2. verify the image integrity: gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig
  3. format a USB stick (FAT format, MBR partition table) or use something like ventoy
  • formatted stick: copy the ISO image to the stick: cp path/to/archlinux.iso /dev/disk/by-id/usb-xxxx
  • ventoy: copy the ISO image to the stick: cp path/to/archlinux.iso path/to/usb/stick
  1. reboot the computer, enter the BIOS, and disable 'safe boot' (if on Linux with systemd: run systemctl reboot --firmware-setup should present you with the boot menu directly)
  2. reboot and select Arch Linux in the boot menu (Dell XPS13: press F12 to get the boot menu)

Pre-installation

Note: in case of SQUASHFS errors during installation, it probably means that the USB device is not good so try another one.

Set the console keyboard layout

The default is us but for e.g. a uk layout:

  1. list the available layouts:

    localectl list-keymaps or ls /usr/share/kbd/keymaps/**/*.map.gz

  2. load the uk layout:

    loadkeys uk

Load a more relevant font: setfont eurlatgr

Connect to the internet

Run wifi-menu, or refer to Network configuration or Wireless network configuration if that doesn't work. add /etc/iwd/main.conf with the following for DHCP: [network] EnableNetworkConfiguration=true ip link to check the network interface is listed and up iwctl to get an interactive prompt; then device list; turn on if necessary with device set-property Powered on (same with adapter if necessary); scan with station scan; list available networks with station get-networks; connect with station connect ping -4 archlinux.org to verify connection ok

Update the system clock

timedatectl set-ntp true

Optimize logical sector size (for NVMe drives)

Partition the disk

Check the disk with lsblk or fdisk -l and take a note of the device name (/dev/nvme0n1 on the Dell XPS13)

  1. Use the GPT disklabel:

    parted -a optimal /dev/nvme0n1 mklabel gpt

  2. Create a small boot partition:

    parted -a optimal -- /dev/nvme0n1 mkpart ESP fat32 1MiB 513MiB set 1 boot on

  3. Create a system partition using the rest of the disk:

    parted -a optimal -- /dev/nvme0n1 mkpart ext4 513MiB 100%

Persistent block device naming for fstab is achieved by using UUID of the disk.

Encrypt the Linux partition

Use LVM on LUKS.

  1. Create the encrypted container on the system partition (choose a good passphrase):

    cryptsetup luksFormat /dev/nvme0n1p2

  2. Open the container (name it 'luks'):

    cryptsetup open /dev/nvme0n1p2 luks

  3. Create a Physical Volume on top of the opened LUKS container:

    pvcreate /dev/mapper/luks

  4. Create a Volume Group and add the Physical Volume to it (name it main):

    vgcreate main /dev/mapper/luks

  5. Create Logical Volumes on that Volume Group (50GiB for / and 100GiB for /home, no swap YOLO):

    lvcreate -L50g main -n root

    lvcreate -L100g main --name home

Format the filesystem on each Logical Volume:

See https://wiki.archlinux.org/index.php/Ext4#Enabling_metadata_checksums and maybe http://www.askapache.com/optimize/super-speed-secrets/ modprobe crc32c_intel mkfs.ext4 -O metadata_csum,64bit /dev/mapper/main-root mkfs.ext4 -O metadata_csum,64bit /dev/mapper/main-home

Mount the file systems

  1. mount /:

    mount -o defaults,journal_checksum /dev/mapper/main-root /mnt

  2. create mountpoints for /boot and /home:

    mkdir /mnt/{boot,home}

  3. mount /boot:

    mount -o defaults,journal_checksum /dev/nvme0n1p1 /mnt/boot

  4. mount /home:

    mount -o defaults,journal_checksum /dev/mapper/main-home /mnt/home

Installation

Install the base packages

Install the base and base-devel package groups as well as some packages for wireless network configuration, Intel micro-code updates and git:

pacstrap /mnt base base-devel dialog dhcpcd wpa_actiond wpa_supplicant intel-ucode git pacstrap /mnt base base-devel linux linux-firmware intel-ucode iwd lvm2 sway foot waybar wofi vim brave

Configure the system

Fstab

Create the fstab file:

genfstab -U /mnt >> /mnt/etc/fstab

Change root into the target system to continue the installation:

arch-chroot /mnt

Time settings

Set the timezone:

ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime

Set the hardware clock (from the system clock but keep it UTC):

hwclock --systohc --utc

Locale

Uncomment required localisations in /etc/locale.gen and regenerate them with locale-gen.

Set the LANG variable in /etc/locale.conf e.g. LANG=en_GB.UTF-8

Make console keyboard mappings and font changes permanent /etc/vconsole.conf:

FONT=eurlatgr
KEYMAP=us

Hostname

  1. Create the hostname file:

    echo <hostname> > /etc/hostname

  2. Add a matching entry to /etc/hosts:

    echo 127.0.1.1 <hostname>.localdomain <hostname> >> /etc/hosts

Network configuration

  1. Configure wireless with wifi-menu.

  2. Configure wireless to start at boot and automatically connect to known networks:

    systemctl enable netctl-auto@<interface_name>.service

(use tab completion to figure out the interface name).

Initramfs

Edit /etc/mkinitcpio.conf with:

  • MODULES="EXT4"
  • HOOKS="autodetect systemd block sd-vconsole sd-encrypt sd-lvm2 fsck keyboard"

Run mkinitcpio -p linux to generate the initramfs image as /boot/initramfs-linux.img

(see mkinitcpio#hooks)

Setup systemd-boot:

bootctl --path=/boot install

Bootloader

Create a bootloader entry:

UUID=$(cryptsetup luksUUID /dev/nvmen0n1p2)
cat <<EOF>/boot/loader/entries/arch.conf
title     Arch Linux
linux     /vmlinuz-linux
initrd    /intel-ucode.img
initrd    /initramfs-linux.img
options   luks.uuid=$UUID luks.name=$UUID=luks root=/dev/mapper/main-root rw
EOF

Point the bootloader to the default entry (see Basic Configuration):

cat <<EOF>/boot/loader/loader.conf
default  arch
editor   0
EOF

Users

Set the root password with passwd

Add a regular user:

useradd -m -g users -G wheel -s /bin/bash franck
passwd franck

Run visudo and add the following to have my user in the sudoers file :

# options
Defaults editor=/usr/bin/vim, !env_editor
Defaults insults

# full access
franck ALL=(ALL) ALL

# last rule as a safety guard
franck ALL=/usr/sbin/visudo

To add a red blinking prompt for root:
First, copy some skeleton files:
cp /etc/skel/.bash_profile /etc/skel/.bashrc /root
And then edit /root/.bashrc and set PS1 to:
PS1="\e[1m\e[91m\e[5m[\u@\h]\$\e[m\e(b "

Reboot

exit

reboot

System configuration

Add the following repo to /etc/pacman.conf for easy installation of vivaldi:

[herecura]
Server = https://repo.herecura.be/herecura/x86_64

ensure that the following options are set:

HoldPkg = pacman glibc
Architecture = auto
Color
CheckSpace
VerbosePkgLists
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional

and upgrade the system with sudo pacman -Syu in order to be able to use it.

add tuning instructions e.g. build in tmpfs (https://wiki.archlinux.org/index.php/Makepkg#Improving_compile_times)

Packages

Install the following package groups: i3 xorg xorg-apps xorg-drivers

Install the packages in packages.lst with pacman and pacaur.

Enable some services

  • systemctl enable --now systemd-timesyncd.service# simple SNTP daemon
  • systemctl enable --now docker.service
  • cp /etc/iptables/empty.rules /etc/iptables/iptables.rules &&
    .. systemctl enable --now iptables.service # safety first (and see Simple Statefull Firewall for configuration)

User configuration

Clone all the config files from github/kifbv/dotfiles and install them with stow

Plus:

  • wayland support, prompt (see here and here and here too.
  • install fonts
  • finish qmk config

TODO

Also see https://wiki.archlinux.org/index.php/Sysctl and https://wiki.archlinux.org/index.php/Improving_performance Fix the layout to be the same as Macbook UK (i.e. use us layout but remap the |\ key next to shift-left to ~`) Relocate files to tmpfs (+ other tips in https://wiki.archlinux.org/index.php/Improving_performance)

Arch Linux Docs:

Installation guide Improving performance Keyboard shortcuts Keyboard configuration in Xorg Map scancodes to keycodes Extra keyboard keys in Xorg Xbindkeys LVM Mkinitcpio Disk encryption Ext4 Wireless Network Configuration

Broadcom driver for the MacBook

About

Instructions to install Arch Linux on a Dell laptop.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published