mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 13:42:23 +00:00
trivial: Show why more devices are not marked as updatable
This commit is contained in:
parent
f56eec47b4
commit
73f6767d87
@ -59,20 +59,3 @@ fu_dell_dock_will_replug(FuDevice *device)
|
||||
fu_device_set_remove_delay(device, timeout * 1000);
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG);
|
||||
}
|
||||
|
||||
void
|
||||
fu_dell_dock_clone_updatable(FuDevice *device)
|
||||
{
|
||||
FuDevice *parent;
|
||||
parent = fu_device_get_parent(device);
|
||||
if (parent == NULL)
|
||||
return;
|
||||
if (fu_device_has_flag(parent, FWUPD_DEVICE_FLAG_UPDATABLE)) {
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
} else {
|
||||
const gchar *message = fu_device_get_update_error(parent);
|
||||
if (message != NULL)
|
||||
fu_device_set_update_error(device, message);
|
||||
fu_device_remove_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
}
|
||||
}
|
||||
|
@ -49,5 +49,3 @@ gboolean
|
||||
fu_dell_dock_set_power(FuDevice *device, guint8 target, gboolean enabled, GError **error);
|
||||
void
|
||||
fu_dell_dock_will_replug(FuDevice *device);
|
||||
void
|
||||
fu_dell_dock_clone_updatable(FuDevice *device);
|
||||
|
@ -197,6 +197,7 @@ fu_dell_dock_hub_set_progress(FuDevice *self, FuProgress *progress)
|
||||
static void
|
||||
fu_dell_dock_hub_init(FuDellDockHub *self)
|
||||
{
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_retry_set_delay(FU_DEVICE(self), 1000);
|
||||
fu_device_register_private_flag(FU_DEVICE(self),
|
||||
FU_DELL_DOCK_HUB_FLAG_HAS_BRIDGE,
|
||||
|
@ -579,17 +579,16 @@ fu_dell_dock_ec_get_dock_data(FuDevice *device, GError **error)
|
||||
if (self->data->board_id >= self->board_min) {
|
||||
if (status != FW_UPDATE_IN_PROGRESS) {
|
||||
fu_dell_dock_ec_set_board(device);
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_uninhibit(device, "update-pending");
|
||||
} else {
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION);
|
||||
fu_device_set_update_error(device,
|
||||
"A pending update will be completed "
|
||||
"next time the dock is "
|
||||
"unplugged from your computer");
|
||||
fu_device_inhibit(device,
|
||||
"update-pending",
|
||||
"A pending update will be completed next time the dock "
|
||||
"is unplugged from your computer");
|
||||
}
|
||||
} else {
|
||||
g_warning("This utility does not support this board, disabling updates for %s",
|
||||
fu_device_get_name(device));
|
||||
fu_device_inhibit(device, "not-supported", "Utility does not support this board");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1014,6 +1013,8 @@ fu_dell_dock_ec_init(FuDellDockEc *self)
|
||||
self->data = g_new0(FuDellDockDockDataStructure, 1);
|
||||
self->raw_versions = g_new0(FuDellDockDockPackageFWVersion, 1);
|
||||
fu_device_add_protocol(FU_DEVICE(self), "com.dell.dock");
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHIBIT_CHILDREN);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1153,8 +1153,6 @@ fu_dell_dock_mst_setup(FuDevice *device, GError **error)
|
||||
fu_device_set_version(device, version);
|
||||
}
|
||||
|
||||
fu_dell_dock_clone_updatable(device);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1237,6 +1235,7 @@ static void
|
||||
fu_dell_dock_mst_init(FuDellDockMst *self)
|
||||
{
|
||||
fu_device_add_protocol(FU_DEVICE(self), "com.synaptics.mst");
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -215,8 +215,6 @@ fu_dell_dock_tbt_setup(FuDevice *device, GError **error)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
fu_dell_dock_clone_updatable(device);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -275,6 +273,7 @@ static void
|
||||
fu_dell_dock_tbt_init(FuDellDockTbt *self)
|
||||
{
|
||||
fu_device_add_protocol(FU_DEVICE(self), "com.intel.thunderbolt");
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -51,9 +51,6 @@ fu_dell_dock_status_setup(FuDevice *device, GError **error)
|
||||
fu_device_set_version_format(device, FWUPD_VERSION_FORMAT_QUAD);
|
||||
fu_device_set_version(device, dynamic_version);
|
||||
fu_device_set_logical_id(FU_DEVICE(device), "status");
|
||||
|
||||
fu_dell_dock_clone_updatable(device);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -160,6 +157,7 @@ static void
|
||||
fu_dell_dock_status_init(FuDellDockStatus *self)
|
||||
{
|
||||
fu_device_add_protocol(FU_DEVICE(self), "com.dell.dock");
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -575,9 +575,6 @@ fu_dell_dock_usb4_probe(FuDevice *device, GError **error)
|
||||
self->intf_nr = GR_USB_INTERFACE_NUMBER;
|
||||
self->blocksz = GR_USB_BLOCK_SIZE;
|
||||
fu_device_set_logical_id(FU_DEVICE(device), "usb4");
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE);
|
||||
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHERIT_ACTIVATION);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -591,6 +588,9 @@ static void
|
||||
fu_dell_dock_usb4_init(FuDellDockUsb4 *self)
|
||||
{
|
||||
fu_device_add_protocol(FU_DEVICE(self), "com.intel.thunderbolt");
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE);
|
||||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHERIT_ACTIVATION);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -183,9 +183,6 @@ fu_plugin_dell_dock_backend_device_added(FuPlugin *plugin, FuDevice *device, GEr
|
||||
|
||||
fu_plugin_device_add(plugin, FU_DEVICE(hub));
|
||||
|
||||
/* clear updatable flag if parent doesn't have it */
|
||||
fu_dell_dock_clone_updatable(FU_DEVICE(hub));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -233,12 +230,6 @@ fu_plugin_dell_dock_device_registered(FuPlugin *plugin, FuDevice *device)
|
||||
if (g_strcmp0(fu_device_get_plugin(device), "dell_dock") == 0 &&
|
||||
(FU_IS_DELL_DOCK_EC(device) || FU_IS_DELL_DOCK_USB4(device)))
|
||||
fu_plugin_dell_dock_separate_activation(plugin);
|
||||
|
||||
if (g_strcmp0(fu_device_get_plugin(device), "thunderbolt") != 0 ||
|
||||
fu_device_has_flag(device, FWUPD_DEVICE_FLAG_INTERNAL))
|
||||
return;
|
||||
/* clone updatable flag to leave in needs activation state */
|
||||
fu_dell_dock_clone_updatable(device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -637,7 +637,7 @@ fu_plugin_uefi_capsule_unlock(FuPlugin *plugin, FuDevice *device, GError **error
|
||||
/* clone the info from real device but prevent it from being flashed */
|
||||
device_flags_alt = fu_device_get_flags(device_alt);
|
||||
fu_device_set_flags(device, device_flags_alt);
|
||||
fu_device_remove_flag(device_alt, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
fu_device_inhibit(device_alt, "alt-device", "Preventing upgrades as alternate");
|
||||
|
||||
/* make sure that this unlocked device can be updated */
|
||||
fu_device_set_version_format(device, FWUPD_VERSION_FORMAT_QUAD);
|
||||
|
@ -434,9 +434,6 @@ fu_device_list_device_delayed_remove_cb(gpointer user_data)
|
||||
static void
|
||||
fu_device_list_remove_with_delay(FuDeviceItem *item)
|
||||
{
|
||||
/* we can't do anything with an unconnected device */
|
||||
fu_device_remove_flag(item->device, FWUPD_DEVICE_FLAG_UPDATABLE);
|
||||
|
||||
/* give the hardware time to re-enumerate or the user time to
|
||||
* re-insert the device with a magic button pressed */
|
||||
g_debug("waiting %ums for %s device removal",
|
||||
@ -478,6 +475,9 @@ fu_device_list_remove(FuDeviceList *self, FuDevice *device)
|
||||
return;
|
||||
}
|
||||
|
||||
/* we can't do anything with an unconnected device */
|
||||
fu_device_inhibit(item->device, "unconnected", "Device has been removed");
|
||||
|
||||
/* ensure never fired if the remove delay is changed */
|
||||
if (item->remove_id > 0) {
|
||||
g_source_remove(item->remove_id);
|
||||
@ -584,6 +584,7 @@ fu_device_list_clear_wait_for_replug(FuDeviceList *self, FuDeviceItem *item)
|
||||
fu_device_remove_flag(item->device_old, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG);
|
||||
}
|
||||
}
|
||||
fu_device_uninhibit(item->device, "unconnected");
|
||||
|
||||
/* optional debug */
|
||||
if (g_getenv("FWUPD_DEVICE_LIST_VERBOSE") != NULL) {
|
||||
@ -747,6 +748,7 @@ fu_device_list_add(FuDeviceList *self, FuDevice *device)
|
||||
/* same ID, different object */
|
||||
g_debug("found existing device %s, reusing item", fu_device_get_id(item->device));
|
||||
fu_device_list_replace(self, item, device);
|
||||
fu_device_uninhibit(device, "unconnected");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -761,6 +763,7 @@ fu_device_list_add(FuDeviceList *self, FuDevice *device)
|
||||
fu_device_get_plugin(item->device),
|
||||
fu_device_get_plugin(device));
|
||||
fu_device_list_replace(self, item, device);
|
||||
fu_device_uninhibit(device, "unconnected");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -775,6 +778,7 @@ fu_device_list_add(FuDeviceList *self, FuDevice *device)
|
||||
fu_device_get_plugin(item->device),
|
||||
fu_device_get_plugin(device));
|
||||
fu_device_list_replace(self, item, device);
|
||||
fu_device_uninhibit(device, "unconnected");
|
||||
return;
|
||||
} else {
|
||||
g_debug("not adding matching %s for device add, use "
|
||||
|
Loading…
Reference in New Issue
Block a user