Commit Graph

9633 Commits

Author SHA1 Message Date
Richard Hughes
22a94e3bfe trivial: Fix a small memory leak when making a request 2022-07-21 21:27:24 +01:00
Richard Hughes
1d590bb32a trivial: Fix a thinko when waiting for acquiesce
Of course, the timeout has to be restarted after a qualifying hotplug event...
2022-07-21 17:19:21 +01:00
Richard Hughes
f4c0c7fe01 corsair: Fix two g_prefix_error() typos 2022-07-21 15:28:24 +01:00
Richard Hughes
b8a5f4945f corsair: trivial: Do not set the physical ID, as it's also set by _add_child() 2022-07-21 15:28:24 +01:00
Richard Hughes
b507f3af59 corsair: trivial: Style fix 2022-07-21 15:28:24 +01:00
Richard Hughes
470258ac24 corsair: Use hex format constants
This means it's easier to match up with the verbose logs.
2022-07-21 15:28:24 +01:00
Richard Hughes
221238b4c0 trivial: Allow each device to specify a different acquiesce delay
Different device classes may need different values, and these may need
modifying by quirks. Also use 50ms to flush out any pending events.
2022-07-21 15:27:04 +01:00
Richard Hughes
4f9b455880 Add UDev devices to the _REQUIRES_ACQUIESCE opt-in 2022-07-21 15:27:04 +01:00
Richard Hughes
027a75a146 Wait for system acquiesce when installing each device of composite firmware
This makes installing firmware onto docks a bit less confusing.
2022-07-21 15:27:04 +01:00
Richard Hughes
463276defd Check if Intel TME has been disabled by the firmware or platform 2022-07-21 11:22:05 +01:00
Richard Hughes
cc7df5e7ab trivial: Fix a tiny memory leak in 'fwupdtool security' 2022-07-21 09:15:58 +01:00
Mario Limonciello
445a8af362 fu-smbios: Fix parsing smbios data
When support was added for falling back to SMBIOS data from the kernel
in /sys/class/dmi, we inadvertently stopped caring about the data parsed
directly from DMI tables as first priority.  This caused a regression in
hwids from some OEMs that relied upon IDs that could only be properly built
from DMI tables, not the kernel /sys/class/dmi interface.

Link: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1982103
Fixes: 464425fb5 ("SMBIOS: try reading from /sys/class/dmi if direct access fails")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
2022-07-20 16:23:56 -05:00
Richard Hughes
1251cb3376 amt: Connect to the interface during ->open() 2022-07-20 20:11:32 +01:00
Richard Hughes
847151a51a Wait for the system to acquiesce after doing each update
We want to allow all the device hotplug events to be processed before
marking the update as completed. Otherwise, we might have a situation
where we have a child device attached to a parent, where we want to
update the parent, then the child. e.g.

 1. Add parent
 2. Add child
 3. Update parent
 4. Attach parent
 5. Wait for parent

...some time passes...

 6. Parent re-appears
 7. Update finishes, client indicates success

...child update is scheduled...
...which returns with failure as it does not exist...

 8. Add child

The child should have been added *before* the update completed to avoid
the caller from needing an unspecified delay as a *workaround*.
2022-07-20 19:10:12 +01:00
Richard Hughes
f336a43936 Avoid duplicate device actions where possible
This removes at least two open(),probe(),setup(),close() chains for the
common case where the vfuncs are not implemented.
2022-07-20 19:01:02 +01:00
Richard Hughes
f65ea325dc trivial: Squash the Wacom Intuos device test file into one
It seems the duplicate content was missed when we moved over to the new
device-test multi-step format.
2022-07-20 12:25:28 +01:00
Richard Hughes
6e69d8fb8f Do not return with rc=0 when devices are not found
Fixes https://github.com/fwupd/fwupd/issues/4843
2022-07-19 09:49:41 -05:00
Richard Hughes
f532d81da9 trivial: Use __version__ to fix new versions of python-markdown 2022-07-19 13:34:02 +01:00
Richard Hughes
fd458cd0de Migrate away from the deprecated distutils 2022-07-19 13:34:02 +01:00
dependabot[bot]
c857c9e95d build(deps): bump vmactions/freebsd-vm from 0.1.6 to 0.2.0
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 0.1.6 to 0.2.0.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/v0.1.6...v0.2.0)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-19 08:23:18 +01:00
Denis Pynkin
5b1d66b671 trivial: fix URLs for SteelSeries Aerox3 device test
Some of URLs disappeared. Marked all versions from the
commit as persistent on LVFS to avoid CABs loss.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2022-07-19 00:59:49 +03:00
Richard Hughes
62fc515714 Allow loading in emulated host profiles for debugging
This allows us to load sets of different host security attributes
for testing the various front end tools we have now. e.g.

    sudo FWUPD_HOST_EMULATE=thinkpad-p1-iommu.json.gz fwupd

or, using a non-compressed absolute path:

    sudo FWUPD_HOST_EMULATE=/tmp/test/thinkpad-p1-iommu.json fwupd

Data can be created with `./contrib/generate-emulation.py file.json`
and then can be manually modified if required. Running the script on
a file that already exists will just strip out any unneeded data, as
well as piping content into it using stdin.

As a precaution, the org.fwupd.hsi.HostEmulation attribute is added
so we do not ask the user to upload the HSI report. It also allows
the LVFS to ignore any HSI reports with this attribute for clients
that upload HSI reports regardless.

See https://github.com/fwupd/fwupd/discussions/4832
2022-07-18 16:27:59 +01:00
Richard Hughes
de15afe466 trivial: Export all the JSON data the daemon sent
The FWUPD_DEVICE_FLAG_TRUSTED flag is used by the daemon, but if the
information is being set on the GVariant then it's not required to
filter it client-side.
2022-07-18 16:27:59 +01:00
Richard Hughes
7566e56fb5 Add fwupd_device_from_json() for future use 2022-07-18 16:27:59 +01:00
Richard Hughes
6adc60b5ba Ensure the container checksum has always been added before install 2022-07-18 16:12:43 +01:00
Richard Hughes
3487eb223b trivial: Add the container checksums when getting file details
This makes it easier to debug, as this shows what the checksum would be
stored in the history database on successful update.

We're already generating them, and so it's really just being helpful.
2022-07-18 16:12:43 +01:00
Richard Hughes
fdc5131dca Only validate source artifacts at cabinet load time
The LVFS was being over-eager, and setting 'binary' for both -- but
for new firmware it's important to specify the correct thing.
2022-07-18 16:12:43 +01:00
Richard Hughes
62a62f8f0f trivial: Clarify the FwupdRelease::checksum is for the container
In one place we were accidentally setting the contents checksum,
because the LVFS was setting the artifact type of 'binary' for metainfo
export -- which was never going to match on the LVFS.
2022-07-18 16:12:43 +01:00
Richard Hughes
19491c02b7 trivial: Save the release ID in the history database
This was supposed to reduce our dependance on unreliable checksums, but
we were not actually storing it and so it was never being matched.
2022-07-18 16:12:43 +01:00
Richard Hughes
93ba530d07 trivial: Allow getting HSI events when there are no device 2022-07-16 21:43:06 +01:00
Richard Hughes
9b9799f9c6 Use the correct protocol member when converting to JSON 2022-07-16 21:43:01 +01:00
Richard Hughes
0f2298095d trivial: Simplify the engine FuProgress setup 2022-07-16 21:42:23 +01:00
Richard Hughes
4720bb90bb trivial: Do not print the header when using 'fwupdtool security'
This matches the behaviour of fwupdmgr.
2022-07-16 21:42:18 +01:00
Mario Limonciello
5686550ed4 bump changelog 2022-07-16 09:00:24 -05:00
Mario Limonciello
7f20e17698 fix build with newer meson 2022-07-16 08:55:35 -05:00
Richard Hughes
a5749f4d23 Set the HSI levels in a central place
This means we don't need to worry about changing multiple
implementations if the HSI levels change for a specific ID.

It also means we can fake HSI results in the future without having
to also store the 'correct' level in the input file.
2022-07-15 20:21:22 +01:00
Sean Rhodes
f1aabcf6f7
plugins/intel-spi: (nit) Change APL from pch to ich (#4833)
APL doesn't have a PCH so change it to ich. This change make no
difference, and is just for correctness.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-07-15 07:27:14 +00:00
Mario Limonciello
611cf51fc8 trivial: lower modem manager probing verbosity in one other place
Fixes: 030a0d51c ("trivial: quiet the modem manager error about unable to probe")
2022-07-14 12:59:53 -05:00
Richard Hughes
a5929cee29 uefi-pk: Use the correct flag when added to the blocklist 2022-07-14 16:05:34 +01:00
Richard Hughes
8e7ad1b188 msr: Fix fwupdmgr security when the plugin is added to the blocklist 2022-07-14 16:05:34 +01:00
Richard Hughes
777b8fed46 pci-mei: Fix fwupdmgr security when the plugin is added to the blocklist 2022-07-14 16:05:34 +01:00
Richard Hughes
58171d46da pci-bcr: Fix fwupdmgr security when the plugin is added to the blocklist 2022-07-14 16:05:34 +01:00
Richard Hughes
7b1204bce0 trivial: Fix outputting the new security attr flags to JSON 2022-07-14 15:43:19 +01:00
Richard Hughes
01304a5fea Do not use MISSING when the iommu was just not found 2022-07-14 15:12:28 +01:00
Richard Hughes
dc91444b46 trivial: Export fu_security_attrs_get_by_appstream_id() for future use 2022-07-14 14:49:00 +01:00
Richard Hughes
26e5ecb567 trivial: Add fwupd_security_attr_remove_flag() for future use 2022-07-14 14:48:51 +01:00
Richard Hughes
0c51630991 Check firmware magic in a more standard way
Some parsers are ignoring the magic when using _FLAG_IGNORE_CHECKSUM
(which is wrong; fuzzers have no problem with enforcing a static prefix)
and other either disregard the offset or check the magic in an unsafe
way. Also, use FWUPD_ERROR_INVALID_FILE consistently for magic failure.

Add a vfunc, and move all the clever code into one place.
2022-07-14 14:48:15 +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
Mario Limonciello
541e7d9657 Backport a patch from upstream to disable capsule on disk by default outside aarch64. This fixes flashing on HP Dev One and several Insyde boxes. 2022-07-14 06:56:21 -05:00
xtcui
d86191c392 analogix: Add support for two new Startech devices. 2022-07-14 11:14:01 +01:00