OS: Ubuntu 20.04
Machine: Dell XPS 13 9370
Attempting to upgrade from Linux kernel 5.13.0 to 5.16.14. Have verified that kernel 5.16.14 runs properly without secure boot. Followed instructions here and here and all steps appear to complete successfully. Specifically, here are the steps I took:
Download kernel files
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-headers-5.16.14-051614_5.16.14-051614.202203111231_all.deb wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-image-unsigned-5.16.14-051614-generic_5.16.14-051614.202203111231_amd64.deb wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-modules-5.16.14-051614-generic_5.16.14-051614.202203111231_amd64.deb Install kernel
chmod +x *.deb sudo dpkg -i *.deb Create req file
vim mokconfig.cnf # filled in details as instructed in articles Generate keys
openssl req -config ./mokconfig.cnf \ -new -x509 -newkey rsa:2048 \ -nodes -days 36500 -outform DER \ -keyout "MOK.priv" \ -out "MOK.der" Convert to pem format
openssl x509 -in MOK.der -inform DER -outform PEM -out MOK.pem Enroll key
sudo mokutil --import MOK.der At this point, I rebooted and the blue MOK screen appeared as expected. The key I had just enrolled was shown and I was able to add, then continue booting.
Verify key is enrolled
sudo mokutil --list-enrolled Sign kernel
sudo sbsign --key MOK.priv --cert MOK.pem /boot/vmlinuz-5.16.14-051614-generic --output /boot/vmlinuz-5.16.14-051614-generic.signed Copy initram
sudo cp /boot/initrd.img-5.16.14-051614-generic{,.signed} Update GRUB
sudo update-grub I also appended the cert I just made to the secure boot keys in bios. The UI showed me a "Success" message and the key count was incremented by 1.
At this point, I was able to reboot and see the new signed kernels. In addition to the original kernels, the list included the following two lines:
Ubuntu, with Linux 5.16.14-051614-generic.signed Ubuntu, with Linux 5.16.14-051614-generic.signed (recovery mode) The resulting message is:
Loading Linux 5.16.14-051614-generic.signed ... error: /boot/vmlinuz-5.16.14-051614-generic.signed has invalid signature. Loading initial ramdisk ... error: you need to load the kernel first. Press any key to continue... The ramdisk issue seems pretty self-explanatory but I can't seem to get the kernel to load.
Is there some other way to verify the key? Does it need to be loaded somewhere else for the system to recognize it?