Commit Graph

17 Commits

Author SHA1 Message Date
Mario Limonciello
7b866e5f92 uefi: Don't use shim for non-secure boot configurations
Since the entry is dynamically created this removes one area that
can potentially cause failures.
Helps: #1794
2020-03-16 06:55:05 -05:00
Mario Limonciello
b87d48a042 When TPM PCR0 measurements fail, query if secure boot is available and enabled
If the measurements are missing but it's a UEFI system, it's a good indication
that the user has secure boot turned off.
Notify the user on the UEFI device through a non-fatal `UpdateMessage`

To accomplish this, move fu-uefi-vars into the plugin library for other plugins to use
2020-03-05 07:54:15 -06:00
Richard Hughes
fdb4c4507b uefi: Just use a uint16_t for BootNext processing
This makes everything simpler, at the expense of not being able to create a
`BootFFFF` entry -- but if we get that far something has already gone very
wrong with the firmware...
2019-11-20 16:24:21 +00:00
Richard Hughes
5772e8451c uefi: Use a simpler entries set algorithm
Although slightly wasteful on memory, allocating 64kb is no big deal, and it
means we can simplify creation and reading a lot.
2019-11-20 16:24:21 +00:00
Mario Limonciello
5bd649ef31 uefi: detect unmounted ESP partitions (Fixes: #1405)
Mount these while writing out updates.
Leave them mounted when done (you gotta reboot anyway).
2019-09-26 10:39:45 -05:00
Richard Hughes
a7715bc74a uefi: Actually write the new device path if different than before
If we add or remove a quirk from a machine using the uefi plugin then the new
setting is not used until the BootXXXX EFI key is manually removed. Rather than
just writing the contents of the found key back to the key (doh) just write the
new DP buffer contents if it is different from the previous buffer.
2019-08-02 14:34:12 +01:00
Richard Hughes
59e375707a uefi: Try to find a duplicate using the loadopt name
This means if the loadoptdata changes for any reason (e.g. we start using a
different quirk) we don't get duplicate entries in efibootmgr.
2019-06-05 11:12:07 +01:00
Richard Hughes
7886c086a1 Don't upload reports when the user has configured their system in a broken way
I'm getting a bit fed up with failed reports from arch users where they just
have a broken system. I don't think it's useful to upload to the LVFS or notify
the vendor about failures like this.
2019-04-18 22:06:01 +08:00
Richard Hughes
35b6e13d96 uefi: Copy the shimx64.efi binary for known broken firmware
Some system firmware helpfully 'deduplicate' the boot loader entries based on
the filepath, without taking into account either the label or optional data.

This means we have to use a custom copy of shim for firmware updates.
2019-03-14 17:00:53 +00:00
Richard Hughes
44ce5aeae4 uefi: Add a quirk to use the legacy bootmgr description
Some hardware from Lenovo deduplicates UEFI Boot entries, and uses the old
string 'Linux-Firmware-Updater' to avoid removing the firmware update entry.
Although this is forbidden in the UEFI specification we shouldn't break
firmware updates from old firmware versions.

Provide a quirk for this, and automatically whitelist anything with the LENOVO
SMBIOS Manufacturer.
2019-01-30 12:13:39 +00:00
Mario Limonciello
68fb11f453 uefi: Correct a boot order creation bug (Fixes: #956)
Unfortunately the previous fix (6131f5d) introduced this bug.

The code previously was actually looking for the non-zero case
which was correct, but non-obvious since `efi_guid_cmp` works like
`g_strcmp0` where a match returns zero.

So rather than revert 6131f5d make this completly explicit.
2019-01-22 07:28:32 +00:00
Mario Limonciello
6131f5df8f trivial: uefi: correct a logic error in setting variable
efi_guid_cmp uses memcmp and hence should return 0 when a match
is found.
2018-12-11 12:51:57 -06:00
Richard Hughes
29129ed4f4 uefi: Allow upgrades using a self-signed fwupd.efi binary
This doesn't require shim, so for this uncommon case add a configure option.

Fixes https://github.com/hughsie/fwupd/issues/669
2018-08-23 14:30:04 +01:00
Richard Hughes
02c90d8a03 Remove the unused Emacs indenting headers from all source files
Fixes https://github.com/hughsie/fwupd/issues/636
2018-08-09 12:48:04 +01:00
Mario Limonciello
14fad85164 UEFI: Rename UEFI boot entry
1) Drop the path at the end of the title (\fwupdx64.efi)
2) Linux-Firmware-Updater to Linux Firmware Updater

The behavior that required the hacky name has been fixed since shim 10
which is in all the relevant distros now.
3322257e61
2018-07-10 10:45:39 -05:00
Mario Limonciello
44305bbde4 Rename EFI application from fwup<arch>.efi to fwupd<arch>.efi
This will prevent potentially clashing with fwupdate's EFI application
and allow them to remain co-installable.
2018-07-10 10:45:39 -05:00
Richard Hughes
a80f79cb4d uefi: Upload the firmware capsule without using libfwup 2018-06-28 15:51:11 +01:00