Add a new device flag "ignore-validation" that will override validation checks

This flag isn't really intended for production, but more for development
to allow setting a quirk for a device during a transition period.
This commit is contained in:
Mario Limonciello 2018-09-04 22:34:04 -05:00 committed by Mario Limonciello
parent afa5ee75ec
commit 9c3a6fd60f
2 changed files with 6 additions and 0 deletions

View File

@ -147,6 +147,8 @@ fwupd_device_flag_to_string (FwupdDeviceFlags device_flag)
return "is-bootloader";
if (device_flag == FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG)
return "wait-for-replug";
if (device_flag == FWUPD_DEVICE_FLAG_IGNORE_VALIDATION)
return "ignore-validation";
if (device_flag == FWUPD_DEVICE_FLAG_UNKNOWN)
return "unknown";
return NULL;
@ -199,6 +201,8 @@ fwupd_device_flag_from_string (const gchar *device_flag)
return FWUPD_DEVICE_FLAG_IS_BOOTLOADER;
if (g_strcmp0 (device_flag, "wait-for-replug") == 0)
return FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG;
if (g_strcmp0 (device_flag, "ignore-validation") == 0)
return FWUPD_DEVICE_FLAG_IGNORE_VALIDATION;
return FWUPD_DEVICE_FLAG_UNKNOWN;
}

View File

@ -79,6 +79,7 @@ typedef enum {
* @FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST: Install composite firmware on the parent before the child
* @FWUPD_DEVICE_FLAG_IS_BOOTLOADER: Is currently in bootloader mode
* @FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG: The hardware is waiting to be replugged
* @FWUPD_DEVICE_FLAG_IGNORE_VALIDATION: Ignore validation safety checks when flashing this device
*
* The device flags.
**/
@ -98,6 +99,7 @@ typedef enum {
#define FWUPD_DEVICE_FLAG_INSTALL_PARENT_FIRST (1u << 12) /* Since: 1.0.8 */
#define FWUPD_DEVICE_FLAG_IS_BOOTLOADER (1u << 13) /* Since: 1.0.8 */
#define FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG (1u << 14) /* Since: 1.1.2 */
#define FWUPD_DEVICE_FLAG_IGNORE_VALIDATION (1u << 15) /* Since: 1.1.2 */
#define FWUPD_DEVICE_FLAG_UNKNOWN G_MAXUINT64 /* Since: 0.7.3 */
typedef guint64 FwupdDeviceFlags;