Appendix: System Internals
System Internals
Deep-dive reference into the P16g’s boot process, disk layout, initramfs generation, kernel parameters, and security stack. This appendix serves as both a deployment record and a learning resource for kernel development.
Boot Chain
The P16g boots through 8 stages from UEFI firmware to the Hyprland desktop. Every stage is documented below with the actual configuration from this machine.
Disk & Partition Layout
4-partition NVMe scheme with dual LUKS encryption and btrfs subvolumes. Root and home are on separate LUKS volumes — independent encryption keys, independent snapshots.
fstab Mount Options
| Option | Purpose |
|---|---|
|
Read-write, no access time updates (SSD performance) |
|
Transparent zstd compression level 3 (~30% savings on text) |
|
SSD-optimized allocation |
|
Background TRIM (batched, not per-delete) |
|
Free space tree (faster allocation) |
|
Mount specific btrfs subvolume |
ESP Layout
The EFI System Partition holds kernels, default initramfs, microcode, and systemd-boot. Fallback initramfs images live on /boot (ext4) because they’re too large for the FAT32 ESP.
Why Two Kernels?
| Kernel | Purpose |
|---|---|
|
Mainline — latest features, GPU drivers, daily driver |
|
LTS — stability fallback if mainline breaks after update |
If a pacman -Syu delivers a broken mainline kernel, reboot into the LTS entry from systemd-boot menu (press l during 3-second timeout).
Pacman Hook: ESP Kernel Sync
Kernels and initramfs are generated on /boot (ext4) but also copied to /boot/efi (ESP) via a pacman hook. This ensures systemd-boot can load them from the ESP.
mkinitcpio Hooks Pipeline
The initramfs is built by mkinitcpio running 13 hooks in order. Each hook adds specific modules, binaries, or scripts to the early boot environment.
Hook Reference
| Hook | What It Adds | Why This Machine Needs It |
|---|---|---|
|
busybox, init script, basic filesystem tools |
Always required — foundation of early userspace |
|
systemd-udev device manager |
Hardware detection and |
|
Nothing — FILTERS modules to this hardware only |
Reduces initramfs from 198MB to 137MB. Skipped in fallback. |
|
Files from |
Custom module parameters (NVIDIA, blacklists) |
|
GPU DRM drivers (nvidia, i915) |
Early display before root mount — shows LUKS prompt |
|
USB HID, PS/2 keyboard drivers |
Type LUKS passphrase — without this, no keyboard at boot |
|
Keymap from |
Correct keyboard layout for passphrase entry |
|
Console font from vconsole.conf |
⚠️ WARNING: no font configured — cosmetic only |
|
Block device drivers (NVMe, SATA, USB storage) |
Access the NVMe drive containing LUKS volumes |
|
dm-crypt, cryptsetup |
CRITICAL: Unlock LUKS encrypted root ( |
|
btrfs module, btrfs-progs tools |
CRITICAL: Mount btrfs subvolumes ( |
|
ext4, vfat, xfs modules |
Support for |
|
Filesystem check tools |
Integrity verification before mount |
Default vs Fallback Initramfs
Firmware Warnings Explained
Warnings during fallback build are for hardware NOT present in the P16g — safe to ignore:
| Firmware | What It’s For |
|---|---|
|
Intel QuickAssist crypto accelerator (server/enterprise) |
|
Aspeed BMC video controller (server baseboard management) |
|
Renesas USB 3.0 controller (specific USB cards) |
|
Adaptec SAS host bus adapter (server storage) |
|
Brocade Fibre Channel adapter (SAN storage) |
|
QLogic Ethernet/SCSI/Fibre Channel (server NICs) |
|
Western Digital SCSI controller (legacy server) |
These warnings appear in fallback because autodetect is skipped — ALL modules are included, including ones for hardware you don’t have.
Kernel Boot Parameters
Every parameter in /proc/cmdline annotated:
| Parameter | Purpose |
|---|---|
|
Tell the |
|
Root filesystem location (after LUKS unlock) |
|
Mount btrfs subvolume |
|
Mount root read-write immediately (skip read-only → remount-rw cycle) |
|
Enable NVIDIA DRM kernel mode setting — required for Wayland/Hyprland |
|
Intel modern standby (suspend-to-idle) — faster wake than S3 |
|
Mask ACPI General Purpose Event 0x6E — ThinkPad P16g interrupt storm fix. Without this, CPU sits at 100% handling phantom ACPI events. |
|
Linux Security Module load order (see LSM Stack below) |
|
Enable AppArmor as the primary MAC framework |
Kernel Module Categories
Categorization of loaded kernel modules by function. Graphviz is used here because module dependency graphs are directed acyclic graphs (DAGs) — Graphviz handles these better than D2.
Generate SVG with: dot -Tsvg kernel-module-categories.graphviz -o kernel-module-categories.svg
|
Module Categories
| Category | Modules | Purpose |
|---|---|---|
Bluetooth |
rfcomm, bnep, cmac |
RFCOMM serial protocol, Bluetooth networking, BT crypto |
Networking |
ip_tables, nf_conntrack, nf_nat, bridge, veth, x_tables |
iptables/netfilter firewall, connection tracking, NAT, Docker networking |
Cryptography |
af_alg, algif_hash, algif_skcipher, ccm |
Kernel crypto API sockets, hash/cipher interfaces, AES-CCM |
Audio |
snd_seq, snd_hrtimer, snd_seq_dummy, snd_seq_device |
ALSA sequencer subsystem (PipeWire uses ALSA underneath) |
Containers |
xt_MASQUERADE, xt_nat, xt_conntrack, iptable_nat |
Docker network isolation — NAT + masquerade for container traffic |
mkinitcpio Configuration
/etc/mkinitcpio.conf — active hooks lineHOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block encrypt btrfs filesystems fsck)
/etc/mkinitcpio.d/linux.presetALL_kver="/boot/vmlinuz-linux"
PRESETS=('default' 'fallback')
default_image="/boot/initramfs-linux.img"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
The -S autodetect in fallback options means "skip the autodetect hook" — include ALL modules for maximum hardware compatibility.
systemd-boot Configuration
/boot/efi/loader/loader.confdefault arch.conf
timeout 3
console-mode max
editor no
editor no is a security measure — prevents anyone from editing kernel command line parameters at the boot menu (which could bypass LUKS or disable security modules).
Quick Reference Commands
| Task | Command |
|---|---|
View boot chain live |
|
Boot time breakdown |
|
Critical chain |
|
Current kernel params |
|
Loaded modules |
|
Module info |
|
Module dependencies |
|
Rebuild initramfs |
|
Rebuild single |
|
Disk layout |
|
Btrfs subvolumes |
|
ESP contents |
|
Boot entries |
|
AppArmor status |
|
LSM stack |
|