Commit Graph

2059 Commits

Author SHA1 Message Date
Richard Hughes
74a2a47f7f Add two report keys affecting report credibility 2021-10-15 13:55:25 +01:00
Richard Hughes
2d5c5b868e Add the missing PolicyKit actions for (un)trusted downgrade
If we want to tighten the allowed actions, we need the actions to be
symmetric.
2021-10-15 13:54:29 +01:00
Richard Hughes
86b27b9505 Mark as SUPPORTED even if on AC power
This makes the 'Downloaded new metadata: N local devices supported'
message correct when refreshing on battery power.
2021-10-12 17:59:27 +01:00
Richard Hughes
4389f9f913 trivial: Show newlines in the warning box
This means we split up the paragraphs into sections as designed.
2021-10-09 08:09:38 +01:00
Richard Hughes
d3706e0e0b Show the user a warning if updating may affect full-disk-encryption
Additionally, if the client does not set the feature flag `fde-warning`,
add an extra paragraph into the update description.

Fixes https://github.com/fwupd/fwupd/issues/3829
2021-10-09 08:09:38 +01:00
Richard Hughes
3f82205062 Support loading remotes from /var/lib/fwupd/remotes.d
This allows us to add remotes on /etc immutable systems.
2021-10-08 17:22:24 +01:00
Richard Hughes
1669f532be trivial: Move the metadata directory
This moves the cached metadata location from /var/lib/fwupd/remotes.d
to /var/lib/fwupd/metadata

The former was a bad name as it wasn't a list of remotes, and .d is the
suffix for directories the user can install files into, rather than for
binary content managed entirely by the daemon.
2021-10-08 17:22:24 +01:00
Richard Hughes
20a1b12afe trivial: Ensure paths in /var exist before starting the daemon
On an immutable system these might have been factory reset to empty.
2021-10-08 17:22:24 +01:00
Richard Hughes
d081db775a Allow specifying 'fwupdmgr device-test foo --json'
This outputs a superset of the existing device-test JSON schema, and is
designed to be read my a machine, not a human.
2021-10-08 17:22:06 +01:00
Richard Hughes
6d121d0163 trivial: Do not show progressbars when running with --json 2021-10-08 17:22:06 +01:00
Richard Hughes
37855a3f5d trivial: Match up the translator comments with the source strings
Doing clang-format on the codebase broke a few of these.
2021-10-06 16:07:43 +01:00
Gaël PORTAY
5c2c9c4672 fu-engine: Fix typo in the efi-firmware-volume ID
The commit 488f2e1f37 has moved some
parsers and has created a typo in the efi-firmware-volume ID.
2021-09-30 07:45:28 -05:00
Richard Hughes
86d92f2c93 trivial: Fix translator comment 2021-09-25 19:48:47 +01:00
Richard Hughes
478e44bc19 trivial: Do not use g_assert() in self test code
Note that g_assert() should not be used in unit tests, since it is a
no-op when compiling with G_DISABLE_ASSERT. Use g_assert() in production
code, and g_assert_true() in unit tests.

See https://github.com/fwupd/fwupd/issues/3790
2021-09-24 22:20:21 +01:00
Daniel Campello
3d7d49c1e1 trivial: do not fallback on missing GUID lookup 2021-09-24 11:07:43 -05:00
Richard Hughes
3a86c7e386 elantp: Use the recently added FuCfuOffer and FuCfuPayload
This increases the amount of parsing we do ahead-of-time.
2021-09-24 08:40:42 +01:00
michaelcheng04
10549674b1 Add a plugin to flash Elan fingerprint reader hardware 2021-09-23 10:41:00 +01: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
06710d7911 Report progress correctly when using fwupdtool
Some methods like fu_engine_firmware_dump() take a FuProgress and do
not use engine signals.
2021-09-21 16:20:20 +01:00
Richard Hughes
450e8e1c17 Add FuCfuPayload and FuCfuOffer
We can use these in the future elantp plugin, and I'm sure we'll need
them again in the future for an *actual* CFU plugin.
2021-09-20 14:43:34 +01:00
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01: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
Mario Limonciello
7258f972ac trivial: fu-tool: for get-plugins load engine with HWINFO
Checking whether some plugins are enabled or not will require smbios
to be available.  Information may be wrongly displayed unless this
has been checked.
2021-09-16 06:44:27 -05:00
Richard Hughes
28494902f5 trivial: Remove the double warning when reinstalling composite firmware
Typo? Merge artifact? Who knows.
2021-09-16 09:15:35 +01:00
Simon Ho
5e67108ab8
plugins: add new plugin for Synaptics CAPE devices (#3746)
CAPE family is Audio DSP for a board range of applications in IOT, PC
and mobile can be interfaced via I2C, UART or USB interface. This patch
is only for CX31993 and CX31988 chips, there is not immediate plans is
to add support to other CAPE devices.

CX31993 have two separate firmware .hid file for for each partition. It
need to convert two .hid files into a .fw file for fwupd tool to
consume.

Currently, this patch is only support for EPOS headsets with basic
firmware update feature. Either new code singing or manifest.xml are
unsupported yet.

The code has been tested with CX31993 EVK board.

A test firmware file is put at 'src/fuzzing/firmware/synaptics-cape.fw'

synaptics-cape: Port to new FuProgress API and style fixups

synaptics-cape: Fix compile errors and add missing test fw file

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix fuzzer test

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Mark the fuzzing target

trivial: Use a stable GLib branch for fuzzing

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix readme

synaptics-cape: Style fixups

synaptics-cape: Fix progress bar percentage

synaptics-cape: Style fixups
2021-09-15 03:42:07 +08:00
Richard Hughes
9ed7eac949 trivial: Add translations for more device categories 2021-09-13 15:08:32 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Richard Hughes
30ee6064f9 trivial: Fix a small memory leak when processing recommends 2021-09-10 21:12:53 +01:00
Richard Hughes
2bcb19ac4b trivial: Fix a small memory leak in the self tests 2021-09-10 21:12:53 +01:00
Richard Hughes
83962339ba trivial: Do not update the progressbar title for the device child 2021-09-08 18:51:30 +01:00
Richard Hughes
39e45920b6 trivial: Disconnect all handlers, including the generic one 2021-09-08 14:10:58 +01:00
Richard Hughes
8a47ded53c Remove the hardcoded legacy runtime requirements
No active firmware on the LVFS depends on either.
2021-09-05 15:45:13 +01:00
Richard Hughes
841adff03d trivial: Add --json to fwupdtool and use for HSI attrs 2021-09-03 22:03:28 +01:00
Richard Hughes
48e42dce56 Use the same JSON schema in the database as the upload
I mistakenly told Kate there was no existing format, but of course
there is, and it makes sense for the formats to be the same.
2021-09-03 19:47:47 +01:00
Kate Hsuan
db04223167 fu_history: fu_security_attr: Convert secutiry attr to json and write to DB.
1. Create hsi_history table to store the security attributes.
2. Convert all security entities to a json string and write to database.

Signed-off-by: Kate Hsuan <hpa@redhat.com>

Changes in v1:
1. Fixed typo: "his_history" to "hsi_history"
2. g_autofree all gchar pointer.
3. Removed unnecessary g_warning messages.
4. Moved the json format comment to Document comment.
5. Add an error handling for json converter.

Changes in v2:
1. Declare all pointers using g_auto_ptr.
2. The warning messages of JSON conversion and DB writing errors were added.
3. "Since: 1.7.0" was added to the document comment.

Changes in v3:
1. Fix variable declaration.
2. Remove unecessary data type casting.

Changes in v4:
1. Fix migration schema.

Changes in v5:
1. Fix hsi_history column name declaration.

Changes in v6:
Column name was modified from last to timestamp.
2021-09-03 12:03:17 +01:00
Richard Hughes
bd52573b11 Add support for an 'unreachable' device flag
This is for devices that are still registered with a receiver but are
no longer in range or in a high power state.
2021-08-31 17:08:05 +01:00
Richard Hughes
566f8e27c2 Do not check wait_removed as multiple devices can be WAIT_FOR_REPLUG
This makes devices that come back in bootloader mode with no children
timeout, which is bad UX. We don't even need the feature now that we
can WAIT_FOR_REPLUG on multiple devices now.
2021-08-31 12:47:46 +01:00
Richard Hughes
b5c59e2733 trivial: Make the 'device ID was not found' messages more helpful 2021-08-31 12:47:29 +01:00
Richard Hughes
a9f2d1966a trivial: Fix a translator string Freudian slip 2021-08-30 08:24:43 +01:00
Mario Limonciello
db72e9f52a trivial: mark some strings as translatable (Fixes: #3654) 2021-08-25 14:28:43 -05:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
cragw
f5fb53a371
trivial: if usb4 device device presents then activate it exclusively (#3595)
* dell-dock: open usb4 device in the activate call, and leave early

* trivial: read history earlier, at least before plugin register

* dell-dock: activate usb4 device exclusively if it needs activation
2021-08-11 22:29:31 +08:00
Richard Hughes
6f8ab5e70c Restart the daemon if any of the the plugin config files are modified
Fixes https://github.com/fwupd/fwupd/issues/3625
2021-08-11 14:27:47 +01:00
Richard Hughes
fb234f3d04 trivial: Show the UpdateError if the device is not UPDATABLE 2021-08-11 10:54:38 +01:00
Richard Hughes
bc759d0584 Fix cleanup and plugin to have the correct args order
All the other vfuncs have 'plugin, device, flags' but prepare and
cleanup vfuncs being 'plugin, flags, device' order has been triggering
my OCD for the last few years.

We've just broken the symbol names, so it's the right time to fix this.
2021-08-10 09:57:49 +01:00
Richard Hughes
e44ec2f0e4 trivial: Do not show superset plugin warnings when disabled 2021-08-06 20:51:22 +01:00
Richard Hughes
a5a978b3f6 Rename some confusing API
More than one person has asked about 'why call fu_plugin_update() for a
reinstall or downgrade' and I didn't have a very good answer.

The plugin API is not officially stable, and we should fix things to be
less confusing. Use the same verbs as the FuDevice vfuncs instead.
2021-08-06 19:49:53 +01:00
Richard Hughes
7a1d547128 trivial: Do not set up the backends if there is no coldplug
This speeds up fu-self-test, but more importantly fixes a intermittent
'ninja check' failure when a host USB device disconnects at exactly the
wrong time.

The FuUsbBackend code is unusual in that the setup() code sets up a
context (with a thread) which takes up to 2 seconds to timeout.
2021-08-03 17:04:27 +01:00
Richard Hughes
27fbab1990 redfish: Disable the uefi_capsule plugin if coldplug succeeded
We don't want to show the big warning about the missing ESRT on server
hardware that is managed by a BMC:

    WARNING: UEFI capsule updates not available or enabled in firmware setup
      See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information.
2021-08-03 13:10:10 +01:00
Richard Hughes
f12068d2e9 Allow devices to only accept version upgrades
See https://github.com/fwupd/fwupd/issues/3554 for details.
2021-07-31 20:41:21 +01:00