From 8b0c057f8f7d10bb015675e7e6fdc08743d8c260 Mon Sep 17 00:00:00 2001 From: "hugh chao(hugh712)" Date: Thu, 18 Aug 2022 10:49:32 +0800 Subject: [PATCH] Install all devices with the same composite id in fwupdtool --- src/fu-tool.c | 11 +++++++++-- src/fu-util.c | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fu-tool.c b/src/fu-tool.c index 6134afe94..aaca6e438 100644 --- a/src/fu-tool.c +++ b/src/fu-tool.c @@ -1258,7 +1258,13 @@ fu_util_install(FuUtilPrivate *priv, gchar **values, GError **error) if (!fu_util_prompt_warning_fde(FWUPD_DEVICE(device), error)) return FALSE; } - devices_possible = g_ptr_array_new_with_free_func((GDestroyNotify)g_object_unref); + devices_possible = + fu_engine_get_devices_by_composite_id(priv->engine, + fu_device_get_composite_id(device), + error); + if (devices_possible == NULL) + return FALSE; + g_ptr_array_add(devices_possible, device); } else { g_set_error_literal(error, @@ -3626,7 +3632,8 @@ main(int argc, char *argv[]) /* TRANSLATORS: command argument: uppercase, spaces->dashes */ _("FILE [DEVICE-ID|GUID]"), /* TRANSLATORS: command description */ - _("Install a firmware file on this hardware"), + _("Install a specific firmware on a device, all possible devices" + " will also be installed once the CAB matches"), fu_util_install); fu_util_cmd_array_add(cmd_array, "reinstall", diff --git a/src/fu-util.c b/src/fu-util.c index a3d009b46..a2eb7de95 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -4229,7 +4229,8 @@ main(int argc, char *argv[]) /* TRANSLATORS: command argument: uppercase, spaces->dashes */ _("[DEVICE-ID|GUID] [VERSION]"), /* TRANSLATORS: command description */ - _("Install a specific firmware version on a device"), + _("Install a specific firmware on a device, all possible devices" + " will also be installed once the CAB matches"), fu_util_install); fu_util_cmd_array_add(cmd_array, "local-install",