Commit Graph

2238 Commits

Author SHA1 Message Date
Richard Hughes
03d166158d trivial: Remove some logically dead code 2022-04-13 15:08:12 +01:00
Sergii Dmytruk
500dd2c9c4 fu-util: pull device flags after unlocking
To allow unlocking operation change them.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-13 09:05:37 +01:00
Richard Hughes
63f2e9ee28 Allow 'fwupdmgr install' to install a specified firmware version
This also moves the 'local-install' action to a new verb, although we
fall back for compatibility.

Fixes https://github.com/fwupd/fwupd/issues/4514
2022-04-12 19:53:38 +01:00
Richard Hughes
55605a0d5e trivial: Split out CLI functionality for future use 2022-04-12 19:53:38 +01:00
Richard Hughes
f4fe33756a trivial: Use the FwupdRelease when sending reports 2022-04-12 19:53:38 +01:00
Richard Hughes
386fbb34c7 trivial: Connect the device signals in one place only 2022-04-12 19:53:38 +01:00
Mario Limonciello
7526d1b183 Add a new attribute for fused platform
Fused parts are unable to be tampered with.
2022-04-12 10:39:02 -05:00
Mario Limonciello
0e3e8ff610 trivial: change Intel debug attributes to generic
As other platforms have features with the same attribute, remove
the Intel generic one.
2022-04-12 10:39:02 -05:00
Mario Limonciello
9adb5380b3 Add a new HSI attributes for SPI protections 2022-04-12 10:39:02 -05:00
Mario Limonciello
04efb0b0cb Add a new HSI attribute for AMD rollback protection
This will be used by an upcoming AMD plugin
2022-04-12 10:39:02 -05:00
Richard Hughes
c049870c22 Do not expect KernelCmdline on Windows
Fixes https://github.com/fwupd/fwupd/issues/4516
2022-04-11 20:03:13 +01:00
Richard Hughes
372550ca0b Fix regression in 'fwupdtool install foo.cab'
When using fwupdtool install we pass all the possible devices and then
loop each one. If loading the requirement failed for a specific one
just continue to the next device rather than aborting too early.

Fixes https://github.com/fwupd/fwupd/issues/4509
2022-04-11 07:05:53 +01:00
Richard Hughes
df9ed97d9d Respect the NO_COLOR env variable
Fixes half of https://github.com/fwupd/fwupd/issues/4503
2022-04-08 17:26:23 +01:00
Richard Hughes
92944f5074 Add the runtime fwupd-efi version as a firmware requirement 2022-04-07 16:55:46 +01:00
Richard Hughes
95054582e3 trivial: Fix crash when getting details on unmatching device 2022-04-04 12:58:40 +01:00
Mario Limonciello
0ebb741c07 trivial: fu-engine: don't show different error message for unknown chassis
This is a wasteful static string, no need for it.
2022-04-03 09:06:00 -05:00
Mario Limonciello
ee4d369860 fu-util/fu-tool: Drop the --force on every run
--force was there because HSI specification was incomplete.  However
now we have the ability for plugins to report when not enough data
was gathered to make a calculation.  So change it to instead only
run if enough data was gathered.
2022-04-03 09:06:00 -05:00
Mario Limonciello
26349d0f28 cpu: Add a new attribute for CPU supported by HSI
On supported CPUs this will show up at HSI level 1 meaning that HSI
should be supported and trusted on this CPU if all plugins provided
enough data.

On non-Intel CPUs this will show up as missing data, meaning
that not enough plugins provide data for HSI to be trusted by default.
2022-04-03 09:06:00 -05:00
Mario Limonciello
a93feda72b trivial: rename the DMAR attribute to be vendor agnostic
The DMAR attribute is for Intel only, but AMD has the same feature in
the IVRS table.  Rename the attribute to clarify this.
2022-04-03 09:05:49 -05:00
Richard Hughes
0c052d4417 trivial: Be more selective when choosing devices to update 2022-04-01 21:46:04 -05:00
Richard Hughes
35417dcebd trivial: Be more selective when choosing devices to detach 2022-04-01 21:46:04 -05:00
Richard Hughes
7dc34ff02e Mark more devices as CAN_VERIFY_IMAGE
This allows us to filter the devices when showing what we can dump.
2022-04-01 21:46:04 -05:00
Mario Limonciello
47920197a4 trivial: fix behavior when running on old json-glib
older json-glib versions can't work with saving or retrieving
HSI security events.  Rather than showing non-sensical errors
about too old of a json glib version that are out of context,
just compile this stuff out on the older versions.

This fixes HSI security events showing up too as a result.
2022-04-01 12:46:41 -05:00
Richard Hughes
04f00e8a17 trivial: Never return the invalid value from fu_progress_get_percentage() 2022-03-30 18:42:01 +01:00
Richard Hughes
3ce161dfc2 Show the device serial number and instance IDs by default
This is a feature that seems useful, but one that no vendor has actually
asked for. It's also of limited use for peripheral devices.

Showing the instance IDs by default is also going to make it much easier
to explain to hardware vendors where the GUIDs come from.

Fixes https://github.com/fwupd/fwupd/issues/4445
2022-03-30 13:21:55 +01:00
Richard Hughes
474a57b6f7 Allow overriding the detected machine type
This makes developing HSI tests and UIs much easier when using VMs or
containers.
2022-03-30 13:17:31 +01:00
Richard Hughes
0eeaad76ec Modernize and refactor the requirement checking code
Before we had FuInstallTask which represented the specific install
action (install foo on bar), FuEngineRequest which described why the
install task was created, and FuEngine. The latter being both reposible
for calling *into* FuInstallTask and also *from* FuInstallTask as well.

Depending on the code, we had XbNodes of component and release, *and*
FwupdReleases as releases and lots of duplicated code to marshall the
former into various forms of the latter.

Create a FuRelease wrapper around FwupdRelease to replace FuInstallTask
and to simplify the code. Make the FuRelease builder do the device
requirement checks, and then use the engine to do checks requiring
engine state and context.
2022-03-30 08:17:24 +01:00
Richard Hughes
a7fb1d354c trivial: Only set to IDLE after auth actions have completed 2022-03-29 20:04:26 +01:00
Richard Hughes
fc011b593e trivial: Try to avoid creating new progressbar lines harder 2022-03-29 20:04:26 +01:00
Richard Hughes
4d330d92bc trivial: Do not set IDLE after parsing the firmware 2022-03-29 20:04:26 +01:00
Richard Hughes
50d9c545f2 Take a device inhibit when updating a device
This ensures that two different clients cannot update the same device,
as there's a window where we're waiting for the device to come back in
bootloader mode where we might accept a request from a different client.

As a side effect it also means we no longer store the UPDATABLE flag
in the history database -- which is fine as it's pretty useless anyway;
the device had to have been UPDATABLE to be updated in the first place.
2022-03-29 20:03:19 +01:00
Richard Hughes
37aac84d4c Never send the DeviceChanged signal with old data
If we connect up the device for property changes and then do an update,
we might send the pre-update GVariant data rather than the post-install
FuDevice.

This could mean that any client using the signal to update UI elements
might either flicker between the values, or show the 'wrong' device
version.
2022-03-29 14:32:51 +01:00
Richard Hughes
d2adec18ca trivial: Add one more translated HSI result case 2022-03-28 08:27:58 +01:00
Richard Hughes
1cdc938fd8 trivial: Use #defines to avoid typos in the HSI translations 2022-03-28 08:27:58 +01:00
Richard Hughes
ff4351d632 trivial: Fix a small memory leak when finding components
The docs of xb_silo_query_first_with_context() were wrong, it's always
(transfer full).
2022-03-25 21:12:53 +00:00
Richard Hughes
89e561c837 trivial: Show the update image in the CLI output 2022-03-24 15:54:12 +00:00
Gaël PORTAY
128caa5388 Fix memory leak
This fixes the memory leak below:

	$ sudo valgrind -v --leak-check=full fwupdtool get-devices
	(...)
	==3244345== 133 (64 direct, 69 indirect) bytes in 2 blocks are definitely lost in loss record 2,488 of 2,681
	==3244345==    at 0x4845899: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==3244345==    by 0x4C04D59: g_malloc (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4C1C816: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4C1CE9E: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4B84684: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6BB65: ??? (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6CAF4: g_object_new_with_properties (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6D659: g_object_new (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4AA8969: ??? (in /usr/lib/libgio-2.0.so.0.7000.4)
	==3244345==    by 0x153967: fu_engine_load_local_metadata_watches (fu-engine.c:7050)
	==3244345==    by 0x1540FC: fu_engine_load (fu-engine.c:7230)
	==3244345==    by 0x124D29: fu_util_start_engine (fu-tool.c:262)
	(...)
	==3244345== LEAK SUMMARY:
	==3244345==    definitely lost: 64 bytes in 2 blocks
	==3244345==    indirectly lost: 69 bytes in 2 blocks
	==3244345==      possibly lost: 1,936 bytes in 8 blocks
	==3244345==    still reachable: 234,668 bytes in 3,072 blocks
	==3244345==         suppressed: 0 bytes in 0 blocks
	==3244345== Reachable blocks (those to which a pointer was found) are not shown.
	==3244345== To see them, rerun with: --leak-check=full --show-leak-kinds=all
	==3244345==
	==3244345== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)
2022-03-23 19:05:20 +00:00
Richard Hughes
b99297046f Check the update protocol exists when checking requirements 2022-03-23 16:34:09 +00:00
Richard Hughes
8624f454d6 trivial: Remove one instance of -Wunused-variable 2022-03-18 13:35:57 +00:00
Richard Hughes
84a13af360 Show the user a wiki page about the FDE warning
Fixes https://github.com/fwupd/fwupd/issues/4400
2022-03-18 12:11:40 +00:00
Richard Hughes
b9774c644d Fix the 'Device has been removed' warning incorrectly seen on devices
Uninhibit the returning device if no firmware update has been performed.
2022-03-17 10:06:37 +00:00
Richard Hughes
92515d193a Add coSWID and uSWID parsers to libfwupdplugin
These parse the structures as defined in:

 * https://datatracker.ietf.org/doc/draft-ietf-sacm-coswid/
 * https://github.com/hughsie/python-uswid
2022-03-15 14:37:02 +00:00
Richard Hughes
6b5d933e99 Do not show unconnected or unreachable devices in the client tools
Fixes https://github.com/fwupd/fwupd/issues/4378
2022-03-15 14:08:17 +00:00
Crag Wang
a2b46e15cf Add daemon configuration 'OnlyTrusted' to D-Bus properties 2022-03-10 09:46:54 +00:00
Richard Hughes
91512925a0 Check for os-release on FWUPD_SYSCONFDIR
Change-Id: I391eabfb1ef6eadbad100273445794172b2cb1fd

Fixes https://github.com/fwupd/fwupd/issues/4366

Based on a patch by Daniel Campello <campello@chromium.org>, many thanks.
2022-03-09 08:10:18 -07:00
Richard Hughes
d86b8bc794 Show devices that are updatable and payload signing is still unknown
But, ignore devices like UEFI, NVMe and Redfish as this is specified in
the firmware metadata.
2022-03-02 15:33:42 +00:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Daniel Campello
6eb1cef881 Use multiple checksums when no <artifacts>
Current behavior is that only first checksum is used from metadata if no
<artifacts> section is present. Change this to process all checksums
available.

Change-Id: I03771971bee0fb7960460094bf0790d29bf11e0a
2022-02-25 10:31:03 +00:00
Richard Hughes
46848d3bef trivial: Fix a thinko when not using --json 2022-02-23 10:50:31 +00:00
Richard Hughes
46cf7e4f30 trivial: Fix thinko when there exists LVFS DeviceIntegrity metadata 2022-02-23 10:44:38 +00:00