Commit Graph

173 Commits

Author SHA1 Message Date
Richard Hughes
99df74f0c2 Add API to wait for a device
This allows us to ignore all the delays when the device is emulated, with the
idea being to do dozens of device emulations in the CI tests.

Also, do not call fu_progress_sleep() when the device is emulated.
2023-02-01 09:42:08 +00:00
Richard Hughes
72f5c1e01e trivial: Make the installed-tests redfish.conf secure to avoid a warning
Also, don't attempt to change the permissions if the correct one is already
set.
2023-01-17 19:29:39 +00:00
Richard Hughes
058dc2301a Include the plugin README text in the generated docs 2023-01-10 14:58:30 +00:00
Mario Limonciello
c939db9296 trivial: skip self tests that fail with G_IO_ERROR_NOT_DIRECTORY
fixes: #5370
2023-01-05 09:20:35 +00:00
Richard Hughes
d1c6acd752 trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
Kai Michaelis
6054d09f35
redfish: Implement updates for Supermicro machines 2022-10-06 12:49:49 +01:00
Richard Hughes
edcdd44795 trivial: Enable all the builtin plugins
Fixes https://github.com/fwupd/fwupd/pull/4836
2022-09-30 12:30:11 +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
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
Richard Hughes
c73a55faa1 Remove a potential foot-gun when saving config values
If a specific plugin calls fu_plugin_set_secure_config_value() and then
fu_plugin_set_config_value() then we'll save the file with the world-readable
permissions.

Set a plugin flag to say that 'this plugin is storing sensitive details' which
allows us to use the same entrypoint and also fix up any files at startup that
do not have the correct permissions.
2022-09-22 14:47:12 +01:00
Richard Hughes
2fb81a6482 redfish: Only create users using IPMI when we know it's going to work
Make the IPMI auto-account feature allow-listed on specific vendors as some IPMI
implementations are not specification compliant and do entirely the wrong thing.
2022-09-21 14:22:35 +01:00
Richard Hughes
b34dc9c1f1 redfish: Set the permissions of redfish.conf at install time
Although typically we set the password using fu_plugin_set_secure_config_value()
or something like Ansible or Puppet -- the user could just edit the file with
vim and we still want the permissions set correctly.
2022-09-20 12:33:03 +01:00
Richard Hughes
e84e8b6927 redfish: Use the passed offset when parsing SMBIOS tables
PVS: Parameter 'offset' is always rewritten in function body before being used.
2022-09-09 19:23:29 +01:00
Richard Hughes
72f6cc5a0a redfish: Fix a condition that can never be false
PVS: A part of conditional expression is always true: path != NULL.
2022-09-09 19:23:29 +01: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
829258401e Allow plugins and backends to print debugging information to the console
This is really useful for debugging.
2022-07-28 16:10:06 +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
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
Richard Hughes
0491b07a93 Make the FuFirmware->parse() vfunc more helpful
This removes the 100% unused addr_end parameter and explicitly makes
the addr_start into the start offset in more cases.
2022-06-27 15:40:11 -05:00
Richard Hughes
b8be6daf1f trivial: Use 'priv' for plugin private data to be consistent 2022-06-26 13:57:53 -05:00
Richard Hughes
dc1730c439 trivial: Some clang-format fixups 2022-06-22 15:55:32 +01:00
Gaël PORTAY
299b42fe96 trivial: Make meson.build indentation consistent 2022-06-21 03:27:38 -04:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 2022-06-14 14:36:52 -05: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
619677fc3f redfish: Also reconnect the network during BMC re-coldplug 2022-06-10 13:15:08 +01:00
Richard Hughes
b75553cb49 redfish: Be more helpful when debugging connection failures 2022-06-10 13:15:08 +01:00
Richard Hughes
09f9ea7d06 redfish: Autoconnect the Redfish network device when rebooting the BMC 2022-06-10 11:09:26 +01:00
Richard Hughes
0c8079b13c redfish: Never manually modprobe ipmi-devintf
This produces startup failures on images that do not ship that exact
module, e.g. guest-images.

Just rely on the kernel driver to be auto-loaded when required.

Fixes https://github.com/fwupd/fwupd/issues/4550
2022-06-06 08:20:21 -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
5ef0ae182d Add a 'name' attribute to each FuProgress step
This allows us to print better warning strings, and in the future
would allow us to profile each operation in a meaningful way.

Also, add context to some of the progress steps as required.
2022-06-01 15:05:43 +01:00
Richard Hughes
4925fc3ba2 redfish: Fix a tiny leak when making requests 2022-05-27 11:59:28 +01:00
Richard Hughes
cc10990628 redfish: Fix a memory leak when running coldplug multiple times 2022-05-27 11:59:28 +01:00
Richard Hughes
54a1ef4642 redfish: Do not show a warning when there is no post delay 2022-05-26 11:55:32 +01:00
Richard Hughes
15a0288141 redfish: Don't reboot the BMC for all updates
The WILDCARD_TARGETS private flag had the same value as MANAGER_RESET...
2022-05-26 11:55:32 +01:00
Richard Hughes
0ad49b444e redfish: Be more resilient when restarting the BMC 2022-05-24 14:45:56 +01:00
Richard Hughes
317887cf85 redfish: Do not print unhelpful coldplug text 2022-05-24 14:45:56 +01:00
Richard Hughes
353a772e1a redfish: Use the correct key name for BMC reboot 2022-05-24 13:01:12 +01:00
Richard Hughes
d3d7cfa816 Add plugin quirk keys earlier in the startup process
This allows creating the silo when starting the engine with custom
plugin keys such as WacomI2cFlashBaseAddr.

If we move the plugin initialization earlier then we don't get the
HwID matches, so we really do have to split this into a 4-stage startup,
e.g. ->load(), ->init(), ->startup() and ->coldplug().
2022-05-09 11:13:52 +01:00