Commit Graph

133 Commits

Author SHA1 Message Date
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
Richard Hughes
5aefc520b6 redfish: Poll less frequently during cleanup
The BMC can take more than 30 minutes to start (!) if lots of devices
are installed.
2022-05-09 11:00:18 +01:00
Richard Hughes
e90367d854 redfish: hardcode the filedata name to firmware.bin
Unbelievably, using a filename with spaces causes Lenovo XCC to return a message
with InternalError, 'The request failed due to an internal service error.
The service is still operational.'

As we're using a multipart update rather than a legacy HttpPushUriTargetsBusy
PATCHing, hardcoding should be quite safe.
2022-05-09 11:00:18 +01:00
Richard Hughes
fb93b6c51c redfish: Do not mark all updates as UPDATABLE 2022-05-09 11:00:18 +01:00
Richard Hughes
5ebcfa909c redfish: Use actual FuProgress steps for ->cleanup() 2022-05-09 11:00:18 +01:00
Richard Hughes
b7bf0a7611 Do not fallback to audio-card
Let the frontend choose the most appropriate icon if unspecified.
2022-04-25 14:49:30 +01:00
Richard Hughes
81fbff8445 redfish: Restart the BMC after installing BCM updates 2022-04-19 20:24:59 +01:00
Richard Hughes
a374254d74 redfish: Drop the cache when invalidated 2022-04-15 16:49:48 +01:00
Richard Hughes
08a3fd8b65 redfish: Fix a memory leak when calling ->setup() more than once 2022-04-15 16:49:48 +01:00
Richard Hughes
064cb648c1 redfish: Allow specifying the request type 2022-04-15 07:43:09 +01:00
Richard Hughes
f8f5cd1f25 redfish: Don't add a device to itself when replugging 2022-04-14 13:06:21 +01:00
Richard Hughes
3b0d1a6c6b trivial: Ignore the return value of curl_easy_setopt() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +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
200302bbc6 redfish: Remove some logically dead code 2022-04-13 15:08:12 +01:00
Richard Hughes
a11fefff35 redfish: Don't add the backup BMC device as it shares the same GUIDs
This fixes the problem when the UEFI update depends on a specific BMC
version -- including the backup BMC device means we checking that both
the primary and the backup were above a specific version.

I don't think it's ever useful to show the backup BMC device, so just
don't include it as an enumerated device.

Fixes https://github.com/fwupd/fwupd/issues/4404
2022-03-18 11:03:14 +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
5bc5462213 trivial: redfish: use the configured prefix to determine if it's an installed test
fixes: #3880
2022-02-28 13:36:49 -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
Richard Hughes
f3a13f89dd Allow specifing the DeviceIntegrity flag from metadata 2022-02-22 19:12:06 +00:00
Richard Hughes
f3d71a18a5 redfish: Be more robust by retrying IPMI transactions
This fixes creating users when the BMC is otherwise busy.
2022-02-01 16:18:28 +00:00
Richard Hughes
fba2fd62f2 redfish: Add error codes not provided in ipmi_msgdefs.h 2022-02-01 16:18:28 +00:00
Richard Hughes
de874c7d8e redfish: Wait some time after creating the initial IPMI user
It would appear that in reality a delay is required for them to sync state.
2022-02-01 16:18:28 +00:00
Richard Hughes
76dcafee1f redfish: Do not use 'unspecified' for the unknown error 2022-02-01 16:18:28 +00:00
Richard Hughes
3917714dd1 redfish: Change an expired password when required 2022-01-19 21:19:01 +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
2734f0ab77 redfish: Do not autoload ipmi-si to avoid warning on non-server hardware
This leads to reports of:

    systemd-modules-load[1710]: Failed to insert 'ipmi_si': No such device
    systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
2022-01-10 14:06:34 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
8e6a3f6bbb Allow devices to opt-in to metadata-provided vendor strings 2021-12-22 15:34:36 +00:00
Mario Limonciello
22057f76cc redfish: Use secure helper to set file permissions when setting password
Instead of installing the conf file as locked down, set permissions when
using it.

This fixes a problem on snap first run:
```
cp: cannot open '/snap/fwupd/x1/etc/fwupd/redfish.conf' for reading: Permission denied
```
2021-12-17 11:05:05 -06:00
Richard Hughes
8fc8539146 trivial: Remove some unused variables 2021-12-10 16:00:07 +00:00
Richard Hughes
58d36dcbe5 Check the value range when parsing the quirk keys
At the moment there isn't an error if you enter something like

    CfiDeviceCmdReadId = 0×12
2021-12-09 13:09:43 +00:00
Richard Hughes
68722ec6e4 redfish: Set SSL_VERIFYHOST=0 to fix OpenBMC auth 2021-11-11 20:47:20 +00:00
Richard Hughes
5a95cf61d8 redfish: Fix crash when specifying a URL without a port 2021-11-11 20:47:20 +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
1a077289bc Speed up daemon startup by 15%
During my fwupd startup fu_plugin_has_custom_flag gets called 21 times
which causes all HWIDs to be enumerated with 346 calls to the quite
expensive fu_context_lookup_quirk_by_id() function.

Move the flag to a private hashset and enumerate the HWIDs only during
startup. There's nothing plugin specific about them anyway...
2021-11-03 07:14:37 +00:00
Richard Hughes
28678235cd Move the fuzzing files into the plugin directories
We only had to pile everything into the src/fuzzing/firmware directory
because honggfuzz could not cope with more than one input path.

This way each plugin is self contained and easy to copy.
Also, install the fuzzing builder objects as this fixes the installed
tests when srcdir does not exist.

Based on a patch by Jan Tojnar <jtojnar@gmail.com>, many thanks.
2021-10-22 15:24:05 +01:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Richard Hughes
852a6dbdc2 redfish: Handle EPERM when testing devices with a IPMI device
Fixes https://github.com/fwupd/fwupd/issues/3849
2021-10-12 19:12:57 -05:00
Richard Hughes
478e44bc19 trivial: Do not use g_assert() in self test code
Note that g_assert() should not be used in unit tests, since it is a
no-op when compiling with G_DISABLE_ASSERT. Use g_assert() in production
code, and g_assert_true() in unit tests.

See https://github.com/fwupd/fwupd/issues/3790
2021-09-24 22:20:21 +01:00
Richard Hughes
4b09701452 redfish: Fix a potential NULL dereference spotted by Coverity 2021-09-24 19:03:52 +01:00
Richard Hughes
ac1ae33b05 redfish: Install the config file readable only by root
It's got a password there, so this seems entirely appropriate.
2021-09-21 15:35:09 +01:00