- TPM module installed in the motherboard (that is set to TPM 2.0 mode from the BIOS).
- refind
- sbsigntools
- shim-signed
- tpm2-tss-engine
- tpm2-tools (optional)
Archlinux / Manjaro: pamac update --download-only --aur && pamac install refind sbsigntools shim-signed tpm2-tss-engine
sudo -i
# Patch refind-install script
curl -o- https://gist.githubusercontent.com/heri16/6df9ae37ae51496fe376debaca45540b/raw/refind-install.patch | patch /usr/bin/refind-install
# Install reFind EFI Bootloader to ESP partition (encrypted keys without TPM)
# refind-install --shim /usr/share/shim-signed/shimx64.efi --localkeys --encryptkeys --yes
# Install reFind EFI Bootloader to ESP partition (encrypted keys on TPM)
refind-install --shim /usr/share/shim-signed/shimx64.efi --localkeys --encryptkeys --engine tpm2tss --yes
efibootmgr
# Sign Linux kernel
sbsign --engine tpm2tss --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output "/boot/vmlinuz-5.6-x86_64" "/boot/vmlinuz-5.6-x86_64"
sbverify --list "/boot/vmlinuz-5.6-x86_64"
# Sign Manjaro's Grub2 EFI Bootloader (optional)
sbsign --engine tpm2tss --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output "/boot/efi/EFI/manjaro/grubx64.efi" "/boot/efi/EFI/manjaro/grubx64.efi"
sbverify --list "/boot/efi/EFI/manjaro/grubx64.efi"
# Reboot into BIOS
Then, reboot into BIOS to enable SecureBoot.
Once in MokManager add refind_local.cer
to MoKList. refind_local.cer
can be found inside a directory called keys in the rEFInd's installation directory, e.g. esp/EFI/refind/keys/refind_local.cer
.
Make pacman sign the kernel automatically on kernel updates.
sudo -i
pamac install x11-ssh-askpass
curl -o- https://gist.githubusercontent.com/heri16/6df9ae37ae51496fe376debaca45540b/raw/90-mkinitcpio-install.hook.patch | patch -o "/etc/pacman.d/hooks/90-mkinitcpio-install.hook" /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
curl -o- https://gist.githubusercontent.com/heri16/6df9ae37ae51496fe376debaca45540b/raw/mkinitcpio-install.patch | patch -o "/usr/local/share/libalpm/scripts/mkinitcpio-install" /usr/share/libalpm/scripts/mkinitcpio-install
- https://wiki.archlinux.org/index.php/REFInd#Using_shim
- https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface/Secure_Boot#Signing_the_kernel_and_boot_manager
- https://superuser.com/questions/1557668/undo-sbsign-on-executable-remove-an-attached-image-signature
- https://github.com/tpm2-software/tpm2-tss-engine
Required
Hardware
Packages
Archlinux / Manjaro:
pamac update --download-only --aur && pamac install refind sbsigntools shim-signed tpm2-tss-engine
Usage
Then, reboot into BIOS to enable SecureBoot.
Once in MokManager add
refind_local.cer
to MoKList.refind_local.cer
can be found inside a directory called keys in the rEFInd's installation directory, e.g.esp/EFI/refind/keys/refind_local.cer
.Misc
Enable pacman hook
Make pacman sign the kernel automatically on kernel updates.
Useful Info