Add a new path for configuring runtime firmware load path

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.
This commit is contained in:
Mario Limonciello 2021-04-21 14:54:14 -05:00 committed by Richard Hughes
parent f7a23d7c88
commit da895169a7
2 changed files with 8 additions and 0 deletions

View File

@ -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");

View File

@ -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
**/
@ -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;