Commit Graph

610 Commits

Author SHA1 Message Date
Richard Hughes
c1eda7d516 Add many new plugins to support for the Host Security ID
The HSI specification is currently incomplete and in active development.

Sample output for my Lenovo P50 Laptop:

    Host Security ID: HSI:2+UA!

    HSI-1
    ✔  UEFI dbx: OK
    ✔  TPM: v2.0
    ✔  SPI: Write disabled
    ✔  SPI: Lock enabled
    ✔  SPI: SMM required
    ✔  UEFI Secure Boot: Enabled

    HSI-2
    ✔  TPM Reconstruction: Matched PCR0 reading

    HSI-3
    ✘  Linux Kernel S3 Sleep: Deep sleep available

    HSI-4
    ✘  Intel CET: Unavailable

    Runtime Suffix -U
    ✔  Firmware Updates: Newest release is 8 months old

    Runtime Suffix -A
    ✔  Firmware Attestation: OK

    Runtime Suffix -!
    ✔  fwupd plugins: OK
    ✔  Linux Kernel: OK
    ✔  Linux Kernel: Locked down
    ✘  Linux Swap: Not encrypted
2020-05-12 21:20:18 +01:00
Richard Hughes
b9640a28ec uefi-dbx: Add a plugin that analyses the UEFI dbx variable
This will be used for future functionality.
2020-05-07 16:59:36 +01:00
Richard Hughes
d744fe8b67 linux-swap: Rename the plugin as it is Linux specific
We'll be adding other linux-foo plugins in the future, so it makes sense to get
the namespace correct now.
2020-05-07 12:42:34 +01:00
Richard Hughes
c368958518 swap: Add a plugin that parses /proc/swaps
This will be used for future functionality.
2020-05-06 15:09:59 +01:00
Mario Limonciello
6358e23490 thunderbolt: drop support for force power
The kernel interface for force power doesn't support tracking the state
of the device, and so this had to be tracked by fwupd.

Unfortunately due to system and thunderbolt controller firmware behavior
on some systems the thunderbolt controller /still/ didn't return even
when force power state was accurately tracked.

The device model for the uevent related to the device removal being ignored
doesn't really fit into the current fwupd architecture anymore either.

Lastly this is a very legacy feature at this point.  Thunderbolt3 controllers
distributed in the last 3 years all operate in 'native' mode meaning that
they will always be powered and use runtime power management.

USB4 controllers won't have a concept of being force powered.
USB4 reimers will have this concept, but the state will be tracked by the
kernel and obfuscated from userspace.

So with all that said, tear out all of the force power related code.
2020-04-29 13:15:45 -05:00
Mario Limonciello
89130342bc Generate a body for github releases (Fixes: #2034) 2020-04-28 09:56:02 -05:00
Richard Hughes
daf5ebb294 trivial: Do not build flashrom on all architectures 2020-04-27 11:58:30 +01:00
Richard Hughes
fe11927eef Use black to format python source in a consistent manner
No code changes.
2020-04-13 23:06:30 +01:00
Richard Hughes
d5e9f59804 trivial: Use the official libjcat packages in the Fedora CI 2020-04-09 09:40:38 +01:00
Mario Limonciello
22306055e3 trivial: enable libjcat from Debian & Ubuntu distro builds 2020-04-08 10:32:34 -05:00
Richard Hughes
f3966c784d Modularize the hardware tests 2020-04-07 16:09:47 +01:00
Mario Limonciello
0c9d083d53 trivial: ci: drop unsupported lintian strings
'binary-is-wrong-architecture' was dropped from lintian 2.62.0
2020-04-06 09:24:11 -05:00
Mario Limonciello
e4fa62b1d1 trivial: contrib: drop Jared from uploaders 2020-04-01 16:51:42 -05:00
Richard Hughes
cf8095d5af Use a static version number
Getting the version string from git means the commit version changes each time
we commit any patch, which means we need to use --force to install firmware
when building fwupd against a version that should be compatible.

It is also very inconvenient not bumping the release version for git snapshots
as firmware can no longer depend on the "planned" release triplet.

tl;dr: A good idea for Flashrom, not so awesome for me.
2020-03-29 12:17:52 +01:00
Mario Limonciello
f35be1c393 trivial: ci: exclude ia64 for flashrom 2020-03-25 09:51:12 -05:00
Mario Limonciello
36ffd92695 trivial: fix ubuntu CI 2020-03-24 10:02:28 -05:00
Mario Limonciello
b963cb3678 Add a new ChromeOS CI target to build without GPG and PKCS7
This is actually built on Debian, but it's intended purpose is to
be able to check whether the package made bad assumptions for ChromeOS
2020-03-23 19:55:12 +00:00
Richard Hughes
d5aab65f30 Use Jcat files in firmware archives and for metadata
A Jcat file can be used to store GPG, PKCS-7 and SHA-256 checksums for multiple
files. This allows us to sign a firmware or metadata multiple times (perhaps
by the OEM and also then the LVFS) which further decentralizes the trust model
of the LVFS.

The Jcat format was chosen as the Microsoft catalog format is nonfree and not
documented. We also don't want to modify an existing .cat file created from WU
as this may make it unsuitable to use on Windows.

More information can be found here: https://github.com/hughsie/libjcat
2020-03-23 19:55:12 +00:00
Richard Hughes
86b0bae0c4 trivial: Do not use -Db_sanitize=address as it breaks g-ir-scanner
And nobody can figure out why!
2020-03-23 19:55:12 +00:00
Richard Hughes
811e75db4b Add support for EP963x hardware 2020-03-22 15:48:04 +00:00
Mario Limonciello
60f15fe426 trivial: ci: suppress binary-is-wrong-architecture as well 2020-03-20 16:10:28 -05:00
Mario Limonciello
75a3b17972 trivial: ci: suppress lintian error that is a lintian bug
This will be fixed in an updated lintian and is not a problem
for the fwupd packaging.
2020-03-20 16:10:28 -05:00
Mario Limonciello
0b2c717e97 trivial: snap: fix bash completion
fwupdmgr is now using fwupdagent, and so we need to reference properly.
2020-03-20 11:18:00 -05:00
Mario Limonciello
14001f7523 trivial: snap: remove master snap
We're realistically never going to build something with this.
2020-03-20 11:18:00 -05:00
Mario Limonciello
c4bc1ad881 trivial: snap: add fwupdagent command 2020-03-20 11:18:00 -05:00
Mario Limonciello
d6baddc772 trivial: snap: include fwupdtpmevlog command (fixes: #1885) 2020-03-20 11:18:00 -05:00
Richard Hughes
b258e514c5 ccgx: Add a firmare parser for cyacd files
These are visually similar to Intel hex files, but different enough to demand
their own parser. Multiple images can be stored in one firmware file, with the
`addr` set to the SiliconID and the `idx` set to the position in the file.
2020-03-18 18:57:06 +00:00
Elvis Stansvik
efc2e47e48 Start fwupd-activate.service after snapd.service
Instead of using RequiresMountsFor=/snap/fwupd/current, which will not
work since /snap/fwupd/current is a symlink [1].

This will work since the mount units generated by snapd all have
Before=snapd.service, so will be stopped after snapd.service during
shutdown.

With After=snapd.service, fwupd-activate.service will then stop before
snapd.service, at a point when all snap mount units are still running.

Fixes the issue where fwupd-activate.service hangs when stopped, causing
a stop job timeout during shutdown.

[1] See https://github.com/systemd/systemd/issues/8907

Closes #1654
2020-03-15 09:06:21 -05:00
Richard Hughes
b992a2a8f9 Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility.
2020-03-09 21:12:01 +00:00
Mario Limonciello
5972a49495 Add a new plugin for CPU microcode 2020-03-09 09:04:38 +00:00
Mario Limonciello
16eea10554 ci: build Debian using libflashrom
The package is now in unstable in the 1.2-4 package.
2020-03-05 17:07:28 -06:00
Richard Hughes
e675a33f93 trivial: A new enough flashrom is available for Fedora now 2020-03-04 08:50:24 +00:00
exploide
c33fbb5002 added completion script for fish shell 2020-02-29 16:31:50 +00:00
Richard Hughes
cfde249435 Inihbit all power management actions using logind when updating
Fixes https://github.com/fwupd/fwupd/issues/1814
2020-02-25 14:31:46 +00:00
Richard Hughes
4a32296f6a trivial: Fix the version generator to correctly compare versions 2020-02-24 18:49:22 +00:00
Mario Limonciello
93d6131d0e trivial: debian: fix build for systems without UEFI
Just dynamically find the binaries in usr/bin rather than hardcoding
2020-02-21 10:39:55 -06:00
Richard Hughes
dbdafa303e trivial: Fix Fedora non-x86_64 build 2020-02-21 10:14:15 +00:00
Richard Hughes
dbcc8e1137 ata: Include a vendor ID for ATA hardware
Some vendors want to ship updates for ATA hardware, but there are currently no
lock-down restrictions in place for these kind of devices.

There is the OUI from the WWN block which is supposed to identify the vendor,
but this is not always set and so we have to be a little creative. We can match
90% of hardware using the vendor name prefix, and the last 10% can be detected
with a heuristic that was the result of comparing over 900 drive models.

I'm not including very old drive models, media converters, raid controllers,
or external 'portable' drives as I don't think it is useful. Also, if the drive
contains a Dell vendor block just hardcode this as Dell rather than trying to
be clever.

Also ask the user to contribute OUI values if this data is found with no quirk
data as this is the only real sane way to manage this data long term.
The list of OUIs can be found here: http://standards-oui.ieee.org/oui.txt
2020-02-20 16:02:44 +00:00
Mario Limonciello
9fa7b38ac1 Move fwupdtpmevlog into bindir 2020-02-20 09:02:11 -06:00
Mario Limonciello
21e7faa78b uefi: Move fwupdate into bindir
Intended to be executed by users for debugging purposes, create a man
page as well.
2020-02-20 09:02:11 -06:00
Mario Limonciello
bf6d455687 Move fwupdtool and fwupdagent into bindir
These are intended to be executed by users (albeit for debugging and
advanced users) and shouldn't be left as an internal implementation
per FHS 3.0.
2020-02-20 09:02:11 -06:00
Richard Hughes
aac406270c Use the system provided flashrom on Fedora 2020-02-20 12:57:21 +00:00
Tomas Winkler
457a7c37ec ci: use standalone script to generate build dependencies
Sometimes it is desirable to create a build environment
outside of docker.
Move dependencies parser to a standalone python script
and call it from generate_docker.py

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
2020-02-18 17:40:39 -06:00
Mario Limonciello
af774426c7 trivial: add libglib2.0-doc to debian/ubuntu build dependencies 2020-02-18 11:22:58 -06:00
Laurent Bigonville
81e359199b Move the daemons from /usr/lib/fwupd to /usr/libexec/fwupd
This is supported since debian policy version 4.1.5 (FHS 3.0)
2020-02-18 11:22:58 -06:00
Laurent Bigonville
022d4fa708 debian/control.in: Add libglib2.0-doc to Build-Depends-Indep
This allows the links between the documentations files to be properly
generated
2020-02-18 11:22:58 -06:00
Mario Limonciello
026f0e0d28 trivial: contrib/debian: Add a diff ignore for vscode in debian packages 2020-02-14 10:31:47 -06:00
Mario Limonciello
df6a9464d5 trivial: contrib/debian: refresh standards version 2020-02-14 10:31:45 -06:00
Mario Limonciello
7a3985f2de upower: Move battery threshold declaration into a configuration file 2020-02-13 09:52:20 -08:00
Richard Hughes
1910e84c72 Add a plugin to update PD controllers by Fresco Logic 2020-02-07 11:46:25 +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
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
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
83425f99af Generate a win32 setup binary
Fixes https://github.com/fwupd/fwupd/issues/1704
2020-01-16 12:23:08 -06:00
Mario Limonciello
31c08120b9 trivial: debian: Add explicit cleanup for fwupdate->fwupd transition
It's possible that someone has removed fwupdate package prior to the
fwupd transition meaning that they might have some artifacts left
behind from fwupdate packaging.  Clean up these artifacts.

This commit can be reverted after both Debian bullseye and Ubuntu
focal have been released.
2020-01-09 09:01:15 -06:00
Mario Limonciello
b78b4fb1bf Revert "trivial: Attempt to fix Debian CI"
This reverts commit 9e8037483a.
2020-01-08 21:08:59 +00:00
Richard Hughes
603e4f6956 Shut down automatically when there is system memory pressure
We can just rescan hardware if required; near OOM it's just more important to
free what we can and get out of the way.
2020-01-07 12:29:07 +00:00
Richard Hughes
d7197d5319 trivial: Move the Fedora CI image to F31 2020-01-07 12:29:07 +00:00
Richard Hughes
a432bdabe3 trivial: Sync the example spec file with downstream 2020-01-06 15:16:48 +00:00
Richard Hughes
f169186700 vli: Rename the vli_usbhub plugin to vli
In the future we'll be doing PD updates without any USB hub at all.
2020-01-02 13:24:13 +00:00
Richard Hughes
eb9522f4d6 trivial: Don't build the Ubuntu CI with Werror 2020-01-02 12:52:51 +00:00
Richard Hughes
9e8037483a trivial: Attempt to fix Debian CI 2020-01-02 12:52:51 +00:00
Mario Limonciello
fd6ffd6dac trivial: rename synapticsmst to synaptics-mst
This brings the naming nomenclature inline with the other plugins
2019-12-12 13:59:41 -06:00
Richard Hughes
f5c6e1d276 Add a new plugin that can parse the TPM event log
Some devices do not have a stable PCR0 for the same firmware version, and I'd
like to collect the TPM event log for affected machines to debug why.
2019-12-06 15:05:16 +00:00
Richard Hughes
fbb677bee2 Add a new plugin that exposes the system TPM device firmware version
This plugin does not yet allow the device to be upgraded, and is provided for
information only.
2019-12-05 21:05:17 +00:00
Richard Hughes
45a00738d8 Allow building on Windows with MinGW
Add various fixes to enable us to build a selection of useful USB plugins.
Also, skip tests that don't make sense on WIN32 or that will not work.

With much help from Mario Limonciello <mario.limonciello@dell.com> -- Thanks!
2019-12-03 16:33:43 +00:00
Richard Hughes
297d1598ef trivial: Only dlopen the test plugin once
This causes problems in the self tests when not lazy-loading symbols.

Also use g_build_filename() for the paths to be more portable and readable.
2019-12-01 20:59:19 +00:00
Mario Limonciello
f12e471414 trivial: ci: debian: enable verbose daemon logging for failure analysis 2019-12-01 06:23:27 -06:00
Mario Limonciello
f35a3dec93 trivial: debian: remove obj-* built files to fix back to back builds 2019-11-30 18:56:09 -06:00
Mario Limonciello
728f0f06c6 trivial: ci: don't let bad symlinks cause debian build failures 2019-11-30 18:43:24 -06:00
Mario Limonciello
0f67b79cc5 trivial: debian: correct a dependency for libfwupdplugin-dev 2019-11-30 18:34:56 -06:00
Richard Hughes
83613aa932 trivial: Add a BR for Fedora 2019-11-27 16:10:17 +00:00
Richard Hughes
6a710c3c23 trivial: Never add duplicate symbols to the map file 2019-11-27 12:45:35 +00:00
Mario Limonciello
11503c23ee Install development files for libfwupdplugin
This splits out all development files, including headers into their
own packages where relevant.

Notably absent is `fu-hash.h` which is used for determining taint.
Out of tree developed plugins should still taint the daemon.
2019-11-27 11:32:43 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Mario Limonciello
f1a4d87063 Add missing documentation from the plugin interface
Also update the structure as the documentation doesn't only describe
libfwupd.
2019-11-26 06:31:57 +00:00
Mario Limonciello
9b36a370ae trivial: ci: pull lintian from unstable for now.
Fixes E: fwupd: library-not-linked-against-libc usr/lib/x86_64-linux-gnu/fwupd-plugins-3/libfu_plugin_upower.so

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=945276
2019-11-25 09:29:46 +00:00
Mario Limonciello
4fcf48606f trivial: debian: ci: ignore library-not-linked-against-libc for more 2019-11-23 20:18:36 +00:00
Mario Limonciello
4c39d7f35f trivial: contrib/get-version.py: require git less hard 2019-11-11 11:05:54 -06:00
Richard Hughes
ab902c0dd9 trivial: Fix Fedora CI build 2019-11-08 17:51:18 +00:00
Richard Hughes
56510ad0c6 trivial: Fix the autobuilt spec file with the new tarball version 2019-11-08 16:36:07 +00:00
Mario Limonciello
429a5128d3 Dynamically determine release version
This is inspired by a change in flashrom to read the version string for meson
dynamically.

No need for "post release version bump", this happens automatically from git
now by there being a dirty commit.
2019-11-08 09:52:02 -06:00
Mario Limonciello
d044dd3d71 trivial: contrib: don't require TSS for debian archs without EFI 2019-11-06 11:14:34 -06:00
Mario Limonciello
85fb312563 flashrom: switch to upstream source
Once upstream flashrom tags a release (>1.1) this should be updated
and as it starts to flow into distros turned on by default.
2019-11-06 08:06:52 -06:00
Mario Limonciello
e6170ca6dd trivial: debian: only use mingw-w64-tools in archs with UEFI plugin 2019-11-05 11:46:15 -06:00
Mario Limonciello
5123d4333e Rename unifying plugin to logitech-hidpp (Fixes: #1329) 2019-11-04 13:35:36 -06:00
Mario Limonciello
6b0e4ba021 Add a new contrib script for installing a Dell BIOS from an EXE file
This script re-uses code from existing firmware-packager related items
to:
* Find the matching device on the system
* Append an ESRT header
* Build a CAB file
* Pass the CAB file into fwupd daemon
2019-11-04 10:30:38 -06:00
Mario Limonciello
d8da3cc504 trivial: add-capsule-header: rename to make it easier to import 2019-11-04 10:30:38 -06:00
Mario Limonciello
69559f0619 trivial: simple_client: make it easier to reuse code 2019-11-04 10:30:38 -06:00
Mario Limonciello
22379ab16c trivial: firmware-packager: make it easier to reuse code 2019-11-04 10:30:38 -06:00
Mario Limonciello
f603e2df88 trivial: add-capsule-header: make it actually work
The result that was being spit out didn't actually work on any of
my test systems.
2019-11-04 10:30:38 -06:00
Richard Hughes
894ebf6ac7 trivial: Add all the _LAST enums that shouldn't be checked for ABI 2019-11-01 08:16:18 -05:00
Richard Hughes
6bbc4c787b jabra: Move the Jabra-specific detach out into its own plugin
This also lets us remove the call to dfu_device_wait_for_replug() which was
causing a deadlock due to unsafe main context usage. Splitting the code allows
us to use the device list to watch for replug, without adding even more Jabra-
specific plugin code to the DFU plugin.

Looking at this with a 40,000ft view, the Jabra runtime really doesn't have
much in common with DFU and the reason it was originally all lumped together
was that the daemon couldn't "change" plugins between detach and update.

It's unfortunate that we have to include a sleep() in the DFU code after the
DFU probe, but this is specified by Jabra themselves. Attempting to open the
device without waiting reboots the hub back into runtime firmware mode, so we
can't even retry the failing setup action.
2019-10-30 15:09:49 +00:00
Richard Hughes
51a869a01d Use XMLb to query quirks
During startup we do 1898 persistent allocations to load the quirk files, which
equates to ~90kb of RSS. Use libxmlb to create a mmap'able store we can query
with XPath queries at runtime.
2019-10-30 08:29:58 -05:00
Mario Limonciello
fe8888cc6f trivial: ci: disable pulling libxmlb from unstable 2019-10-30 08:29:58 -05:00
Mario Limonciello
e62db1bc57 trivial: debian: remove some unneeded lintian 2019-10-28 10:43:43 -05:00
Mario Limonciello
ea10d7b14e trivial: debian: bump compat version 2019-10-28 10:43:43 -05:00
Mario Limonciello
e7b2ea02b9 uefi: use genpeimg to mark ASLR and DP/NX on EFI binary
If the tool is available at build time use it to this.
2019-10-26 12:59:11 -05:00
Richard Hughes
679d1c0f9a Add a plugin to update VIA USB hub hardware
Only protocol V1 hardware (VL810~VL813) is currently supported.
2019-10-24 12:52:18 +01:00