Richard Hughes [Thu, 9 Feb 2023 12:40:05 +0000 (12:40 +0000)]
Ensure composite devices all share the same acquiesce delay
We go to great pains to set the parent to the MAX of the child delays, but we
don't actually set the children to have the new parent value.
This means if you update the child device without the parent in the transaction
we don't always wait for all the USB devices to come back -- which is what the
acquiesce delay is designed to do.
Fixes an intermittant device test for the Wacom USB tablet.
Richard Hughes [Thu, 2 Feb 2023 14:22:07 +0000 (14:22 +0000)]
ccgx: Detect factory mode and set a non-zero version
The Element Hub (and several other docks that use the CCGX5 DMC reference
design) is in "factory mode" out of the box, displaying a version of `0.0.0.0`
Detect factory mode and set a non-zero version -- using the "real" version if
possible by matching the CCG5 devx base firmware firmware.
trivial: Disable the automatic snap stable promotion
The snap is converted into a confined version, but we need to make
sure that the snapd has promoted into a stable release so that fwupd
snap also works.
Richard Hughes [Tue, 7 Feb 2023 19:13:57 +0000 (19:13 +0000)]
Optimise getting the list of upgrades using the legacy API
We use GetReleases for all the *possible* releases that could be installed
(although the device might be in UPDATABLE_HIDDEN), and the legacy GetUpgrades
API just wants to know what can be done right now.
Richard Hughes [Tue, 7 Feb 2023 19:12:06 +0000 (19:12 +0000)]
Speed up regenerating the MOTD
This is regenerated on every device hotplug event, and although infrequent
there is no point doing all that CPU-heavy requirement checking for no reason.
Richard Hughes [Sat, 4 Feb 2023 12:46:03 +0000 (12:46 +0000)]
Use the correct range check when parsing SMBIOS
The SMBIOS specification says:
Maximum size of SMBIOS Structure Table, pointed to by the
Structure Table Address, in bytes. The actual size is guaranteed
to be less or equal to the maximum size.
So, the firmware is actually allowed to return a DMI blob smaller than the
specified size.
Richard Hughes [Sat, 28 Jan 2023 19:11:47 +0000 (19:11 +0000)]
Use indexes when building the quirk prepared queries
This can save 250us on each query (of which we do a *lot*), and reduces the
number of queries by about half if the user is using a libxmlb version that can
convert from `_BOUND_TEXT` to `_BOUND_INDEX_TEXT`.
The more devices detected, the bigger the difference, and without this patch
fixing libxmlb would break fwupd as we'e been searching with an index, but not
actually providing one.
Richard Hughes [Fri, 27 Jan 2023 16:50:06 +0000 (16:50 +0000)]
trivial: Remove duplicate call to fu_engine_ensure_device_supported()
This is moderately expensive to call as it processes each requirement on each
release on each device, so the last thing we want to do is call it *twice*.
Richard Hughes [Mon, 30 Jan 2023 11:54:05 +0000 (11:54 +0000)]
Remove unused API for setting backend tags
It turns out we do not want to know the current phase of the device, and we can
achieve the same thing tagging the GUsbDevice manually and clearing the events
at exactly the correct time.
fwupd-efi 1.4 enforces that NX bit is set by default.
This won't affect most users, it should only affect those that compile
by hand and don't have fwupd-efi installed already.
Jason Gerecke [Tue, 17 Jan 2023 22:24:14 +0000 (14:24 -0800)]
wacom-usb: Retry set_report on failure
Sometimes the flash process will randomly hang and time-out when sending
data to the device. We currently do not use any retry logic, so if this
happens the flash attempt is treated as a failure. This can be a source
of worry or frustration, especially if subsequent manual retries fail
in a similar way.
Adding FU_HID_DEVICE_FLAG_RETRY_FAILURE to the list of flags used when
calling fu_hid_device_set_report allows fwupd to try sending a block
multiple times if such a time-out (or other error) occurs. This makes
the flash process less prone to failure.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Richard Hughes [Mon, 23 Jan 2023 15:43:37 +0000 (15:43 +0000)]
Save all the FwupdDeviceFlags in the pending database
Force the compiler to treat them as uint64_t so that bitwise operations work.
At the moment flags greater than 1<<32 are just being silently ignored...
Richard Hughes [Sat, 21 Jan 2023 09:54:28 +0000 (09:54 +0000)]
Speed up startup by a huge amount when using directory remotes
By using libxmlb correctly we can avoid rebuilding the metadata if the directory
is unchanged. This means the initial 'generation' is unchanged in speed, but
subsequent loads are almost instant as the archives are not decompressed.
Richard Hughes [Sat, 21 Jan 2023 10:59:22 +0000 (10:59 +0000)]
Fallback to the <checksum> if the <artifact> is invalid
In 62a62f8f0f707d815e65ca9d0634459edb6eed97 we started ignoring the artifact
when the type was 'binary' -- however, we need to fall back to the older tag
schema if the data was not set, rather than only if the <artifact> tag was not
found.
Michal Suchanek [Wed, 18 Jan 2023 15:07:05 +0000 (16:07 +0100)]
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>
Richard Hughes [Fri, 13 Jan 2023 10:06:07 +0000 (10:06 +0000)]
Improve FDT parsing compatibility
Newer versions of dtc agressively pack the string table, using *any* matching
suffix rather than whole strings. This is specification compliant, but breaks
if you use the offset as a hash key as a [premature] optimization.
Just use the string table as a flat block of memory rather than pre-parsing it.
This fixes reading the system FDT on new OpenBMC builds.
Richard Hughes [Mon, 16 Jan 2023 15:42:55 +0000 (15:42 +0000)]
Refactor the hwids functionality
This refactors the code as it was getting very confusing; before FuSmbios was
reading both SMBIOS and the kernel-provided DT -- and various things were
injecting overrides in three different place. To properly support FDT remove
one layer of indirection.
This also lets us use the compatible strings to enable plugins specifying the
flag _REQUIRE_HWID -- which means we only load the plugin if it's got a chance
of working. e.g.