Skip to content

Commit

Permalink
Add a new path for configuring runtime firmware load path
Browse files Browse the repository at this point in the history
The kernel allows configuring this, and certain plugins will use this
path to be able to load firmware in the kernel driver through runtime,
but to flash to the device.
  • Loading branch information
superm1 authored and hughsie committed Jul 13, 2021
1 parent f7a23d7 commit da89516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libfwupdplugin/fu-common.c
Expand Up @@ -1175,6 +1175,12 @@ fu_common_get_path (FuPathKind path_kind)
if (tmp != NULL)
return g_strdup (tmp);
return g_strdup ("/sys/firmware/acpi/tables");
/* /sys/module/firmware_class/parameters/path */
case FU_PATH_KIND_FIRMWARE_SEARCH:
tmp = g_getenv ("FWUPD_FIRMWARESEARCH");
if (tmp != NULL)
return g_strdup (tmp);
return g_strdup ("/sys/module/firmware_class/parameters/path");
/* /etc */
case FU_PATH_KIND_SYSCONFDIR:
tmp = g_getenv ("FWUPD_SYSCONFDIR");
Expand Down
2 changes: 2 additions & 0 deletions libfwupdplugin/fu-common.h
Expand Up @@ -68,6 +68,7 @@ typedef guint FuEndianType;
* @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)
* @FU_PATH_KIND_FIRMWARE_SEARCH: The path to configure the kernel policy for runtime loading other than /lib/firmware (IE /sys/module/firmware_class/parameters/path)
*
* Path types to use when dynamically determining a path at runtime
**/
Expand All @@ -90,6 +91,7 @@ typedef enum {
FU_PATH_KIND_ACPI_TABLES,
FU_PATH_KIND_LOCKDIR,
FU_PATH_KIND_SYSFSDIR_FW_ATTRIB,
FU_PATH_KIND_FIRMWARE_SEARCH,
/*< private >*/
FU_PATH_KIND_LAST
} FuPathKind;
Expand Down

0 comments on commit da89516

Please sign in to comment.