I am running AlmaLinux 9 (RedHat 9 clone) and have compiled a new kernel module. I am running in a VM with UEFI and secure boot enabled. When I insert the module I get the following error:
insmod: ERROR: could not insert module npreal2.mod: Key was rejected by service
From other posts I concluded it was related to UEFI/secure boot. So I disabled secure boot and then insmod reports:
insmod: ERROR: could not insert module npreal2.mod: Invalid module format
I tried recompiling with secure mode off then insmod worked, but I then have to leave secure boot disabled. How can I make this module work with secure boot?
There is a post on github about creating your own MOK keys, but that seems to be DKMS specific.