Commit Graph

30 Commits

Author SHA1 Message Date
Richard Hughes
bc3a4e1f57 Store firmware update success and failure to a local database
Rename FuPending to FuHistory to better represent what the object is now doing.
Also, while we're here, switch to using SQLite prepared statements to avoid a
possible invalid read on i386 hardware.
2018-01-11 09:59:34 +00:00
Richard Hughes
ae252cd83c trivial: Add some common functionality from reading and writing to a buffer 2017-12-08 20:07:09 +00:00
Philip Withnall
8e2ca90509 udev: Fix a double-free bug
That GUdev function returns a const gchar*, not an allocated pointer, so
don’t try to autofree it. This would have caused a crash (I only
observed it as a compiler warning with
-Wincompatible-pointer-types-discards-qualifiers).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-30 13:44:41 +00:00
Richard Hughes
d0cff7caec Remove autoconf-isms from the meson configure options
See https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
2017-11-27 18:07:53 +00:00
Richard Hughes
ca0bc0adf7 udev: Don't delimit the platform ID now it is hashed anyway 2017-11-27 18:07:53 +00:00
Richard Hughes
82c63d3d65 udev: Don't register for USB events to later ignore them 2017-11-27 18:07:53 +00:00
Richard Hughes
9d30c5a4ee trivial: Fix a Werror=sign-compare on Fedora 28 2017-10-07 11:11:25 +01:00
Richard Hughes
9e79223ecf trivial: C99ify more for-loops 2017-09-28 09:23:52 +01:00
Richard Hughes
0de86eca3d udev: Do not match USB devices, even with a GUID set
Prevents a warning about PRODUCT not existing when the usb plugin is disabled.
2017-09-13 14:05:46 +01:00
Richard Hughes
c1c2fec6f5 Add optional icons to each device
This allows us to show the devices in a GUI with a nice icon. Some of the icon
mappings are not perfect and I'll be asking the GNOME designers for some
additions to the icon specification.

Custom vendor icons can also be specified, and /usr/share/fwupd/icons would be
a good place to put them. If vendor icons are used they should show a physical
device with the branding, rather than just the vendor logo.
2017-09-11 17:27:35 +01:00
Yehezkel Bernat
e43f7fb655 trivial: cleanup for many compilation warnings from clang
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 10:43:15 +01:00
Richard Hughes
e7472a22cc Use a static library to avoid symlinking files for the tests 2017-08-09 10:19:13 +01:00
Richard Hughes
ed34991bd8 Do not unlock devices when doing VerifyUpdate
We used to do this dance to avoid reading the Option ROM on hardware by default
(some faulty hardware would crash...) but now we're doing the verify update in
the daemon there's no need to split this into two steps.

Fixes: https://github.com/hughsie/fwupd/issues/149
2017-06-22 10:37:10 +01:00
Richard Hughes
fd381cc96e Add the ability to restrict the firmware installation to specific vendor IDs
This allows us to fix https://github.com/hughsie/lvfs-website/issues/4
2017-06-12 20:22:25 +01:00
Richard Hughes
e76ed8eb0d trivial: Generate more than just SHA1 OptionROM checksums 2017-06-07 08:02:41 +01:00
Richard Hughes
68cc00c7e9 Allow multiple checksums on devices and releases
Although we supported other hashes than SHA1 (which is now moderately unsafe)
we had to switch the metadata provider and daemon on some kind of flag day to
using SHA256. Since that's somewhat impractical, just allow multiple checksums
to be set on objects and just try to match whatever is given in preference
order.

This also means we can easily transition to other hash types in the future.

The removed API was never present in a tarball release, so not an API break.
2017-06-06 20:06:53 +01:00
Richard Hughes
1fdb335025 Remove the automake build system 2017-04-13 18:42:08 +01:00
Richard Hughes
9f0c47b36a Fix the raspberrypi self test code under meson
Also, refactor the common test code to a new source file.
2017-04-13 10:09:33 +01:00
Richard Hughes
67b8cb62bc trivial: Fix the last -Wpointer-sign warning 2017-04-12 17:56:54 +01:00
Richard Hughes
57746cb839 Add the Meson build system as an alternate to autotools
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.

See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
2613dcc3b8 trivial: Fix another -Wpointer-sign compile warning 2017-02-13 10:50:07 +00:00
Kai Krakow
1c7ea9ee2d Fix compiler warnings
My compiler doesn't understand -Wno-discard-qualifiers so drop it and
fix the warnings instead. I think it is better to explicitly fix them
anyways instead of just to ignore the discarded const qualifier in
general.

I think the option should be avoided in hand-written code. The warning
is there for a reason: To protect you from possibly overwriting data you
expect to not be modified when passing pointers around.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41215
2017-02-13 10:02:25 +00:00
Richard Hughes
48d23f7bb0 Fix a refcounting issue in the udev plugin
Objects are returned from the cache with transfer:none.

Hopefully fixes https://github.com/hughsie/fwupd/issues/86
2017-02-03 14:17:07 +00:00
Richard Hughes
04042a10e8 trivial: Fix a tiny memory leak in the Udev plugin
Also, fix some method prefixes to match the plugin name.
2016-12-16 14:03:08 +00:00
Richard Hughes
598a40d746 trivial: Use a delay when adding Udev devices
There might be a better plugin to claim these than the generic fallback.
2016-12-16 12:41:57 +00:00
Richard Hughes
74702297b2 Move the Option ROM parsing to the Udev plugin 2016-12-15 17:09:38 +00:00
Richard Hughes
561c457149 trivial: Use unique profiling IDs in plugins 2016-12-15 12:55:21 +00:00
Mario Limonciello
f074b0d367 Fix udev plugin loading
failed to open plugin /usr/lib/x86_64-linux-gnu/fwupd-plugins-2/libfu_plugin_udev.so:
failed to open plugin: /usr/lib/x86_64-linux-gnu/fwupd-plugins-2/libfu_plugin_udev.so:
undefined symbol: g_udev_device_get_property
2016-12-13 13:19:51 -06:00
Richard Hughes
4232185bec trivial: Remove some false-positive messages when using clang 2016-12-13 16:01:52 +00:00
Richard Hughes
cff38bcb3a Convert the providers to plugins to simplify code and for future features
This is a large commit that removes all the providers and turns them into
plugins. I think having both providers _and_ plugins was super confusing.

Plugins are loaded at runtime so you could in theory develop a new plugin
without putting it in the fwupd source tree, although there are no installed
headers or PC files as I'm not sure it's a good idea at this stage.

This commit moves all the per-provider docs, tests, notes, debug dumps and test
data to plugin-specific directories -- these also allows the plugin author to
"own" more of the source tree so we don't enforce fu- prefixes and the style
guide everywhere.

This allows us to run the same action on all the plugins in the future, so we
could have a prepare(FuPlugin, FuDevice) and cleanup(FuPlugin, FuDevice) run
on *all* plugins, so doing an update using one plugin would allow us to work
around hardware quirks in other plugins.

If I've broken your out-of-tree provider it's trivial to port to the new API
with sed and a fixed up build file. If you need help please let me know.
2016-12-12 12:31:23 +00:00