Commit Graph

93 Commits

Author SHA1 Message Date
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
Sean Rhodes
9b3349a586
plugins/uefi-capsule: Force ux-capsule over full size bgrt (#3823)
If bgrt is the same size as the screen, show ux-capsule on top of bgrt.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-10-01 11:36:11 +01:00
Sean Rhodes
49c08f436f
plugins/uefi-capsule: Disable ux-capsule for all StarLabs laptops (#3815)
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-09-30 08:52:02 +01:00
Richard Hughes
46435e798f Write the BMP image upside down to avoid using a negative bitmap height
It would seem that some EFI BMP loaders are unable to flip the image
and hang when trying to load the UX capsule.

This was a real PITA to debug.

Many thanks to Sean Rhodes <sean@starlabs.systems> for all the help.
2021-09-30 08:34:14 +01:00
Richard Hughes
f86c6add5f trivial: Load SMBIOS when using fwupdate to avoid a warning 2021-09-28 13:00:22 +01:00
Richard Hughes
c598ad6434 trivial: Fix a typo causing fwupdate to crash 2021-09-28 13:00:22 +01:00
Richard Hughes
8bd5c55425 uefi-capsule: Use accurate FuProgress values 2021-09-27 19:51:26 +01:00
Richard Hughes
543ae52e23 Document some of the environment variables used by fwupd
Fixes https://github.com/fwupd/fwupd/issues/3760
2021-09-21 10:25:12 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Richard Hughes
504e8db1a0 uefi-capsule: Add the apply method to the uploaded report
We want to be able to differenciate failures for a specific update
method, e.g. finding if should be enabling CoD by default or not.
2021-09-03 13:11:17 -05:00
Ilias Apalodimas
4eca8be63d uefi-capsule: Update documentation for CoD
Capsule update on-disk was added a while ago.
Document the config file changes and limitations on firmwares that's
doesn't support RT->SetVariable

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-09-02 17:54:34 +01:00
Mario Limonciello
92c8f0e727 trivial: fix the grub configuration from 684bc03
fixes #3685
2021-09-01 09:40:24 -05:00
Richard Hughes
d8af914072 trivial: Remove some unused variables 2021-08-28 10:17:56 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
684bc03813 trivial: fix various shellcheck warnings 2021-08-18 07:58:17 -05:00
Mario Limonciello
747aeb5f8a trivial: uefi-capsule: remove an always true condition
found by codacity
2021-08-18 07:58:17 -05:00
Richard Hughes
a5a978b3f6 Rename some confusing API
More than one person has asked about 'why call fu_plugin_update() for a
reinstall or downgrade' and I didn't have a very good answer.

The plugin API is not officially stable, and we should fix things to be
less confusing. Use the same verbs as the FuDevice vfuncs instead.
2021-08-06 19:49:53 +01:00
Richard Hughes
6c2535a71f uefi-capsule: Disable all UX capsules for Lenovo hardware
Applying updates to my new P1G3:

 * schedule the update in fwupd
 * boot into the BootNext
 * apply the capsule with RT->UpdateCapsule
 * reboot with RT->ResetSystem

Except the firmware updater EFI binary then wasn't running. The ESRT
last_attempt_status comes back as Success on the reboot.

Disabling the UX capsule made the update apply correctly each and every
time. Until we can work out what models are affected, use a per-vendor
quirk to avoid delaying the release.
2021-08-02 14:26:45 +01:00
Mario Limonciello
b87c6dab95 uefi-capsule: Add support for installing UEFI updates from GRUB
Shim has had a hard time with loading updates from arguments in the
most recent release and this isn't the first time that happened.

Give distros and users an escape hatch that will allow using GRUB
instead.
2021-07-28 17:11:39 +01:00
Richard Hughes
3747e245e5 uefi-capsule: Add support for CapsuleOnDisk
Based on a patch by Ilias Apalodimas <ilias.apalodimas@linaro.org>,
many thanks.

Fixes https://github.com/fwupd/fwupd/issues/2900
2021-07-28 17:11:39 +01:00
Richard Hughes
f2fd6b0717 trivial: Do not save the self test quirk silo to disk
This also speeds up the tests as the amount of pointless i/o is reduced.

Fixes https://github.com/fwupd/fwupd/issues/3522
2021-07-22 12:51:47 +01:00
Richard Hughes
9f808bdbc0 uefi-capsule: Convert two metadata booleans to private flags 2021-07-22 12:47:54 +01:00
Richard Hughes
305e69f73b uefi-capsule: Rename the plugin flag to match the device flag 2021-07-22 12:47:54 +01:00
Richard Hughes
7b40c111c7 uefi-capsule: Move the results capsule to the FuDevice subclass
This allows us to create subclasses of FuUefiDevice that use different
ways to report update success.
2021-07-22 12:47:54 +01:00
Richard Hughes
d562c007a3 update-capsule: Move FuUefiDevice to a derivable for future use 2021-07-22 12:47:54 +01:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
a564e458d2 trivial: Fix Python linting issue spotted by Codacy 2021-07-14 15:20:57 +01:00
Richard Hughes
5eabab90f4 trivial: Don't set a device ID if setting a physical ID
This isn't actually doing anything as setting a physical ID invalides
the manually-set ID.
2021-07-09 14:08:12 +01:00
Richard Hughes
d4bd5cca5a Standardize some of the device summary text
This is supposed to be 'Sentence case' with no trailing fullstop.
2021-07-09 07:07:07 +01:00
Mario Limonciello
1d44dce78a trivial: remove some unused variables 2021-06-23 08:29:56 -05:00
Richard Hughes
aaa77c6f51 Allow adding and removing custom flags on devices
The CustomFlags feature is a bit of a hack where we just join the flags
and store in the device metadata section as a string. This makes it
inefficient to check if just one flag exists as we have to split the
string to a temporary array each time.

Rather than adding to the hack by splitting, appending (if not exists)
then joining again, store the flags in the plugin privdata directly.

This allows us to support negating custom properties (e.g. ~hint) and
also allows quirks to append custom values without duplicating them on
each GUID match, e.g.

[USB\VID_17EF&PID_307F]
Plugin = customflag1
[USB\VID_17EF&PID_307F&HUB_0002]
Flags = customflag2

...would result in customflag1,customflag2 which is the same as you'd
get from an enumerated device flag doing the same thing.
2021-06-23 07:59:15 +01:00
Mario Limonciello
78b78d8edd trivial: update python black style to 21.6b0 2021-06-16 06:41:46 -05:00
Sergii Dmytruk
c0d0ce4e1a Switch from sysctl to ioctl for ESRT on FreeBSD
Initial version of the patch was rejected and rewritten.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-15 17:25:16 +01:00
Sergii Dmytruk
9c21e4e135 Depend on libefivar in uefi-capsule
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-15 17:25:16 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Richard Hughes
694e774c2a uefi-capsule: Make less Linux-specific
Based on patches by Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-07 19:54:12 +01:00
Sergii Dmytruk
4558e5f317 Fix two off-by-one errors in uefi-capsule plugin
Data is accessed at offset 0x13, so the code must abort if size is
0x13 when you can access only offsets 0x00 through 0x12.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-07 11:18:57 +01:00
Sergii Dmytruk
cac4f98420 Improve error message in fu-uefi-backend-freebsd
"not supported" doesn't explain much.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-07 11:18:41 +01:00
Richard Hughes
03726227b7 uefi-capsule: Add FreeBSD ESRT support
Based on a patch by Sergii Dmytruk <sergii.dmytruk@3mdeb.com>, many thanks.
2021-05-25 17:17:45 +01:00
Richard Hughes
6c07675558 uefi-capsule: Split out the Linux specific ESRT enumeration
This allows us to add the same functionality for FreeBSD and Windows.
2021-05-25 17:17:45 +01:00
Richard Hughes
1113a7aa11 trivial: Allow setting FuUefiDevice properties at construction 2021-05-25 17:17:45 +01:00
Sergii Dmytruk
1a328fd3ad Branch explicitly per OS type
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-05-18 06:49:47 +01:00
Sergii Dmytruk
3d0e624ed3 Include <efivar-dp.h> explicitly
On FreeBSD <efivar.h> doesn't include <efivar-dp.h>.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-05-18 06:49:47 +01:00
Sergii Dmytruk
113a91985b Handle missing defaults in fu-uefi-devpath.c
FreeBSD's libefivar native implementation doesn't provide these defines.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-05-18 06:49:47 +01:00
Richard Hughes
769cbbf8af Add support for the PHAT table
On Alterlake and newer hardware the Platform Health Assessment Record
data can be used by the IHV to debug why a specific capsule update
failed. Any custom firmware loaded by the OEM can be identified and
used to further debug the root cause.
2021-05-12 12:02:33 +01:00
Richard Hughes
1ac05ef3bd trivial: Codespell fixes 2021-04-26 10:29:39 +01:00
Mario Limonciello
99832622e1 uefi-capsule: Move EFI binary into a subproject
This will allow distributions to package and distribute the unsigned
EFI binary separately, similar to what has been done for GRUB.
2021-04-23 13:59:10 -05:00