Commit Graph

1396 Commits

Author SHA1 Message Date
Mario Limonciello
561751faff trivial: don't try to enable LVFS from systemd 2019-10-18 09:21:19 -05:00
Mario Limonciello
fd877a02e0 fu-util: Add user friendly strings for all device flags
This also hides some flags that users don't care about unless run with
`--verbose`
2019-10-17 11:38:46 -05:00
Patrick Rudolph
a60b547edb fu-plugin: Add fu_plugin_get_hwid_replace_value
Allow a plugins to cherry-pick specific HWIDs and add them as InstanceIds.
By adding them as InstanceIds rather than adding them as GUIDs, the
original string can be found in the output generated by:
$ fupdmgr get-devices

Example output:
  Guid:                 230c8b18-8d9b-53ec-838b-6cfc0383493a <- main-system-firmware
  Guid:                 de6fd40f-4ec9-5c0b-95e1-8fb13d1b030c <- LENOVO&ThinkPad T410&2537VG5
  Guid:                 978b0d18-bfe9-5279-9a9f-68dc247a705f <- LENOVO&ThinkPad T410&LENOVO&2537VG5

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2019-10-17 18:31:01 +02:00
Richard Hughes
791c91be1e trivial: Increase verbosity when actually updating devices
As the plugin is allowed to change print out the entire FuDevice before
performing each step when in verbose mode.

Note, these are only show during update if run with --verbose, not at startup.
2019-10-17 14:06:27 +01:00
Richard Hughes
802bb313c6 trivial: Allow plugins to use WAIT_FOR_REPLUG in prepare and cleanup 2019-10-17 14:06:27 +01:00
Richard Hughes
b05d39adff Add FuDevice->prepare() and FuDevice->cleanup() vfuncs for future use 2019-10-17 14:06:27 +01:00
Mario Limonciello
326950cd68 trivial: fu-util: break out of automatic reports if one is not automatic
Currently this is controlled by the order of remotes enumerated and might
return the wrong result with too many remotes.
2019-10-16 10:13:10 -05:00
Richard Hughes
1db25c9f2c Allow a custom FuFirmwareImage->write() in superclassed objects 2019-10-15 08:10:11 -05:00
Mario Limonciello
1d01d3bb38 Fix device flag filtering
When multiple flags were passed, they made combinations that would never
exist in the daemon causing advanced filtering to not work.
2019-10-14 12:41:09 -05:00
Mario Limonciello
2a0e20bfaa trivial: fu-engine: Don't compare device and content checksums
Use `FWUPD_DEVICE_FLAG_CAN_VERIFY_IMAGE` to register that a content
checksum should be used.
2019-10-14 12:41:09 -05:00
Mario Limonciello
91d36095e1 fu-engine: Read all releases and convert versions when comparing
Fixes matching ESRT version to metadata version for UEFI
2019-10-14 12:41:09 -05:00
Mario Limonciello
8fa0b382fa Add new flags can-verify and can-verify-image
These are used to indicate that the device can verify checksums or
can dump an image for checksumming.
2019-10-14 12:41:09 -05:00
Mario Limonciello
49556a3948 trivial: make verify and verify-update safer
Don't show output for all devices - it doesn't work for most of them.

I also found that running verify on my Synaptics touchpad device puts it
into a pretty bad state until reboot.  That's of course a problem on
it's own, but at least prompting for it will prevent it from easily
happening.
2019-10-14 12:41:09 -05:00
Mario Limonciello
248e3f8d6e trivial: fu-udev-device: use parent udev device to indicate internal
If the parent device is hooked up via I2C that's a pretty good
indication that the touchpad is internal to the device.
2019-10-14 11:36:42 -05:00
Richard Hughes
cbf53fe52d trivial: Fix a recent regression causing a double-free
This was introduced accidentally in a9be536ef0.

Fixes https://github.com/fwupd/fwupd/issues/1461
2019-10-14 12:31:03 +01:00
Mario Limonciello
e202a39851 trivial: fu-util: add some extra checks around automatic reports
Avoid some extra roundtrips to the daemon if user has poked at some
files.
2019-10-13 07:34:09 +01:00
Mario Limonciello
8692d01cf9 trivial: fu-tool: typo 2019-10-13 07:30:43 +01:00
Mario Limonciello
3a10c3cf3d fu-systemd: Use correct method for stopping units.
Fixes a regression in 3d00522dd3 that caused systemd stopping to
not work.

Previously the flow was to use `GetUnit` and `StopUnit` on the manager
interface.  In that code this was switched over it should have been
using the unit interface + `Stop` or manager interface + `StopUnit`
not try to use the manager interface on the unit proxy with `StopUnit`.
2019-10-13 07:30:43 +01:00
Mario Limonciello
fece7553af trivial: fu-udev-device: Use ID_PCI_CLASS_FROM_DATABASE if name not set
This helps at least with display controllers
2019-10-12 14:29:21 -05:00
Mario Limonciello
a9be536ef0 trivial: fu-plugin: quiet down debug output for optionrom plugin
All of these messages continually output are just noise for unsupported
devices:

```
18:11:52:0851 FuPlugin             using generic udev_device_added() on optionrom
18:11:52:0851 FuEngine             optionrom ignoring: no FWUPD_GUID property
```
2019-10-12 14:29:21 -05:00
Mario Limonciello
e1b4d8ebcd Add a new device flag for indicating device won't come back
Devices like this can't be verified that the version was updated
until they're manually put into the correct mode by the user.
2019-10-12 14:07:34 -05:00
Richard Hughes
c0695320c8 Add a generic DFU firmware object for plugins to use 2019-10-11 13:19:46 +01:00
Richard Hughes
f591a3594b trivial: Add fu_firmware_parse_file() helper for future use 2019-10-10 16:18:58 +01:00
Richard Hughes
224e991ab8 trivial: Add klass->to_string for superclassed FuFirmwareImage objects
This matches the behaviour of FuFirmware.
2019-10-10 16:16:42 +01:00
Richard Hughes
f0eb091173 Read firmware back from the device as a FuFirmware
Returning a GBytes is not good enough when the device may be returning multiple
partitions which have to be stored as FuFirmwareImage objects.
2019-10-10 11:57:48 +01:00
Richard Hughes
8653e70480 trivial: Remove G_BEGIN_DECLS from all private headers 2019-10-09 20:02:16 +01:00
Richard Hughes
731875af86 Remove FU_PLUGIN_RULE_REQUIRES_QUIRK as all the plugins now use it 2019-10-09 20:02:16 +01:00
Richard Hughes
d8a8d5e776 Set all FuUdevDevice plugins to use FU_QUIRKS_PLUGIN
This speeds up startup as we're only calling fu_plugin_udev_device_added() on
plugins that can actually handle the device.
2019-10-09 20:02:16 +01:00
Richard Hughes
42f33df3dc trivial: Remove some now-unused vfuncs 2019-10-07 12:37:21 +01:00
Richard Hughes
989acf12e7 Create the custom plugin GType in common code
This reduces the amount of boilerplate in plugins.
2019-10-07 12:37:21 +01:00
Richard Hughes
7f67721432 Reduce more boilerplate in plugins 2019-10-07 12:37:21 +01:00
Mario Limonciello
d70260692f trivial: fu-engine: fix never reporting remotes
```
Uploading firmware reports helps hardware vendors to quickly identify failing and successful updates on real devices.
Upload report now? (Requires internet connection):
0.	Do not upload reports at this time, but prompt again for future updates
1.	Do not upload reports, and never ask to upload reports for future updates
2.	Upload reports just this one time, but prompt again for future updates
3.	Upload reports this time and automatically upload reports after completing future updates
1
key ReportUri not supported
```
2019-10-07 05:36:22 -05:00
Mario Limonciello
9213c5c7bf trivial: fu-util: don't show warnings for no reports to upload
```
(fwupdmgr:5605): FuMain-WARNING **: 22:16:06.048: No reports require uploading
```
2019-10-07 05:36:22 -05:00
Richard Hughes
e4ad9d27fd trivial: Fix a tiny memory leak when starting the daemon 2019-10-05 13:03:19 +01:00
Richard Hughes
4b30380e78 Provide a default implementation of common FuDevice actions
This reduces the amount of boilerplate in each plugin.

    32 files changed, 156 insertions(+), 584 deletions(-)
2019-10-04 14:57:32 +01:00
Mario Limonciello
d837ca8c28 fu-util: add support for a reinstall command 2019-10-03 08:16:41 -05:00
Mario Limonciello
350fc4c787 trivial: fu-util/fu-tool: update re-install help text to reinstall 2019-10-03 08:16:41 -05:00
Mario Limonciello
f59cc375ae trivial: fu-util: remove double printed message about succesful firmware update 2019-10-03 08:16:41 -05:00
Mario Limonciello
d122facc09 trivial: fu-util: show no updatable devices error for update command
This makes it mirror the behavior of `get-updates` command.
2019-10-03 08:16:41 -05:00
Richard Hughes
47ae4f89d7 Fuzz the SREC and IHEX file parsers once more 2019-10-02 16:28:28 +01:00
Richard Hughes
e9232c4fc0 Use parallel fuzzing for the SMBIOS checks too 2019-10-02 16:28:28 +01:00
Mario Limonciello
2b69098d89 trivial: fu-util: output newline after prompt.
Before:
```
Uploading firmware reports helps hardware vendors to quickly identify failing and successful updates on real devices.
Upload report now? (Requires internet connection):0.	Do not upload reports at this time, but prompt again for future updates
1.	Do not upload reports, and never ask to upload reports for future updates
2.	Upload reports just this one time, but prompt again for future updates
3.	Upload reports this time and automatically upload reports after completing future updates
```

After:
```
Uploading firmware reports helps hardware vendors to quickly identify failing and successful updates on real devices.
Upload report now? (Requires internet connection):
0.	Do not upload reports at this time, but prompt again for future updates
1.	Do not upload reports, and never ask to upload reports for future updates
2.	Upload reports just this one time, but prompt again for future updates
3.	Upload reports this time and automatically upload reports after completing future updates
```
2019-10-01 16:07:48 -05:00
Mario Limonciello
fac50a8eef trivial: fix %u output in report upload
Don't bother showing the numbers, they were listed right above.
2019-10-01 16:07:48 -05:00
Richard Hughes
0b1c65ede8 Add a --no-domain logging option
This allows us to match the debug output of other legacy tools easier, which
allows us to compare output dumps for differences.
2019-10-01 10:46:09 -05:00
Richard Hughes
1002b92fb2 trivial: Fix compiler warning for impossible-to-hit condition 2019-10-01 15:34:48 +01:00
Mario Limonciello
34c366aab2 Add support for automatically uploading reports 2019-09-30 16:21:23 -05:00
Mario Limonciello
dc6d0af352 trivial: fu-udev-device: fix some assertions
These seem to be caused by udev_parent being `NULL`.

```
19:26:06:0220 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0220 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0220 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0221 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0221 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0221 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0221 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0221 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0221 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0222 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0222 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0222 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0222 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0223 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0223 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0223 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0223 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0223 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0223 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0224 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0224 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0224 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0224 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0224 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0224 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0225 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0225 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0225 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0225 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0225 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0225 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0225 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0225 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0226 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0226 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0226 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0226 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0226 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0226 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0226 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0227 GLib-GObject         g_object_ref: assertion 'G_IS_OBJECT (object)' failed
19:26:06:0227 GUdev                g_udev_device_get_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
19:26:06:0227 GUdev                g_udev_device_get_parent: assertion 'G_UDEV_IS_DEVICE (device)' failed
```
2019-09-30 09:49:30 +01:00
Richard Hughes
a86790ac11 Search up the tree for a vendor name rather than (ab)using the HID_NAME 2019-09-28 21:58:04 +01:00
Richard Hughes
c56d2bd046 Add some success messages when CLI tasks have completed
Updating firware is sometimes scary, and for user-facing CLI tools we ought to
show some kind of reassurance than it went well.

Fixes some of https://github.com/fwupd/fwupd/issues/1409
2019-09-27 12:20:00 -05:00
Richard Hughes
bcee63a52d trivial: Put the boolean prompt on the same line as the text 2019-09-27 12:20:00 -05:00