libfwupdplugin: add support for firmware-attributes

This commit is contained in:
Mario Limonciello 2021-06-22 13:54:43 -05:00 committed by Mario Limonciello
parent b9965d4d5c
commit d20a95458d
2 changed files with 8 additions and 0 deletions

View File

@ -1239,6 +1239,12 @@ fu_common_get_path (FuPathKind path_kind)
/* /run/lock */
case FU_PATH_KIND_LOCKDIR:
return g_strdup ("/run/lock");
/* /sys/class/firmware-attributes */
case FU_PATH_KIND_SYSFSDIR_FW_ATTRIB:
tmp = g_getenv ("FWUPD_SYSFSFWATTRIBDIR");
if (tmp != NULL)
return g_strdup (tmp);
return g_strdup ("/sys/class/firmware-attributes");
case FU_PATH_KIND_OFFLINE_TRIGGER:
tmp = g_getenv ("FWUPD_OFFLINE_TRIGGER");
if (tmp != NULL)

View File

@ -67,6 +67,7 @@ typedef guint FuEndianType;
* @FU_PATH_KIND_SYSFSDIR_SECURITY: The sysfs security location (IE /sys/kernel/security)
* @FU_PATH_KIND_ACPI_TABLES: The location of the ACPI tables
* @FU_PATH_KIND_LOCKDIR: The lock directory (IE /run/lock)
* @FU_PATH_KIND_SYSFSDIR_FW_ATTRIB The firmware attributes directory (IE /sys/class/firmware-attributes)
*
* Path types to use when dynamically determining a path at runtime
**/
@ -88,6 +89,7 @@ typedef enum {
FU_PATH_KIND_SYSFSDIR_SECURITY,
FU_PATH_KIND_ACPI_TABLES,
FU_PATH_KIND_LOCKDIR,
FU_PATH_KIND_SYSFSDIR_FW_ATTRIB,
/*< private >*/
FU_PATH_KIND_LAST
} FuPathKind;