This how to aims to make UEFI boot your signed kernel+initramfs directly, without a bootloader like grub or system-boot. As a pre-requisite, you should log in to your UEFI settings and set SecureBoot into Setup Mode.
- Check EFI partition size, if you want to include extra drivers in
initrd
(likenvidia
), make it at least 1gb. I recommend 2gb to be future-proof. - Include extra drivers in
/etc/mkinitcpio.conf
. You neednvidia-dkms
installed for this to work. I wanted to include this in my system so SDDM (the Login Screen itself) can run in Wayland. Important: Make sureFILES
section doesn't include/crypto_keyfile.bin
as it should not be included in the initramfs on the unencrypted EFI.
MODULES=(crc32c-intel i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)
- Modify
/etc/mkinitcpio.d/linux612.preset
(or your current kernel preset) to generate a Unified Kernel Image. (see example in this gist) - Add a
/etc/kernel/cmdline
for your current kernel. You can checkcat /proc/cmdline
. (see example in this gist) - Install
sbctl
- Run
sudo sbctl status
to check current SecureBoot status. It should be in Setup Mode. If it is not, restart to UEFI and remove keys or reset secure boot. - Run
sudo sbctl create-keys
thensudo sbctl enroll-keys --Microsoft
. - Run
sudo mkinitcpio -P
. It should create a UKI for your current kernel in the EFI partition. - Run
sudo efibootmgr
to check current boot entries. - Run
sudo efibootmgr -B -b 000N
to delete old entries. Where N is theBoot0000
entry you want to delete. - Run
sudo findmnt /boot/efi
to find the EFI partition device. Usually,/dev/sda1
or/dev/nvme0n1p1
. - Run
sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "Manjaro" -l "EFI/Linux/manjaro-6.12-x86_64.efi"
- Run
sudo sbctl verify
to make sure all images are signed.
You should be able to restart now, enable Secure Boot and lock changes to boot order and secureboot itself with a firmware password.
In order to have your disk enrolled and unlocked with a TPM key, you need a LUKS2 header. Manjaro still creates a LUKS1 container, so we need to convert it. It is possible to convert in place though.
To confirm your current LUKS version, run sudo cryptsetup luksDump /dev/nvme0n1p2
. Note Version number (replace nvme0n1p2 to your device and partition, it could be /dev/sda2).
- Make sure you followed the UKI tutorial above and you don't need GRUB anymore.
- Boot into a live cd with cryptsetup available, because you can't convert with the system in use.
- Backup your luks header:
sudo cryptsetup luksHeaderBackup /dev/nvme0n1p2 --header-backup-file /mnt/backup/luks1.bkp
- Run
sudo cryptsetup convert --type luks2 /dev/nvme0n1p2
- Restart back to your installed system.
- Run
sudo systemd-cryptenroll --tpm2-device=auto /dev/nvme0n1p2
. - After that, edit
/etc/crypttab
, making it look something like this:
luks-xxx-xxx-xxx-xxx-xxx UUID=xxx-xxx-xxx-xxx-xxx none tpm2-device=auto,discard
- Create
/etc/crypttab.initramfs
, making it the same as above. - Check your TPM driver, run
sudo systemd-cryptenroll --tpm2-device=list
, note Driver column. - Edit
/etc/mkinitcpio.conf
, add that driver toMODULES
list. Also, inHOOKS
changeencrypt
tosd-vconsole sd-encrypt
and addsystemd
afterbase
. It should look like this:
MODULES=(crc32c-intel tpm_tis i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)
HOOKS=(base systemd udev autodetect microcode kms modconf block keyboard keymap consolefont plymouth sd-vconsole sd-encrypt filesystems)
- Recreate your UKI running
sudo mkinitcpio -P
- Restart