Commit Graph

196 Commits

Author SHA1 Message Date
Richard Hughes
b633859ffc uefi-capsule: Add some wisdom on version formats
I'm answering this question a lot, so add some UEFI-specific notes.
2023-02-21 19:12:08 +00:00
Richard Hughes
5a4229fce6 Allow enabling low-level debugging of fwupdx64.efi from uefi_capsule.conf
Short-to-medium-term we want to stop installing fwupdate and this was the last
useful part we never migrated.
2023-02-21 09:13:28 -06:00
Mario Limonciello
2b96b9e933 Add a quirk for COD detection
Insyde has added a bit into the ACPI UEFI table that can be utilized
to detect if they have fixed the COD bug.

This means that COD can be turned on by default for X86 for all vendors
that support it, and if Insyde is encountered whenever that bit is active.
2023-02-19 08:38:52 +00:00
Mario Limonciello
9407c5680f trivial: fix overwriting errors for existence of shim
fixes: #5545
2023-02-17 16:44:09 +00:00
Mario Limonciello
2ddda260a6 trivial: uefi-capsule: drop the fallback to removable path flag
It was used for ubuntu-core with a confined fwupd, but now we will
load our own shim as necessary to the ESP.
2023-02-16 11:32:36 -06:00
Mario Limonciello
5266d62611 uefi-capsule: Copy in an updated shim if provided
If a shim is in the fwupd libexec/efi directory, it's intended to
be paired with the fwupd binary.
2023-02-16 11:32:36 -06:00
Richard Hughes
b25e0f3a28 uefi-capsule: Require at least 80MB free in the ESP
See https://github.com/fwupd/firmware-lenovo/issues/257
2023-02-15 16:12:26 +00:00
Richard Hughes
336494190d Allow installing some battery firmware updates when the power is too low
The firmware in this case fixes the battery charging, and as the battery is
*internal* the user isn't able to apply the fix.

Fixes https://github.com/fwupd/firmware-lenovo/issues/315
2023-02-15 16:08:53 +00:00
Richard Hughes
06c95b22aa trivial: Fix warning: function has a definition with different parameter names 2023-02-13 12:34:46 +00:00
Richard Hughes
2336f6a345 trivial: Fix warning: do not use 'else' after 'return' 2023-02-13 12:34:46 +00:00
Richard Hughes
9d313bb3c9 trivial: Include the correct headers to make clang-tidy happy 2023-02-13 12:34:46 +00:00
Richard Hughes
6e34a90a12 trivial: Add FuProgress to fu_context_load_hwinfo()
TIL: fu_bios_settings_setup() takes over 50ms (10%!) at startup.
2023-01-30 14:47:44 +00:00
Michal Suchanek
5688191a7b uefi-capsule: Do not call grub2-probe without arguments
commit 684bc0381 ("trivial: fix various shellcheck warnings") adds call
to ${grub_probe} without any argument which causes grub2-probe to return
an error, and generating grub configuration fails.

Add --version argument to avoid the error, and redierct the output to
/dev/null so that it's not included in the grub configuration file.

The commit also adds superfluous single quotes causing another error:

/usr/sbin/grub2-probe: error: cannot find a GRUB drive for `${grub_probe} --target=device \${ESP}` | sed -e "s/^/\t/".  Check your device.map.

Fix the quoting to work at least for single device.

Fixes: #5424
Fixes: 684bc0381 ("trivial: fix various shellcheck warnings")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2023-01-18 10:56:26 -06:00
Richard Hughes
8af1943142 trivial: Add FuContextHwidFlags for future usage 2023-01-16 17:49:57 +00:00
Richard Hughes
058dc2301a Include the plugin README text in the generated docs 2023-01-10 14:58:30 +00:00
Richard Hughes
542014ebe3 Use 'check' when calling run_command() to avoid a warning
New versions of meson [correctly] warn when this parameter is not specified.
2022-12-29 15:49:02 +00:00
Josh Soref
67deecde31
Lots of spelling fixes
Fixes:

* activate
* active
* additional
* and
* approaches
* attestation
* bootloader
* calculate
* capability
* children
* close
* compatible
* continuous
* convenience
* critical
* data
* delivery
* disabled
* disambiguate
* documented
* elapse
* emergency
* erasable
* expectations
* filesystem
* from
* haptic
* ignorable
* images
* infinity
* information
* information
* inhibited
* insufficient
* interrupt
* into
* limited
* management
* manifest
* maximum
* memory
* metadata
* mismatch
* model
* nonexistent
* not
* objects
* offset
* omissions
* ota
* past
* perform
* peripherals
* predictable
* product
* quarterly
* quirk
* quirks
* recognize
* release
* requests
* revocation
* sanitized
* sector
* status
* the
* the update
* timeout
* transfer
* transfers
* typically
* unspecified
* upgrade
* which
* will
* wireless
2022-12-29 13:57:31 +00:00
Richard Hughes
427e5cec7a trivial: Add new convenience API to make plugins simpler 2022-12-20 20:54:12 +00:00
Mario Limonciello
85a168206c trivial: uefi-capsule: decrease warning about missing header to debug
Plenty of vendors rely upon this behavior, so we don't need to be
making noise in everyone's logs for them.
2022-12-08 14:18:47 -06:00
Richard Hughes
72a84c5977 trivial: Fix capsule image generation for broken locales 2022-11-09 14:02:39 +00:00
Richard Hughes
1e7d741601 Check system integrity when installing UEFI updates
Recently we had an update that changed the system-defined Platform Key, and
we've certainly had updates in the past that changed the Boot#### variables.

Store some core ACPI and UEFI system integrity state from before and after the
update which can be used to mark (waivable) test failures on the LVFS.
2022-11-03 15:51:10 +00:00
Richard Hughes
d1c6acd752 trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
Richard Hughes
41973568a6 uefi-capsule: Try harder when trying to find the default ESP
Look for a plausible path existing, still continuing to the first entry on
failure as before. This makes it "work" for more people out-of-the-box.
2022-10-07 15:11:38 +01:00
Richard Hughes
52e9885c87 Use a higher compression preset for the UEFI splash images
This reduces the size of the archive by ~500Kb at the expense of taking a few
seconds more to compress.
2022-09-30 12:48:20 +01:00
Richard Hughes
edcdd44795 trivial: Enable all the builtin plugins
Fixes https://github.com/fwupd/fwupd/pull/4836
2022-09-30 12:30:11 +01:00
Richard Hughes
b85f36ceb3 trivial: Use the existing plugin objects in fwupdate 2022-09-29 12:32:53 +01:00
Richard Hughes
99002a7a18 Build many more plugins as builtin
This reduces the plugin directory size by 2.2Mb
2022-09-28 17:01:23 +01:00
Richard Hughes
c4b7f42e43 Only compress one version of the builtin-quirks
Saving the quirks in the GResource section worked well, but it made the build
system very complicated and also meant the .data section was duplicated in
both `fwupd` and `fwupdtool` -- negating a lot of the hard-fought savings.

Simplify this feature so that we just `cat` all the quirk files together, then
gzip them into a single file. This means that at startup fwupd only needs to
check the mtime of one file, and weirdly it's actually faster to load a smaller
compressed file from disk that it is to load multiple uncompressed files.
2022-09-27 12:44:04 +01:00
Richard Hughes
0415db6f67 Revert "trivial: Use files() rather than current_source_dir()"
This reverts commit b581fa5670 as it breaks
`ninja dist` with `-Dgresource_quirks=enabled`.
2022-09-25 10:31:14 +01:00
Richard Hughes
b581fa5670 trivial: Use files() rather than current_source_dir() 2022-09-24 09:12:14 -05:00
Richard Hughes
5d38e0aeea Move the getting the ESP to the context
We now have two plugins getting the ESP values, and we only allow hardcoding
the ESP in uefi_capsule.conf.

Make all this a lot simpler by moving the ESP+BDP code to `FuContext`, which
also means we can handle the override (via the config file) in the engine,
and the override (in the command line tools) using the same mechanism.

Also, automate the migration of the `OverrideESPMountPoint` -> `EspLocation`
when loading the engine.

Fixes https://github.com/fwupd/fwupd/issues/5042
2022-09-22 14:31:06 +01:00
Richard Hughes
77006b75eb Set the target value on the security attribute
Semantically it is the desire of the security attribute, not the bios
attribute, i.e. you could imagine that a specific attribute would have
to be *foo or bar or baz* for HSI-1 and *only foo* for HSI-2

Also make it easier to add possible BIOS attribute target values in
plugin code.
2022-08-01 07:12:18 +01:00
Mario Limonciello
803967289c uefi-capsule: Set FwupdBiosAttr ID for when secure boot is turned off
Lenovo and Dell both use the same key name 'SecureBoot' for this
functionality.
2022-07-29 11:31:50 -05:00
Mario Limonciello
9289e7d817 trivial: set firwmare attributes class directory for all tests
We don't want the system's firmware attributes class directory to
conflict.
2022-07-28 17:30:57 -05:00
Richard Hughes
829258401e Allow plugins and backends to print debugging information to the console
This is really useful for debugging.
2022-07-28 16:10:06 +01:00
Richard Hughes
ae0c3fe38a Add 'action' resolution flags to each FwupdSecurityAttr
We tried to solve this by matching the org.fwupd.hsi AppStream ID, but
in some cases the resolution depends on what actually failed.

Add "the action the user is supposed to do" as flags so that the
front-end can translate this in the appropriate way, for instance,
using a different string for log events and HSI dialogs.
2022-07-14 14:47:44 +01:00
Richard Hughes
77880751cd Do not use CoD even when advertized on non-aarch64 platforms
Fixes https://github.com/fwupd/fwupd/issues/4823
2022-07-14 07:50:42 +01:00
Richard Hughes
f45c10bd26 uefi-capsule: Fix a tiny memory leak when falling back to the app path
Found by Coverity.
2022-07-11 08:29:37 +01:00
Richard Hughes
a61bb37881 Build the quirk files into the daemon as a GResource
Interestingly, this increases the `fwupd` binary size by ~30kb but
reduces the installed size of /usr/share/fwupd/quirks.d by ~330kb.
2022-06-30 18:52:24 +01:00
Richard Hughes
c4cdda0b87 trivial: Do not load the GResource when not required 2022-06-27 19:06:21 +01:00
Richard Hughes
b8be6daf1f trivial: Use 'priv' for plugin private data to be consistent 2022-06-26 13:57:53 -05:00
Gaël PORTAY
299b42fe96 trivial: Make meson.build indentation consistent 2022-06-21 03:27:38 -04:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
377bcb718f Remove the 'common' prefix from the volume creation methods 2022-06-14 14:36:52 -05:00
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
425fedcca1 trivial: Remove fu_byte_array_set_size_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 2022-06-14 14:36:52 -05:00