Commit Graph

4635 Commits

Author SHA1 Message Date
Benson Leung
23ca19acf8 fmap-firmware: Parse flashmap format into images
Implements a search for the fmap, and follow the map to break the firmware
into the constituent images.

Tested using a servo_micro firmware:
$ fwupdtool firmware-parse servo_micro_v2.4.17-df61092c3.bin
<select fmap option>
FuFmapFirmware:
  FuFirmwareImage:
  ID:                    EC_RO
  Index:                 0x1
  Data:                  0xf000
  FuFirmwareImage:
  ID:                    FR_MAIN
  Index:                 0x2
  Data:                  0xf000
  FuFirmwareImage:
  ID:                    RO_FRID
  Index:                 0x3
  Address:               0xc4
  Data:                  0x20
  FuFirmwareImage:
  ID:                    FMAP
  Index:                 0x4
  Address:               0x9a40
  Version:               1.0
  Data:                  0x15e
  FuFirmwareImage:
  ID:                    WP_RO
  Index:                 0x5
  Data:                  0x10000
  FuFirmwareImage:
  ID:                    EC_RW
  Index:                 0x6
  Address:               0x10000
  Data:                  0x10000
  FuFirmwareImage:
  ID:                    RW_FWID
  Index:                 0x7
  Address:               0x100c4
  Data:                  0x20
2020-06-20 07:24:32 +01:00
Benson Leung
acba98bd50 fmap-firmware: Add initial skeleton for fmap
fmap is a Google flash layout format that is used in several of Google's
firmware projects, including Chrome OS Embedded Controller and the Chrome OS
coreboot firmwares. Introduce it as a firmware format in libfwupdplugin.
2020-06-20 07:24:32 +01:00
Richard Hughes
0164141f9b trivial: Fix incorrect comment text 2020-06-19 10:59:16 +01:00
Richard Hughes
e5a4d52ea1 trivial: Spelling fixes from codespell 2020-06-18 20:49:12 +01:00
Mario Limonciello
5164e713f6 trivial: fix issue with agent on but man off
Fixes: #2192
2020-06-18 13:37:12 -05:00
Mario Limonciello
7d5f6b0232 dell-dock: Add more module types to the enum
Unfortunately module type has more than I previously realized.
The meanings that previously were applied fortunately worked for
the most important case (130-180W TBT) but didn't for single C, dual
C or small power (45W) cases.

Since composite_prepare was trying to read and interpret these, it
causes failures when these other ones are encountered.

I reproduced this on a 130W adapter plugged into a single C (type 0x4).
This meant the update wouldn't install since NULL was returned for the
type.

In case a new module ID is added later, also return an "unknown" for
the metadata.
2020-06-17 17:10:05 -05:00
Mario Limonciello
1b8047be1d trivial: fu-util: correct an assertion when no remotes configured
```
(fwupdmgr:185983): FuMain-CRITICAL **: 15:20:57.044: fu_util_time_to_str: assertion 'tmp != 0' failed
```
2020-06-17 15:49:39 -05:00
Mario Limonciello
f412227415 trivial: don't show reconstruction errors if uefi device is missing
The system must support UEFI capsule updates in order to measure
this. (Fixes: #2181)
2020-06-17 15:01:34 -05:00
Mario Limonciello
28bcecc028 trivial: fwupdtpmevlog: make clearer which algorithm is used 2020-06-17 15:01:34 -05:00
Mario Limonciello
9122999bfb tpm-eventlog: verify all algorithms, not just one of them
This will help to suss out any problems that are specific to sha1
or sha256 eventlog calculation.
2020-06-17 15:01:34 -05:00
Mario Limonciello
fe862a1d1b tpm-eventlog: Always look at all supported algorithms
This will effectively mean that both sha1 and sha256 results are
sent back to uefi plugin for analysis.
2020-06-17 15:01:34 -05:00
Richard Hughes
87143298cd pci-mei: Set the security attr result for a passed version 2020-06-17 18:37:27 +01:00
Richard Hughes
19a60e62bc trivial: Check for the _UNKNOWN enum when mashalling to GVariant 2020-06-17 18:37:27 +01:00
Mario Limonciello
8012fb3c8d trivial: dell-dock: clarify the pending update message (#2185)
To a user it's not obvious if being unplugged means host or AC adapter.
Unplugging from AC adapter will prevent the dock from completing an
update.
2020-06-17 11:49:33 -05:00
Richard Hughes
33b0f48b6f vli: Wait for the root device to be replugged when updating the MSP430
The MSP device is a virtual child of the USB hub.
2020-06-17 17:29:34 +01:00
Richard Hughes
a8610c3027 vli: Do not use GUID matching for the MSP device
Not strictly required, but it makes the FuDeviceList operation much simpler.
2020-06-17 17:29:34 +01:00
Richard Hughes
1ec96e31f5 Allow plugins to set remove delay only on the child
Force the FuDevice parent to have the largest of the child removal delays.
This avoids each plugin enumerating the children (which may not even be added
yet) to increase the length of the allowed parent delay.
2020-06-17 17:29:34 +01:00
Richard Hughes
6d9ae625ed trivial: Move the report success report to common code
This would allow us to use it from fwupdagent in the future.
2020-06-16 15:49:28 +01:00
Richard Hughes
b114661a25 Collect per-device report metadata for the history database
Add two new vfuncs that can be used to collect report metadata from devices
both before and after the update has run. This means we can remove the hacks
where we set add 'global' metadata entries and just hope that there is only one
device from the same plugin that is updated.

This also allows us to collect debugging metadata from devices after an offline
update has been run.
2020-06-16 15:49:28 +01:00
Richard Hughes
e012513bed trivial: Allow modifying the historical device metadata 2020-06-16 15:49:28 +01:00
Richard Hughes
4837ab5a22 trivial: Simplify marking devices as reported 2020-06-16 15:49:28 +01:00
Richard Hughes
589270a7c4 trivial: Simplify some reporting code
This is not a fast path, so make getting the FwupdRemote simpler.
2020-06-16 15:49:28 +01:00
Mario Limonciello
5b63015c19 tpm-eventlog: fix PCR0 calculation
One of the core problems is that systems with both sha1 and sha256
were miscalculating.

Fixes: #2181
2020-06-15 16:17:29 -05:00
Mario Limonciello
2caea54202 uefi: check for free space after cleaning up ESP
In a very small ESP situation it's possible that the amount of free
space is insufficient until it's actually been cleaned.

Fixes: #2179
2020-06-15 10:21:18 -05:00
Richard Hughes
e261bb6fa0 Record the UEFI failure in more cases
Ensure the historical error is set for failed NEEDS_REBOOT UEFI devices that do
not set LastAttemptStatus.
2020-06-15 16:16:37 +01:00
Richard Hughes
7f7f0aed1f trivial: Add more items to the kernel command line checker
This data is from Pascal Ernster, many thanks.
2020-06-15 12:11:00 +01:00
Richard Hughes
d94ce34d56 trivial: Add more items to the kernel command line checker
This data is from Pascal Ernster, many thanks.
2020-06-12 20:56:17 -05:00
Richard Hughes
4fd61e4756 vli: Use the GPIOB reset for the MiniDock VL103 2020-06-11 07:03:23 +01:00
Richard Hughes
6cd6e2adb6 vli: Set FuQuirks on the shared SPI object 2020-06-11 07:03:23 +01:00
Richard Hughes
92072b4239 vli: Add the project ID shared SPI PD controllers
The Mini-Dock and Travel-Hub accidentally share the same VID:PID and this is the
only way to tell them apart.
2020-06-11 07:03:23 +01:00
Mario Limonciello
080789916f trivial: fix news generation script 2020-06-10 13:03:14 -05:00
Richard Hughes
0143c67c76 trivial: Build a specific tag from the libjcat subproject 2020-06-10 15:21:54 +01:00
Richard Hughes
afda962cba Fix regression when checking for downgraded metadata
When verifying a signature the valid results are ordered by timestamp. The
CHECKSUM results have a zero timestamp and should have been ordered last.
The sorting callback was wrong, which explains the odd result where we could
downgrade Jcat signatures before we fixed 64ebf9, and nicely explains why we
ignored a timestamp of zero in the first place.

When getting the timestamp, ensure we actually get the newest _signature_ not
just the newest result in case checksums start having timestamps in the future
for some reason. Use new API from libjcat where available, else fall back to
sneaking it out using GObject properties and magic values.
2020-06-10 15:21:54 +01:00
Mario Limonciello
471a0e2105 fu-main: Make it clearer what lost name is and bump it to warning
This happens often enough when people switch from snap to distro
package that we should mention it in non-verbose logs.

Fixes: #2112
2020-06-09 11:05:09 -05:00
Mario Limonciello
6b9664168d trivial: checkout branch to fix changelog publishing 2020-06-09 09:42:32 -05:00
Richard Hughes
83a21cb7cd vli: Allow chained usb hub devices where the parent needs GPIOB reset
As both hub devices share a FuVliUsbhubDeviceClass instance we cannot 'hijack'
the vfuncs depending on object type. This allows the downstream hub to proxy to
the upstream hub where a GPIOB reset can be performed.
2020-06-09 11:56:30 +01:00
Richard Hughes
09950a13ce vli: Do not modify the class vfuncs depending on device type
We can have multiple FuVliPdDevice objects registered with the daemon, but they
will all share the FuVliPdDeviceClass instance. If one device requries a
silicon workaround, do not 'hijack' the vfunc for all devices of this type.

This means we do the right thing when updating both the one that requires the
workaround, and the 'normal' one.
2020-06-09 11:30:49 +01:00
Ryan Lee
59bb497a3e ccgx: modify install duration for dmc device 2020-06-09 10:37:26 +01:00
Richard Hughes
49f99d186d trivial: Fix Debian CI targets 2020-06-09 09:09:47 +01:00
Ryan Lee
0942dcc413 ccgx: Add support for HP DMC dock devices 2020-06-05 13:35:54 +01:00
Richard Hughes
2e3605ffdc trivial: Add RemoveDelay as a standard FuDevice quirk 2020-06-05 12:17:52 +01:00
Mario Limonciello
5c2c782446 trivial: add a bug report target for Dell WD19 2020-06-02 11:47:00 -05:00
Mario Limonciello
c0a2798fb5 trivial: logitech_hidpp: set the protocol properly when bootloader unknown
This appears to be a regression from c6ae0d998b
where the case of bootloader version 0 didn't get protocol set.

Fixes: #2156
2020-06-02 10:27:13 -05:00
Richard Hughes
0f6d754d5a Detect if the MEI device has known security issues
If it has, fail HSI-1.
2020-06-01 22:49:39 +01:00
Richard Hughes
bb228cbe53 pci-mei: Check the HFS register for the override strap 2020-05-29 17:34:18 +01:00
Richard Hughes
bdfccdf097 Allow multi-byte FuUdevDevice preads and writes 2020-05-29 17:34:18 +01:00
Mario Limonciello
cafea91f53 trivial: fix windows and snap CI
Introducing newer gusb caused these builds to run gusb as a subproject
and hence the introspection binaries were looked for.

Fixes: cd65ae ("Require libgusb 0.3.3")
2020-05-29 08:08:32 -05:00
Mario Limonciello
d5d496b62a trivial: uefi: fix dell TPM updates
Adding an extra header makes the firmware reject the GUID in the real
header.
2020-05-29 07:31:15 -05:00
Richard Hughes
64ebf91124 Always enforce the metadata signature has a valid timestamp
Although this is something that we have always done on the LVFS, corporate
deployments that resign the firmware or metadata might not be signing the files
in the same way.

Always require a timestamp to prevent allowing an inadvertent rollback attack.
2020-05-29 13:24:29 +01:00
Benson Leung
a22310374e cros-ec: Provide device metadata as a part of to_string
Provide the following metadata:

"Dirty firmware" bit
Protocol version
Header type
Maximum PDU Size
Flash protection status
Raw version string
Key Version
Minimum rollback
2020-05-29 06:55:40 +01:00