Commit Graph

4304 Commits

Author SHA1 Message Date
Mario Limonciello
88f8b7f8e1 fu-util: Check that daemon is started by expected unit
Unexpected behaviors can happen if:
* a snapped daemon is running with a packaged frontend
* a packaged daemon is running with a snapped frontend

This should make sure that if the snap is installed on top of a
packaged frontend that people don't try to mix and match as much.
2019-05-08 10:05:31 -05:00
Mario Limonciello
ea527ca2e7 fu-util-common: when stopping a daemon, check for snap too 2019-05-08 10:05:31 -05:00
Richard Hughes
5cbb5cf908 Allow using --force to trigger a duplicate offline update 2019-05-07 14:30:07 +01:00
Richard Hughes
c3bbfe70a8 trivial: Allow using FuUsbDevice without a GUsbDevice
This allows us to use it more easily in the self tests.
2019-05-07 14:30:07 +01:00
Richard Hughes
069433e97d trivial: Copy the icons if unset for the device child 2019-05-07 14:30:07 +01:00
Richard Hughes
08ba5be69b trivial: Copy the physical ID if unset for the device child 2019-05-07 14:30:07 +01:00
Richard Hughes
59c4d02698 trivial: Ensure the parent ID is up to date if the device ID changes
This includes the case where the device ID is unset, the child gets added and
the parent device ID then gets set. This makes the ordering for adding children
much less fragile.
2019-05-07 14:30:07 +01:00
Richard Hughes
f5d799df19 trivial: Fix typo when setting the parent ID 2019-05-07 14:30:07 +01:00
Richard Hughes
8238de9995 trivial: Disable the flatpak CI build
It's failing for no good reason, and travis is spamming me with emails.
2019-05-07 10:34:55 +01:00
Richard Hughes
dfa9e11bb2 Allow handling FORCE for devices that subclass FuDevice
Pass FwupdInstallFlags down to the vfunc to allow us to check the flags when
parsing the firmware and updating the device.
2019-05-05 15:29:00 -05:00
Richard Hughes
26d3da4074 uefi: Fix a libasan failure when reading a UEFI variable
It seems some older versions of libefi var incorrectly build the 'length' value
in the DP returned from efi_generate_file_device_path(). This means we copy past
the end of the allocated buffer when parsing the efi_update_info_t structure.

This bug seems fixed in efivar git master, and this fix is only going to help
people with older efivar versions. It's probably a good thing to be a bit more
paranoid about EFI variable data anyway.

    DEBUG: UpdateInfo:
           ? 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    ????????????????????????????????????????????????????????????????????????????????????????????????????????
    0x0000 ? 07 00 00 00 20 d9 7b 69 cf 12 a9 4d 83 85 99 69 09 bc 65 59 00 00 05 00 00 00 00 00 00 00 00 00
    0x0020 ? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 01 2a 00 01 00 00 00 00 08 00 00
    0x0040 ? 00 00 00 00 00 40 06 00 00 00 00 00 5a aa 97 5a 10 d5 7e 49 99 0b ca 8d 35 4d c8 6d 02 02 04 04
    0x0060 ? 86 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 66 00 77 00 5c 00
    0x0080 ? 66 00 77 00 75 00 70 00 64 00 2d 00 36 00 39 00 37 00 62 00 64 00 39 00 32 00 30 00 2d 00 31 00
    0x00a0 ? 32 00 63 00 66 00 2d 00 34 00 64 00 61 00 39 00 2d 00 38 00 33 00 38 00 35 00 2d 00 39 00 39 00
    0x00c0 ? 36 00 39 00 30 00 39 00 62 00 63 00 36 00 35 00 35 00 39 00 2e 00 63 00 61 00 70 00 00 00 7f ff
    0x00e0 ? 04 00
    DEBUG: DP type:0x04 subtype:0x01 size:0x002a
    DEBUG: DP type:0x04 subtype:0x04 size:0x0086
    DEBUG: found END_ENTIRE at 0x00aa
    DEBUG: DP length invalid! Truncating from 0x0086 to 0x0080
    DEBUG: DP type:0x7f subtype:0xff size:0x0004
2019-05-02 17:25:34 +01:00
Richard Hughes
8499930a45 trivial: Fix a memory leak found using libasan 2019-05-02 10:46:12 +01:00
Richard Hughes
bb5199b428 trivial: Fix an libasan failure in the dell plugin
Use a buffer of an explicit size to avoid reading junk off the stack.
2019-05-02 10:46:06 +01:00
Richard Hughes
1b83960d88 trivial: Fix some dead code spotted by coverity 2019-05-02 09:59:47 +01:00
Richard Hughes
41c35d084c trivial: Fix a typo spotted by coverity 2019-05-02 09:59:47 +01:00
Richard Hughes
f5a0d24a95 trivial: Fix a missing config.h include in a new source file 2019-05-02 09:59:47 +01:00
Mario Limonciello
e1b4b20978 Dynamically read path to use for /system-update
This allows `fwupdoffline` to work in installations that don't use
`/var/lib/fwupd`.
2019-05-01 09:24:55 -05:00
Richard Hughes
acfa4ef012 Display the remote warning on the console in an easy-to-read way
The lines are almost impossible to read as they are not wrapped and not
delimited from the normal script output. Add a box around to make them stand out:

    ╔══════════════════════════════════════════════════════════════════════════════╗
    ║ The LVFS is a free service that operates as an independent legal entity and  ║
    ║ has no connection with Fedora. Your distributor may not have verified any    ║
    ║ of the firmware updates for compatibility with your system or connected      ║
    ║ devices. All firmware is provided only by the original equipment             ║
    ║ manufacturer.                                                                ║
    ║                                                                              ║
    ║ Enabling this functionality is done at your own risk, which means you have   ║
    ║ to contact your original equipment manufacturer regarding any problems       ║
    ║ caused by these updates. Only problems with the update process itself        ║
    ║ should be filed at https://bugzilla.redhat.com/.                             ║
    ║                                                                              ║
    ╚══════════════════════════════════════════════════════════════════════════════╝

    Agree and enable the remote? [Y|n]:
2019-05-01 14:03:11 +01:00
Mario Limonciello
8be5756edd ata: Set version format to plain for devices obtained from udev
This matches behavior of those obtained by ID command.
2019-04-30 09:31:55 +01:00
Mario Limonciello
12a016b939 trivial: Only apply SmbiosManufacturer to release version for internal
External devices may not use the same VersionFormat.
2019-04-30 09:27:08 +01:00
Richard Hughes
b6f4a1697e trivial: Fix two bugs in the hardware self tests script 2019-04-30 09:26:48 +01:00
Richard Hughes
5079f26f0e Never guess the version format from the version string
This leads to madness, as some formats are supersets of the detected types,
e.g. 'intel-me' is detected as 'quad' and 'bcd' is detected as 'pair'.

Where the version format is defined in a specification or hardcoded in the
source use a hardcoded enum value, otherwise use a quirk override.

Additionally, warn if the version does not match the defined version format
2019-04-30 09:25:41 +01:00
Richard Hughes
94422f651e Only force a semver when the device opts-in
This is only used by one, so-far out-of-tree plugin. Reduce complexity by not
using the version format to decide if we're forcing a semver.
2019-04-30 09:25:41 +01:00
Richard Hughes
c84b36c541 Export the version-format to clients
This allows a vendor to verify the VersionFormat of a device without running
the daemon in verbose mode.
2019-04-30 09:25:41 +01:00
Mario Limonciello
396026582d Add missing gtk-doc documentation 2019-04-30 07:05:26 +01:00
Richard Hughes
5d7f5a2a87 dfu: Add some trivial, but useful, debugging for AVR DFU devices 2019-04-29 08:27:51 -05:00
Richard Hughes
3c7f58170d dfu: Correctly identify DFU firmware that starts at offset zero
Use 0xffffffff as the 'never set' base address.
2019-04-29 08:27:51 -05:00
Richard Hughes
2cebf6c555 dfu: Don't keep showing trivial debug output 2019-04-29 08:27:51 -05:00
Richard Hughes
e4e96742e7 dfu: Reset the forced version during attach and detach
If the runtime DFU version is a vanilla DFU runtime rather than the AVR32 DFU
variant then we no longer need to use the override.
2019-04-29 08:27:51 -05:00
Mario Limonciello
8b222bd557 ata/nvme: For devices running Dell firmware, set VersionFormat (Fixes: #1169)
Dell firmware is known to use `VersionFormat` `plain`.
2019-04-25 10:26:02 -05:00
Mario Limonciello
253b825e6b fu-engine: Check if VersionFormat is ambiguous when adding devices
Set `UpdateError` in this case, and prevent updates.

If the `VersionFormat` is not known, then the device will later have
problems installing firmware with errors like:
```
failed to get release version: version format unset and version 13000001 ambiguous
```

or

```
Firmware version formats were different, device was '(null)' and release is 'plain'

```

This generally should be corrected by quirking the device.
2019-04-25 10:26:02 -05:00
Richard Hughes
cdd390a785 trivial: Fix fwupdate --apply 2019-04-25 12:52:59 +01:00
Richard Hughes
8ef139faba Only use class-based instance IDs for quirk matching
These are dangerous GUIDs that shouldn't generally be used by any device
for distribution of firmware updates. They'll potentially apply to
devices outside of the vendor they were created for.

Additionally if two USB devices with common interface classes are
on the system, they may lead to one device not being populated by
fwupd.

Fixes https://github.com/hughsie/fwupd/issues/1162
2019-04-23 15:23:31 -04:00
Mario Limonciello
398afe545f trivial: dell-dock: set minimum board to 6
Drop all TODO and quirks for older pre-production boards.
2019-04-23 13:36:30 -05:00
Richard Hughes
59ea33de80 trivial: post release version bump 2019-04-23 10:31:07 +01:00
Richard Hughes
828c913e37 Release fwupd 1.2.8 2019-04-23 10:25:55 +01:00
Richard Hughes
7886c086a1 Don't upload reports when the user has configured their system in a broken way
I'm getting a bit fed up with failed reports from arch users where they just
have a broken system. I don't think it's useful to upload to the LVFS or notify
the vendor about failures like this.
2019-04-18 22:06:01 +08:00
Mario Limonciello
38027e696b Allow setting the daemon verbose domains at runtime 2019-04-17 12:12:13 -04:00
Mario Limonciello
bfcf75b7a6 Allow fwupdmgr to modify the daemon config
This allows several things, for instance:

 * Adding or removing blacklisted plugins or devices
 * Changing the idle timeout where allowed

...without a user needing to manually modify a configuration file.
2019-04-17 12:12:13 -04:00
Richard Hughes
fb9cfffe7d trivial: Share some systemd code for future usage 2019-04-17 12:12:13 -04:00
Richard Hughes
982e23c438 Do not compare version formats when the release format is unknown 2019-04-17 12:11:45 -04:00
Richard Hughes
3c8777f0f6 Do not fall back integers to a plain version format
We can't possibly know what version format to use.
2019-04-17 12:11:45 -04:00
Richard Hughes
2c40b3734f Use the device version format when converting the release version
This is arguably the more correct fix, regardless of the UEFI quirk use as each
release was reading and converting the exact same property from the component.

Fixes https://github.com/hughsie/fwupd/issues/1156
2019-04-17 12:11:45 -04:00
Richard Hughes
21ab7f588c Set the VersionFormat using the metadata or the UEFI quirk
This allows existing Dell firmware to not ship a LVFS::VersionFormat key and
instead use the existing SmbiosManufacturer quirk.
2019-04-17 12:11:45 -04:00
Richard Hughes
75449d9db1 trivial: Return the superclassed FuDevice from fu_engine_get_details()
This allows us to print the daemon-specific properties like VersionFormat when
debugging. The caller can continue to operate on the subclassed FwupdDevice
without changes.
2019-04-17 12:11:45 -04:00
Richard Hughes
099f0f1123 trivial: Fix some spaces-for-tabs failure 2019-04-17 12:11:45 -04:00
Richard Hughes
1fb8202b06 nvme: Fix the correct handling of a plain version number 2019-04-17 15:46:58 +01:00
Mario Limonciello
c73c02fa70 trivial: uefi: clarify errors related to secure boot 2019-04-17 16:39:29 +08:00
Mario Limonciello
a50b02faf2 uefi: Don't leak the application build path into the binary
This can be set at runtime if needed using environment variables.
2019-04-17 16:39:29 +08:00
Richard Hughes
8fada51919 Correctly parse DFU interfaces with extra vendor-specific data
Fixes: https://github.com/hughsie/fwupd/issues/1152
2019-04-17 15:12:43 +08:00