I thought this handy information should be included in the Garuda doc/wiki to make it easier for folks to find and setup Secure Boot. Arch Linux which Garuda is based on, supports Secure Boot, but is disabled by default and is installed with shim (generic) certificates.
= /\ = This is for a standard Garuda installation with GRUB = /\ =
To dual boot with Secure Boot enabled, follow the instructions outlined to install Microsoft’s signed keys and sign your kernel image(s). The ‘esp’ directory should point to your system’s EFI’s folder and in a standard Garuda installation, this would be /boot/efi.
Enter UEFI and place your Secure Boot to setup mode. This is commonly done by clearing the installed keys in your system.
–Replace shim with Microsoft’s CA certificates using self-signed keys to sign all images with:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=garuda --modules="tpm" --disable-shim-lock
–Install sbctl using pacman and verify that it is in setup mode:
sbctl status
–Regenerate your grub configuration:
sudo grub-mkconfig -o /boot/grub/grub.cfg
–Create your custom secure boot keys:
sudo sbctl create-keys
–Enroll your custom keys (-m is required to include Microsoft’s CA certificates, -f will retain firmware builtins):
sudo sbctl enroll-keys -m -f
–Verify that your keys have successfully been enrolled:
sbctl status
–Check which files need to be signed for secure boot to work:
sudo sbctl verify
–Sign all unsigned files (this string will search for all images installed and sign the relevant images):
sbctl verify | sed 's/✗ /sbctl sign -s /e'
–sbctl can miss Linux images due to their install location, to ensure these images aren’t skipped:
find /boot/vmlinuz-* | xargs -n1 sbctl sign -s
–You may get an error because of an issue with certain files being immutable. To make those files mutable, run the following command for each file then re-sign afterwards:
sudo chattr -i /sys/firmware/efi/efivars/<filename>
–Verify that everything has been signed:
sudo sbctl verify
–To automate resigning of keys after a system update if using systemd-boot, add this pacman hook:
sudo sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi
–Reboot, in some cases you may need to manually re-enable Secure Boot, to verify that you are in Secure Boot after booting:
sbctl status
Credits