Commit Graph

355 Commits

Author SHA1 Message Date
Richard Hughes
a78b13fb71 Use a different Device ID for the OptionROM devices
We want to continue to dedupe the ID, and the priority should be decided on the
GUID match.

Fixes https://github.com/fwupd/fwupd/issues/2510 in a different way
2020-10-29 14:01:25 +00:00
Richard Hughes
f90cda6f0b Release fwupd 1.5.0 2020-10-26 11:50:11 +00:00
Richard Hughes
b619245897 trivial: Write up some release notes for the next release 2020-10-22 12:45:08 +01:00
Mario Limonciello
02f2cc311e Add switch-branch support to fwupdtool 2020-10-21 12:00:55 -05:00
Richard Hughes
7bcb8d4385 Export FwupdPlugin so we can convey enumerated system errors to the end user
For instance, we can tell the user that UEFI UpdateCapsule is disabled in the
system firmware, or that efivarfs is not mounted. This is much better than
creating "dummy" devices which are really just hacks around the problem because
no better API existed. THe dummy devices cause as many problems as they solve.

Plugins have to set FWUPD_PLUGIN_FLAG_USER_WARNING if a warning should be shown
to the user, and only one warning will be shown of each failure type.

It is expected that GUI clients like gnome-software and gnome-firmware would use
this API to notify the user the localized message for why firmware updates are
not being shown.

Fixes https://github.com/fwupd/fwupd/issues/2456
2020-10-13 15:56:49 +01:00
Mario Limonciello
02d9d23f13 trivial: fix shutdown error on fwupdtool activate
EXIT_NOTHING_TO_DO needs to be caught by the shutdown script too.
Fixes: #2463
2020-10-12 09:06:30 -05:00
Richard Hughes
6450d0deb4 Add FwupdInstallFlags of _IGNORE_CHECKSUM, _IGNORE_VID_PID and _IGNORE_POWER
The FWUPD_INSTALL_FLAG_FORCE flag has really unclear semantics, and ignoring a
file CRC, checksum or model ID should only be done when using fwupdtool actually
debugging a plugin or firmware parser.

Use the existing --force flag when we want a "gentle nudge" like reuploading
previously processed reports.
2020-10-07 13:15:09 +01:00
Richard Hughes
5bbf013879 Add a --allow-branch-switch to fwupdmgr
This allows us to turn off the tests like version format differences and
checking for downgrades.
2020-10-07 13:15:09 +01:00
Mario Limonciello
406025ba56 trivial: ci: fix installed-tests for test plugin
This has been broken for a while and missed various changes.
* Reading firmware version
* Passing `-y` into build
* New verify / verify-image split
2020-10-06 13:34:41 -05:00
Richard Hughes
10c3fd2ff9 Support loading DMI data from DT systems
To do this with the existing codebase just fake the required SMBIOS structures.
2020-09-30 19:22:45 -05:00
Richard Hughes
460c4b75fe Add the concept of firmware 'branches'
This allows a device to identify with different streams, for instance a Lenovo
laptop could have a coreboot firmware or a AMI firmware. The GUIDs would be the
same, but switching firmware would only be done rarely and very carefully.

Another example would be switching the Broadcom BCM57xx nework adaptors from the
vendor nonfree firmware with a signed PXE image, to the free software reverse
engineered driver with no PXE support (and thus no signed DXE) at all.

It is expected firmware would have additional metadata something like this:

    ...
    <branch>sdcc</branch>
    <description>
      <p>
        This is an alternate firmware built by the community using only free
        software tools.
      </p>
    </description>
    <requires>
      <id compare="ge" version="1.5.0">org.freedesktop.fwupd</id>
      <client>switch-branch</client>
    </requires>
    ...

Additionally, alternate branch firmware will not be returned for clients not
setting the FWUPD_FEATURE_FLAG_SWITCH_BRANCH before the GetReleases request.
2020-09-30 18:33:00 +01:00
Daniel Campello
9fbd7fe65d Allow to filter get-updates on device-id
This change allows to get available updates for a given device. This is
similar to what is done for the update and activate commands.
2020-09-28 16:43:42 -05:00
Richard Hughes
fbd8b5d325 Add fu_device_dump_firmware()
Conceptually we were trying to stuff subtly different actions into one vfunc:

 * Read firmware from the device to update the verification checksums

 * Read a firmware blob from the device for debugging

For the first action we might want to mask out the sections of the flash with
serial numbers (so the verification hashes match the ones published on the LVFS)
and for the second we want just a raw ROM file from the hardware with no
pre-processing that we can compare against an external SPI dumper.

Split out ->dump_firmware to get the raw blob, and allow plugins to also
implement ->read_firmware() if they have to mask out specific offsets or remove
specific images from the FuFirmware container.

In the common case when masking is not required, fall back to using a 'binary'
FuFirmware automatically to make most plugins simpler.
2020-09-24 10:54:27 -05:00
Richard Hughes
0924c93422 Do not use firmware-convert to build firmware
Copying the images from the src to the destination meant we could never set
properties on the new FuFirmware instance or subclass.
2020-09-23 15:22:31 +01:00
Richard Hughes
dd65344dde Add firmware-extract subcommand to fwupdtool 2020-09-22 12:11:38 +01:00
Richard Hughes
34f7d9d8fb Allow binding and unbinding kernel drivers 2020-09-21 20:07:54 +01:00
Richard Hughes
7ef2dea271 optionrom: Test if the PCI device has ROM in probe
This means we make things a simpler by not relying on udev to stat the file.
It also reduces the number of added *unused* GUIDs by one per device too.
2020-09-20 19:11:44 +01:00
Richard Hughes
b9ef4399c9 Remove unused udev rules
We used these before we had the quirk files, and now with all the VLI devices
supported in the quirk files these entries do nothing at all.
2020-09-20 19:11:44 +01:00
mendel5
75810207dc flag_require_ac: System requires external power source 2020-09-20 12:08:52 -05:00
Richard Hughes
5c82b94322 Do not show HSI obsoleted attributes by default
When one result is obsoleted by another, then do not show the old result by
default.

Additionally hide the HSI URLs as this was designed more for GUI clients like
gnome-firmware than CLI tools such as fwupdmgr.
2020-09-14 09:58:46 -05:00
Mario Limonciello
5de5dd3582 Install the installed tests
Move binaries out of fwupd tree to https://github.com/fwupd/fwupd-test-firmware

Fixes some of https://github.com/fwupd/fwupd/issues/1956
2020-08-28 10:10:43 -05:00
Richard Hughes
a83deb42b5 Add commands to fwupdtool for interacting with the ESP 2020-08-12 18:35:15 +01:00
Richard Hughes
3120683143 Allow blocking specific firmware releases by checksum
Fixes https://github.com/fwupd/fwupd/issues/2280
2020-08-10 17:14:15 +01:00
Richard Hughes
b76b4f8deb trivial: Make the bash completion script reflect reality 2020-07-29 15:05:15 +01:00
Richard Hughes
5bfa7bf808 trivial: Add a device test for the Thelio Io device 2020-07-28 16:01:47 +01:00
Richard Hughes
ff0dc24e54 trivial: Add some documentation for the ApprovedFirmware config key 2020-07-09 12:52:38 +01:00
Richard Hughes
85226fd9d1 Remove potentially problematic language
Red Hat wants to drive an initiative in correcting problematic and potentially
divisive language in open source projects. These naming conventions and
descriptive phrases are hurtful and offensive to many of our colleagues across
the open source universe.

See https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 17:31:17 +01:00
Richard Hughes
9bc9debd98 Allow uploading security attributes to the LVFS
We sign the data with the client cert to allow users with LVFS accounts to
publish 'official' HSI ratings.
2020-05-21 11:48:09 +01:00
Richard Hughes
196c6c69db Add support for the Host Security ID
The HSI specification assigns a simple text ID to the current state of firmware
security. As new vulnerabilities are found, and as protection measures are
updated, new requirements will be added to the required firmware behaviours for
each HSI value.

The HSI specification is currently incomplete and in active development, and
so the --force flag is required in all command line tools. The current ID value
will probably change on a given platform so please do not start using the result
for any kind of compliance requirements.
2020-05-11 22:11:49 +01:00
Mario Limonciello
3838b22a7c trivial: add missing changelog entry for 1.3.9
This release came out after 1_3_X branched but long before 1.40 release
so these entries are confusing to be missing.
Fixes: #2059
2020-05-05 13:14:22 -05:00
Richard Hughes
86f6324a26 Switch the default of EnumerateAllDevices to false
This was causing dozens of regressions to be reported.
2020-05-03 06:47:40 +01:00
Richard Hughes
ad113b931f Release fwupd 1.4.1 2020-04-27 11:05:41 +01:00
Jan Tojnar
463db5162f build: Allow overriding prefix for systemd file installation
It is a good practice to install files relative to our own variables
https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/
and it is required on systems like NixOS.

Unfortunately, systemd allows overriding the root prefix,
see also 1c2c7c6cb3,
so we cannot just do that.

Let's at least make the systemd installation prefix overridable.

This will also allow us to drop `systemdsystemunitdir` option since
systemd hardcodes it to `${rootprefix}/lib/systemd/system`.
2020-04-18 15:22:10 +01:00
Jan Tojnar
0f035013df build: Install bash-completion relative to datadir
Since bash-completion 2.9, it was no longer possible to override
the completionsdir through prefix. [1] In 2.10, the overridability
was re-estabilished but this time through datadir variable. [2]

This should not really matter except for developers installing the project
into a custom prefix or distros using per-package prefixes like NixOS.

[1]: 81ba2c7e7d
[2]: https://github.com/scop/bash-completion/pull/344
2020-04-16 12:45:19 -05:00
Mario Limonciello
c727742df3 trivial: remove references to hardware.py (Fixes: #2007) 2020-04-15 20:27:21 -05:00
Jan Tojnar
2f12e38e61 build: Re-use installed tests directory
It will make it easier for downstreams to patch the path.
2020-04-15 20:16:46 +01:00
Richard Hughes
a3d6ee0e29 Release fwupd 1.4.0 2020-04-14 10:27:32 +01:00
Richard Hughes
b47d347823 trivial: Add some more self tests 2020-04-09 16:55:17 +01:00
Richard Hughes
0e8ee75890 trivial: Add some more device regression tests 2020-04-09 09:55:30 +01:00
Richard Hughes
d668225685 trivial: Allow filtering the device-test by the protocol
This allows us to run the device tests with all 4 supported types of unifying
dongles plugged in at the same time.
2020-04-09 09:07:13 +01:00
Richard Hughes
b452c752aa trivial: Add some more device regression tests 2020-04-08 16:52:22 +01:00
Richard Hughes
854e6f6362 Add some more device regression tests 2020-04-08 13:55:39 +01:00
Richard Hughes
372565aef8 trivial: Show what device test is being run right now 2020-04-08 13:55:39 +01:00
Richard Hughes
f3966c784d Modularize the hardware tests 2020-04-07 16:09:47 +01:00
Ross Burton
d783c3a531 Install the installed-tests only if tests are enabled
The README says: "A test suite that can be used to interact with a fake device is installed when configured with `-Ddaemon=true` and `-Dtests=true`", so actually only install these tests when tests are enabled.
2020-04-06 12:16:52 -05:00
Paul Menzel
bf1b876e56 data/motd/fwupd-refresh: Only order after network.target
From [Lennart’s answer on systemd-devel][1]:

> fwupd.target should not list the various network management solutions,
> that is unnecessary, and ordering after network.target should be
> sufficient to achieve the same, in a generic fashion. i.e. network
> managers should order themselves before network.target, so that
> ordering yourself after that automatically orders you after all
> implementations at once...

So, remove the unneeded targets. As the service unit is not
installed/enabled, and instead called by a timer, the system will most
probably be online already.

[1]: https://lists.freedesktop.org/archives/systemd-devel/2020-March/044205.html
     "Best practices for starting unit only if network is online"
2020-04-01 13:14:41 -05:00
Mario Limonciello
4fa95a7b51 Add a new daemon configuration option to control EnumerateAllDevices
For plugins that are configured to only enumerate devices supported
by metadata this will allow showing them in all contexts

Fixes: #1877
2020-03-31 13:05:57 -05:00
Filipe Laíns
674478d4b8 bash: add completion for fwupdtool reinstall
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-03-31 10:46:40 +01: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
exploide
b3c8bc4010 trivial: update command consumes device ids in fish shell completion 2020-03-17 19:12:00 +00:00