Files
quartz/content/10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Base Install.md
Quartz Syncer fe0581e423
All checks were successful
Build and Deploy Quartz / build (push) Successful in 27s
Published multiple files
2026-02-05 12:24:25 -07:00

466 lines
8.6 KiB
Markdown

---
publish: true
permalink: /os/base-install
title: Base Install
created: 2026-01-29T14:10:28.844-07:00
modified: 2026-02-05T12:17:52.905-07:00
tags:
- arch
- installation
- luks
- btrfs
cssclasses: ""
---
My Arch Linux installation guide for Framework Laptop 13 (AMD Ryzen 7040). LUKS2 encrypted BTRFS with Limine bootloader.
> Based on guides by [yovko](https://gist.github.com/yovko/512326b904d120f3280c163abfbcb787) and [mgajewskik](https://gist.github.com/mgajewskik/a9331171c31b6e8839c427210ba76730), adapted for Framework AMD hardware.
---
## Overview
- **Encryption:** LUKS2 on system partition
- **Filesystem:** BTRFS with subvolumes (snapshots, compression)
- **Bootloader:** Limine (lightweight, Snapper-friendly)
- **Hardware:** Framework Laptop 13 AMD (Ryzen 7040 series)
---
## Preparation
Boot from the [official Arch ISO](https://archlinux.org/download/).
### Connect to WiFi
```bash
iwctl station wlan0 connect <SSID>
```
### Set keymap and font
```bash
loadkeys us
setfont ter-132b
```
### Verify UEFI mode
```bash
cat /sys/firmware/efi/fw_platform_size
# Should return 64
```
### (Optional) SSH in from another machine
```bash
passwd # set root password
ip addr show # get IP
# From other machine: ssh root@<ip>
```
---
## Disk Partitioning
Assuming single-boot Arch on `/dev/nvme0n1`.
### Wipe existing partitions
```bash
sgdisk --zap-all /dev/nvme0n1
```
### Create partitions
- **ESP:** 2GB FAT32 for `/boot`
- **System:** Rest of disk, LUKS2 encrypted BTRFS
```bash
parted --script /dev/nvme0n1 \
mklabel gpt \
mkpart ESP fat32 1MiB 2049MiB \
set 1 esp on \
mkpart Linux btrfs 2050MiB 100%
```
### Format ESP
```bash
mkfs.fat -F 32 /dev/nvme0n1p1
```
---
## Encryption Setup
### Create LUKS container
```bash
cryptsetup luksFormat /dev/nvme0n1p2
```
**Save the UUID** — you'll need it for the bootloader:
```bash
cryptsetup luksUUID /dev/nvme0n1p2
```
### Open the container
```bash
cryptsetup open /dev/nvme0n1p2 root
```
---
## BTRFS Setup
### Format and mount
```bash
mkfs.btrfs /dev/mapper/root
mount /dev/mapper/root /mnt
```
### Create subvolumes
```bash
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@var_log
btrfs subvolume create /mnt/@var_cache
btrfs subvolume create /mnt/@snapshots
```
### Remount with subvolumes
```bash
umount /mnt
mount -o compress=zstd:1,noatime,subvol=@ /dev/mapper/root /mnt
mount --mkdir -o compress=zstd:1,noatime,subvol=@home /dev/mapper/root /mnt/home
mount --mkdir -o compress=zstd:1,noatime,subvol=@var_log /dev/mapper/root /mnt/var/log
mount --mkdir -o compress=zstd:1,noatime,subvol=@var_cache /dev/mapper/root /mnt/var/cache
mount --mkdir -o compress=zstd:1,noatime,subvol=@snapshots /dev/mapper/root /mnt/.snapshots
mount --mkdir /dev/nvme0n1p1 /mnt/boot
```
---
## Install Base System
```bash
pacman -Syy
pacstrap -K /mnt \
base base-devel linux linux-firmware linux-headers \
git vim neovim \
btrfs-progs efibootmgr limine cryptsetup \
networkmanager iwd wireless-regdb \
reflector bash-completion zsh \
pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber sof-firmware \
bluez bluez-utils \
acpi acpid power-profiles-daemon \
firewalld cups avahi nss-mdns \
util-linux terminus-font openssh man sudo rsync \
amd-ucode mesa vulkan-radeon libva-mesa-driver
```
### Generate fstab
```bash
genfstab -U /mnt >> /mnt/etc/fstab
```
---
## System Configuration
### Chroot in
```bash
arch-chroot /mnt
```
### Timezone and locale
```bash
ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
hwclock --systohc
# Edit /etc/locale.gen, uncomment en_US.UTF-8 UTF-8
vim /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
```
### Console font and keymap
```bash
cat > /etc/vconsole.conf << EOF
KEYMAP=us
FONT=ter-132b
EOF
```
### Hostname
```bash
echo "framework" > /etc/hostname
```
### Root password
```bash
passwd
```
### Create user
```bash
useradd -mG wheel phil
passwd phil
EDITOR=vim visudo # uncomment %wheel ALL=(ALL:ALL) ALL
```
### Configure mkinitcpio
Edit `/etc/mkinitcpio.conf`:
```bash
MODULES=(btrfs)
BINARIES=(/usr/bin/btrfs)
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)
```
> **Note:** Add `resume` after `filesystems` if you want hibernation support.
Regenerate:
```bash
mkinitcpio -P
```
---
## Limine Bootloader
### Install Limine
```bash
mkdir -p /boot/EFI/limine
cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/
```
### Create NVRAM entry
```bash
efibootmgr --create --disk /dev/nvme0n1 --part 1 \
--label "Arch Linux" \
--loader '\EFI\limine\BOOTX64.EFI' \
--unicode
```
### Configure Limine
Create `/boot/EFI/limine/limine.conf`:
```
timeout: 3
/Arch Linux
protocol: linux
path: boot():/vmlinuz-linux
cmdline: quiet cryptdevice=UUID=<YOUR-LUKS-UUID>:root root=/dev/mapper/root rw rootflags=subvol=@ rootfstype=btrfs cfg80211.ieee80211_regdom=US
module_path: boot():/initramfs-linux.img
/Arch Linux (fallback)
protocol: linux
path: boot():/vmlinuz-linux
cmdline: quiet cryptdevice=UUID=<YOUR-LUKS-UUID>:root root=/dev/mapper/root rw rootflags=subvol=@ rootfstype=btrfs cfg80211.ieee80211_regdom=US
module_path: boot():/initramfs-linux-fallback.img
```
Replace `<YOUR-LUKS-UUID>` with the UUID from earlier.
---
## Enable Services
```bash
systemctl enable NetworkManager
systemctl enable iwd
systemctl enable bluetooth
systemctl enable cups
systemctl enable avahi-daemon
systemctl enable firewalld
systemctl enable acpid
systemctl enable power-profiles-daemon
systemctl enable reflector.timer
systemctl enable fstrim.timer
```
---
## Framework AMD Tweaks
### Disable PC speaker
Create `/etc/modprobe.d/nobeep.conf`:
```
blacklist pcspkr
blacklist snd_pcsp
```
### Lid behavior
Edit `/etc/systemd/logind.conf`:
```ini
HandlePowerKey=ignore
HandlePowerKeyLongPress=poweroff
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore
```
### WiFi performance (MediaTek RZ616)
The AMD Framework uses MediaTek WiFi which needs some tuning.
**Set regulatory domain** — without this you're stuck on 2.4GHz:
```bash
# Add to Limine cmdline:
cfg80211.ieee80211_regdom=US
```
**Use iwd as NetworkManager backend** for better stability:
Create `/etc/NetworkManager/conf.d/wifi-backend.conf`:
```ini
[device]
wifi.backend=iwd
```
**Disable WiFi power saving** to prevent disconnects:
Create `/etc/modprobe.d/mt7921.conf`:
```
options mt7921e power_save=0
```
### Headphone jack buzz fix
The AMD board has a slight buzz when audio is idle. Disable power saving:
Create `/etc/modprobe.d/audio-powersave.conf`:
```
options snd_hda_intel power_save=0
```
### USB-A expansion card power drain
Avoid placing USB-A cards in the **two rear slots** — they cause higher idle power drain. Front slots are fine.
### HDMI/DisplayPort expansion cards
Don't use the **front-left slot** for HDMI/DP cards — may not work on AMD.
---
## Reboot
```bash
exit
umount -R /mnt
cryptsetup close root
reboot
```
Remove the USB drive.
---
## Post-Install
### Connect to WiFi
```bash
nmcli device wifi connect <SSID> password <password>
```
### Install paru (AUR helper)
```bash
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/paru.git
cd paru && makepkg -si
cd .. && rm -rf paru
```
### Enable pacman colors
Uncomment `Color` in `/etc/pacman.conf`.
### Time sync
```bash
timedatectl set-ntp true
```
### Pacman hook for Limine updates
Create `/etc/pacman.d/hooks/99-limine.hook`:
```ini
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = limine
[Action]
Description = Deploying Limine after upgrade...
When = PostTransaction
Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/
```
### BIOS updates
Framework AMD is well supported on LVFS. Check for updates:
```bash
sudo pacman -S fwupd
fwupdmgr refresh
fwupdmgr get-updates
fwupdmgr update
```
> **Note:** If you have a batch 1 or 2 device, make sure BIOS is at least 3.03 before updating further.
---
## Next Steps
- [[10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Hyprland Setup]] — graphical environment
- [[10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Network]] — advanced networking
- Snapper for BTRFS snapshots
- Swap/hibernation setup
---
## References
- [Arch Wiki: Framework Laptop 13](https://wiki.archlinux.org/title/Framework_Laptop_13)
- [Arch Wiki: Installation Guide](https://wiki.archlinux.org/title/Installation_guide)
- [Arch Wiki: Limine](https://wiki.archlinux.org/title/Limine)
- [Arch Wiki: BTRFS](https://wiki.archlinux.org/title/Btrfs)
- [Arch Wiki: dm-crypt](https://wiki.archlinux.org/title/Dm-crypt)