Allow marking a device as EOL

This probably means it is unlikely to get any new security updates.
This commit is contained in:
Richard Hughes 2022-02-04 16:31:31 +00:00
parent 930e6f4e52
commit 31dacb8687
4 changed files with 19 additions and 0 deletions

View File

@ -201,6 +201,8 @@ fwupd_device_flag_to_string(FwupdDeviceFlags device_flag)
return "unreachable";
if (device_flag == FWUPD_DEVICE_FLAG_AFFECTS_FDE)
return "affects-fde";
if (device_flag == FWUPD_DEVICE_FLAG_END_OF_LIFE)
return "end-of-life";
if (device_flag == FWUPD_DEVICE_FLAG_UNKNOWN)
return "unknown";
return NULL;
@ -312,6 +314,8 @@ fwupd_device_flag_from_string(const gchar *device_flag)
return FWUPD_DEVICE_FLAG_UNREACHABLE;
if (g_strcmp0(device_flag, "affects-fde") == 0)
return FWUPD_DEVICE_FLAG_AFFECTS_FDE;
if (g_strcmp0(device_flag, "end-of-life") == 0)
return FWUPD_DEVICE_FLAG_END_OF_LIFE;
return FWUPD_DEVICE_FLAG_UNKNOWN;
}

View File

@ -495,6 +495,15 @@ typedef enum {
* Since: 1.7.1
*/
#define FWUPD_DEVICE_FLAG_AFFECTS_FDE (1llu << 45)
/**
* FWUPD_DEVICE_FLAG_END_OF_LIFE:
*
* The device is no longer supported by the original hardware vendor as it is considered
* end-of-life. It it unlikely to receive firmware updates, even for security issues.
*
* Since: 1.7.5
*/
#define FWUPD_DEVICE_FLAG_END_OF_LIFE (1llu << 46)
/**
* FWUPD_DEVICE_FLAG_UNKNOWN:
*

View File

@ -762,6 +762,8 @@ fu_engine_set_release_from_appstream(FuEngine *self,
fwupd_release_set_update_image(rel, tmp);
}
}
if (xb_node_get_attr(release, "date_eol") != NULL)
fu_device_add_flag(dev, FWUPD_DEVICE_FLAG_END_OF_LIFE);
/* sort the locations by scheme */
g_ptr_array_sort_with_data(fwupd_release_get_locations(rel),

View File

@ -1238,6 +1238,10 @@ fu_util_device_flag_to_string(guint64 device_flag)
/* TRANSLATORS: we might ask the user the recovery key when next booting Windows */
return _("Full disk encryption secrets may be invalidated when updating");
}
if (device_flag == FWUPD_DEVICE_FLAG_END_OF_LIFE) {
/* TRANSLATORS: the vendor is no longer supporting the device */
return _("End of life");
}
if (device_flag == FWUPD_DEVICE_FLAG_SKIPS_RESTART) {
/* skip */
return NULL;