143 points · by todsacerdoti · 6y ago · 40 comments
When I was learning there was definitely a lack of well-documented UEFI bootloader code publicly available. As someone new to the technology, you definitely don't want to sift through ELILO to find out how Linux uses UEFI.
If I did this again, which I'm sure I will, I would not use GNU-EFI. I would use a cross-compiler to build a PE executable for the EFI executable directly, without using GNU-EFI. Still, GNU-EFI is a good place to start. It's much easier to work with than EDK2.
Forgive my self-promotion here, I feel it could be relevant to interested parties here.
I wanted to mention the excellent HEADS project (as in the other side of TAILS): https://github.com/osresearch/heads
This talk is great: https://trmm.net/Heads_33c3
I remember when UEFI became a thing and people were complaining in linux forums that the keys are controlled by the manufacturers and 'the whole thing is a ploy by microsoft to kill linux' (UEFI is just a convoluted standard way to write BIOS in a certain way).
Now we can control the keys, all we need to do is kick UEFI to the curb and use linux from BIOS all the way to the DE/WM (coreboot..).
Turns out we can turn the boot process into a chain of kexec's and simplify everything greatly.
See also Pete Batard's excellent project to support all kinds of exotic filesystems in EFI. http://efi.akeo.ie/
MS signed some at the start, see https://docs.fedoraproject.org/en-US/Fedora/18/html/UEFI_Sec... or https://wiki.debian.org/SecureBoot#Shim
> Shim then becomes the root of trust for all the other distro-provided UEFI programs. It embeds a further distro-specific CA key that is itself used for signing further programs (e.g. Linux, GRUB, fwupdate). This allows for a clean delegation of trust - the distros are then responsible for signing the rest of their packages. Shim itself should ideally not need to be updated very often, reducing the workload on the central auditing and CA teams.
- the root of trust is in the TPM
- by default, the initial shim stage is verified using a Microsoft cert in the native trust database, and after the shim (which has an embedded Canonical cert) loads grub, then it verifies and loads the kennel
Grub also has its own trust store it can use, if I recall.
[1] https://www.linuxjournal.com/content/take-control-your-pc-ue...
First they require a lock, but also that the user gets the key. Next they require a lock, but the key may be withheld from the user. I wonder what they will require next. Their Surface RT line of laptops came without unlockable secure boot, so no alternative OS could be installed.
Just what any hobbyist wants to do to dual boot though. Sit down and read up on cryptographic signature verification! That'll make the hobby more approachable.
With modern firmware, you can add a self-generated key pretty easily, and it's not hard to do secure boot dual boot with Linux (or even macOS if you're using OpenCore, I think!). It does require a bit of reading up though. :)
how is this possible?
UEFI is not Secure Boot. Secure Boot is a feature that is implemented by UEFI-compliant systems these days, but UEFI systems originally shipped completely without the feature and it's still perfectly possible to do so.
Complaints about Secure Boot are generally valid complaints to have. Complaints about UEFI that are actually just complaints about Secure Boot are... just complaints about Secure Boot. Valid complaints about UEFI that are unrelated to Secure Boot are rare.