Allow devices to be updatable, but only when upgrading a proxy device

This commit is contained in:
Richard Hughes 2020-04-17 11:47:04 +01:00
parent 395f936b72
commit 8500b4f233
4 changed files with 10 additions and 2 deletions

View File

@ -193,6 +193,8 @@ fwupd_device_flag_to_string (FwupdDeviceFlags device_flag)
return "add-counterpart-guids";
if (device_flag == FWUPD_DEVICE_FLAG_NO_GUID_MATCHING)
return "no-guid-matching";
if (device_flag == FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)
return "updatable-hidden";
if (device_flag == FWUPD_DEVICE_FLAG_UNKNOWN)
return "unknown";
return NULL;
@ -287,6 +289,8 @@ fwupd_device_flag_from_string (const gchar *device_flag)
return FWUPD_DEVICE_FLAG_ADD_COUNTERPART_GUIDS;
if (g_strcmp0 (device_flag, "no-guid-matching") == 0)
return FWUPD_DEVICE_FLAG_NO_GUID_MATCHING;
if (g_strcmp0 (device_flag, "updatable-hidden") == 0)
return FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN;
return FWUPD_DEVICE_FLAG_UNKNOWN;
}

View File

@ -104,6 +104,7 @@ typedef enum {
* @FWUPD_DEVICE_FLAG_MD_SET_VERFMT: Set the device version format from the metadata if available
* @FWUPD_DEVICE_FLAG_ADD_COUNTERPART_GUIDS: Add counterpart GUIDs from an alternate mode like bootloader
* @FWUPD_DEVICE_FLAG_NO_GUID_MATCHING: Force an explicit ID match when adding devices to the device list
* @FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN: Device is updatable but should not be called by the client
*
* The device flags.
**/
@ -145,6 +146,7 @@ typedef enum {
#define FWUPD_DEVICE_FLAG_MD_SET_VERFMT (1llu << 34) /* Since: 1.4.0 */
#define FWUPD_DEVICE_FLAG_ADD_COUNTERPART_GUIDS (1llu << 35) /* Since: 1.4.0 */
#define FWUPD_DEVICE_FLAG_NO_GUID_MATCHING (1llu << 36) /* Since: 1.4.1 */
#define FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN (1llu << 37) /* Since: 1.4.1 */
#define FWUPD_DEVICE_FLAG_UNKNOWN G_MAXUINT64 /* Since: 0.7.3 */
typedef guint64 FwupdDeviceFlags;

View File

@ -276,7 +276,8 @@ fu_install_task_check_requirements (FuInstallTask *self,
}
/* no update abilities */
if (!fu_device_has_flag (self->device, FWUPD_DEVICE_FLAG_UPDATABLE)) {
if (!fu_device_has_flag (self->device, FWUPD_DEVICE_FLAG_UPDATABLE) &&
!fu_device_has_flag (self->device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)) {
g_set_error (error,
FWUPD_ERROR,
FWUPD_ERROR_NOT_SUPPORTED,

View File

@ -962,7 +962,8 @@ fu_util_device_flag_to_string (guint64 device_flag)
/* TRANSLATORS: Device cannot be removed easily*/
return _("Internal device");
}
if (device_flag == FWUPD_DEVICE_FLAG_UPDATABLE) {
if (device_flag == FWUPD_DEVICE_FLAG_UPDATABLE ||
device_flag == FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN) {
/* TRANSLATORS: Device is updatable in this or any other mode */
return _("Updatable");
}