Commit Graph

1018 Commits

Author SHA1 Message Date
Richard Hughes
ac48c865a0 Add a helper to get a GUsbDevice from a FuUdevDevice 2022-10-26 23:27:50 +01:00
Richard Hughes
2c321ac29b Emit a critical warning if a plugin tries to use HWIDs in ->init()
The HWIDs are only available for ->setup() and ->coldplug().
2022-10-25 10:46:29 -05:00
Richard Hughes
e8eaca0051 Save the ONLY_QUIRK instance IDs to fix incorporation of i2c
The baseclass is calling fu_device_build_instance_id_quirk() and when we
incorporate the device we were only copying the 'proper' instance IDs and not
the ones used for quirk matching -- which we need to match the devices that use
keys containing MODALIAS for the Plugin key to be set.
2022-10-25 15:39:30 +01:00
Richard Hughes
7c4398615e trivial: Watch the plugin config even if there's no ->startup() 2022-10-25 06:54:08 -05:00
Richard Hughes
5987a9691a Ensure the configure file is correct for built-in plugins
The fu_plugin_open() function is only called for modular plugins.
2022-10-25 06:54:08 -05:00
Richard Hughes
5a2ef166ee Support loading COSWID when only one role has been set
CBOR supports removing the array for only one base element, which the python
uSWID tools now support; allow parsing this in fwupd.
2022-10-24 16:12:00 +01:00
Richard Hughes
d1c6acd752 trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
Richard Hughes
06800069d4 Split out FuUefiPkDevice as a device for future use
This does not serve much purpose now, but would be useful if we need to know
more about the installed PK from other plugins. If nothing else it makes the
`--verbose` output more helpful.
2022-10-20 13:52:22 +01:00
Richard Hughes
5fcfe7f0fc Only count the Microsoft hashes when getting the dbx version
HP include extra keys that means the version is higher than expected.
2022-10-17 16:31:37 +01:00
Richard Hughes
0f8ec55f46 Add a new plugin to get more Intel ME MCA data
This allows us to get the OEM Public Key BootGuard hashes.

Also add a new HSI test for leaked bootguard keys.
2022-10-13 18:34:00 +01:00
Richard Hughes
ef04d0578f trivial: Fix a critical warning when using old kernel versions 2022-10-13 18:34:00 +01:00
Richard Hughes
6894f67dc5 Do not use GKeyFile to parse quirk files
There are two reasons for this. First is that GKeyFile is quite inefficient,
using a large amount of heap memory when loading. Given we don't actually use
the merge and replace functionality of GKeyFile and we only need line-by-line
access we can parse this ourselves and reduce the peak RSS considerably.

This also accidentally fixes another bug. Moving from multiple quirk files to
a single builtin.quirk meant that multiple subsystem plugins were deduped --
which isn't really what we wanted. For example, this now works:

    [MEI]
    Plugin = one
    [MEI]
    Plugin = two
2022-10-12 15:12:56 +01:00
Richard Hughes
2dea742004 Match the MEI UUID in quirk files
This allows us to be more specific when matching devices, and also means we get
more attributes 'for free' from the FuUdevDevice->probe().

This would allow us to have multiple device GTypes handling multiple MEI
interfaces in the same plugin., for instance, PTHI and MKHI.

The slight fly in the ointment is that the kernel does not set the 'dev' for
the mei_me devices, but it's always going to be just /dev/mei0, so hardcode it.
2022-10-12 13:17:42 +01:00
Richard Hughes
48557a428e Add fwupd_device_has_checksum() for future usage 2022-10-12 13:02:44 +01:00
Richard Hughes
366e3a5668 trivial: Define the HECI GUIDs in a central place 2022-10-11 16:17:20 +01:00
Richard Hughes
14e7e1b587 Use EFI-style GUIDs when connecting the MEI interface
This means the GUID matches what the kernel exports in sysfs.
2022-10-11 16:17:20 +01:00
Richard Hughes
a92a33f522 Add the correct instance ID for HUB devices 2022-10-08 08:47:08 +01:00
Richard Hughes
112e26e33d Make the CoSWID parser more full-featured 2022-10-07 16:25:31 +01:00
Richard Hughes
0110a3ebdf Fix a regression when getting the i2c bus number
When I replaced the regex with a fu_strtoull() in bb548f15 I missed that the
regex looked at the 2nd-to-last sysfs path element, e.g. the i2c bus number for
/sys/devices/pci0000:00/0000:00:15.2/i2c_designware.1/i2c-1/i2c-1AF80175:00 is
actually '1'.

This fixes enumerating the parade-lspcon on a Puff ChromeBox.
2022-10-07 16:24:55 +01:00
Richard Hughes
fb764b5187 trivial: Support writing compressed uSWID payloads 2022-10-07 14:52:31 +01:00
Richard Hughes
2fef67db3b trivial: Fix writing uSWIDv2 payloads
The optional flags come last in the header.
2022-10-07 14:52:31 +01:00
Richard Hughes
a01379f835 trivial: Use fu_strtobool() to parse the uSWID compressed attr 2022-10-07 14:52:31 +01:00
Richard Hughes
617137922d Add some more profiling to debug custom device GType creation
It turns out using tss2_esys is slow (200ms) -- and now we know.
2022-10-07 14:41:48 +01:00
Kai Michaelis
6054d09f35
redfish: Implement updates for Supermicro machines 2022-10-06 12:49:49 +01:00
Richard Hughes
f579c03223 trivial: Only show the DS20 debug output when debugging 2022-10-06 12:44:36 +01:00
Richard Hughes
ac27638878 Only request the BOS descriptor for newer libgusb versions
This fixes a deadlock only recently debugged and fixed in GUsb.
2022-10-06 12:44:36 +01:00
Richard Hughes
423637ef80 Use LVFS::UpdateRequestId to create a translated FwupdRequest 2022-10-06 10:30:31 +01:00
Richard Hughes
1b6438e8ff trivial: Only set the fallback builtin plugin name when required
We only want to use the gtype-generated name if the plugin has not already used
fu_plugin_set_name() to set a custom name.
2022-10-04 08:32:18 +01:00
Richard Hughes
a69341b228 trivial: Add a new env var to show MEI reads and writes 2022-10-01 13:10:21 +01:00
Richard Hughes
1f261ba283 Rename the source file and private data of modular plugins
This would allow us to convert more easily to a built-in plugin in the future
and means we match the source style used in 97% of the other plugins.

No logic changes.
2022-09-30 15:20:23 +01:00
Richard Hughes
fc3cfbad92 Do not check the build hash of modular plugins
We removed the abilty to easily build modular plugins, and so we don't need to
worry so much about random 3rd party modules being loaded.
2022-09-30 14:19:56 +01:00
Richard Hughes
e8de491030 trivial: Do not require fu-hash.h for builtin plugins 2022-09-30 10:36:12 +01:00
Richard Hughes
cdbc6b5266 Fix installing the dbx update when not using fwupdtool --force
Fixes https://github.com/fwupd/fwupd/issues/5089
2022-09-29 15:32:30 +01:00
Richard Hughes
1bd8b5d211 trivial: Speed up the build by about 9%
Only build libfwupdplugin source files once; we were only using one
non-exported symbol and so move that to the exported map so we can just link
the library in the self tests.
2022-09-29 12:42:50 +01:00
Richard Hughes
a8e56396d5 Prevent a partial fuzzing DoS when loading corrupt SREC files
The SREC parser attempts to fill 1Mb of data when parsing corrupt data sections
-- which in the static fuzz targets takes a long time. Correctly check that the
data exists to mitigate.

Fixes https://oss-fuzz.com/testcase-detail/6102934106013696
2022-09-29 12:32:35 +01:00
Mario Limonciello
d5585728a2 trivial: don't refer to plugindir in the build system anymore 2022-09-28 15:12:10 -05:00
Richard Hughes
99002a7a18 Build many more plugins as builtin
This reduces the plugin directory size by 2.2Mb
2022-09-28 17:01:23 +01:00
Richard Hughes
439c364f46 trivial: Fold FuPluginVfuncs into FuPluginClass
This adds 7 pointer-size blocks of wasted space for each modular plugin, and
three pointers for builtin plugins, but allows us to use the exact same vfuncs
when building plugins in either mode.

This will allow us to convert nearly all the plugins to being builtin.
2022-09-28 14:42:04 +01:00
Richard Hughes
f8400ffaae trivial: Rename the FuPluginClass signals callbacks
The aim is to fold FuPluginVfuncs into this, and the names clash.
2022-09-28 14:42:04 +01:00
Richard Hughes
2a5f7766a4 trivial: Remove the deprecated fu_plugin_set_secure_config_value() 2022-09-28 14:42:04 +01:00
Richard Hughes
3dbf5fa8a4 trivial: Remove the deprecated fu_volume_new_esp_default() 2022-09-28 14:42:04 +01:00
Richard Hughes
d629240a83 trivial: Remove the padding from FuXxxClass structs
The library is now tied to the current fwupd version, so we can break API.
2022-09-28 14:42:04 +01:00
Richard Hughes
99e9e5d523 Allow compiling plugin as built-in GObjects
Allow plugins to be built into libfwupdpluginbuiltin.so and created via GType.
2022-09-28 12:52:00 +01:00
Mario Limonciello
ec0496b47a Make libfwupdplugin an internal library instead
This drops the requirement on us being so strict on a particular ABI version,
and also more strongly discourages out of tree plugin development.

We should still strive to keep API stable, and as such keep a symbol map still.

Use rpath instead for the static plugins, and set the plugin install directory
to just fwupd-$ABI$ as we're storing more than just plugins here now.
2022-09-28 10:04:12 +01:00
Richard Hughes
3fa2df2ab3 trivial: Remove unused build includes
It was amazing this ever worked, as the file was being generated in src/
2022-09-27 14:18:01 +01:00
Richard Hughes
c4b7f42e43 Only compress one version of the builtin-quirks
Saving the quirks in the GResource section worked well, but it made the build
system very complicated and also meant the .data section was duplicated in
both `fwupd` and `fwupdtool` -- negating a lot of the hard-fought savings.

Simplify this feature so that we just `cat` all the quirk files together, then
gzip them into a single file. This means that at startup fwupd only needs to
check the mtime of one file, and weirdly it's actually faster to load a smaller
compressed file from disk that it is to load multiple uncompressed files.
2022-09-27 12:44:04 +01:00
Richard Hughes
24db10ac1c trivial: Add fu_plugin_set_context() for future use 2022-09-26 22:24:41 +01:00
Richard Hughes
0415db6f67 Revert "trivial: Use files() rather than current_source_dir()"
This reverts commit b581fa5670 as it breaks
`ninja dist` with `-Dgresource_quirks=enabled`.
2022-09-25 10:31:14 +01:00
Richard Hughes
b581fa5670 trivial: Use files() rather than current_source_dir() 2022-09-24 09:12:14 -05:00
Richard Hughes
b50ef90aa6 trivial: Fix up some internal docs to reflect reality 2022-09-23 16:39:21 +01:00