Commit Graph

3265 Commits

Author SHA1 Message Date
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
Haowei Lo
6cd0871fcb Add new plugin to update FPC fingerprint devices 2022-09-27 16:41:16 +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
3195a57485 trivial: Always use g_assert_no_error() first
It's way more helpful to print the GError message than just an boolean failure.
2022-09-27 12:10:07 +01:00
waynehuang2022
22106fea81 focalfp: Add new plugin to update touchpads from focaltech 2022-09-27 09:13:08 +01:00
Dylan Van Assche
4c7906c8fd android-boot: set default version format
In case no version is found, android-boot plugin uses a fall back
version (0.0.0) but no version format is set. Therefore, fwupd uses
format 'plain' as default which is not correct as 0.0.0 is a triplet.
2022-09-25 10:53:14 +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
5d38e0aeea Move the getting the ESP to the context
We now have two plugins getting the ESP values, and we only allow hardcoding
the ESP in uefi_capsule.conf.

Make all this a lot simpler by moving the ESP+BDP code to `FuContext`, which
also means we can handle the override (via the config file) in the engine,
and the override (in the command line tools) using the same mechanism.

Also, automate the migration of the `OverrideESPMountPoint` -> `EspLocation`
when loading the engine.

Fixes https://github.com/fwupd/fwupd/issues/5042
2022-09-22 14:31:06 +01:00
Richard Hughes
f60af523e3 trivial: Don't print NULL in GError strings
PVS: Incorrect format: A null pointer is used.
2022-09-22 14:24:50 +01:00
Richard Hughes
d4c589cc04 trivial: Fix -Wunused-variable warning 2022-09-22 14:24:50 +01:00
Richard Hughes
2d2bde2268 trivial: Fix -Wunused-but-set-variable warning 2022-09-22 14:24:50 +01:00
Victor Cheng
ae74625721 usi-dock: Add initialization retry to ensure flash ready 2022-09-22 13:50:32 +01:00
SonixLeo
2c515f9a7b update the Quirk specifications for our Sonix CAM products 2022-09-22 10:34:43 +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
64cf323e57 wacom-raw: Fix maximum szie for AES panels
The latest AES panel G14T is expanded to 0x4000.
2022-09-21 07:29:33 +01:00
Richard Hughes
28fc1a5130 wacom-raw: Correctly finalize Wacom AES devices
The attach behaviour is not common between AES and EMR panels.
2022-09-21 07:29:33 +01:00
Richard Hughes
c0b8673faa dbx: Do not show the 'connected devices may not be usable while updating' message 2022-09-20 12:55:00 +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
Mario Limonciello
e8ca440bad Add new plugin to display SMU firmware version on AMD APU/CPU
This plugin is read-only, but can be used to tell what version of
SMU firmware is installed.
2022-09-19 06:51:27 -05:00
Richard Hughes
aba96e4a4a pixart-rf: Fix the endianness of the magic
This was probably broken in 0c51630991

Mea culpa.
2022-09-18 12:40:33 +01:00
Richard Hughes
e72ed08b56 Always check the BDP partitions when getting all the possible ESPs
Fixes https://github.com/fwupd/fwupd/issues/5035
2022-09-17 13:41:36 +01:00
Mario Limonciello
6ce4244edd trivial: fix reading the microcode version on AMD systems
The kernel will issue a CPUID of 0x1 before reading microcode.
Align this behavior with the MSR plugin.

AMD and Intel align their microcode diffrently in MSR 0x8b.
* Intel it's 4 bytes in.
* AMD it's at the start of the MSR.
2022-09-13 11:10:45 -05:00
Richard Hughes
891bae783c Show the USB4 NVM device ID in the debug output
Otherwise there's no way to find out what value the big-table-of-data needs.
2022-09-13 14:25:15 +01:00
Richard Hughes
404ab8e3e9 trivial: Rename the internal NvmProductId to NvmModelId to match Intel docs
This preserves sanity when comparing numbers from vendors.
2022-09-13 14:25:15 +01:00
Mario Limonciello
561c8661f8 trivial: convert pci-psp plugin to create and use a device
In general this is a cleanup, means less vfuncs that get called when
devices are added. Beyon the optimization functionally should be a
no-op for fwupd.  It will also potentially storing the version
to the newly created secure processor device in the future.
2022-09-13 07:14:22 -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
e358cc7bde Set the firmware contents even when subclassing ->parse() 2022-09-10 09:16:05 +01:00
Richard Hughes
1dab4f67cf modem-manager: Fix debug format string
PVS: The size_t type argument is expected.
2022-09-09 19:23:29 +01:00
Richard Hughes
e17f41b638 rts54hid: Fix possible unsafe memcpy()
PVS: A call of the 'memcpy' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
d8c464889a logitech-hidpp: Fix possible unsafe memcpy()
PVS: A call of the 'memcpy' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
824f634244 dfu-csr: Fix uploading to devices
This was due to an overzealous sed script running in 90254a5152.

PVS: A call of the 'memcmp' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
af3d1116f6 parade-lspcon: Remove trivial dead init
PVS: The 'write_data[0]' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
e6e476a0e7 emmc: Use struct init to set mmc_ioc_cmd
PVS: The 'idata.write_flag' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
67a0812b92 logitech-hidpp: Fix debug text when getting a HIDPP error message
PVS: Two or more case-branches perform the same actions.
2022-09-09 19:23:29 +01:00
Richard Hughes
aa71485cc5 trivial: Fix a few theoretical memory leaks that can't happen in reality
PVS: The function was exited without releasing the 'str' pointer.
2022-09-09 19:23:29 +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
a74e383f8d synaptics-cxaudio: Use fu_strtobool() to parse TRUE and FALSE
PVS: Converting type 'guint64' to type 'gboolean' can lead to a loss of high-order bits.
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
Richard Hughes
908c1d8c02 modem-manager: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
ab5683deb0 emmc: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
f79572891b cros-ec: Fix trivial format specifier
PVS: The size_t type argument is expected.
2022-09-09 19:23:29 +01:00
Richard Hughes
425f1a70c7 dell-dock: Remove trivial duplicate line 2022-09-09 19:23:29 +01:00
Richard Hughes
0c80952e30 synaptics-mst: Check the firmware payload size when updating cayenne
PVS: Parameter 'payload_len' is always rewritten in function body before being used.
2022-09-09 19:22:58 +01:00
Richard Hughes
07b368d6b1 vbe: Fix a crash when dumping firmware
PVS: The null pointer is passed into 'g_byte_array_append' function.
2022-09-09 18:50:56 +01:00
Dylan Van Assche
c62e7a6bab android-boot: fix segfault
Store strings during the lifetime of the plugin and free them
when destroyed.
2022-09-09 16:16:50 +01:00
Richard Hughes
5f554d1668 ccgx: Write all the metadata block as intended
PVS: It's odd that 'sizeof()' operator evaluates the size of a pointer to a
class, but not the size of the 'metadata' class object.
2022-09-09 06:42:51 -05:00
Richard Hughes
5ebc3b6ad9 Move the generic Intel Goshen Ridge code out to a new plugin
The original code was written by Dell for the dell-dock plugin, but
it's exactly the same code and NVM format for Intel reference hardware.
2022-09-08 09:56:33 +01:00