Commit Graph

475 Commits

Author SHA1 Message Date
Richard Hughes
a02c1073f2 trivial: Fix up some of the developer docs
And add some missing content as requried.
2021-06-11 09:39:03 +01:00
Mario Limonciello
1e17457b16 Allow building the documentation with gi-docgen and gtk-doc
Until gi-docgen is declared stable support either of them.
This effectively means that hand builds and CI builds will use
gi-docgen, but distro builds use gtk-doc-tools.
2021-06-09 22:21:53 +01:00
Mario Limonciello
3f016787ee trivial: add gtkdoc for more of the defines 2021-06-04 13:21:41 -05:00
Richard Hughes
66482687f7 trivial: Move the sys/mman.h include to the right #ifdef 2021-05-26 16:00:32 +01:00
Sergii Dmytruk
d01603c2f9 Don't fail if memfd_create() is not available
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-05-21 17:29:17 +01:00
Richard Hughes
2a5122b4a0 trivial: Fix a warning when compiling on Windows
Move the function prototype out of the GUnixInputStream-using ones.
2021-05-18 13:08:04 +01:00
Richard Hughes
6bc2d155a9 trivial: Remove a build warning by including Json properly 2021-05-17 09:27:54 +01:00
Richard Hughes
0aaf060105 Follow HTTP 3XX redirects when downloading files
This allows us to punt some smaller files onto the CDN.
2021-05-14 18:48:47 +01:00
Richard Hughes
dd415ab396 Add fwupd_remote_setup() to split out the 'parsing' from the 'validation' 2021-05-14 06:02:56 +01:00
Richard Hughes
2e6fee186e trivial: Fix several potential leaks when parsing remotes
This fixes several issues when calling fwupd_remote_load_from_filename()
multiple times on the same FwupdRemote.
2021-05-14 06:02:56 +01:00
Richard Hughes
6c706c74d6 trivial: Export fwupd_remote_set_filename_source() for possible future usage 2021-05-14 06:02:56 +01:00
Richard Hughes
769cbbf8af Add support for the PHAT table
On Alterlake and newer hardware the Platform Health Assessment Record
data can be used by the IHV to debug why a specific capsule update
failed. Any custom firmware loaded by the OEM can be identified and
used to further debug the root cause.
2021-05-12 12:02:33 +01:00
Richard Hughes
cb5aa1a254 trivial: Convert FwupdRelease to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
3f0340c3a7 trivial: Convert FwupdPlugin to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
8246e43174 trivial: Convert FwupdDevice to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
20ef071b3c trivial: Style fixes to lots of gtk-doc 2021-05-10 14:35:10 +01:00
Richard Hughes
5e95cae0c4 trivial: Fix CI by including the version symbols 2021-04-30 16:07:10 +01:00
Richard Hughes
c77b4f03a2 Check the versions of libfwupd and libfwupdplugin at startup
This prevents super-hard-to-debug crashes like we saw in #3197 where the user
was mixing PPAs and official versions.
2021-04-30 15:00:04 +01:00
Richard Hughes
76cafb29b7 Fix a critical warning when downloading files
The call to g_proxy_resolver_get_default() is (transfer none) and so unref'ing
it causes GLib to get very upset. Also, move it to be per-FwupdClient rather
than per-request as it can be expensive to call in the PAC-runner case.
2021-04-30 11:19:09 +01:00
Richard Hughes
89d45a0d91 trivial: Standardize on introspection for @error and @cancellable
Also standarize on `Returns:` for the result.
2021-04-28 16:19:50 +01:00
Richard Hughes
fdd507957a Switch from libproxy to GProxyResolver
GProxyResolver will use libproxy only when required. TIL.
2021-04-28 15:52:45 +01:00
Richard Hughes
f992fb75cd Use libproxy to get the system proxy setting for a given URL 2021-04-26 16:30:13 +01:00
Richard Hughes
63bc42eace Add a composite ID that is used to identify all devices in the same physical package 2021-04-22 16:27:04 +01:00
Richard Hughes
d42bd85059 trivial: Do not use the deprecated allow-none introspection argument
It's been deprecated since 2014... oops.

https://blogs.gnome.org/desrt/2014/05/27/allow-none-is-dead-long-live-nullable/
2021-04-19 14:46:42 +01:00
Richard Hughes
64416bcd0a trivial: Mark more functions arguments as 'nullable' 2021-04-19 14:46:42 +01:00
Richard Hughes
6ef551a39e Never allow plugins to add a NULL GUID
Not fixing, but should help with https://github.com/fwupd/fwupd/issues/3156
2021-04-19 14:46:42 +01:00
Mario Limonciello
1f9c035788 trivial: fix some trailing whitespace problems across the project 2021-04-09 16:02:20 +01:00
Richard Hughes
f3c64adb6c intel-spi: Allow downloading the firmware image from the eSPI controller
Add the IFD regions as child devices and set the region access on the child
devices. Also add read-only SPI descriptor as an HSI attribute and require
FLOCKDN on Intel hardware.

Use the hidden PCI 00:1f.5 device to set the SPIBAR automatically and generate
the quirk file automatically to support more hardware.
2021-04-01 21:56:35 +01:00
Richard Hughes
2002bd5046 trivial: Fix a compile failure with new GLib versions
GLib now 'helpfully' includes type_traits in gmacros.h -- which now explodes
when compiling with a C++ compiler.
2021-03-21 20:18:34 +00:00
Norbert Kamiński
76e19930a8 fwupd port for BSD distros
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2021-03-19 17:05:09 +00:00
Richard Hughes
a5966f7085 trivial: Codespell fixes 2021-03-19 16:42:33 +00:00
Richard Hughes
d94286b9de Allow enabling plugins only matching a specific HwId
At the moment plugins are doing this a few different ways; either looping
through the HwIds manually (e.g. flashrom) or setting a custom flag that is
checked in fu_plugin_setup (e.g. uefi-recovery).

Define a standard 'Plugin' HwId quirk to simplify plugins.
2021-03-02 18:19:45 +00:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
Richard Hughes
078beafb2d Add a new internal flag to opt-in to GUID matching
It is far too easy to forget to set FWUPD_DEVICE_FLAG_NO_GUID_MATCHING for new
plugins, and without it it all works really well *until* a user has two devices
of the same type installed at the same time and then one 'disappears' for hard
to explain reasons. Typically we only need it for replug anyway!

Explicitly opt-in to this rarely-required behaviour, with the default to just
use the physical and logical IDs. Also document the update behavior for each
plugin to explain why the flag is being used.

This allows you to have two identical Unifying plugged in without one of them
being hidden from the user, at the same time allowing a HIDRAW<->USB transition
when going to and from bootloader and runtime modes.

This removes the workaround added in 99eb3f06b6.

Fixes https://github.com/fwupd/fwupd/issues/2915
2021-02-25 15:47:25 +00:00
Richard Hughes
7b2621c3de trivial: Incorporate by merging the device flags
If any flags are set in the baseclass (e.g. FuDevice) then incorporating with
a FuUdevDevice or FuUefiDevice is not going to merge the flags.
2021-02-23 14:33:30 +00:00
Richard Hughes
f722b30205 libfwupd: Fix adding multiple flags to devices
Ignore the request if _all_ the new flags are already set, not just any of them.
2021-02-22 22:48:56 +00:00
Richard Hughes
3f94eabe69 trivial: Use fwupd_device_add_flags() to set a single flag 2021-02-22 22:48:56 +00:00
Richard Hughes
5eca890f93 trivial: Do not assume the running system has LVFS enabled for the tests
This is not true for RHEL, and so 'ninja dist' fails on any RHEL workstation.
2021-02-16 09:19:46 +00:00
Richard Hughes
0b6907e0bb trivial: Fix warning from clang about unused variable 2021-02-08 12:53:32 +00:00
Richard Hughes
4d7bcaace5 trivial: Fix warning when compiling without libcurl 2021-02-08 12:53:12 +00:00
Richard Hughes
01a30aa6de Add support for oss-fuzz 2021-02-08 09:17:03 +00:00
Richard Hughes
9b3f7aba82 trivial: Remove unused -Dlink_language support 2021-02-07 16:59:57 +00:00
Richard Hughes
6de10e118c Allow downloading firmware from IPFS
Only a small amount of the firmware on the LVFS will be available. The user
can use --ipfs on the command line for testing, or change the system-wide
default in /etc/fwupd/daemon.conf.

The IPFS daemon and command line client will need to be installed manually.
2021-02-01 19:33:31 +00:00
Richard Hughes
4d8163c2ee trivial: Fix up a gtk-doc warning for a new symbol 2021-01-30 16:14:21 +00:00
Richard Hughes
7715dead97 trivial: Fix bogus -Wunused-variable warning 2021-01-30 15:49:20 +00:00
Richard Hughes
382524d82f trivial: Fix potential crash when doing crazy things
Fix the asan crash when feeding the value back into itself, e.g

    fu_firmware_set_version (firmware, fu_firmware_get_version (firmware));
2021-01-28 14:13:59 +00:00
Richard Hughes
5bb9cf9392 Fix a crash when using fwupdtool
The docs for `fwupd_device_get_children()` make it very clear that only the
parent should be assigned. Also add a warning to `fwupd_device_add_child()`
explaining it is for internal daemon use only.
2021-01-27 15:48:43 +00:00
Richard Hughes
5d534970cb trivial: Show a warning if the child device gets unref'd from the parent
Should not happen, but bugs will be bugs.
2021-01-27 15:48:43 +00:00
Richard Hughes
e1abefb788 trivial: Use fwupd_client_download_bytes2_async() when installing releases 2021-01-26 20:32:32 +00:00
Richard Hughes
633ff10772 libfwupd: Add fwupd_client_install_release2_async()
We forgot to include FwupdClientDownloadFlags when adding the original method
fwupd_client_install_release() -- and we want to use additional download flags
for operations in the future.
2021-01-26 18:01:33 +00:00