ad 3)
with Secure Boot in effect, only kernel modules with valid signatures will be allowed. As the MOK installation process was not actually completed, the signature check on the Nvidia modules failed, and as the Nvidia module installation process had probably already blacklisted the in-kernel nouveau
drivers, the system most likely fell back to the un-accelerated efifb
display driver, which only supports whatever displays the firmware had already set up.
In order to protect the system from unauthorized modification of the MOK, the MOK installation process will request the firmware to store the MOK in such a way that it will only be accessible at boot time - not when any OS is actually running. Because of this, the MOK installation process requires a reboot.
First, the MOK is created and prepared for installation while the OS is running, and a one-time password is created to protect the second phase of the installation process. Then, the system is rebooted, and the shimx64.efi
will detect that a MOK installation process has been started, and shows the blue MOK Manager screen at boot. At that point, you should select the "install key" option and confirm it by entering the one-time password that was set before the reboot. That password will never again be required: if the MOK installation was successful, the kernel module management tools will be able to automatically use the MOK when needed, or if it failed, the MOK installation process will need to be started over from the beginning.
Initially, Secure Boot firmware will only accept bootloader *.efi
files (which must use the Windows-style PE32/PE32+ binary format, rather than the ELF format Linux uses) that are either specifically whitelisted by cryptographic hash or signed by one of the Secure Boot certificates in the firmware NVRAM. The shimx64.efi
will add the Linux distribution's signing certificate and optionally the MOK certificate to the list of allowed certificates (non-persistently).
This will allow shimx64.efi
to load the grubx64.efi
bootloader and the distribution kernel, which are signed with the Secure Boot signing key of that particular Linux distribution. When built for UEFI, the Linux kernel can include an UEFI boot stub which will make the kernel look like a PE32+ binary, so the kernel can also be signed in a Secure Boot-compatible way.
The Secure Boot specification requires that the kernel must maintain the requirement to have all kernel code signature-checked before executing it, or else any non-compliant kernels may be blacklisted by future Secure Boot-compliant firmware versions. Therefore, the kernel will also signature-check any kernel modules it will load. For this purpose, the kernel axiomatically trusts the signing key it was built with. Distribution kernels usually add the Secure Boot accepted keys to their whitelist (see keyctl list %:.builtin_trusted_keys
and keyctl list %:.secondary_trusted_keys
in modern Linuxes, or keyctl list %:.system_keyring
in older versions) - this will include the MOK if one is set.