Good news: PikaOS now works with Secure Boot turned on. No more signing things yourself with sbctl.
Here's how it works. Your PC trusts Microsoft's keys, so we use shim (a tiny bootloader Microsoft has signed) to start rEFInd. rEFInd and the kernel are signed with the PikaOS key. You tell your PC to trust that key once, and after that, updates take care of themselves.
The live ISO still won't boot with Secure Boot on. Install PikaOS with Secure Boot turned off first, then come back here.
You'll need a working PikaOS install that boots with rEFInd (that's the default). Your firmware's Secure Boot keys need to include Microsoft's, which is how almost every PC ships. That's what lets shim run.
The signed kernel, the signed NVIDIA modules and the Secure Boot version of rEFInd all come from the repo, so grab the latest first:
pikman upgrade
If that pulled in a new kernel, reboot before carrying on.
pikman install pika-secureboot
sudo pika-secureboot enable
This sets up shim and the signed rEFInd alongside your current rEFInd, so your config and theme stay as they are. It also adds a "PikaOS Secure Boot" entry to your boot menu and makes it the default. If rEFInd lives in the fallback EFI/BOOT folder, shim moves in there instead.
You'll be asked to pick a password. It's only used once, on the next boot, so something simple is fine.
Reboot. You'll get a blue screen saying "Perform MOK management". It only waits about 10 seconds, so don't wander off!
Pick Enroll MOK, then Continue, then Yes. Type the password from step 2 and choose Reboot.
Head into your firmware settings, switch Secure Boot on and leave the keys alone. Save and reboot.
mokutil --sb-state
If it says SecureBoot enabled, you're done. Enjoy!
You don't have to do anything when updates come in. New kernels, rEFInd and shim get copied to your EFI partition automatically.
NVIDIA users are covered too. The NVIDIA modules that come with the PikaOS kernel are already signed. If you use DKMS modules instead, enroll your DKMS key as well:
sudo pika-secureboot enable --dkms
Then reboot and do step 3 again.
Heads up for gamers: Linux anti-cheat like EAC only allows well-known keys as MOKs. Your DKMS key was made on your own PC, so enrolling it will block protected games. Stick with the prebuilt modules if you play those.
Dual booting Windows? Nothing changes there, and games or anti-cheat on Windows that need Secure Boot will be happy.
Custom kernels and third-party modules that aren't signed by us (or by your DKMS key) won't load while Secure Boot is on.
Changed your mind? Just switch Secure Boot off in your firmware. PikaOS keeps booting exactly the same way.
No worries, just reboot again. The request sticks around until you enroll it. If the screen still doesn't show up, start the request again and redo step 3:
sudo mokutil --revoke-import
sudo pika-secureboot enable
That means the key isn't enrolled yet. Turn Secure Boot off in your firmware, boot into PikaOS, run sudo pika-secureboot enable, then do steps 3 and 4 again.
It looks in /boot/efi/EFI/refind and /boot/efi/EFI/BOOT. If your EFI partition is mounted somewhere else, point it there:
sudo PIKA_ESP=/path/to/esp pika-secureboot enable