mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 21:23:19 +00:00
trivial: Allow EFI application path to come from a different root
This commit is contained in:
parent
10a4824cb0
commit
e6e2bf9d97
@ -87,6 +87,7 @@ fu_uefi_get_built_app_path (GError **error)
|
|||||||
const gchar *extension = "";
|
const gchar *extension = "";
|
||||||
const gchar *suffix;
|
const gchar *suffix;
|
||||||
g_autofree gchar *source_path = NULL;
|
g_autofree gchar *source_path = NULL;
|
||||||
|
g_autofree gchar *prefix = NULL;
|
||||||
if (fu_uefi_secure_boot_enabled ())
|
if (fu_uefi_secure_boot_enabled ())
|
||||||
extension = ".signed";
|
extension = ".signed";
|
||||||
if (g_file_test (EFI_APP_LOCATION_BUILD, G_FILE_TEST_EXISTS))
|
if (g_file_test (EFI_APP_LOCATION_BUILD, G_FILE_TEST_EXISTS))
|
||||||
@ -94,8 +95,9 @@ fu_uefi_get_built_app_path (GError **error)
|
|||||||
suffix = fu_uefi_bootmgr_get_suffix (error);
|
suffix = fu_uefi_bootmgr_get_suffix (error);
|
||||||
if (suffix == NULL)
|
if (suffix == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
prefix = fu_common_get_path (FU_PATH_KIND_EFIAPPDIR);
|
||||||
source_path = g_strdup_printf ("%s/fwupd%s.efi%s",
|
source_path = g_strdup_printf ("%s/fwupd%s.efi%s",
|
||||||
EFI_APP_LOCATION,
|
prefix,
|
||||||
suffix,
|
suffix,
|
||||||
extension);
|
extension);
|
||||||
if (!g_file_test (source_path, G_FILE_TEST_EXISTS)) {
|
if (!g_file_test (source_path, G_FILE_TEST_EXISTS)) {
|
||||||
|
@ -850,6 +850,19 @@ fu_common_get_path (FuPathKind path_kind)
|
|||||||
if (tmp != NULL)
|
if (tmp != NULL)
|
||||||
return g_build_filename (tmp, DATADIR, PACKAGE_NAME, NULL);
|
return g_build_filename (tmp, DATADIR, PACKAGE_NAME, NULL);
|
||||||
return g_build_filename (DATADIR, PACKAGE_NAME, NULL);
|
return g_build_filename (DATADIR, PACKAGE_NAME, NULL);
|
||||||
|
/* /usr/libexec/fwupd/efi */
|
||||||
|
case FU_PATH_KIND_EFIAPPDIR:
|
||||||
|
tmp = g_getenv ("FWUPD_EFIAPPDIR");
|
||||||
|
if (tmp != NULL)
|
||||||
|
return g_strdup (tmp);
|
||||||
|
#ifdef EFI_APP_LOCATION
|
||||||
|
tmp = g_getenv ("SNAP");
|
||||||
|
if (tmp != NULL)
|
||||||
|
return g_build_filename (tmp, EFI_APP_LOCATION, NULL);
|
||||||
|
return g_strdup (EFI_APP_LOCATION);
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
/* /etc/fwupd */
|
/* /etc/fwupd */
|
||||||
case FU_PATH_KIND_SYSCONFDIR_PKG:
|
case FU_PATH_KIND_SYSCONFDIR_PKG:
|
||||||
basedir = fu_common_get_path (FU_PATH_KIND_SYSCONFDIR);
|
basedir = fu_common_get_path (FU_PATH_KIND_SYSCONFDIR);
|
||||||
|
@ -19,6 +19,7 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
FU_PATH_KIND_CACHEDIR_PKG,
|
FU_PATH_KIND_CACHEDIR_PKG,
|
||||||
FU_PATH_KIND_DATADIR_PKG,
|
FU_PATH_KIND_DATADIR_PKG,
|
||||||
|
FU_PATH_KIND_EFIAPPDIR,
|
||||||
FU_PATH_KIND_LOCALSTATEDIR,
|
FU_PATH_KIND_LOCALSTATEDIR,
|
||||||
FU_PATH_KIND_LOCALSTATEDIR_PKG,
|
FU_PATH_KIND_LOCALSTATEDIR_PKG,
|
||||||
FU_PATH_KIND_PLUGINDIR_PKG,
|
FU_PATH_KIND_PLUGINDIR_PKG,
|
||||||
|
Loading…
Reference in New Issue
Block a user