mirror of
https://git.proxmox.com/git/fwupd
synced 2025-04-29 01:50:33 +00:00
Allow using requirements <firmware depth=0> with no parent
In this context a depth of 0 with no siblings means 'an only child' which in practice means 'the device itself'.
This commit is contained in:
parent
0378f9ffdb
commit
106de6f3fb
@ -1922,14 +1922,20 @@ fu_engine_check_requirement_firmware(FuEngine *self,
|
|||||||
FuDevice *child = NULL;
|
FuDevice *child = NULL;
|
||||||
FuDevice *parent = fu_device_get_parent(device_actual);
|
FuDevice *parent = fu_device_get_parent(device_actual);
|
||||||
GPtrArray *children;
|
GPtrArray *children;
|
||||||
|
|
||||||
|
/* no parent, so look for GUIDs on this device */
|
||||||
if (parent == NULL) {
|
if (parent == NULL) {
|
||||||
|
if (!fu_device_has_guids_any(device_actual, guids)) {
|
||||||
g_set_error(error,
|
g_set_error(error,
|
||||||
FWUPD_ERROR,
|
FWUPD_ERROR,
|
||||||
FWUPD_ERROR_NOT_SUPPORTED,
|
FWUPD_ERROR_NOT_SUPPORTED,
|
||||||
"No parent specified for device %s",
|
"No GUID of %s on self device %s",
|
||||||
|
xb_node_get_text(req),
|
||||||
fu_device_get_name(device_actual));
|
fu_device_get_name(device_actual));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
children = fu_device_get_children(parent);
|
children = fu_device_get_children(parent);
|
||||||
for (guint i = 0; i < children->len; i++) {
|
for (guint i = 0; i < children->len; i++) {
|
||||||
child = g_ptr_array_index(children, i);
|
child = g_ptr_array_index(children, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user