What does HackerNews think of sbupdate?
Generate and sign kernel images for UEFI Secure Boot on Arch Linux
It doesn't store a new key in the uefi, it signs the new image with the key that uefi already knows about.
See [1] for the whole setup and [2] for the signing part specifically.
[0] https://github.com/andreyv/sbupdate
[1] https://wiki.archlinux.org/title/Unified_Extensible_Firmware...
[2] https://wiki.archlinux.org/title/Unified_Extensible_Firmware...
As for signing kernel: https://github.com/andreyv/sbupdate
If one cares about SecureBoot then this package automates everything: https://github.com/andreyv/sbupdate (it's setup only once and works later without supervision).
If I may suggest something if you have TPM version 2 use sha256 everywhere. And you can expand the PCRs list to cover more stuff. I'm using PCRs 0 to 8 (or 9? Can't check now) so any hardware configuration change is apparent during boot.
Another useful package is sbupdate [0] that not only signs kernel for SecureBoot but additionally makes it possible to boot the kernel directly from UEFI firmware bypassing the need for bootloader (be it grub or systemd boot). Once setup it just works!
Another benefit of sbupdate (besides Secure Boot) is that it allows running Linux kernel directly as a UEFI executable, no GRUB or systemd-boot needed!