Commit Graph

4304 Commits

Author SHA1 Message Date
Mario Limonciello
bcd14de89f uefi: make debugging output more readable 2020-02-10 12:39:26 -06:00
Richard Hughes
e076d48afb trivial: Fix some invalid error handling in fwupdmgr
If somehow we forget to add a case section, return with an error as the code
suggests, rather than always returning TRUE. Found with Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
ef168b289e vli: Fix a potential buffer-overflow when parsing firmware
Spotted by Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
b27f0d42f9 tpm: Optimize the string parsing and fix the boolean logic
The g_ascii_isgraph() correctly handles NUL so just remove the check rather
than adding brackets around the logic.
2020-02-07 15:16:39 +00:00
Richard Hughes
04fde48e9a synaptics-rmi: Add a missing error enum value
This was spotted whilst fixing the last bug...
2020-02-07 15:16:39 +00:00
Richard Hughes
9baaacc099 synaptics-rmi: Correctly identify a checksum failure
The typo was spotted by Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
2f85c24363 synaptics-rmi: Fix Coverity issue that is impossible to hit in reality
The guint16 was promoted to (signed) int for the multiplication, which meant
that the highest address possible was 0x7FFFFFFF not 0xFFFFFFFF. Which doesn't
really matter in reality, as all addresses are much smaller than that now.
2020-02-07 15:16:39 +00:00
Richard Hughes
072efbde88 trivial: Fix broken commit
I didn't actually mean to push this, but as I did, lets make it at least compile...
2020-02-07 12:04:03 +00:00
Mario Limonciello
d89bf61c0e trivial: fu-engine-helper: Add whitespace to motd
This matches the optional other lines that show updates.

Current experience:

```
Welcome to Ubuntu Focal Fossa (development branch) (GNU/Linux 5.4.0-12-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Multipass 1.0 is out! Get Ubuntu VMs on demand on your Linux, Windows or
   Mac. Supports cloud-init for fast, local, cloud devops simulation.

     https://multipass.run/
1 device has a firmware upgrade available.
Run `fwupdmgr get-upgrades` for more information.

10 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Last login: Thu Jan 16 21:00:01 2020 from 127.0.0.1
```

Updated experience:

```
Welcome to Ubuntu Focal Fossa (development branch) (GNU/Linux 5.4.0-12-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Multipass 1.0 is out! Get Ubuntu VMs on demand on your Linux, Windows or
   Mac. Supports cloud-init for fast, local, cloud devops simulation.

     https://multipass.run/

1 device has a firmware upgrade available.
Run `fwupdmgr get-upgrades` for more information.

10 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Last login: Thu Feb  6 16:29:12 2020 from 127.0.0.1
```
2020-02-07 11:52:50 +00:00
Richard Hughes
af7c098df2 solokeys: Parse old versions of the bootloader string 2020-02-07 11:49:01 +00:00
Richard Hughes
1910e84c72 Add a plugin to update PD controllers by Fresco Logic 2020-02-07 11:46:25 +00:00
Mario Limonciello
df27f720e7 trivial: Fix lgtm build
bsdtar has migrated to libarchive-tools in eoan
2020-02-06 17:12:48 -06:00
Richard Hughes
e4661788ec vli: Set the device progress correctly when erasing a PD device 2020-02-06 20:38:19 +00:00
Richard Hughes
e17dd6f0cd vli: Use the correct command to get the device firmware version
Mea culpa; I misread the example code. It's a different command entirely.
2020-02-06 20:38:19 +00:00
Richard Hughes
6afe612c2f vli: Correctly reset all VL100 devices
The reset happens before the USB transfer completes.
2020-02-06 20:38:19 +00:00
Richard Hughes
4359ea9017 vli: Set all standalone PD devices to not do SPI auto-detection 2020-02-06 20:38:19 +00:00
Richard Hughes
9d22db26f9 vli: Mark standalone PD devices as updatable 2020-02-06 20:38:19 +00:00
Mario Limonciello
4adec1b752 trivial: circleci: explicitly add new doc files on deployment
When a new section is introduced (or renamed) it's not getting added
currently.
2020-02-05 12:44:45 -06:00
Mario Limonciello
6c8beb6b3c trivial: Re-order circleci commands
This should allow using a git client provided by the OS, not CircleCI.

Hopefully it helps the deployment job for the next release.
2020-02-05 12:02:26 -06:00
Richard Hughes
003c150cc2 vli: Set the protocol for FuVliUsbhubPdDevice types 2020-02-05 17:23:51 +00:00
Richard Hughes
7d11d44242 Support the new gnuefi file locations
gnu-efi 3.0.11 moves a few files around, e.g.

    /usr/lib64/gnuefi/elf_x64_efi.lds -> /usr/lib64/gnuefi/x64/efi.lds

...and this causes the UEFI EFI helper to fail to link.

Add support for the 'new' paths and fall back to the old ones.

Fixes https://github.com/fwupd/fwupd/issues/1736
2020-02-05 07:41:35 -06:00
Richard Hughes
4f28afb6e7 trivial: Only install the udev rules file if GUdev is enabled 2020-02-05 09:54:12 +00:00
Mario Limonciello
8527405c8d Cleanup ancient fwupdate-* EFI variables too (Fixes: #1739)
It seems that fwupd.efi is picking up both fwupdate-* and fwupd-*
entries that are sitting around in efivarfs.
2020-02-04 11:36:58 -06:00
Mario Limonciello
9dce1f7011 Detect kernel lockdown status
Disable superio when kernel lockdown in effect.
2020-02-04 10:08:25 -06:00
Richard Hughes
e01c4cc8cb vli: Add the DEV instance ID to all devices
In some composite dock hardware there are two USB devices exported to the host,
both with the same VID:PID values. We need to use the device type (e.g. VL812B3)
to differenciate the devices and install the correct fw on the correct device.
2020-02-04 15:52:07 +00:00
Richard Hughes
59d947ac24 tpm-eventlog: Replay the TPM event log to get the PCRx values
In theory, these should always match the reported PCRx values from the TPM.

If the reconstructed event log checksum does not match the TPM value then
something is either implemented wrongly, or something bad has happened.
2020-02-04 11:54:27 +00:00
Richard Hughes
ca3e785c40 tpm-eventlog: Store the eventlog hashes in binary form
This means we use half the amount of memory to store the event hashes, and also
means we can process the raw data in future patches without parsing back out
of ASCII format.
2020-02-04 11:54:27 +00:00
Richard Hughes
7513750f65 trivial: Remove the s390 debian build as it's currently broken 2020-02-04 10:25:34 +00:00
Javier Martinez Canillas
2f636bf53d trivial: provide a fwupdate transition for RHEL 8
This is similar to commit 1ff1164630 ("trivial: debian/control*: Update
for fwupdate transition") but to provide a fwupdate transition in RHEL 8
where the fwupdate{,efi} packages are still present.

There is no need to do this for Fedora, since the fwupdate packages have
already been retired.
2020-02-04 10:22:56 +00:00
Mario Limonciello
5d8c244b2e trivial: correct a fwupd-refresh.service filling error 2020-02-02 11:27:20 +00:00
Mario Limonciello
6f6f50c24a trivial: fix plural translation (Fixes: #1732) 2020-01-31 14:35:43 -06:00
Richard Hughes
ca3cdaef43 Release fwupd 1.3.7 2020-01-31 13:13:57 +00:00
Ivan Hu
44f55e2ee6 Correctly delete UEFI variables
UEFI runtime service GetVariable with DataSize NULL, will fail and get
EFI_INVALID_PARAMETER returned. Set DataSize 0 and allocate the buffer for
getting attributes for the deleted variable.

Also, fix the real reason Boot#### was never found.
2020-01-30 16:52:41 +00:00
Tomas Winkler
2a026147ce ci: allow working with podman w/o aliases
Fedora doesn't distribute docker anymore, instead
it uses podman for the containers.
It is possible to alias podman to docker, but
it's less hassle if it will work just out of the box.

The fix here is simple the podman is a fallback if
docker is not found.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
2020-01-29 08:43:31 +00:00
Tomas Winkler
8a00dc898f ci: fedora: force correct rpm package version
RPM doesn't allow '-' in the version number,
so this must be fixed if also when building from
an untagged git tree.

sanitize_for_ci() from get-version.py
fixes it only when build is CI environment.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
2020-01-29 08:22:41 +00:00
Mario Limonciello
793099201b src: fu-engine: check version was updated by checking version
In case a plugin decides to make a version 5.3.10 instead of 5.3.010
these should match.
2020-01-22 16:23:18 -06:00
Mario Limonciello
da2adf0e6f trivial: synaptics-mst: adjust last part of triplet to be 2 digits not 3
Synaptics versions are encoded as BCD, the largest version that will
ever be represented in this field is '99'.

Using 3 digits in this field has caused multiple problems in upgrades from
LVFS.

1. Devices are being upgraded when not necessary.
IE `5.3.10 > 5.3.010`

2. Device upgrades are deemed failures as follows:

```
BootTime=1571436076,
CompileVersion(com.redhat.efivar)=37,
CompileVersion(com.redhat.fwupdate)=12,
CompileVersion(org.freedesktop.fwupd)=1.3.2,
CompileVersion(org.freedesktop.gusb)=0.3.0,
CpuArchitecture=x86_64,
DistroId=fedora,
DistroVariant=workstation,
DistroVersion=32,
FirmwareId=1915,
Flags=4194346,
Guid=f15aa55c-9cd5-5942-85ae-a6bf8740b96c,
MachineId=97aa89528b88d9631867a4e20c68a5208124ef592e19d05f0c5e7d22bd4d7afb,
Plugin=synapticsmst,
RuntimeVersion(com.dell.libsmbios)=2.4,
RuntimeVersion(com.redhat.fwupdate)=12,
RuntimeVersion(org.freedesktop.appstream-glib)=0.7.14,
RuntimeVersion(org.freedesktop.fwupd)=1.3.2,
RuntimeVersion(org.kernel)=5.4.0-0.rc2.git2.1.fc32.x86_64,
UpdateError=device version not updated on success, 05.03.10 != 5.03.010,
UpdateState=failed,
VersionNew=05.03.10,
VersionOld=5.03.010

```
2020-01-22 15:22:11 -06:00
dann frazier
b25be977a9 trivial: debian: Don't use --parents when rmdir'ing /var/*/fwupdate
Calling 'rmdir --parents /var/cache/fwupdate' will cause it to attempt
to rmdir /var/cache and /var. Those directories are very unlikely to be
empty, so it should always quietly fail. However, there's not benefit
in attempting those removals, so let's quit doing it.
2020-01-21 17:52:28 -06:00
Richard Hughes
64d868a77b Correctly import PKCS-7 remote metadata
The PEM data is larger than 2kB, which was a crazy-small max size for a
signature. Make this a more respectable 1Mb so that we can load PKCS-7
signatures with full certificate info included.

This wasn't being tested in the self tests as it only affects data read from
the remote file descriptor.
2020-01-17 17:45:46 +00:00
Richard Hughes
4959baa65b Add 'refresh' to fwupdtool
This actually makes 'get-updates' do something useful when using the flatpak.
2020-01-17 16:33:07 +00:00
Richard Hughes
be5b019ae5 trivial: Split up fu_engine_update_metadata() for future use 2020-01-17 16:33:07 +00:00
Richard Hughes
fd7e994971 Add 'get-remotes' to fwupdtool 2020-01-17 16:33:07 +00:00
Mario Limonciello
315fd4dee9 trivial: motd: correct the systemd path to include package name 2020-01-16 21:00:47 -06:00
Mario Limonciello
4fdbb118a4 trivial: correct systemd motd directory variable
fixes the blank variable in systemd unit
2020-01-16 20:50:13 -06:00
Richard Hughes
83425f99af Generate a win32 setup binary
Fixes https://github.com/fwupd/fwupd/issues/1704
2020-01-16 12:23:08 -06:00
Richard Hughes
429f72b214 Fix display of UTF-8 characters on Windows 2020-01-16 12:23:08 -06:00
Richard Hughes
56d0d51e00 trivial: Actually install daemon.conf for the standalone build too
The name is a bit of a misnomer, it really affects anything that loads FuEngine.
2020-01-16 12:23:08 -06:00
Richard Hughes
47862828e1 trivial: Allow setting an ID of NULL for the FuFirmwareImage
There's no reason to prevent NULL, and doing so means the caller has to check
before setting the value. Only one subclassed type was actually doing this...
2020-01-16 11:24:55 -06:00
Mario Limonciello
d81ea2e3fc Move MOTD population into the daemon
This allows it to be refreshed anytime the daemon updates rather
than once a day by a systemd job.

As part of this change, remove the logging from `fwupdmgr` which
was only used for motd purposes.
2020-01-16 10:33:43 -06:00
Mario Limonciello
eb442ea9a5 fu-util: Discourage metadata refreshes more than once per day
As the motd timer may be activated to run on a system, ensure that
it hasn't actually stepped on the user running an update manually
or another client such as gnome-software refreshing metadtata.

Users can override this behavior with `--force`.
2020-01-16 10:33:43 -06:00