I upgraded my kernel today with ukuu, and since then I cant boot because i'm getting this errors:
error: /boot/vmlinuz-4.18.12-041812-generic has invalid signature
error: you need to load the kernel first
I have dual boot with windows 10 and ubuntu 18.10 (Upgraded today)
Update: I managed to boot to older kernel that i chose from "Advanced options for Ubuntu" in grub
But I need to upgrade my kernel and if I do that I still get the same problem...
Signing a custom kernel for Secure Boot
Instructions are for ubuntu, but should work similar for other distros, if they are using shim and grub as bootloader. If your distro is not using shim (e.g. Linux Foundation Preloader), there should be similar steps to complete the signing (e.g. HashTool instead of MokUtil for LF Preloader) or you can install shim to use instead. The ubuntu package for shim is called
shim-signed
, but please inform yourself on how to install it correctly, so you do not mess up your bootloader.Since the most recent GRUB2 update (2.02+dfsg1-5ubuntu1) in Ubuntu, GRUB2 does not load unsigned kernels anymore, as long as Secure Boot is enabled. Users of Ubuntu 18.04 will be notified during upgrade of the grub-efi package, that this kernel is not signed and the upgrade will abort.
Thus you have three options to solve this problem:
Since option two and three are not really viable, these are the steps to sign the kernel yourself.
Instructions adapted from the Ubuntu Blog. Before following, please backup your /boot/EFI directory, so you can restore everything. Follow these steps on your own risk.
Adjust all parts with <YOUR*> to your details.
You will be asked for a password, you will just use it to confirm your key selection in the next step, so choose any.
Note: if MOKManger does not load on reboot then change the boot order. link
Now your system should run under a signed kernel and upgrading GRUB2 works again. If you want to upgrade the custom kernel, you can sign the new version easily by following above steps again from step seven on. Thus BACKUP the MOK-keys (MOK.der, MOK.pem, MOK.priv).
Instead of signing the kernel in question, I just turned off Secure Boot in the BIOS/UEFI menu of my laptop.
You can usually enter the menu by pressing a special key during boot, you can google the specific one for your device or it might even be shown on screen during boot.
I had this issue after updating today. Changing the bootloader to
shimx64.efi
seems to have fixed it.