Commit Graph

514 Commits

Author SHA1 Message Date
Richard Hughes
e6dc11a205 trivial: Update all the device test URLs to reflect reality 2022-01-12 14:23:44 +00:00
Richard Hughes
c30f491001 trivial: Add a device test for the Servo Micro hardware 2022-01-07 20:18:30 +00:00
Richard Hughes
f885ab6d2a Allow patching firmware files at known offsets
This allows us to replace the 'dfu-tool replace' with a much more
controlled 'fwupdtool firmware-patch' command that patches at a set of
specific offsets.

Drop in the new functionality into the existing firmware ->write()
vfuncs so that the image headers, footers and/or checksums are correct.
2022-01-05 09:51:45 +00:00
Denis Pynkin
6fdaeb8f99 nordic-hid: add device test
Added the test for nRF52840-DK board with MCUBoot variant.
Images based on MCUBoot may be used for test automation since this
bootloader type does not have version dependencies.

To prepare the board for testing it should be flashed with MCUBoot
image variant with `nrfjprog` initially.
2021-12-30 10:24:22 +00:00
Richard Hughes
054fb04860 Release fwupd 1.7.3 2021-12-13 12:15:42 +00:00
Richard Hughes
ca221927ff trivial: Include the CfiDeviceCmdReadId value in the quirk data
If we're getting the flash ID out-of-band we might not have this set.
2021-12-09 13:09:43 +00:00
Richard Hughes
ea5cae7c41 Enable the MOTD integration when using pam_motd
This has to be a file, not a file-in-a-directory.

Fixes https://github.com/fwupd/fwupd/issues/4047
2021-12-01 20:55:15 +00:00
Richard Hughes
20d57b9ae6 trivial: Update subproject versions to latest 2021-12-01 20:46:20 +00:00
Richard Hughes
beb29ff698 Add a sync-bkc subcommand to ensure a known set of firmware versions
Install or downgrade firmware on all devices to make the system match
a well known set. This allows two things:

 * Factory recovery where a device in the field has been upgraded
 * Ensuring a consistent set of tested firmware for a specific workload

A tag is assigned either during upload or added post-upload on the LVFS
which is included in the metadata. A single firmware can be marked with
multiple tags, and tags can be duplicated for different firmwares.
2021-11-29 15:16:14 +00:00
Richard Hughes
677c80eb64 trivial: Use string comparisons for new libjcat versions
This regressed in 7b865f213c
2021-11-24 22:18:17 +00:00
Richard Hughes
7b865f213c trivial: Only install files that are going to be used 2021-11-23 15:14:14 +00:00
Richard Hughes
a15a50bc5c Release fwupd 1.7.2 2021-11-19 09:54:57 +00:00
Richard Hughes
7e386f8791 trivial: Do not install the fwupdtpmevlog debugging cli to save 50Kb 2021-11-15 15:01:22 +00:00
Richard Hughes
5f01678daa Use -Doffline=false to reduce the install size by over 100Kb
If there's no SuperIO chip then there's no need to support this.
2021-11-12 21:06:34 +00:00
Richard Hughes
e840e9c23b Use -Dfish_completion=false to reduce the install size by a few more Kb 2021-11-12 21:06:34 +00:00
Richard Hughes
34d531074c Use -Dmetainfo=false to reduce the install size by over 100Kb 2021-11-12 21:06:34 +00:00
Richard Hughes
4f3e2c3a57 Allow overriding HwId data from the config file
To use this on a immutable system like ChromeOS you can create a file
in /var/lib/fwupd/daemon.conf which is used as an override.
2021-11-10 17:59:52 +00:00
Ross Burton
a346c582cc installed-tests: use sh instead of bash
fwupdmgr.sh uses [[ ]] tests, but none of the functionality offered by
them.

Use traditional [ ] tests, and switch the interpreter to /bin/sh.
2021-11-05 12:16:23 +00:00
Richard Hughes
1c7b4ef223 Release fwupd 1.7.1 2021-11-01 11:55:09 +00:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Richard Hughes
6235a8222a Share the Common Flash Memory Interface quirks between plugins
Now two plugins are using hardcoded SPI constants for various CFI chips,
and it makes sense to have some common quirk data that can be used by
both.

Add a FuSpiChip helper object that can be used by FuDevice subclasses
to get the specific SPI commands to use for each flash ID.
2021-10-20 12:19:39 +01:00
Richard Hughes
be1879fa4d trivial: Delete some unused test data 2021-10-20 09:55:44 +01:00
Richard Hughes
fcb5257e16 Allow OnlyTrusted=false in the non-polkit case 2021-10-17 14:29:58 +01:00
Richard Hughes
644ac0ea05 Only installing firmwares with signatures by default
99.9999% of users are consuming firmware updates from the LVFS or
another trusted remote. It's far too easy to get a user to enter the
password to install an untrusted firmware, where the security
consequences are pretty dire.

Provide an escape-hatch for firmware engineers, but it does mean
editing a file in /etc as root. This seems like an acceptable level of
inconvenience.
2021-10-15 15:54:44 +01:00
Richard Hughes
88592df086 rts54hub: Use demo firmware on the evaluation board for the tests
This avoids clashing with real-world devices that have the same VID/PID.
Many thanks to Ricky WU <ricky_wu@realtek.com> for all the help.

Fixes: https://github.com/fwupd/fwupd/issues/3835
2021-10-13 20:07:15 +08:00
Richard Hughes
24cc4d9d30 trivial: Set the systemd timeout to match the client proxy
The systemd default of 90 seconds is uncomfortably close to the
worst-case Redfish startup time. Give ourselves some more headroom.
2021-10-08 17:22:45 +01:00
Richard Hughes
0afe353e05 Release fwupd 1.7.0 2021-10-06 16:09:38 +01:00
Mario Limonciello
70b327c41f trivial: drop fish-completion for ignore-power 2021-10-06 14:57:05 +01:00
Richard Hughes
204da7a775 trivial: Remove one case of master that snuck in 2021-09-24 19:13:44 +01:00
Richard Hughes
494fd2736f Allow installing the LVFS remote, but disabled
This is a patch that I have to regenerate almost every rebase. Just
move it upstream as it's probably not RHEL specific.
2021-09-24 16:55:04 +01:00
Richard Hughes
90ea3453c3 trivial: Do not install the device tests when using -Dtests=false 2021-09-24 06:51:09 -05:00
Mario Limonciello
6ebccf1e1e Remove support for --ignore-power by frontends
This functionality broke a number of releases ago as part of
implementing device inhibition and was just noticed now.

Instead of fixing it, the preference seems to be to remove the
functionality as it exists today as inhibitions can happen for
a number of reasons.

To still allow people to override these power warnings (such as during
development) add a new daemon configuration item that can be used.

Fixes: #3778
2021-09-21 13:13:52 -05:00
Richard Hughes
9d37e447a1 Convert the device test script to a fwupdmgr subcommand
This allows us to do a few things:

 * Remove the runtime dep on Python 3, which is tricky for ChromeOS
 * Test composite devices more efficiently, only writing once per test
 * Automatically upload signed reports for successful device tests.
2021-09-16 15:01:36 +01:00
Ricardo Cañuelo
15a39b94ee logitech-hidpp: Add support for updating Bolt peripheral firmware
Also simplify the Instance IDs added by the Bolt hardware.
2021-09-13 11:28:55 +01:00
Richard Hughes
75eae41a86 dell-dock: Use the correct data file for the device test 2021-09-09 17:59:20 +01:00
Richard Hughes
75221f2e07 cxaudio: Use the correct data file for the device test 2021-09-09 17:59:20 +01:00
Mario Limonciello
41c00ff404 trivial: libfwupdplugin: make the self tests not overwrite source folders 2021-09-03 15:10:38 -05:00
Richard Hughes
3932a1f0d3 device-tests: Do not use a deprecated method
This also fixes the bug where you can't recover a Unifying device stuck
in bootloader mode if the 'default' protocol is not the one that matches.
2021-09-01 15:36:07 +01:00
Ricardo Cañuelo
35af30321a logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
Richard Hughes
c1ff02f055 trivial: Make the quirk style more consistent 2021-08-23 18:10:12 +01:00
Richard Hughes
7cfbea795c redfish: Allow starting when using RestrictAddressFamilies 2021-08-03 15:45:15 +01:00
Richard Hughes
2f9eece213 Release fwupd 1.6.2 2021-08-02 15:18:37 +01:00
Richard Hughes
19ab121f80 trivial: Write some initial release notes 2021-07-31 20:46:03 +01:00
Richard Hughes
f11abafed7 trivial: Use a valid firmware file for the ColorHug test 2021-07-30 18:53:30 +01:00
Richard Hughes
ac44c59605 Support DeviceRequest in the regression device-tests
Real hardware needs this and it was causing failures in the pre-release
regression tests.
2021-07-30 07:24:17 +01:00
Mario Limonciello
3081dea088 trivial: allow writing to /boot/grub
When running with systemd confinement writing to /boot/grub is needed.
```
fwupd[20533]: /usr/sbin/grub-mkconfig: 269: cannot create /boot/grub/grub.cfg.new: Read-only file system
fwupd[20492]: 03:12:53:0148 GLib                 posix_spawn avoided (fd close requested)
fwupd[20630]: /usr/bin/grub-editenv: error: cannot open `/boot/grub/grubenv': Read-only file system.
```
2021-07-28 17:11:39 +01:00
Richard Hughes
3747e245e5 uefi-capsule: Add support for CapsuleOnDisk
Based on a patch by Ilias Apalodimas <ilias.apalodimas@linaro.org>,
many thanks.

Fixes https://github.com/fwupd/fwupd/issues/2900
2021-07-28 17:11:39 +01:00
Mario Limonciello
84c4ae387d trivial: only use systemd env variables if /usr prefix
This helps avoid confusion of /usr/local/etc vs /etc/ when using hand
install on a system that previous had packaged install.
2021-07-28 10:25:47 -05:00
Richard Hughes
eb215753ee trivial: Add the ability to download files using PkClient for testing 2021-07-27 15:59:17 +01:00
Peter Marheine
464425fb5c SMBIOS: try reading from /sys/class/dmi if direct access fails
The raw SMBIOS tables that Linux exposes in /sys/firmware/dmi
are restricted to being readable by root only. If running as
non-root access is still permitted by fields that have been
pre-parsed by the kernel in /sys/class/dmi, most of which are
world-readable. This allows the daemon to load most HWIDs even
if running as a non-root user, as is done on Chromium OS.
2021-07-23 09:46:45 +01:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
f0bc835769 Move all the fwupdagent code to fwupdmgr
We want to provide a lot more in JSON format in the future, and this
will reduce a lot of code duplication.

As various people are using this in the wild, the existing fwupdagent
binary just shims requests to fwupdmgr as required. We'll stop doing
this for 2.0.0 or something.
2021-07-15 20:34:07 +01:00
Richard Hughes
65b3115b48 trivial: Move the builder docs to docdir
Fixes https://github.com/fwupd/fwupd/issues/3464
2021-07-09 16:40:36 +01:00
Yuan-Chen Cheng
c593ca6d4b trivial: vendor-directory typo 2021-07-03 10:17:31 +01:00
Richard Hughes
ef2c226a0c wacom-usb: Retry the legacy bluetooth version read for up to 5s 2021-06-18 14:03:54 +01:00
Mario Limonciello
04fdca165e trivial: move upower.quirk out of upower plugin
This should be used by other power plugins as well.
2021-06-18 09:12:57 +01:00
Benson Leung
d92d99d075 trivial: device-tests: Add HP USB-C Dock G5 firmware v1.0.13
Fixes #3376
2021-06-17 10:25:05 +01:00
Richard Hughes
85e3916c77 Release fwupd 1.6.1 2021-06-14 14:31:12 +01:00
Richard Hughes
3f8c3e04d0 trivial: Include the LVFS remotes for the standalone build too 2021-06-07 22:04:17 +01:00
Richard Hughes
69071e14e8 trivial: Use new 8BitDo name 2021-05-24 08:59:54 +01:00
Richard Hughes
d7ed64b536 trivial: Actually look for GNU tar for --xform support
This fixes the tests on FreeBSD.
2021-05-21 17:23:11 +01:00
Richard Hughes
2e6fee186e trivial: Fix several potential leaks when parsing remotes
This fixes several issues when calling fwupd_remote_load_from_filename()
multiple times on the same FwupdRemote.
2021-05-14 06:02:56 +01:00
Richard Hughes
769cbbf8af Add support for the PHAT table
On Alterlake and newer hardware the Platform Health Assessment Record
data can be used by the IHV to debug why a specific capsule update
failed. Any custom firmware loaded by the OEM can be identified and
used to further debug the root cause.
2021-05-12 12:02:33 +01:00
Richard Hughes
ba890cde46 Release fwupd 1.6.0 2021-04-26 10:46:50 +01:00
John Karahalis
ae690c57b7 trivial: Update --no-reboot-check description
Update the description of the --no-reboot-check option to clarify that
this option also disables the reboot prompt.
2021-04-23 07:58:14 -05:00
Richard Hughes
e65d28d817 Add a utility to resign firmware files
This can be used like this:

    fwupdtool firmware-sign firmware.cab rhughes_signed.pem rhughes.key

Test signing certificates can be generated using the example script here:
https://github.com/hughsie/libjcat/blob/master/contrib/build-certs.py although
these certificates should not be used for enterprise use.
2021-04-19 12:59:35 +01:00
Mario Limonciello
563d24954b trivial: fix a shellcheck failure 2021-04-09 16:02:20 +01:00
Mario Limonciello
6d1afc3e87 trivial: reformat all python code with black 2021-04-08 10:43:29 -05:00
Richard Hughes
b5555003bb Detect files with CRLF line endings
Mixing Unix-style and Windows-style line endings causes some of our tools
heartache. Just standardize on the former.
2021-04-08 15:55:36 +01:00
Emily Miller
d216fb8d45 vli: fix bizlink json tests 2021-04-08 10:48:26 +01:00
memily
c255034574
vli: Add VL822 device+share-spi-pd
Co-authored-by: Emily Miller <m_emily@berkeley.com>
2021-03-30 13:06:49 +01:00
Richard Hughes
a5966f7085 trivial: Codespell fixes 2021-03-19 16:42:33 +00:00
Richard Hughes
52441f28a4 Allow objects to deserialize to XML
This makes a lot more sense; we can parse a firmware and export the same XML
we would use in a .builder.xml file. This allows us to two two things:

 * Check we can round trip from XML -> binary -> XML

 * Using a .builder.xml file we can check ->write() is endian safe
2021-03-15 12:07:30 +00:00
Emily Miller
7752ffe344 vli:ODM changed U2 pid, add json test 2021-03-10 14:20:58 +00:00
Richard Hughes
c81b755872 Be more strict for custom quirk keys
Rather than trying to guess typos, force each plugin to register the quirk
keys it supports, so we can show a sensible warning if required at startup on
the console.
2021-03-03 08:30:34 +00:00
Richard Hughes
7d132b728c Simplify the quirk file format
The best way of not getting something wrong is to not require it in the first
place...

All plugins now use DeviceInstanceId-style quirk matches and we can just drop
the prefix in all files. We were treating HwId=, Guid= and DeviceInstanceId= in
exactly the same way -- they're just converted to GUIDs when building the silo!
2021-03-03 08:30:34 +00:00
Richard Hughes
0724620f1e Remove the Hughski public key
Hughski Limited is no more, and everything should be using the LVFS cert now.
2021-03-01 08:26:41 +00:00
Richard Hughes
91337c2bdf trivial: Fix the device test for the 03x7609 device 2021-02-25 15:47:25 +00:00
Emily Miller
9b304fdfbd vli:fw fix to LVFS 2021-02-25 08:30:13 +00:00
Richard Hughes
674fccdd0d Release fwupd 1.5.7
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-02-23 14:54:50 +00:00
Richard Hughes
a76de3279b Add a test BLE plugin for a demo 2021-02-22 16:53:41 +01:00
Richard Hughes
260a24449d Release fwupd 1.5.6 2021-02-16 12:14:12 +00:00
Richard Hughes
c3ecec575b fmap: Use memmem to find the FMAP signature
Trust glibc to optimize for the binary search, removing a oss-fuzz detected
crash with our bad pointer maths.
2021-02-11 20:27:20 +00:00
Richard Hughes
98972f4a34 libfwupdplugin: Promote DfuFirmware to FuDfuseFirmware
Port the DFU plugin to use the new objects to make it act the same as all the
other plugins.
2021-02-01 19:34:28 +00:00
Richard Hughes
6de10e118c Allow downloading firmware from IPFS
Only a small amount of the firmware on the LVFS will be available. The user
can use --ipfs on the command line for testing, or change the system-wide
default in /etc/fwupd/daemon.conf.

The IPFS daemon and command line client will need to be installed manually.
2021-02-01 19:33:31 +00:00
Richard Hughes
b856f0bc42 Allow configuring URI scheme preferences
This would allow, for instance, only allowing IPFS downloads or preferring
https over http downloads.
2021-01-28 15:34:36 +00:00
Richard Hughes
f6751cd783 Allow using custom data to generate CHIDs
This is really useful when working out HwId quirk values for remote systems.

    fwupdtool export-hwids target.hwids
    vim target.hwids
    fwupdtool hwids target.hwids
2021-01-18 07:56:34 +00:00
Richard Hughes
5f31395fcf trivial: Remove unused variable spotted by shellcheck 2021-01-12 16:54:37 +00:00
Richard Hughes
bea7665c81 Release fwupd 1.5.5 2021-01-11 10:16:43 +00:00
Richard Hughes
5c9b1fcc81 Only include the start year in the copyright header
The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.
2021-01-07 14:48:16 +00:00
Richard Hughes
ee2e2c3674 uefi: Rename to uefi-capsule
Rename the plugin to make it clearer of the scope.

Based on a patch from Mario Limonciello <mario.limonciello@dell.com>
2021-01-05 15:31:22 +00:00
Richard Hughes
32d36a0bf5 Release fwupd 1.5.4 2020-12-16 12:52:28 +00:00
Mario Limonciello
a7d1530385 fu-util: Add a new --no-remote-check to ignore checking for download remotes
This fixes the overloaded `--no-metadata-check` that was previously
present from being used in multiple instances.
2020-12-14 12:52:38 -06:00
Mario Limonciello
89a2f190b6 trivial: fwupd-refresh: don't add --no-metadata-check
This is implied because the service is started non-interactively
by systemd.
2020-12-14 12:52:38 -06:00
Richard Hughes
e300ca513f Release fwupd 1.5.3 2020-12-08 09:48:10 +00:00
Richard Hughes
caa1be6a62 trivial: Add device test for Lenovo USB-C Dock Gen2 2020-11-30 08:59:46 +00:00
Richard Hughes
b0cb62fa49 trivial: Add device test for HP USB-C Dock G5 2020-11-30 08:58:18 +00:00
Richard Hughes
c21cff1c04 Release fwupd 1.5.2 2020-11-23 15:49:53 +00:00
Mario Limonciello
2f49da7f4e libfwupd: Restore recognizing gpg and pkcs7 types still
The snap-store intends to ship an updated libfwupd library but
to use it with whatever version daemon is on the host system.

This means that the library needs to still work with older metadata
signing types.

This fixes the following error in that scenario:
```Failed to update metadata for lvfs: Keyring kind jcat not supported```
2020-11-21 07:37:36 -06:00
Richard Hughes
8b035b01fe trivial: Add device tests for the Dell KH08P 2020-11-20 09:59:15 +00:00