Commit Graph

38 Commits

Author SHA1 Message Date
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
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
Mario Limonciello
02f2cc311e Add switch-branch support to fwupdtool 2020-10-21 12:00:55 -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
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
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
Richard Hughes
a83deb42b5 Add commands to fwupdtool for interacting with the ESP 2020-08-12 18:35:15 +01:00
Richard Hughes
b76b4f8deb trivial: Make the bash completion script reflect reality 2020-07-29 15:05:15 +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
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
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
bca63edccf Add 'firmware-convert' subcommand to fwupdtool
This is a useful function that allows us to use all the fwupdplugin loaders.
2020-03-09 21:12:01 +00:00
Richard Hughes
4959baa65b Add 'refresh' to fwupdtool
This actually makes 'get-updates' do something useful when using the flatpak.
2020-01-17 16:33:07 +00:00
Richard Hughes
fd7e994971 Add 'get-remotes' to fwupdtool 2020-01-17 16:33:07 +00:00
Richard Hughes
0e830d9c10 trivial: Fix typo in fwupdtool bash completion command name 2020-01-14 12:25:41 +00:00
Mario Limonciello
98b951688a Use device safety flags to show prompts before installing updates 2019-10-30 11:30:36 -05:00
Richard Hughes
a58510b246 Allow verifying the device image itself from fwupdtool
To debug flashing failures it's sometimes requried to get a SPI dump of the
hardware to analysis.

Add a debug-only command that lets us dump the device from the engine.
2019-10-30 13:55:55 +00:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Richard Hughes
0e46b22728 Allow disabling SSL strict mode for broken corporate proxies 2019-09-05 19:14:38 +01:00
Mario Limonciello
dfff18e3e8 Add aliases for get-upgrades and upgrade
Mostly for consistency purpose.  Details:
* It's confusing that internally the functions for `FwupdClient` use
`upgrade` in the name.
* The logical antonym of `downgrade` is `upgrade` not `update`
* People who don't use the tool frequently may try `get-upgrades`
2019-08-29 19:14:55 +01:00
Richard Hughes
747f570310 Allow filtering devices when using the command line tools 2019-08-06 20:59:28 +01:00
Mario Limonciello
fe593944a9 fu-tool: Port get-history command to fwupdtool 2019-04-03 14:37:25 -05:00
Richard Hughes
1568449e69 Add a verify-update command to fwupdtool
This is useful for debugging to just read the checksum from the device.
2019-03-18 10:08:58 +00:00
Richard Hughes
3d60762bed Add a D-Bus method to generate a signature using the self-signed client certificate 2019-03-11 13:57:39 +00:00
Mario Limonciello
3143bad0f5 fu-tool: Save device state to @LOCALSTATEDIR@/lib/fwupd/state.json on actions
This feature is turned on with the new fwupdtool option `--enable-json-state`

The intended use case is for ChromeOS to be able to save information about
devices on the system when `fwupdtool update` was run to display in the UX at
a later time.
2019-02-28 10:32:45 -06:00
Mario Limonciello
96a0dd5606 Add a support for delayed activation
This is intended for devices that it is not safe to immediately activate
the firmware.  It may be called at a more convenient time instead.

Both fwupdmgr and fwupdtool support the feature.

- if called at runtime with fwupdmgr it uses the daemon
- during shutdown fwupdtool uses the pending.db to perform this feature.
2019-02-27 09:04:54 +00:00
Mario Limonciello
53ce25d985 Add support to call composite prepare and cleanup using fwupdtool
Two new arguments added to fwupdtool: `--prepare` and `--cleanup`

They are used only with the `install-blob` command

This makes sure that devices can get rebooted in dell-dock even if using
fwupdtool to install a single blob.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2019-02-01 16:39:08 +00:00
Mario Limonciello
1e35e4c22d fu-tool: Port the get-updates command over
Now that there is actually support to load non-static information
(at least from fwupd perspective) it makes sense to support this
command in both tools.
2019-01-29 09:21:54 -06:00
Mario Limonciello
46aaee8cec fu-tool: Add support for an 'update' command to fwupdtool
This will perform updates with all currently present metadata.

It is "intended" for usage with local metadata repositories referring
to local files.

fwupdtool however does also support fetching a file from the web
and if the metadata refers to the file on the web it should also work
for that.
2019-01-11 12:59:00 +00:00
Mario Limonciello
62f8486ffe fwupdmgr/fwupdtool: Move monitor command to fwupdtool
This command is used for monitoring events from the daemon and normally
used only by power users or developers.
2018-10-18 19:36:59 +01:00
Mario Limonciello
f6d01b16de fwupdmgr/fwupdtool: Move firmware builder from fwupdmgr to fwupdtool
This command is really a power user command and should live in
fwupdtool with similar debugging and development features.
2018-10-18 19:36:59 +01:00
Richard Hughes
1d894f13cc trivial: Move the hwids debug functionality to fwupdtool 2018-08-31 16:39:09 +01:00
Mario Limonciello
716ab27c17 Add get-details command to fwupdtool 2018-05-29 13:35:44 -05:00
Mario Limonciello
b900c09ced trivial: add bash completion for get-plugins 2018-05-22 16:03:14 -05:00