mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 21:08:29 +00:00
Remove some deprecated API
This commit is contained in:
parent
4ee6cce9b8
commit
f9e6aa16a3
@ -52,3 +52,4 @@ Remember: Plugins should be upstream!
|
|||||||
* `fu_usb_device_new_full()`: Use `fu_usb_device_new()` instead -- as the latter always specifies the context.
|
* `fu_usb_device_new_full()`: Use `fu_usb_device_new()` instead -- as the latter always specifies the context.
|
||||||
* `fu_device_new_with_context()`: Use `fu_device_new()` instead -- as the latter always specifies the context.
|
* `fu_device_new_with_context()`: Use `fu_device_new()` instead -- as the latter always specifies the context.
|
||||||
* `fu_plugin_has_custom_flag()`: Use `fu_plugin_has_private_flag()` instead.
|
* `fu_plugin_has_custom_flag()`: Use `fu_plugin_has_private_flag()` instead.
|
||||||
|
* `fu_efivar_secure_boot_enabled_full()`: Use `fu_efivar_secure_boot_enabled()` instead -- as the latter always specifies the error.
|
||||||
|
@ -265,17 +265,17 @@ fu_efivar_set_data_bytes(const gchar *guid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fu_efivar_secure_boot_enabled_full:
|
* fu_efivar_secure_boot_enabled:
|
||||||
* @error: (nullable): optional return location for an error
|
* @error: (nullable): optional return location for an error
|
||||||
*
|
*
|
||||||
* Determines if secure boot was enabled
|
* Determines if secure boot was enabled
|
||||||
*
|
*
|
||||||
* Returns: %TRUE on success
|
* Returns: %TRUE on success
|
||||||
*
|
*
|
||||||
* Since: 1.5.0
|
* Since: 1.8.2
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
fu_efivar_secure_boot_enabled_full(GError **error)
|
fu_efivar_secure_boot_enabled(GError **error)
|
||||||
{
|
{
|
||||||
gsize data_size = 0;
|
gsize data_size = 0;
|
||||||
g_autofree guint8 *data = NULL;
|
g_autofree guint8 *data = NULL;
|
||||||
@ -301,18 +301,3 @@ fu_efivar_secure_boot_enabled_full(GError **error)
|
|||||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_FOUND, "SecureBoot is not enabled");
|
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_FOUND, "SecureBoot is not enabled");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* fu_efivar_secure_boot_enabled:
|
|
||||||
*
|
|
||||||
* Determines if secure boot was enabled
|
|
||||||
*
|
|
||||||
* Returns: %TRUE on success
|
|
||||||
*
|
|
||||||
* Since: 1.4.0
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
fu_efivar_secure_boot_enabled(void)
|
|
||||||
{
|
|
||||||
return fu_efivar_secure_boot_enabled_full(NULL);
|
|
||||||
}
|
|
||||||
|
@ -64,6 +64,4 @@ fu_efivar_delete_with_glob(const gchar *guid,
|
|||||||
GPtrArray *
|
GPtrArray *
|
||||||
fu_efivar_get_names(const gchar *guid, GError **error) G_GNUC_WARN_UNUSED_RESULT;
|
fu_efivar_get_names(const gchar *guid, GError **error) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
gboolean
|
gboolean
|
||||||
fu_efivar_secure_boot_enabled(void);
|
fu_efivar_secure_boot_enabled(GError **error);
|
||||||
gboolean
|
|
||||||
fu_efivar_secure_boot_enabled_full(GError **error);
|
|
||||||
|
@ -465,7 +465,6 @@ LIBFWUPDPLUGIN_1.4.0 {
|
|||||||
fu_efivar_delete_with_glob;
|
fu_efivar_delete_with_glob;
|
||||||
fu_efivar_exists;
|
fu_efivar_exists;
|
||||||
fu_efivar_get_data;
|
fu_efivar_get_data;
|
||||||
fu_efivar_secure_boot_enabled;
|
|
||||||
fu_efivar_set_data;
|
fu_efivar_set_data;
|
||||||
fu_efivar_supported;
|
fu_efivar_supported;
|
||||||
fu_hid_device_get_interface;
|
fu_hid_device_get_interface;
|
||||||
@ -535,7 +534,6 @@ LIBFWUPDPLUGIN_1.5.0 {
|
|||||||
fu_device_report_metadata_pre;
|
fu_device_report_metadata_pre;
|
||||||
fu_device_unbind_driver;
|
fu_device_unbind_driver;
|
||||||
fu_efivar_get_data_bytes;
|
fu_efivar_get_data_bytes;
|
||||||
fu_efivar_secure_boot_enabled_full;
|
|
||||||
fu_efivar_set_data_bytes;
|
fu_efivar_set_data_bytes;
|
||||||
fu_firmware_add_flag;
|
fu_firmware_add_flag;
|
||||||
fu_firmware_build;
|
fu_firmware_build;
|
||||||
@ -1045,6 +1043,7 @@ LIBFWUPDPLUGIN_1.8.1 {
|
|||||||
LIBFWUPDPLUGIN_1.8.2 {
|
LIBFWUPDPLUGIN_1.8.2 {
|
||||||
global:
|
global:
|
||||||
fu_device_new;
|
fu_device_new;
|
||||||
|
fu_efivar_secure_boot_enabled;
|
||||||
fu_progress_add_step_full;
|
fu_progress_add_step_full;
|
||||||
fu_progress_get_name;
|
fu_progress_get_name;
|
||||||
fu_progress_set_name;
|
fu_progress_set_name;
|
||||||
|
@ -173,7 +173,7 @@ fu_plugin_uefi_capsule_add_security_attrs(FuPlugin *plugin, FuSecurityAttrs *att
|
|||||||
fu_security_attrs_append(attrs, attr);
|
fu_security_attrs_append(attrs, attr);
|
||||||
|
|
||||||
/* SB not available or disabled */
|
/* SB not available or disabled */
|
||||||
if (!fu_efivar_secure_boot_enabled_full(&error)) {
|
if (!fu_efivar_secure_boot_enabled(&error)) {
|
||||||
if (g_error_matches(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
if (g_error_matches(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||||
fwupd_security_attr_set_result(attr, FWUPD_SECURITY_ATTR_RESULT_NOT_FOUND);
|
fwupd_security_attr_set_result(attr, FWUPD_SECURITY_ATTR_RESULT_NOT_FOUND);
|
||||||
return;
|
return;
|
||||||
@ -608,7 +608,7 @@ static void
|
|||||||
fu_plugin_uefi_capsule_test_secure_boot(FuPlugin *plugin)
|
fu_plugin_uefi_capsule_test_secure_boot(FuPlugin *plugin)
|
||||||
{
|
{
|
||||||
const gchar *result_str = "Disabled";
|
const gchar *result_str = "Disabled";
|
||||||
if (fu_efivar_secure_boot_enabled())
|
if (fu_efivar_secure_boot_enabled(NULL))
|
||||||
result_str = "Enabled";
|
result_str = "Enabled";
|
||||||
fu_plugin_add_report_metadata(plugin, "SecureBoot", result_str);
|
fu_plugin_add_report_metadata(plugin, "SecureBoot", result_str);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ fu_uefi_bootmgr_bootnext(FuDevice *device,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* test if we should use shim */
|
/* test if we should use shim */
|
||||||
secure_boot = fu_efivar_secure_boot_enabled();
|
secure_boot = fu_efivar_secure_boot_enabled(NULL);
|
||||||
if (secure_boot) {
|
if (secure_boot) {
|
||||||
/* test to make sure shim is there if we need it */
|
/* test to make sure shim is there if we need it */
|
||||||
shim_app = fu_uefi_get_esp_app_path(device, esp_path, "shim", error);
|
shim_app = fu_uefi_get_esp_app_path(device, esp_path, "shim", error);
|
||||||
|
@ -106,7 +106,7 @@ fu_uefi_get_built_app_path(GError **error)
|
|||||||
source_path_exists = g_file_test(source_path, G_FILE_TEST_EXISTS);
|
source_path_exists = g_file_test(source_path, G_FILE_TEST_EXISTS);
|
||||||
source_path_signed_exists = g_file_test(source_path_signed, G_FILE_TEST_EXISTS);
|
source_path_signed_exists = g_file_test(source_path_signed, G_FILE_TEST_EXISTS);
|
||||||
|
|
||||||
if (fu_efivar_secure_boot_enabled()) {
|
if (fu_efivar_secure_boot_enabled(NULL)) {
|
||||||
if (!source_path_signed_exists) {
|
if (!source_path_signed_exists) {
|
||||||
g_set_error(error,
|
g_set_error(error,
|
||||||
G_IO_ERROR,
|
G_IO_ERROR,
|
||||||
|
@ -511,7 +511,7 @@ fu_uefi_check_asset(FuDevice *device, GError **error)
|
|||||||
{
|
{
|
||||||
g_autofree gchar *source_app = fu_uefi_get_built_app_path(error);
|
g_autofree gchar *source_app = fu_uefi_get_built_app_path(error);
|
||||||
if (source_app == NULL) {
|
if (source_app == NULL) {
|
||||||
if (fu_efivar_secure_boot_enabled())
|
if (fu_efivar_secure_boot_enabled(NULL))
|
||||||
g_prefix_error(error, "missing signed bootloader for secure boot: ");
|
g_prefix_error(error, "missing signed bootloader for secure boot: ");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user