Commit Graph

737 Commits

Author SHA1 Message Date
Richard Hughes
41bc319331 trivial: Fix -Wundef warning when compiling without libcbor 2022-03-18 10:38:12 +00:00
Richard Hughes
da37d93eb0 trivial: Remove some long dead docs about fu_plugin_device_add_delay() 2022-03-16 09:18:29 +00:00
Richard Hughes
8b62bf6b64 Set the context in the right place more often 2022-03-16 09:18:29 +00:00
Richard Hughes
945002f7a3 Fix build for MacOS
This is more for curiosity than anything else.
2022-03-15 14:37:28 +00:00
Richard Hughes
92515d193a Add coSWID and uSWID parsers to libfwupdplugin
These parse the structures as defined in:

 * https://datatracker.ietf.org/doc/draft-ietf-sacm-coswid/
 * https://github.com/hughsie/python-uswid
2022-03-15 14:37:02 +00:00
Richard Hughes
6b5d933e99 Do not show unconnected or unreachable devices in the client tools
Fixes https://github.com/fwupd/fwupd/issues/4378
2022-03-15 14:08:17 +00:00
Richard Hughes
e8f0d76da7 Do not leak child processes when cancelling
See https://github.com/fwupd/fwupd/pull/4372
2022-03-15 14:01:45 +00:00
Richard Hughes
b4e88bae49 trivial: Move the UNREACHABLE inhibit to common code 2022-03-15 11:29:00 +00:00
Daniel Campello
61226b49f3 fwupdplugin-self-test: fix spawn tests for qemu
Wrap the spawned script with an explicit call to the /bin/sh
interpreter needed when running tests in a cross compiled enviroment.

Also increase the timeout for the spawned script to execute to give
enough time for the print to happen in the much slower virtualized
environment.

Change-Id: I71ed377e1bc8db4be4c522cdb9562c1662df7266
2022-03-09 17:32:40 -07:00
Richard Hughes
66cb93c4e2 trivial: Make clear sizes are in hex 2022-03-07 12:38:33 +00:00
Richard Hughes
94d572375f trivial: Clarify the unit for the device remove delay 2022-03-03 11:26:17 +00:00
Richard Hughes
c4ca026294 Allow devices to build instance IDs more easily
Provide a device instance builder that allows plugins to easily
create multiple instance IDs based on parent attributes.

Also fix a lot of the instance ID orders, so that we add more generic
IDs first, and more specific IDs after.
2022-03-03 09:13:29 +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
Daniel Campello
bcaeda34ad Backfill SHA256 when generating metadata from cab files
This change allows for the computation of SHA256 checksum when
generating metadata from cabinet file. This is particularly used when
working with the directory type of remote config.

Change-Id: I1a6e90a76b79cdae97d68d799a5cea81430da03f
2022-02-25 10:31:03 +00:00
Richard Hughes
adfef91731 trivial: Strip leading and trailing spaces from the vendor name 2022-02-24 17:07:44 +00:00
Richard Hughes
e3583793ed trivial: Fix two potential critical warnings when finding devices 2022-02-24 17:07:32 +00:00
Richard Hughes
f3a13f89dd Allow specifing the DeviceIntegrity flag from metadata 2022-02-22 19:12:06 +00:00
Richard Hughes
758d5d8c6f Add a flag to indicate the device is signed or unsigned
Devices without either flag are unknown.
2022-02-22 19:12:06 +00:00
Richard Hughes
7ef94d7a31 vli: Skip probing the Dell DA300 device
Although 2109:2820 and 2109:0820 is the generic reference firmware,
firmware revision 3003 is specific to this device.

Fixes https://github.com/fwupd/fwupd/issues/4305
2022-02-22 17:22:13 +00:00
Richard Hughes
e21391f85d trivial: Don't warn if the superclass is using custom flags 2022-02-22 13:28:48 +00:00
Richard Hughes
4cd8468722 trivial: Don't warn if overwriting with the same device name 2022-02-22 13:28:48 +00:00
Richard Hughes
bd02edcc43 trivial: Add missing API wrapper for future functionality 2022-02-21 18:57:20 +00:00
Richard Hughes
308e03a6f4 Sanitize the instance ID parts more carefully
The only users of `SERIO\FWID` and `I2C\NAME` are already 'safe' and
the device GUIDs should all be unchanged.

There are no current users of the `MTD\NAME` instance IDs, and these
are the ones that may be more unpredictable and in need of sanity.
2022-02-18 08:23:39 +00:00
Richard Hughes
eb6ba4eafb trivial: Show the firmware GType in the device ->to_string() 2022-02-17 06:15:30 +00:00
Richard Hughes
f63080fbe2 Allow assigning issues to devices
This allows us to show in the tools if a device is currently affected
by a specific CVE. For instance, we could inform the user that a device
requires a critical firmware update that is being actively exploited.

Note, this also means we can show the user a firmware update is now
required, even though the firmware may not be available on the LVFS.

Also show the issue in the `fwupdmgr security` output, e.g.

    There are devices with issues:
      Samsung — MZVLB2T0HALB-000L7:
       • CVE-2022-12345
       • CVE-2022-54321
2022-02-16 14:50:29 +00:00
Richard Hughes
c71ca76235 Add a plugin to set GPIOs for the duration of an update 2022-02-16 14:01:07 +00:00
Richard Hughes
55bd4862d3 Try harder to convert to a version into a correct semver
This is really useful for the flashrom plugin.
2022-02-11 15:28:05 +00:00
Richard Hughes
171ebda355 Check the IFD sections have non-zero data length
This fixes a critical warning when loading an invalid builder file.
2022-02-09 13:31:55 +00:00
Richard Hughes
8cec5d8686 Allow padding firmware sections in builder XML files 2022-02-09 13:31:55 +00:00
Richard Hughes
2448660922 trivial: Print the RemoveDelay in the device debug string 2022-02-07 14:21:01 +00:00
Richard Hughes
24c041c3f8 trivial: Fix the range check for the RemoveDelay quirk 2022-02-07 14:21:01 +00:00
Richard Hughes
2fd4ea5ddc Get the SMBIOS table on Windows
Fixes https://github.com/fwupd/fwupd/issues/4253
2022-02-07 14:04:44 +00:00
Richard Hughes
75b68ed9f9 trivial: Allow NULL @error for fu_device_retry_full()
The docs say `(nullable)` and it's the only function that seems to hard require
an error, for no good reason I can see.
2022-02-01 16:18:28 +00:00
Richard Hughes
6f87fc5ee3 trivial: Fix 'fwupdtool firmware-sign' by removing debugging 2022-01-31 10:57:10 +00:00
Richard Hughes
b9960095b8 trivial: Fix the FreeBSD build
Mea culpa. Fixes https://github.com/fwupd/fwupd/issues/4225
2022-01-27 20:35:41 +00:00
Richard Hughes
f966dfe251 Fall back to the Device Tree 'compatible' data as required
This allows us to use CHID requirements on the PinePhone, and
potentially other hardware too.

See https://github.com/fwupd/fwupd/discussions/4209
2022-01-24 21:30:15 +00:00
Richard Hughes
38bab8fc4f Allow overriding daemon parameters using /var/etc/fwupd/daemon.conf
This is super useful for debugging immutable systems like ChromeOS.
2022-01-21 11:52:06 +00:00
Crag Wang
b728608baa Show results when calling get-details if failing requirements 2022-01-19 12:10:52 +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
Richard Hughes
45673e7d9f trivial: Show results when using FWUPD_XMLB_VERBOSE 2022-01-12 16:16:52 +00:00
Richard Hughes
1ef67c60ca Only accept GUIDs when calling fu_quirks_lookup_by_id()
The only place we were using the instance ID -> GUID conversion was in
the self tests, and assuming the group is always a GUID removes a lot
of checks from a very hot path at startup.
2022-01-12 16:16:52 +00:00
Richard Hughes
c74c0ab655 trivial: Fix builds with -Dgusb=false 2022-01-11 09:40:57 +00:00
Richard Hughes
dbdb207561 Increase the chances of success of WAIT_FOR_REPLUG on WIN32
Decrease the GUsb polling interval when any of the devices is in
`WAIT_FOR_REPLUG` on when running on Windows. Any device that can
re-enumerate much faster than the default 1000ms may be missed and the
detach may fail.

Linux doesn't have this problem as it has `LIBUSB_CAP_HAS_HOTPLUG`.
2022-01-06 13:20:34 -06:00
Richard Hughes
25b1813069 trivial: Fix up some clang-format issues that snuck in recently 2022-01-06 17:04:34 +00:00
Richard Hughes
e70f2df7f7 trivial: Fix some recently added gtk-doc markup 2022-01-05 09:51:45 +00:00
Richard Hughes
f885ab6d2a Allow patching firmware files at known offsets
This allows us to replace the 'dfu-tool replace' with a much more
controlled 'fwupdtool firmware-patch' command that patches at a set of
specific offsets.

Drop in the new functionality into the existing firmware ->write()
vfuncs so that the image headers, footers and/or checksums are correct.
2022-01-05 09:51:45 +00:00
Richard Hughes
1c62194dd3 trivial: Fix fu_common_dump_full() header when specifying both flags 2022-01-04 22:06:33 +00:00
Richard Hughes
8df102b7c0 Add fu_usb_device_add_interface() for plugins to use
It's a common action for plugins to call FuUsbDevice->open() then claim
interfaces, and then release them just before FuUsbDevice->close().

It's also something a lot of plugins get wrong, so provide common code
to handle it correctly in one place.
2022-01-04 22:05:37 +00:00