Libreboot Full Disk Encryption
This guide covers single password boot on a Librebooted machine. On a Librebooted system, GRUB is baked into the firmware chip rather than installed to disk. This means GRUB itself unlocks your LUKS container at boot, with the initramfs using an embedded keyfile for the second unlock automatically (resulting in a single password prompt).
This guide assumes:
- You have Libreboot installed and running successfully.
- You have completed the Artix Installation Guide (or have any GNU/Linux distribution) with
--type luks2 --pbkdf argon2idwhen formatting your LUKS partition.
Step 1: Boot with iomem=relaxed
The Linux kernel blocks direct memory access by default. You need to pass iomem=relaxed as a kernel parameter to allow flashrom to access the firmware chip.
At the GRUB menu press e, navigate to the linux line and append iomem=relaxed, then press Ctrl+x to boot.
Verify it worked:
You should see iomem=relaxed in the output.
Step 2: Install Tools
&&
Step 3: Backup the Current ROM
Take three reads and verify they match before proceeding:
Step 4: Set Up a Keyfile
Without a keyfile you will be prompted for your LUKS password twice on every boot: once by Libreboot's GRUB to load the kernel, and once by the initramfs to mount root. A keyfile embedded in the initramfs allows the second unlock to happen automatically.
i. Generate and register the keyfile:
# generate keyfile
# add it as a LUKS key
/dev/nvme0n1p2 returns an error, find the underlying device with lsblk -f and use that instead.ii. Give it read permissions so mkinitcpio can embed it:
iii. Edit /etc/mkinitcpio.conf and add the keyfile to the FILES line:
FILES=(/grub_crypto_key.bin)
iv. Rebuild the initramfs:
v. Verify the keyfile is embedded:
|
Step 5: Create the Firmware grub.cfg
i. Get your LUKS partition UUID:
ii. Create a grub.cfg file replacing <uuid> with your value. Use the version that matches your setup:
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2014-2016,2020-2021,2023-2025 Leah Rowe <[email protected]>
# Copyright (C) 2015 Klemens Nanni <[email protected]>
)
if ; then
else
gfxpayload=keep
for; do
for; do
if [); then
)
fi
done
done
fi
if ; then
fi
if [); then
)
else
fi
if [); then
)
fi
# --- Uncomment the below for LVM setups (update for your UUID and disk) ---
# menuentry 'Artix Linux' {
# insmod part_gpt
# insmod cryptodisk
# insmod luks2
# insmod lvm
# insmod btrfs
# cryptomount -u <uuid>
# set root='lvm/vg0-root'
# linux (lvm/vg0-root)/@/boot/vmlinuz-linux root=/dev/vg0/root cryptdevice=UUID=<uuid>:main rootflags=subvol=@ cryptkey=rootfs:/grub_crypto_key.bin loglevel=3 quiet
# initrd (lvm/vg0-root)/@/boot/initramfs-linux.img
# }
# --- Uncomment the below for standard setups (update for your UUID and disk) ---
# menuentry 'Artix Linux' {
# insmod part_gpt
# insmod cryptodisk
# insmod luks2
# insmod btrfs
# cryptomount -u <uuid>
# set root='crypto0'
# linux (crypto0)/@/boot/vmlinuz-linux root=/dev/mapper/main cryptdevice=UUID=<uuid>:main rootflags=subvol=@ cryptkey=rootfs:/grub_crypto_key.bin loglevel=3 quiet
# initrd (crypto0)/@/boot/initramfs-linux.img
# }
if [); then
fi
if [); then
fi
set timeout=3 shows the menu for 3 seconds before auto-booting. Set it to 0 to boot straight through with no menu.Step 6: Update the SPI Chip
Flash the updated ROM:
Keep your backup ROMs somewhere safe in case you ever need to recover with an external programmer.
That's all folks!