Commit Graph

44 Commits

Author SHA1 Message Date
Richard Hughes
6e34a90a12 trivial: Add FuProgress to fu_context_load_hwinfo()
TIL: fu_bios_settings_setup() takes over 50ms (10%!) at startup.
2023-01-30 14:47:44 +00:00
Richard Hughes
8af1943142 trivial: Add FuContextHwidFlags for future usage 2023-01-16 17:49:57 +00:00
Richard Hughes
058dc2301a Include the plugin README text in the generated docs 2023-01-10 14:58:30 +00:00
Richard Hughes
6c18cc0f66 mtd: Use dummy SMBIOS data to fix self test on s390x 2023-01-04 07:24:01 -06:00
Richard Hughes
02e3549f1a trivial: Fix build failure when /var/cache/fwupd is not writable
The fu_context_load_quirks(FU_QUIRKS_LOAD_FLAG_NO_CACHE) has to be done first,
otherwise fu_context_load_hwinfo() auto-loads the quirk db with the defaults.

Fixes a build failure in Fedora QA.
2022-12-14 14:12:17 +00:00
Mario Limonciello
308068e73b trivial: fix autopkgtest failure
Explicitly load_hwinfo at start of mtd self test
```
.# Start of mtd tests
.# GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
.# XbSilo-DEBUG: attempting to load /tmp/.E94WW1
.# XbSilo-DEBUG: failed to load silo: blob too small
Bail out! FuContext-FATAL-CRITICAL: cannot use HWIDs before calling ->load_hwinfo()

(/usr/libexec/installed-tests/fwupd/mtd-self-test:1758): FuContext-CRITICAL **: 23:27:43.095: cannot use HWIDs before calling ->load_hwinfo()
```
2022-12-09 07:53:33 -06:00
Richard Hughes
e2371a5690 igsc: Add a plugin to update some Intel discrete graphics cards 2022-11-03 13:43:54 +00: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
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
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
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
Dylan Van Assche
a8017e0a4f mtd: expose Pine64 PinePhone Pro MTD as Tow-Boot
Pine64 PinePhone Pro has an SPI device which is handled by the MTD
plugin and comes with Tow-Boot pre-installed from the factory.
Expose it as Tow-Boot and mark the firmware type with uSWID for version
extraction. However, it does not provide uSWID data so users have to manually
upgrade to a Tow-Boot version with uSWID data support first.
2022-09-12 14:51:14 +01:00
Richard Hughes
fc3ac81978 Load coSWID metadata from a uSWID MTD block device
The coSWID is a child of the parent, and the parent container does not have a
version. Also fix a small memory leak when parsing container formats.

Fixes https://github.com/fwupd/fwupd/issues/4294
2022-09-07 16:02:27 +01:00
Mario Limonciello
d6a455e856 trivial: try harder to make sure mtdram is set up
the autopkgtest environment in Ubuntu seems to not be preparing the mtdram
device properly. Sometimes the udev node "exists" but the /dev/mtd0 does not
exist.

Look for this explicitly and skip the test if it happens.
2022-09-07 08:24:10 -05:00
Mario Limonciello
9289e7d817 trivial: set firwmare attributes class directory for all tests
We don't want the system's firmware attributes class directory to
conflict.
2022-07-28 17:30:57 -05:00
Richard Hughes
a61bb37881 Build the quirk files into the daemon as a GResource
Interestingly, this increases the `fwupd` binary size by ~30kb but
reduces the installed size of /usr/share/fwupd/quirks.d by ~330kb.
2022-06-30 18:52:24 +01:00
Gaël PORTAY
299b42fe96 trivial: Make meson.build indentation consistent 2022-06-21 03:27:38 -04:00
Richard Hughes
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
4b1313b406 Split out the GByte helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
0cbcac93cd Rename fu_udev_device_ioctl_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
029d2895bd Rename fu_udev_device_pread_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Mario Limonciello
48544bd2ac trivial: skip mtd tests if not working off mtdram test device
(LP: #1973598)
2022-05-16 11:22:30 -05:00
Richard Hughes
7ec0f11e69 mtd: Use the correct uSWID child for multiple coSWID children 2022-04-18 17:48:52 +01:00
Richard Hughes
0b7af7d54b trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
7dc34ff02e Mark more devices as CAN_VERIFY_IMAGE
This allows us to filter the devices when showing what we can dump.
2022-04-01 21:46:04 -05:00
Richard Hughes
2bee2164af trivial: Fix the mtd test when the prefix is read only 2022-03-22 14:36:48 +00:00
Richard Hughes
8ef261af32 mtd: Add some self tests using mtdram 2022-03-18 12:55:44 +00:00
Richard Hughes
df66a1d73e mtd: Ignore devices that report EPERM on open 2022-03-18 12:55:44 +00:00
Richard Hughes
7d9dff4789 mtd: Support dumping the image to a firmware blob 2022-03-18 12:55:44 +00:00
Richard Hughes
095cbad100 mtd: Fix writing mtd images larger than 10kb 2022-03-18 12:55:44 +00:00
Richard Hughes
a6aef01e49 mtd: Do not try to probe recovery read-only partitions
Ignore devices without a 'flags' file.
2022-03-11 16:51:45 +00:00
Richard Hughes
a239dc8ab8 mtd: Allow the metadata to set the signed payload flag 2022-03-11 16:51:45 +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
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
Richard Hughes
cda5879974 mtd: Parse the firmware version using the defined GType 2022-02-18 10:38:17 +00:00
Richard Hughes
f8d1a1606e mtd: Add two more instance IDs to the MTD devices 2022-02-18 10:38:17 +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
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Richard Hughes
36d7077f65 Add a new plugin to handle MTD devices 2021-11-05 20:01:51 +00:00