From d20a95458de1fc2d127189a173d0007c05c8b66f Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 22 Jun 2021 13:54:43 -0500 Subject: [PATCH] libfwupdplugin: add support for firmware-attributes --- libfwupdplugin/fu-common.c | 6 ++++++ libfwupdplugin/fu-common.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libfwupdplugin/fu-common.c b/libfwupdplugin/fu-common.c index 986713cab..5007b3fa1 100644 --- a/libfwupdplugin/fu-common.c +++ b/libfwupdplugin/fu-common.c @@ -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) diff --git a/libfwupdplugin/fu-common.h b/libfwupdplugin/fu-common.h index f03e0c224..4e49b60d9 100644 --- a/libfwupdplugin/fu-common.h +++ b/libfwupdplugin/fu-common.h @@ -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;