mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 05:17:31 +00:00
trivial: Use the new fwup_get_esp_mountpoint() call to log the defined ESP
This commit is contained in:
parent
d421da0597
commit
54dcd29b3c
@ -197,6 +197,9 @@ endif
|
|||||||
|
|
||||||
if get_option('plugin_uefi')
|
if get_option('plugin_uefi')
|
||||||
fwup = dependency('fwup', version : '>= 5')
|
fwup = dependency('fwup', version : '>= 5')
|
||||||
|
if fwup.version().version_compare('>= 11')
|
||||||
|
conf.set('HAVE_FWUP_GET_ESP_MOUNTPOINT', '1')
|
||||||
|
endif
|
||||||
if fwup.version().version_compare('>= 10')
|
if fwup.version().version_compare('>= 10')
|
||||||
conf.set('HAVE_FWUP_GET_BGRT_INFO', '1')
|
conf.set('HAVE_FWUP_GET_BGRT_INFO', '1')
|
||||||
conf.set('HAVE_FWUP_CUSTOM_ESP', '1')
|
conf.set('HAVE_FWUP_CUSTOM_ESP', '1')
|
||||||
|
@ -597,6 +597,8 @@ fu_plugin_uefi_set_custom_mountpoint (FuPlugin *plugin, GError **error)
|
|||||||
FuPluginData *data = fu_plugin_get_data (plugin);
|
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||||
const gchar *key = "OverrideESPMountPoint";
|
const gchar *key = "OverrideESPMountPoint";
|
||||||
|
|
||||||
|
/* load from file and keep @key ref'd for the lifetime of the plugin as
|
||||||
|
* libfwupdate does not strdup the value in fwup_set_esp_mountpoint() */
|
||||||
data->esp_path = fu_plugin_get_config_value (plugin, key);
|
data->esp_path = fu_plugin_get_config_value (plugin, key);
|
||||||
if (data->esp_path != NULL) {
|
if (data->esp_path != NULL) {
|
||||||
if (!g_file_test (data->esp_path, G_FILE_TEST_IS_DIR)) {
|
if (!g_file_test (data->esp_path, G_FILE_TEST_IS_DIR)) {
|
||||||
@ -611,8 +613,6 @@ fu_plugin_uefi_set_custom_mountpoint (FuPlugin *plugin, GError **error)
|
|||||||
}
|
}
|
||||||
#ifdef HAVE_FWUP_CUSTOM_ESP
|
#ifdef HAVE_FWUP_CUSTOM_ESP
|
||||||
fwup_set_esp_mountpoint (data->esp_path);
|
fwup_set_esp_mountpoint (data->esp_path);
|
||||||
g_debug ("%s set to %s", key, data->esp_path);
|
|
||||||
fu_plugin_add_report_metadata (plugin, key, data->esp_path);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,9 +622,25 @@ fu_plugin_uefi_set_custom_mountpoint (FuPlugin *plugin, GError **error)
|
|||||||
gboolean
|
gboolean
|
||||||
fu_plugin_startup (FuPlugin *plugin, GError **error)
|
fu_plugin_startup (FuPlugin *plugin, GError **error)
|
||||||
{
|
{
|
||||||
|
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||||
|
|
||||||
/* load any overriden options */
|
/* load any overriden options */
|
||||||
if (!fu_plugin_uefi_set_custom_mountpoint (plugin, error))
|
if (!fu_plugin_uefi_set_custom_mountpoint (plugin, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* get the default compiled-in value for the ESP mountpoint */
|
||||||
|
#ifdef HAVE_FWUP_GET_ESP_MOUNTPOINT
|
||||||
|
if (data->esp_path == NULL)
|
||||||
|
data->esp_path = g_strdup (fwup_get_esp_mountpoint ());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* fall back to a sane default */
|
||||||
|
if (data->esp_path == NULL)
|
||||||
|
data->esp_path = g_strdup ("/boot/efi");
|
||||||
|
|
||||||
|
/* save in report metadata */
|
||||||
|
g_debug ("ESP mountpoint set as %s", data->esp_path);
|
||||||
|
fu_plugin_add_report_metadata (plugin, "ESPMountPoint", data->esp_path);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user