Commit Graph

71 Commits

Author SHA1 Message Date
Richard Hughes
d4d0ba0faf Unexport fu_common_cab_build_silo()
There's no reason this needs to be in the shared library.
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
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
3f77af3cd4 Split out the kernel 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
c6581fb7a6 Split out the GByteArray helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
3fe9c0de34 Split out the CRC and sum functions to new source files 2022-06-14 14:36:52 -05:00
Richard Hughes
945002f7a3 Fix build for MacOS
This is more for curiosity than anything else.
2022-03-15 14:37:28 +00:00
Richard Hughes
92515d193a Add coSWID and uSWID parsers to libfwupdplugin
These parse the structures as defined in:

 * https://datatracker.ietf.org/doc/draft-ietf-sacm-coswid/
 * https://github.com/hughsie/python-uswid
2022-03-15 14:37:02 +00:00
Mario Limonciello
d04f2468c0 trivial: switch from path to full_path for meson 0.56+ 2022-02-28 08:34:48 -06:00
Mario Limonciello
6896e0ab52 trivial: switch from meson.source_root to meson.project_source_root
The former is deprecated in meson 0.56 or later.
2022-02-28 08:34:48 -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
7143e04852 Add FuArchiveFirmware
Add a FuFirmware superclass that allows us to parse an new archive in the archive. We already do this for fastboot and we're about to add another.
2021-11-26 13:47:04 +00: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
6235a8222a Share the Common Flash Memory Interface quirks between plugins
Now two plugins are using hardcoded SPI constants for various CFI chips,
and it makes sense to have some common quirk data that can be used by
both.

Add a FuSpiChip helper object that can be used by FuDevice subclasses
to get the specific SPI commands to use for each flash ID.
2021-10-20 12:19:39 +01:00
Richard Hughes
35fff9684e trivial: Export the CFU enum conversion functions
We need these in the CFU plugin too.
2021-09-25 21:16:18 +01:00
Richard Hughes
450e8e1c17 Add FuCfuPayload and FuCfuOffer
We can use these in the future elantp plugin, and I'm sure we'll need
them again in the future for an *actual* CFU plugin.
2021-09-20 14:43:34 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Mario Limonciello
65a7f87358 trivial: libfwupdplugin: remove unused PLUGINBUILDDIR 2021-09-03 15:10:38 -05:00
Mario Limonciello
d3983674f4 trivial: don't use same variable definition as config.h in code
If config.h is included by a file then which one is used may end up
be confusing.  Be explicit to use the values that are declared by
libraries.
2021-08-24 11:18:40 -05:00
Richard Hughes
488f2e1f37 Export the EFI and IFD parsers
We'll need to use this from another plugin soon.
2021-07-12 10:33:38 +01:00
Mario Limonciello
a8cfa9ee86 trivial: fix gir compilation when gusb is turned off 2021-06-14 09:26:22 +01:00
Mario Limonciello
172fd51e93 trivial: don't include gusb in pkg-config unless gusb enabled 2021-06-14 09:25:53 +01:00
Mario Limonciello
be5de229e0 trivial: set header for fwupdplugin documentation 2021-06-14 09:24:58 +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
Michał Kopeć
d678b755d0 libfwupdplugin: Implement fu-efivar-freebsd.c
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-06-09 15:22:58 +01:00
Sergii Dmytruk
080129fc43 Handle bsdisks' UDisks2 implementation on FreeBSD
There is no Manager object, so block devices must be discovered
manually.

Additionally, Type field contains FS name rather than its MBR ID in
hex form or a GPT GUID.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-06-07 19:54:12 +01:00
Richard Hughes
e1519f394e trivial: Do not change ABI when -Dudev=false 2021-05-26 16:00:32 +01:00
Richard Hughes
76602389ff Export FuBackend into libfwupdplugin for future use 2021-05-25 17:17:45 +01:00
Richard Hughes
79bbcd792a Store the BSD kernel cmdline string in the failure report
Also split out a kenv helper into common code.
2021-05-25 06:31:46 +01:00
Richard Hughes
d1bf0f439b trivial: Do not show a warning when building the libfwupdplugin introspection
If new enough add Xmlb into the libfwupdplugin GIR includes.
2021-05-22 14:16:42 +01:00
Richard Hughes
99f40fa7a7 Add a FuI2cDevice to abstract I²C devices 2021-05-18 14:29:28 +01:00
Richard Hughes
b94a7b507b trivial: Do not generate fwupdplugin.vapi
We don't want applications to use libfwupdplugin, and we don't want to
support plugins written in Vala either.
2021-05-17 09:27:54 +01:00
Richard Hughes
38f82b10f8 trivial: Remove warnings from the GObjectIntrospection output 2021-05-11 16:55:53 +01:00
Richard Hughes
8fe6a1dd0c trivial: Make FuSrecFirmwareRecord usable from non-C languages 2021-05-11 13:15:27 +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
b333e0045c Split out a shared system context
There is a lot of code in fwupd that just assigns a shared object type to
a FuPlugin, and then for each device on that plugin assigns that same shared
object to each FuDevice.

Rather than proxy several kinds of information stores over two different levels
of abstraction create a 'context' which contains the shared *system* state
between the daemon, the plugins and the daemon.

This will allow us to hold other per-machine state in the future, for instance
the system battery level or AC state.
2021-04-01 21:11:29 +01: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
664226a350 spi: Move all the IFD parsing to the new 'spi' plugin
We do not want to export this unfinished API, and it's probably best just to
not compile it by default until it is actually useful.
2021-03-15 09:45:17 +00:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Richard Hughes
e19ebe7177 Add an Intel Flash Descriptor parser 2021-03-05 10:51:34 +00:00
Ricardo Cañuelo
536fb85e21 Add initial support for Bluez bluetooth devices
Bare skeleton for what will be the Bluez backend and the base bluetooth
device class.
2021-02-22 16:53:41 +01:00
Richard Hughes
01a30aa6de Add support for oss-fuzz 2021-02-08 09:17:03 +00:00
Richard Hughes
98972f4a34 libfwupdplugin: Promote DfuFirmware to FuDfuseFirmware
Port the DFU plugin to use the new objects to make it act the same as all the
other plugins.
2021-02-01 19:34:28 +00:00
Richard Hughes
a3f8fc30ac Convert FuChunk from a C structure to an object 2021-01-28 17:41:46 +00:00
Mario Limonciello
e95c1b3bd5 trivial: fwupdplugin: install deprecated header as well 2021-01-22 14:01:25 -06:00