Commit Graph

139 Commits

Author SHA1 Message Date
Richard Hughes
5ef0ae182d Add a 'name' attribute to each FuProgress step
This allows us to print better warning strings, and in the future
would allow us to profile each operation in a meaningful way.

Also, add context to some of the progress steps as required.
2022-06-01 15:05:43 +01:00
Klemens Nanni
9d67fecabb trivial: Typofix fwupdate(1) NAME 2022-05-27 08:54:11 -05:00
Richard Hughes
5ceabcda1a trivial: Remove the class structs for types that use G_DECLARE_FINAL_TYPE 2022-05-21 12:19:50 +01:00
Richard Hughes
b7bf0a7611 Do not fallback to audio-card
Let the frontend choose the most appropriate icon if unspecified.
2022-04-25 14:49:30 +01:00
Mario Limonciello
0432cfe537 trivial: uefi: drop unnecessary HAVE_HSI declaration
This appears to have been from before a vfunc was added and isn't
necessary.
2022-04-18 10:01:02 -05:00
Richard Hughes
2d5186622c Add FuProgress to ->prepare and ->cleanup
Some plugins were creating local versions (which were not attached to
the daemon progress in any way) as a workaround as they needed to do
actions that took a long time to complete.
2022-04-15 16:50:06 +01:00
Richard Hughes
0b7af7d54b trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
bef1d742b3 Allow Capsule-on-Disk to work in more cases 2022-04-12 09:57:44 +01:00
Richard Hughes
4bdd1d40e1 uefi-capsule: Use GByteArray to make code more modern 2022-04-08 07:23:48 +01:00
Richard Hughes
92944f5074 Add the runtime fwupd-efi version as a firmware requirement 2022-04-07 16:55:46 +01:00
Richard Hughes
3640d22fb2 Use the GLib functions to convert to UCS2
UTF-16 is a superset of UCS-2 and so we can just use the GLib versions
instead of rolling our own versions.
2022-04-07 15:41:09 +01:00
Richard Hughes
633571fa99 trivial: Fix some 'Comparison of narrow type with wide type in loop condition' 2022-04-05 14:45:42 +01:00
Jeremy Soller
09f3a627c2 trivial: Add HP Dev One quirk with no-ux-capsule flag 2022-04-01 11:18:12 -05:00
Richard Hughes
8b62bf6b64 Set the context in the right place more often 2022-03-16 09:18:29 +00:00
Richard Hughes
2e92dc02d1 uefi: Do not add the Windows compat ID
This is just confusing vendors and doesn't match any of the other IDs.
2022-03-01 12:52:12 +00:00
Mario Limonciello
d04f2468c0 trivial: switch from path to full_path for meson 0.56+ 2022-02-28 08:34:48 -06:00
Mario Limonciello
6896e0ab52 trivial: switch from meson.source_root to meson.project_source_root
The former is deprecated in meson 0.56 or later.
2022-02-28 08:34:48 -06:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Richard Hughes
f3a13f89dd Allow specifing the DeviceIntegrity flag from metadata 2022-02-22 19:12:06 +00:00
Richard Hughes
c8e5f92f27 uefi-capsule: Add a private flag for devices that never want a header 2022-02-21 22:52:45 -06:00
Richard Hughes
50b52aef0d trivial: Do not install test data for -Dtests=false 2022-02-16 19:38:45 +00:00
Yuan-Chen Cheng
4642e7694e fall back to signed EFI app as secure boot is off.
Some distribution hopes to not install the not-signed EFI app by default.
However, for the corner case, the user might still want to use not-signed
one (maybe to work around bugs or do testing). This implements
a logic that uses the not-signed EFI app as the secure boot is off, and
if it does not exist, then we fall back to using the signed one.

Also drop fwupd-unsigned from Recommends of fwupd in debian/control.
2022-02-15 08:15:56 -06:00
Richard Hughes
b5e7a0be16 Do not use gettext before calling setlocale 2022-02-09 16:56:47 +00:00
Norbert Kamiński
7fdf7c60ee fu-uefi-common.h: Fix efivar compatibility with FreeBSD
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2022-01-21 16:24:37 +00:00
Richard Hughes
e74d38bfd3 Fix compiling with new versions of efivar
Fixes https://github.com/fwupd/fwupd/issues/4181
2022-01-17 15:27:05 +00:00
Mario Limonciello
64e7ea25b1 Fix the logic for removable fallback path in uefi-capsule
The logic was built on the presumption of Ubuntu core which doesn't
have /etc/os-release.  Since other distributions do have /etc/os-release
adjust the logic to instead build the path explicitly.
2022-01-15 07:09:04 -06:00
Richard Hughes
73f6767d87 trivial: Show why more devices are not marked as updatable 2022-01-13 16:04:31 +00:00
Richard Hughes
ca43733a8c Show why devices are not marked as updatable
At the moment a lot of the failures are only visible when running the
daemon in verbose mode, and the inhibit functionalit provides us a way
to unset FWUPD_DEVICE_FLAG_UPDATABLE from multiple places, as well as
setting the update error for the user to see why.
2022-01-13 12:40:56 +00:00
Mario Limonciello
f57a6637c9 trivial: fix man page sections
They're marked in the man page as section 8 but installed into 1.
They should be installed into 1 as they're not admin tools.
2022-01-04 14:17:43 -06:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
f76880182f Do not allow UEFI updates when the lid is closed
Most vendors do not mirror the firmware update to an external display,
and some don't behave correctly when the lid is shut and the machine is
docked. Add this quirk just for Lenovo for now.

Fixes https://github.com/fwupd/firmware-lenovo/issues/181
2021-12-29 19:18:26 +00:00
Richard Hughes
8e6a3f6bbb Allow devices to opt-in to metadata-provided vendor strings 2021-12-22 15:34:36 +00:00
Philipp Wendler
935e92d079 uefi-capsule: clarify UDisks requirement for ESP autodetection
The ESP is autodetected only if UDisks is available,
but this was not explicitly documented so far.

Fixes #4103
2021-12-17 14:35:08 -06:00
Richard Hughes
8fc8539146 trivial: Remove some unused variables 2021-12-10 16:00:07 +00:00
Richard Hughes
dc1d5de057 Make the HSI tests optional for embedded targets
70% of the plugins installed on OpenBMC are not being used...
2021-11-29 09:30:57 +00:00
Richard Hughes
3ffc3fa774 Add fu_common_sum8() common functionality
We now have 9 different plugins all using this functionality, and we're
about to add one more. Move this into common code so that all the
plugins are using the same endian and bufsz-safe versions.
2021-11-26 18:33:11 +03:00
Richard Hughes
b2ad10a818 trivial: Work around two false positives when compiling with gcc -Os 2021-11-22 15:19:38 +00:00
Richard Hughes
49afe450ab Use -Dcompat_cli=false to reduce the install size by over 100Kb
We don't need these binaries for green-field projects.
2021-11-15 15:01:22 +00:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Richard Hughes
bab0778e78 uefi-capsule: Skip devices that fail coldplug
This means that if the user has a single ESRT entry with a GUID of
00000000-0000-0000-0000-000000000000 then none of them work correctly.

Fixes https://github.com/fwupd/fwupd/issues/3950
2021-11-09 07:42:05 +00:00
Ross Burton
3147fef735 uefi-capsule: use /bin/sh in grub hook
Use . instead of source as source is a bashism.

Use /bin/sh as the interpretter as there are no strict bashisms in the
hook.

Ideally the shell expansion using `` is changed to $(), but the escaping
behaviour is complex and dash/busybox sh both support ``.
2021-11-05 12:16:23 +00:00
Richard Hughes
1a077289bc Speed up daemon startup by 15%
During my fwupd startup fu_plugin_has_custom_flag gets called 21 times
which causes all HWIDs to be enumerated with 346 calls to the quite
expensive fu_context_lookup_quirk_by_id() function.

Move the flag to a private hashset and enumerate the HWIDs only during
startup. There's nothing plugin specific about them anyway...
2021-11-03 07:14:37 +00:00
Richard Hughes
510a9bfe0c Merge tpm-eventlog into the tpm plugin
This is so much less complicated.
2021-11-02 13:47:25 +00:00
Richard Hughes
b0f80757f5 Add a test UEFI device that can be used to test capsules
To use this use `sudo systemctl edit fwupd.service` and set
`Environment="FWUPD_SYSFSFWDIR=/usr/share/installed-tests/fwupd"`

Fixes https://github.com/fwupd/fwupd/issues/3441
2021-11-02 08:09:25 +00:00
Richard Hughes
e29c74180c Move the TPM handling into the TPM place
The fact that it currently lives in uefi-capsule is a historical
accident, and it doesn't really belong to tpm-eventlog either.

Fixes some of https://github.com/fwupd/fwupd/issues/3901
2021-11-01 14:51:27 +00:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Sean Rhodes
130da188eb
plugins/uefi-capsule: Remove ux capsule for StarLite (#3885)
UX capsule only seems to work on certain distros and firmware versions.
Restoring for reliability.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-10-20 08:05:16 +01:00
Richard Hughes
d3706e0e0b Show the user a warning if updating may affect full-disk-encryption
Additionally, if the client does not set the feature flag `fde-warning`,
add an extra paragraph into the update description.

Fixes https://github.com/fwupd/fwupd/issues/3829
2021-10-09 08:09:38 +01:00
Sean Rhodes
555ae48ebd
plugins/uefi-capsule: Enable ux-capsule for all starlabs laptops (#3824)
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-10-01 11:36:23 +01:00