Commit Graph

3273 Commits

Author SHA1 Message Date
Richard Hughes
1c257b7779 synapticsmst: Add another name quirk for the ThinkPad USB-C Dock 2019-09-12 09:44:38 +01:00
Richard Hughes
71db86f466 Re-introduce GUID support to fwupdmgr and fwupdtool
This reverts commit dca4d6a5d6.

I've had two vendors ask me why the GUIDs have disappeared from the device.
2019-09-11 13:00:16 +01:00
Richard Hughes
04cb360847 uefi-recovery: Add a plugin to add a fake ESRT entry for device recovery
The factory-shipped MinnowBoardMAX board has firmware that does not include
the ESRT table. Create a 'fake' UEFI device with the lowest possible version
so that it can be updated to any version firmware.

All the HwId GUIDs are used for the fake UEFI device, and so should be used in
the firmware metadata for releases that should recover the system.
2019-09-11 12:47:31 +01:00
Richard Hughes
1984180592 Add a DMI quirk for the Minnowboard Turbot
The fwupd UEFI plugin refuses to start if bit 3 of the "BIOS Characteristics
Extension Byte 2" (13h) is cleared. Bit 3 is UEFI Specification is supported.

Also, double-check that /sys/firmware/efi does not exist before disabling the
plugin as other machines may be affected too. The quirk then acts to supress
the console warning about the broken SMBIOS value.

Fixes https://github.com/fwupd/fwupd/issues/1342
2019-09-10 20:39:45 +01:00
Richard Hughes
83e2ca2129 trivial: Make it easy to disable or enable libflashrom for distros 2019-09-10 14:17:34 +01:00
Richard Hughes
f5e68d4e89 trivial: Don't use Recommends for RHEL 7 2019-09-10 14:17:34 +01:00
Filipe Laíns
718905f7f0 unifying: fix timeout metadata
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-07 15:25:29 -05:00
Filipe Laíns
ccda6790f5 ci: arch: minor improvements
- Moved version discovery routine to PKGBUILD
- Set PKGEXT to .pkg.tar to avoid the package being compressed
- Added --needed to pacman arguments when installing the dependencies to
avoid reinstalling packages

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-06 16:37:38 +02:00
Filipe Laíns
a39951b289 unifying: fix timeout
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-06 13:44:10 +01:00
Richard Hughes
0e46b22728 Allow disabling SSL strict mode for broken corporate proxies 2019-09-05 19:14:38 +01:00
Richard Hughes
c4ee883ea4 trivial: Allow ignoring the daemon version check by using --force 2019-09-05 18:13:05 +01:00
Mario Limonciello
20cc9eebc5 Try to only show DMI product name once
* libfwupd: export new property HostProduct
* clients: Use this property for setting the title of trees

Before:
```
○
├─XPS 13 7390 TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─XPS 13 7390 System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot

```

After:
```
XPS 13 7390
│
├─TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot
```
2019-09-05 11:22:39 -05:00
Mario Limonciello
3996af38c8 trivial: fu-util-common: Show unknown devices as interesting devices
This restore `fwupdmgr get-details` working with nothing plugged in.
2019-09-05 11:22:39 -05:00
Mario Limonciello
2275379196 dell: Use TSS to query and build TPM vendor strings for GUIDs
These are a more scalable way to apply firmware across a variety of
platforms.

An example:
```
XPS 13 7390 TPM 2.0
  DeviceId:             c56e9f77cfee65151bdef90310776f9d62827f5a
  Guid:                 a4352c96-f8d7-526c-8485-7f84085f348e <- 0962-2.0
  Guid:                 7d65b10b-bb24-552d-ade5-590b3b278188 <- DELL-TPM-2.0-NTC-NPCT
  Guid:                 6f5ddd3a-8339-5b2a-b9a6-cf3b92f6c86d <- DELL-TPM-2.0-NTC-NPCT75x
  Guid:                 fe462d4a-e48f-5069-9172-47330fc5e838 <- DELL-TPM-2.0-NTC-NPCT75xrls
  Summary:              Platform TPM device
  Plugin:               uefi
  Flags:                internal|require-ac|registered
  Vendor:               Dell Inc.
  Version:              7.2.1.0
  VersionFormat:        quad
  Icon:                 computer
  Created:              2019-09-04
```

When this system is queried using tpm2-tools:
```
$ sudo tpm2_getcap -c properties-fixed
TPM_PT_FAMILY_INDICATOR:
  as UINT32:                0x08322e3000
  as string:                "2.0"
TPM_PT_LEVEL:               0
TPM_PT_REVISION:            1.38
TPM_PT_DAY_OF_YEAR:         0x00000008
TPM_PT_YEAR:                0x000007e2
TPM_PT_MANUFACTURER:        0x4e544300
TPM_PT_VENDOR_STRING_1:
  as UINT32:                0x4e504354
  as string:                "NPCT"
TPM_PT_VENDOR_STRING_2:
  as UINT32:                0x37357800
  as string:                "75x"
TPM_PT_VENDOR_STRING_3:
  as UINT32:                0x02010024
  as string:                ""
TPM_PT_VENDOR_STRING_4:
  as UINT32:                0x726c7300
  as string:                "rls"
```
2019-09-05 00:23:23 -05:00
Mario Limonciello
43742bcd3b trivial: dell: show reasons for lack of updates in UpdateError
```
└─XPS 13 7390 TPM 2.0:
      Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
      Summary:             Platform TPM device
      Current version:     7.2.1.0
      Vendor:              Dell Inc.
      Update Error:        Updating disabled due to TPM owernship
      Flags:               internal|require-ac|registered
```
2019-09-05 00:23:23 -05:00
Mario Limonciello
26563d750f fu-util-common: strip all trailing whitespace in XML description
Before:
```
└─Thunderbolt controller in Dell dock:
  │   Device ID:           42b9e069d0b5515065cf4a32cec39552861439c9
  │   Description:         Updating the dock improves performance.
  │
  │   Flags:               updatable|require-ac|registered
  │
  └─Thunderbolt controller Update:
        Version:           43.00
        Summary:           Update for the Thunderbolt controller within a Dell dock
        License:           proprietary
        Size:              409.6 kB
        Vendor:            Dell Inc.
        Flags:             trusted-payload
```

After:
```
└─Thunderbolt controller in Dell dock:
  │   Device ID:           42b9e069d0b5515065cf4a32cec39552861439c9
  │   Description:         Updating the dock improves performance.
  │   Flags:               updatable|require-ac|registered
  │
  └─Thunderbolt controller Update:
        Version:           43.00
        Summary:           Update for the Thunderbolt controller within a Dell dock
        License:           proprietary
        Size:              409.6 kB
        Vendor:            Dell Inc.
        Flags:             trusted-payload

```
2019-09-05 00:09:40 -05:00
Mario Limonciello
ef3c766e1f trivial: fu-common: match all whitespace not just ' ' in fu_common_strstrip 2019-09-05 00:09:40 -05:00
Mario Limonciello
8e14544d37 fu-util: show release output in get-details again
This was lost in the move to tree output
```
$ fwupdmgr get-details tpm.cab
Decompressing…           [***************************************]
○
└─XPS 13 9380 TPM 2.0:
  │   Device ID:           1a433daa3acb71e6befadcf2b1a783c1549663b1
  │   Description:         Updating the system firmware improves performance.
  │
  │   Flags:               internal|updatable|require-ac|registered|needs-reboot
  │
  └─TPM 2.0 Update:
        Version:           7.2.0.2
        Summary:           Firmware for the Dell TPM 2.0
        License:           proprietary
        Size:              1.1 MB
        Vendor:            Dell Inc.
        Flags:             none
```
2019-09-05 00:09:40 -05:00
Filipe Laíns
21b591f996 unifying: use fu_firmware_strparse_uint16 to read be 16bit values
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-29 20:01:58 +01:00
Filipe Laíns
e3f380afda unifying: fix incomplete hex file parsing
The new firmware for receivers with the nordic chips is using the 0x04
record type. This was previously not handled when parsing the file,
causing wrong behavior when trying to update the device. This patch
tries to properly deal with the record types, being them 0x04 or other.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-29 20:01:58 +01:00
Mario Limonciello
4250d9da62 fu-util/fu-tool: Print devices, remotes, releases using a tree
This brings consistency to all fwupd output and allows stuff like
this:

```
    No upgrades for Thunderbolt controller in Dell dock, current is 43.00: 40.00=older
    No upgrades for Package level of Dell dock, current is 01.00.08.01: 01.00.04.01=older
    No upgrades for RTS5413 in Dell dock, current is 01.21: 01.21=same
    No upgrades for RTS5487 in Dell dock, current is 01.47: 01.47=same
    No upgrades for VMM5331 in Dell dock, current is 05.04.00: 05.03.10=older
    No upgrades for WD19TB, current is 01.00.00.02: 01.00.00.00=older
    ○
    └─XPS 13 9380 System Firmware:
      │   Device ID:           6c24a747f97668873b761558e322398a91dbf394
      │   Current version:     0.1.6.0
      │   Minimum Version:     0.1.6.0
      │   Vendor:              Dell Inc.
      │   Flags:               internal|updatable|require-ac|supported|registered|needs-reboot
      │
      └─XPS 13 9380 System Update:
            Version:           0.1.7.0
            Remote ID:         lvfs
            Summary:           Firmware for the Dell XPS 13 9380
            License:           proprietary
            Size:              0x1563d67
            Vendor:            Dell Inc.
            Flags:             is-upgrade
            Description:       This stable release fixes the following issues:

           Fixed the issue where the Dell Power Manager displays an error when a 130W Type-C adapter is connected to the system.

           new functionality has also been added:

           Added a new feature to automatically suspend BitLocker before upgrading the firmware. After the firmware upgrade is complete, BitLocker is automatically enabled.
```
2019-08-29 13:58:00 -05:00
Mario Limonciello
dfff18e3e8 Add aliases for get-upgrades and upgrade
Mostly for consistency purpose.  Details:
* It's confusing that internally the functions for `FwupdClient` use
`upgrade` in the name.
* The logical antonym of `downgrade` is `upgrade` not `update`
* People who don't use the tool frequently may try `get-upgrades`
2019-08-29 19:14:55 +01:00
Mario Limonciello
0f490525f0 trivial: UEFI skip self tests if library fails to initialize
This means no simulator or TPM actually available
2019-08-29 12:52:27 -05:00
Mario Limonciello
d1681e6de5 libfwupd: Add a new private function fwupd_remote_set_remotes_dir
This allows the daemon to set the base directory to store remotes.

This fixes issues with systemd where the installation prefix was set
to soemthing not writable such as `/usr/local` but systemd
`STATE_DIRECTORY` doesn't match up.

```
$ fwupdmgr refresh
Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
Downloading…             [***************************************] Less than one minute remaining…
Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc

Failed to update metadata for lvfs: Error creating directory /usr/local/var/lib/fwupd/remotes.d: Read-only file system
```

It should also hopefully help with immutable systems.
2019-08-29 11:44:32 -05:00
Mario Limonciello
37a3ecf0ef trivial: add libtss2-dev into debian/control (Closes: #1324) 2019-08-29 10:27:41 -05:00
Richard Hughes
7831c76368 trivial: Fix up the GtkDoc Since lines for API only available in 1.3.x 2019-08-28 17:08:21 +01:00
Richard Hughes
0f431da26f trivial: Post branch version bump
We've added enough new code to justify a minor bump.
2019-08-28 17:08:21 +01:00
Mario Limonciello
6865dd3bac thunderbolt: Add support for kernel safety checks (Fixes: #1312)
There are commits to the Thunderbolt kernel driver that make sure
that the upgrade process goes smoothly.  If these commits aren't
present then it will look like a fwupd problem, when it's actually
a kernel problem.

When this issue was reported it appeared that commit
e4be8c9b6a
was missing from the locally tested kernel, but it's impossible
to determine that from userspace.

Prevent running the thunderbolt plugin on older kernels than that
set in `$sysconfdir/fwupd/thunderbolt.conf`.

By default that is set to 4.13.0, but if a distribution vendor has
backported all the necessary support it can be decreased to a lower
version for distro packages.
2019-08-28 11:06:18 -05:00
Richard Hughes
f679e5efa8 Include the kernel release as a runtime version
Although not always useful (due to patches being backported) being able to
depend on a specific kernel version might save our bacon in the future.
2019-08-28 15:52:50 +01:00
Mario Limonciello
dca4d6a5d6 trivial: fu-util: Drop GUID support from get-devices
To the average user this is not a useful feature.  None of the command
line options will take a GUID as an argument.
Really it's an internal representation of device to firwmare upgrade CAB file.

This simplifies this output:
```
├─VMM3320 inside Dell WD15/TB16/TB18 wired Dock:
│     Device ID:           585c346c009da3cc19a400fb59a4ed8d0cbd0151
│     Summary:             Multi-Stream Transport Device
│     Current version:     3.12.002
│     Vendor:              Synaptics
│     Update State:        success
│     Flags:               updatable|registered
│     GUIDs:               c1e81f96-234e-597d-b9cb-6477d0652868
│                          152a9833-41e6-5c21-9dde-0ff8984f3e20
│                          c1e2bea5-4cf2-5f84-b965-533e8e5fea45
│                          0a52c8c7-26d5-59a0-ae44-6b00e276d775
│                          82460515-30d3-5cdf-be4c-571340842a10
│                          51000744-2de6-5a52-8a86-d5f69fd73d34
│                          d6072785-6fc0-5f83-9d49-11376e7f48b1
│                          6bc9fc61-618a-535f-a629-98345e11336e
│                          4e4e06b6-8217-5cf0-8eff-ce5e987d531a
```

To this:
```
├─VMM3320 inside Dell WD15/TB16/TB18 wired Dock:
│     Device ID:           585c346c009da3cc19a400fb59a4ed8d0cbd0151
│     Summary:             Multi-Stream Transport Device
│     Current version:     3.12.002
│     Vendor:              Synaptics
│     Update State:        success
│     Flags:               updatable|registered
```

Those who are developing upgrades to devices can run fwupdmgr --verbose and
will get the verbose output that includes GUIDs:

```
VMM3320 inside Dell WD15/TB16/TB18 wired Dock
  DeviceId:             585c346c009da3cc19a400fb59a4ed8d0cbd0151
  Guid:                 c1e81f96-234e-597d-b9cb-6477d0652868
  Guid:                 152a9833-41e6-5c21-9dde-0ff8984f3e20
  Guid:                 c1e2bea5-4cf2-5f84-b965-533e8e5fea45
  Guid:                 0a52c8c7-26d5-59a0-ae44-6b00e276d775
  Guid:                 82460515-30d3-5cdf-be4c-571340842a10
  Guid:                 51000744-2de6-5a52-8a86-d5f69fd73d34
  Guid:                 d6072785-6fc0-5f83-9d49-11376e7f48b1
  Guid:                 6bc9fc61-618a-535f-a629-98345e11336e
  Guid:                 4e4e06b6-8217-5cf0-8eff-ce5e987d531a
  Summary:              Multi-Stream Transport Device
  Plugin:               synapticsmst
  Flags:                updatable|registered
  Vendor:               Synaptics
  Version:              3.12.002
  VersionFormat:        triplet
  Icon:                 video-display
  Created:              2019-08-28
  Modified:             2019-08-28
  UpdateState:          success
```

If they run this as an administrator they'll also get the strings used to build the GUID:
```
VMM3320 inside Dell WD15/TB16/TB18 wired Dock
  DeviceId:             585c346c009da3cc19a400fb59a4ed8d0cbd0151
  Guid:                 c1e81f96-234e-597d-b9cb-6477d0652868 <- MST-wd15-274
  Guid:                 152a9833-41e6-5c21-9dde-0ff8984f3e20 <- MST-wd15-vmm3320-274
  Guid:                 c1e2bea5-4cf2-5f84-b965-533e8e5fea45 <- MST-tb16-274
  Guid:                 0a52c8c7-26d5-59a0-ae44-6b00e276d775 <- MST-tb16-vmm3320-274
  Guid:                 82460515-30d3-5cdf-be4c-571340842a10 <- MST-tb18-274
  Guid:                 51000744-2de6-5a52-8a86-d5f69fd73d34 <- MST-tb18-vmm3320-274
  Guid:                 d6072785-6fc0-5f83-9d49-11376e7f48b1 <- MST-leaf
  Guid:                 6bc9fc61-618a-535f-a629-98345e11336e <- MST-leaf-vmm3320-274
  Guid:                 4e4e06b6-8217-5cf0-8eff-ce5e987d531a <- MST-leaf-274
  Summary:              Multi-Stream Transport Device
  Plugin:               synapticsmst
  Flags:                updatable|registered
  Vendor:               Synaptics
  Version:              3.12.002
  VersionFormat:        triplet
  Icon:                 video-display
  Created:              2019-08-28
  Modified:             2019-08-28
  UpdateState:          success
```
2019-08-28 09:17:58 -05:00
Richard Hughes
d350b2ecd7 synapticsmst: Partially rewrite the plugin (Fixes #1105)
This removes the 'two-layer' FuDevice and FuSyanpticsmstDevice model, where
a complicated plugin cache was used to add and remove devices to the daemon.

By making FuSynapticsmstDevice derive from FuDevice rather than GObject we can
also use a lot of the helper functionality like the other plugins, for instance
->prepare_firmware().

The `drm_dp_aux_dev` devices do not emit uevents on unplug/re-plug and so all
devices of `drm` class are watched and the actual DP AUX devices rescanned after
a small delay. When the AUX devices emit changes from the kernel this workaround
can be removed.

Also drop force power support for MST controllers in the Dell plugin. Overall
this has just led to more problems than it's helped.

 * Monitor flickers when turned on
 * Crashing graphics drivers from time to time
 * Fragile logic that doesn't always represent the device state
2019-08-28 08:50:15 -05:00
Mario Limonciello
da55c48b7d Remove replug flag after the device comes back from reboot
This prevents errors like this from happening:

```
failed to get device after update: failed to wait for detach replug: device did not come back
```
2019-08-28 09:24:31 +01:00
Richard Hughes
758f3b5abd trivial: Fix running the tests on devices with the TPM in v1.2 mode 2019-08-27 20:03:53 +01:00
Mario Limonciello
0887b675c3 trivial: fu-util-common: more cleanup related to topology
* Set the log domain for verbose messages
* Don't show root node in verbose messages
2019-08-27 10:36:00 -05:00
Mario Limonciello
764fc2a676 trivial: fu-util: cleanup fwupdmgr get-details output
* Show "No Device ID" if no matching devices
* Don't show flags if no flags available

Before:
```
  Device ID:
  Description:          Updating the MST FW improves display performance.

  Flags:
  GUID:                 0a52c8c7-26d5-59a0-ae44-6b00e276d775

```

After:
```
  Device ID:            No Device ID
  Description:          Updating the MST FW improves display performance.

  GUID:                 0a52c8c7-26d5-59a0-ae44-6b00e276d775

```
2019-08-27 10:36:00 -05:00
Mario Limonciello
17e9bf5056 trivial: Don't use topology printing in --verbose mode
The strings won't be properly indented and characters will be lobbed
off.
2019-08-27 15:39:29 +01:00
Mario Limonciello
1a9127d676 Make get-devices and get-topology aliases for one another
Since get-topology can now show all the details while in a topology,
just make both commands point to the same code.
2019-08-27 15:39:29 +01:00
Mario Limonciello
6ff8a16390 trivial: Adjust daemon device sorting
This should output devices by priority followed by name instead now.
2019-08-27 15:39:29 +01:00
Richard Hughes
c67b4e726a Make get-topology more useful by showing all information 2019-08-27 15:39:29 +01:00
Richard Hughes
847cae824a trivial: Fix fu_common_string_append_kv() to align properly with idx > 0 2019-08-27 15:39:29 +01:00
Mario Limonciello
e13f7a142e trivial: dell-dock: correct an error preventing write_size from being set
This fixes 7afd7cba0d which led to write_size
being set to 0 and an endless loop.
2019-08-27 09:28:30 -05:00
Richard Hughes
2b2605fb58 trivial: Do not warn about deprecated declarations
We need to silence the warning about GTimeVal, as the type is part of the ABI
of libgcab for better or worse.
2019-08-27 15:00:36 +01:00
Richard Hughes
7fac3788bf trivial: Update BRs for the example Fedora package 2019-08-27 12:52:46 +01:00
Jonas Witschel
5a7575d947 uefi: add test for TPM 2.0 PCR read function
The test is run if a physical TPM is available or if the environment
variable "TPM_SERVER_RUNNING" is set. In the latter case, the user is
expected to start a TPM simulator on their own, like we do in the Arch
Linux CI script here.
2019-08-27 06:23:42 -05:00
Jonas Witschel
1b5f1da202 uefi: use tpm2-tss library to read PCR values
Using the library instead of the command line tools provides a more
stable interface. This implementation only fetches PCR 0 for all
available hash algorithms since this is the only PCR that is actually
used in fwupd.
2019-08-27 06:23:42 -05:00
Mario Limonciello
277c196369 fu-common: Use environment variables for systemd managed directories
The systemd unit will set these, create these directories and set all
permissions.  If that has happened, use them.
2019-08-27 06:08:06 -05:00
Mario Limonciello
921e426f5a Use more systemd directives for directories
systemd will automatically create these directories if missing
and also will set permissions accordingly on them.
2019-08-27 06:08:06 -05:00
Mario Limonciello
b76960efe0 trivial: fu-util: fix debug output for devices
I noticed this was only actually working for fwupdtool, and that's
because fwupdmgr doesn't set FWUPD_VERBOSE currently in the environment.
2019-08-27 06:08:06 -05:00
Richard Hughes
d8aaa21cde Allow turning off the timestamp prefix for debugging
This makes it easier to 'diff' the fwupd and fwupdtool output between runs.
2019-08-26 13:55:55 +01:00
Richard Hughes
5e952ce35f Add a ->udev_device_changed plugin vfunc
This allows plugins to rescan hardware based on uevents of any device class
registered with fu_plugin_add_udev_subsystem().

Additionally, the events are rate limited to avoid causing lots of extra plugin
processing when replugging hardware.
2019-08-26 13:55:55 +01:00