uefi: Rename to uefi-capsule

Rename the plugin to make it clearer of the scope.

Based on a patch from Mario Limonciello <mario.limonciello@dell.com>
This commit is contained in:
Richard Hughes 2021-01-05 09:53:54 +00:00
parent 364e2685ca
commit ee2e2c3674
92 changed files with 103 additions and 96 deletions

View File

@ -18,7 +18,7 @@ cp -R ../../../!(build|dist) .
popd
chown nobody . -R
# install and run TPM simulator necessary for plugins/uefi/uefi-self-test
# install and run TPM simulator necessary for plugins/uefi-capsule/uefi-self-test
pacman -Syu --noconfirm swtpm tpm2-tools
swtpm socket --tpm2 --server port=2321 --ctrl type=tcp,port=2322 --flags not-need-init --tpmstate "dir=$PWD" &
trap "kill $!" EXIT

View File

@ -18,7 +18,7 @@ meson .. \
-Dpolkit=false \
-Dplugin_coreboot=false \
-Dplugin_flashrom=false \
-Dplugin_uefi=false \
-Dplugin_uefi_capsule=false \
-Dplugin_redfish=false \
-Dplugin_altos=false \
-Dplugin_dell=false \

View File

@ -14,7 +14,7 @@ mkdir -p build
cd build
meson .. \
--werror \
-Dplugin_uefi=false \
-Dplugin_uefi_capsule=false \
-Dplugin_dell=false \
-Dplugin_modem_manager=false \
-Dplugin_synaptics=true \

View File

@ -17,7 +17,7 @@ meson .. \
--cross-file s390x_cross.txt \
--werror \
-Dplugin_flashrom=false \
-Dplugin_uefi=false \
-Dplugin_uefi_capsule=false \
-Dplugin_dell=false \
-Dplugin_modem_manager=false \
-Dplugin_msr=false \

View File

@ -15,7 +15,7 @@ meson .. \
-Dplugin_flashrom=true \
-Dplugin_modem_manager=false \
-Dplugin_thunderbolt=true \
-Dplugin_uefi=true \
-Dplugin_uefi_capsule=true \
-Dplugin_dell=true \
-Dplugin_synaptics=true $@
ninja-build dist

View File

@ -8,8 +8,14 @@ if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
/etc/fwupd.conf 1.0.0~ -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/fwupd/remotes.d/fwupd.conf 1.2.7~ -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/dbus-1/system.d/org.freedesktop.fwupd.conf 1.3.2~ -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/dbus-1/system.d/org.freedesktop.fwupd.conf 1.3.2~ -- "$@"
fi
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
dpkg-maintscript-helper mv_conffile \
/etc/fwupd/uefi.conf /etc/fwupd/uefi_capsule.conf 1.5.5~ -- "$@"
fi
# Clean up from fwupdate->fwupd transition

View File

@ -38,9 +38,9 @@ else
endif
ifeq (yes,$(shell pkg-config --exists efivar && echo yes))
CONFARGS += -Dplugin_uefi=true
CONFARGS += -Dplugin_uefi_capsule=true
else
CONFARGS += -Dplugin_uefi=false
CONFARGS += -Dplugin_uefi_capsule=false
endif
ifneq ($(filter $(DEB_HOST_ARCH_CPU),i386 amd64),)

View File

@ -213,10 +213,10 @@ can be flashed using flashrom. It is probably not required on servers.
%endif
-Dplugin_thunderbolt=true \
%if 0%{?have_uefi}
-Dplugin_uefi=true \
-Dplugin_uefi_capsule=true \
-Dtpm=true \
%else
-Dplugin_uefi=false \
-Dplugin_uefi_capsule=false \
-Dtpm=false \
%endif
%if 0%{?have_dell}
@ -290,7 +290,7 @@ done
%config(noreplace)%{_sysconfdir}/fwupd/daemon.conf
%config(noreplace)%{_sysconfdir}/fwupd/upower.conf
%if 0%{?have_uefi}
%config(noreplace)%{_sysconfdir}/fwupd/uefi.conf
%config(noreplace)%{_sysconfdir}/fwupd/uefi_capsule.conf
%endif
%config(noreplace)%{_sysconfdir}/fwupd/redfish.conf
%config(noreplace)%{_sysconfdir}/fwupd/thunderbolt.conf
@ -437,7 +437,7 @@ done
%{_libdir}/fwupd-plugins-3/libfu_plugin_tpm.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_tpm_eventlog.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_bios.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_uefi.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_uefi_capsule.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_uefi_dbx.so
%{_libdir}/fwupd-plugins-3/libfu_plugin_uefi_recovery.so
%endif

View File

@ -49,7 +49,7 @@ if get_option('systemd') and build_daemon
con2.set('localstatedir', localstatedir)
con2.set('package_name', meson.project_name())
rw_directories = []
if get_option('plugin_uefi')
if get_option('plugin_uefi_capsule')
rw_directories += ['-/boot/efi', '-/efi/EFI', '-/boot/EFI']
endif

View File

@ -328,7 +328,7 @@ else
tpm2tss = dependency('', required: false)
endif
if build_standalone and get_option('plugin_uefi')
if build_standalone and get_option('plugin_uefi_capsule')
cairo = dependency('cairo')
fontconfig = cc.find_library('fontconfig')
freetype = cc.find_library('freetype')
@ -368,8 +368,8 @@ endif
if build_standalone and get_option('plugin_dell')
libsmbios_c = dependency('libsmbios_c', version : '>= 2.4.0')
conf.set('HAVE_DELL', '1')
if not get_option('plugin_uefi')
error('plugin_dell also needs plugin_uefi to work')
if not get_option('plugin_uefi_capsule')
error('plugin_dell also needs plugin_uefi_capsule to work')
endif
endif

View File

@ -16,7 +16,7 @@ option('plugin_emmc', type : 'boolean', value : true, description : 'enable eMMC
option('plugin_synaptics', type: 'boolean', value: true, description : 'enable Synaptics MST hub support')
option('plugin_thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
option('plugin_redfish', type : 'boolean', value : true, description : 'enable Redfish support')
option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI support')
option('plugin_uefi_capsule', type : 'boolean', value : true, description : 'enable UEFI support')
option('plugin_nvme', type : 'boolean', value : true, description : 'enable NVMe support')
option('plugin_modem_manager', type : 'boolean', value : false, description : 'enable ModemManager support')
option('plugin_msr', type : 'boolean', value : true, description : 'enable MSR support')

View File

@ -837,7 +837,7 @@ fu_plugin_init (FuPlugin *plugin)
data->smi_obj->fake_smbios = TRUE;
/* make sure that UEFI plugin is ready to receive devices */
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "uefi");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "uefi_capsule");
/* our TPM device is upgradable! */
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_BETTER_THAN, "tpm");

View File

@ -17,7 +17,7 @@
#include "fu-hash.h"
typedef struct {
FuPlugin *plugin_uefi;
FuPlugin *plugin_uefi_capsule;
FuPlugin *plugin_dell;
} FuTest;
@ -60,10 +60,10 @@ fu_engine_plugin_device_register_cb (FuPlugin *plugin_dell,
FuDevice *device,
gpointer user_data)
{
FuPlugin *plugin_uefi = FU_PLUGIN (user_data);
FuPlugin *plugin_uefi_capsule = FU_PLUGIN (user_data);
g_autofree gchar *dbg = fu_device_to_string (device);
g_debug ("registering device: %s", dbg);
fu_plugin_runner_device_register (plugin_uefi, device);
fu_plugin_runner_device_register (plugin_uefi_capsule, device);
}
static void
@ -94,14 +94,14 @@ fu_plugin_dell_tpm_func (gconstpointer user_data)
devices = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
added_id =
g_signal_connect (self->plugin_uefi, "device-added",
g_signal_connect (self->plugin_uefi_capsule, "device-added",
G_CALLBACK (_plugin_device_added_cb),
devices);
register_id =
g_signal_connect (self->plugin_dell, "device-register",
G_CALLBACK (fu_engine_plugin_device_register_cb),
self->plugin_uefi);
self->plugin_uefi_capsule);
ret = fu_plugin_runner_coldplug (self->plugin_dell, &error);
g_assert_no_error (error);
g_assert (ret);
@ -144,7 +144,7 @@ fu_plugin_dell_tpm_func (gconstpointer user_data)
g_assert_false (fu_device_has_flag (device_v12, FWUPD_DEVICE_FLAG_UPDATABLE));
/* try to unlock 2.0 */
ret = fu_plugin_runner_unlock (self->plugin_uefi, device_v20, &error);
ret = fu_plugin_runner_unlock (self->plugin_uefi_capsule, device_v20, &error);
g_assert_error (error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED);
g_assert_false (ret);
g_clear_error (&error);
@ -175,7 +175,7 @@ fu_plugin_dell_tpm_func (gconstpointer user_data)
/* try to unlock 2.0 */
device_v20 = _find_device_by_name (devices, "TPM 2.0");
g_assert_nonnull (device_v20);
ret = fu_plugin_runner_unlock (self->plugin_uefi, device_v20, &error);
ret = fu_plugin_runner_unlock (self->plugin_uefi_capsule, device_v20, &error);
g_assert_error (error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED);
g_assert_false (ret);
g_clear_error (&error);
@ -207,7 +207,7 @@ fu_plugin_dell_tpm_func (gconstpointer user_data)
g_assert_false (fu_device_has_flag (device_v20, FWUPD_DEVICE_FLAG_UPDATABLE));
/* try to unlock 2.0 */
ret = fu_plugin_runner_unlock (self->plugin_uefi, device_v20, &error);
ret = fu_plugin_runner_unlock (self->plugin_uefi_capsule, device_v20, &error);
g_assert_no_error (error);
g_assert (ret);
@ -242,20 +242,20 @@ fu_plugin_dell_tpm_func (gconstpointer user_data)
g_assert_false (fu_device_has_flag (device_v12, FWUPD_DEVICE_FLAG_UPDATABLE));
/* With one flash left we need an override */
ret = fu_plugin_runner_update (self->plugin_uefi, device_v20, blob_fw,
ret = fu_plugin_runner_update (self->plugin_uefi_capsule, device_v20, blob_fw,
FWUPD_INSTALL_FLAG_NONE, &error);
g_assert_error (error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED);
g_assert_false (ret);
g_clear_error (&error);
/* test override */
ret = fu_plugin_runner_update (self->plugin_uefi, device_v20, blob_fw,
ret = fu_plugin_runner_update (self->plugin_uefi_capsule, device_v20, blob_fw,
FWUPD_INSTALL_FLAG_FORCE, &error);
g_assert_no_error (error);
g_assert (ret);
/* all */
g_signal_handler_disconnect (self->plugin_uefi, added_id);
g_signal_handler_disconnect (self->plugin_uefi_capsule, added_id);
g_signal_handler_disconnect (self->plugin_dell, register_id);
}
@ -274,13 +274,13 @@ fu_plugin_dell_dock_func (gconstpointer user_data)
devices = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
added_id =
g_signal_connect (self->plugin_uefi, "device-added",
g_signal_connect (self->plugin_uefi_capsule, "device-added",
G_CALLBACK (_plugin_device_added_cb),
devices);
register_id =
g_signal_connect (self->plugin_dell, "device-register",
G_CALLBACK (fu_engine_plugin_device_register_cb),
self->plugin_uefi);
self->plugin_uefi_capsule);
/* make sure bad device doesn't trigger this */
fu_plugin_dell_inject_fake_data (self->plugin_dell,
@ -465,7 +465,7 @@ fu_plugin_dell_dock_func (gconstpointer user_data)
g_free (buf.record);
/* all */
g_signal_handler_disconnect (self->plugin_uefi, added_id);
g_signal_handler_disconnect (self->plugin_uefi_capsule, added_id);
g_signal_handler_disconnect (self->plugin_dell, register_id);
}
@ -477,14 +477,14 @@ fu_test_self_init (FuTest *self)
g_autofree gchar *pluginfn_uefi = NULL;
g_autofree gchar *pluginfn_dell = NULL;
self->plugin_uefi = fu_plugin_new ();
pluginfn_uefi = g_build_filename (PLUGINBUILDDIR, "..", "uefi",
"libfu_plugin_uefi." G_MODULE_SUFFIX,
self->plugin_uefi_capsule = fu_plugin_new ();
pluginfn_uefi = g_build_filename (PLUGINBUILDDIR, "..", "uefi-capsule",
"libfu_plugin_uefi_capsule." G_MODULE_SUFFIX,
NULL);
ret = fu_plugin_open (self->plugin_uefi, pluginfn_uefi, &error);
ret = fu_plugin_open (self->plugin_uefi_capsule, pluginfn_uefi, &error);
g_assert_no_error (error);
g_assert (ret);
ret = fu_plugin_runner_startup (self->plugin_uefi, &error);
ret = fu_plugin_runner_startup (self->plugin_uefi_capsule, &error);
g_assert_no_error (error);
g_assert (ret);
@ -503,8 +503,8 @@ fu_test_self_init (FuTest *self)
static void
fu_test_self_free (FuTest *self)
{
if (self->plugin_uefi != NULL)
g_object_unref (self->plugin_uefi);
if (self->plugin_uefi_capsule != NULL)
g_object_unref (self->plugin_uefi_capsule);
if (self->plugin_dell != NULL)
g_object_unref (self->plugin_dell);
g_free (self);

View File

@ -1 +1 @@
../uefi/tests/
../uefi-capsule/tests/

View File

@ -119,9 +119,9 @@ endif
subdir('synaptics-mst')
endif
if get_option('plugin_uefi')
if get_option('plugin_uefi_capsule')
subdir('bios')
subdir('uefi')
subdir('uefi-capsule')
subdir('uefi-recovery')
subdir('uefi-dbx')
endif

View File

@ -22,7 +22,7 @@ void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_alloc_data (plugin, sizeof (FuPluginData));
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_BEFORE, "uefi");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_BEFORE, "uefi_capsule");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "tpm");
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
}
@ -118,7 +118,7 @@ void
fu_plugin_device_registered (FuPlugin *plugin, FuDevice *device)
{
/* only care about UEFI devices from ESRT */
if (g_strcmp0 (fu_device_get_plugin (device), "uefi") == 0) {
if (g_strcmp0 (fu_device_get_plugin (device), "uefi_capsule") == 0) {
fu_plugin_device_registered_uefi (plugin, device);
return;
}

View File

@ -1,5 +1,5 @@
UEFI Support
============
UEFI Capsule Support
====================
Introduction
------------
@ -9,7 +9,7 @@ defines the software interface between an OS and platform firmware.
With the UpdateCapsule boot service it can be used to update system firmware.
If you don't want or need this functionality you can use the
`-Dplugin_uefi=false` option.
`-Dplugin_uefi_capsule=false` option.
Firmware Format
---------------
@ -55,7 +55,7 @@ Custom EFI System Partition
Since version 1.1.0 fwupd will autodetect the ESP when it is mounted on
`/boot/efi`, `/boot`, or `/efi`. A custom EFI system partition location can be
used by modifying *OverrideESPMountPoint* in `/etc/fwupd/uefi.conf`.
used by modifying *OverrideESPMountPoint* in `/etc/fwupd/uefi_capsule.conf`.
Setting an invalid directory will disable the fwupd plugin.

View File

@ -41,6 +41,7 @@ fu_plugin_init (FuPlugin *plugin)
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "tpm");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "tpm_eventlog");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "dell");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_CONFLICTS, "uefi"); /* old name */
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
}
@ -125,7 +126,7 @@ fu_plugin_add_security_attrs (FuPlugin *plugin, FuSecurityAttrs *attrs)
}
static GBytes *
fu_plugin_uefi_get_splash_data (guint width, guint height, GError **error)
fu_plugin_uefi_capsule_get_splash_data (guint width, guint height, GError **error)
{
const gchar * const *langs = g_get_language_names ();
const gchar *localedir = FWUPD_LOCALEDIR;
@ -196,7 +197,7 @@ fu_plugin_uefi_get_splash_data (guint width, guint height, GError **error)
}
static guint8
fu_plugin_uefi_calc_checksum (const guint8 *buf, gsize sz)
fu_plugin_uefi_capsule_calc_checksum (const guint8 *buf, gsize sz)
{
guint8 csum = 0;
for (gsize i = 0; i < sz; i++)
@ -205,10 +206,10 @@ fu_plugin_uefi_calc_checksum (const guint8 *buf, gsize sz)
}
static gboolean
fu_plugin_uefi_write_splash_data (FuPlugin *plugin,
FuDevice *device,
GBytes *blob,
GError **error)
fu_plugin_uefi_capsule_write_splash_data (FuPlugin *plugin,
FuDevice *device,
GBytes *blob,
GError **error)
{
FuPluginData *data = fu_plugin_get_data (plugin);
guint32 screen_x, screen_y;
@ -270,12 +271,12 @@ fu_plugin_uefi_write_splash_data (FuPlugin *plugin,
fu_uefi_bgrt_get_height (data->bgrt);
/* header, payload and image has to add to zero */
csum += fu_plugin_uefi_calc_checksum ((guint8 *) &capsule_header,
sizeof(capsule_header));
csum += fu_plugin_uefi_calc_checksum ((guint8 *) &header,
sizeof(header));
csum += fu_plugin_uefi_calc_checksum (g_bytes_get_data (blob, NULL),
g_bytes_get_size (blob));
csum += fu_plugin_uefi_capsule_calc_checksum ((guint8 *) &capsule_header,
sizeof(capsule_header));
csum += fu_plugin_uefi_capsule_calc_checksum ((guint8 *) &header,
sizeof(header));
csum += fu_plugin_uefi_capsule_calc_checksum (g_bytes_get_data (blob, NULL),
g_bytes_get_size (blob));
header.checksum = 0x100 - csum;
/* write capsule file */
@ -298,7 +299,7 @@ fu_plugin_uefi_write_splash_data (FuPlugin *plugin,
}
static gboolean
fu_plugin_uefi_update_splash (FuPlugin *plugin, FuDevice *device, GError **error)
fu_plugin_uefi_capsule_update_splash (FuPlugin *plugin, FuDevice *device, GError **error)
{
FuPluginData *data = fu_plugin_get_data (plugin);
guint best_idx = G_MAXUINT;
@ -369,14 +370,14 @@ fu_plugin_uefi_update_splash (FuPlugin *plugin, FuDevice *device, GError **error
}
/* get the raw data */
image_bmp = fu_plugin_uefi_get_splash_data (sizes[best_idx].width,
sizes[best_idx].height,
error);
image_bmp = fu_plugin_uefi_capsule_get_splash_data (sizes[best_idx].width,
sizes[best_idx].height,
error);
if (image_bmp == NULL)
return FALSE;
/* perform the upload */
return fu_plugin_uefi_write_splash_data (plugin, device, image_bmp, error);
return fu_plugin_uefi_capsule_write_splash_data (plugin, device, image_bmp, error);
}
gboolean
@ -413,7 +414,7 @@ fu_plugin_update (FuPlugin *plugin,
/* perform the update */
fu_device_set_status (device, FWUPD_STATUS_SCHEDULING);
if (!fu_plugin_uefi_update_splash (plugin, device, &error_splash)) {
if (!fu_plugin_uefi_capsule_update_splash (plugin, device, &error_splash)) {
g_debug ("failed to upload UEFI UX capsule text: %s",
error_splash->message);
}
@ -422,7 +423,7 @@ fu_plugin_update (FuPlugin *plugin,
}
static void
fu_plugin_uefi_load_config (FuPlugin *plugin, FuDevice *device)
fu_plugin_uefi_capsule_load_config (FuPlugin *plugin, FuDevice *device)
{
gboolean disable_shim;
gboolean fallback_removable_path;
@ -449,14 +450,14 @@ fu_plugin_uefi_load_config (FuPlugin *plugin, FuDevice *device)
}
static void
fu_plugin_uefi_register_proxy_device (FuPlugin *plugin, FuDevice *device)
fu_plugin_uefi_capsule_register_proxy_device (FuPlugin *plugin, FuDevice *device)
{
FuPluginData *data = fu_plugin_get_data (plugin);
g_autoptr(FuUefiDevice) dev = fu_uefi_device_new_from_dev (device);
g_autoptr(GError) error_local = NULL;
/* load all configuration variables */
fu_plugin_uefi_load_config (plugin, FU_DEVICE (dev));
fu_plugin_uefi_capsule_load_config (plugin, FU_DEVICE (dev));
if (data->esp == NULL)
data->esp = fu_common_get_esp_default (&error_local);
if (data->esp == NULL) {
@ -477,12 +478,12 @@ fu_plugin_device_registered (FuPlugin *plugin, FuDevice *device)
g_warning ("cannot create proxy device as no GUID: %s", dbg);
return;
}
fu_plugin_uefi_register_proxy_device (plugin, device);
fu_plugin_uefi_capsule_register_proxy_device (plugin, device);
}
}
static const gchar *
fu_plugin_uefi_uefi_type_to_string (FuUefiDeviceKind device_kind)
fu_plugin_uefi_capsule_uefi_type_to_string (FuUefiDeviceKind device_kind)
{
if (device_kind == FU_UEFI_DEVICE_KIND_UNKNOWN)
return "Unknown Firmware";
@ -498,19 +499,19 @@ fu_plugin_uefi_uefi_type_to_string (FuUefiDeviceKind device_kind)
}
static gchar *
fu_plugin_uefi_get_name_for_type (FuPlugin *plugin, FuUefiDeviceKind device_kind)
fu_plugin_uefi_capsule_get_name_for_type (FuPlugin *plugin, FuUefiDeviceKind device_kind)
{
GString *display_name;
/* set Display Name prefix for capsules that are not PCI cards */
display_name = g_string_new (fu_plugin_uefi_uefi_type_to_string (device_kind));
display_name = g_string_new (fu_plugin_uefi_capsule_uefi_type_to_string (device_kind));
if (device_kind == FU_UEFI_DEVICE_KIND_DEVICE_FIRMWARE)
g_string_prepend (display_name, "UEFI ");
return g_string_free (display_name, FALSE);
}
static gboolean
fu_plugin_uefi_coldplug_device (FuPlugin *plugin, FuUefiDevice *dev, GError **error)
fu_plugin_uefi_capsule_coldplug_device (FuPlugin *plugin, FuUefiDevice *dev, GError **error)
{
FuUefiDeviceKind device_kind;
@ -533,7 +534,7 @@ fu_plugin_uefi_coldplug_device (FuPlugin *plugin, FuUefiDevice *dev, GError **er
device_kind = fu_uefi_device_get_kind (dev);
if (fu_device_get_name (FU_DEVICE (dev)) == NULL) {
g_autofree gchar *name = NULL;
name = fu_plugin_uefi_get_name_for_type (plugin, device_kind);
name = fu_plugin_uefi_capsule_get_name_for_type (plugin, device_kind);
if (name != NULL)
fu_device_set_name (FU_DEVICE (dev), name);
if (device_kind != FU_UEFI_DEVICE_KIND_SYSTEM_FIRMWARE)
@ -562,7 +563,7 @@ fu_plugin_uefi_coldplug_device (FuPlugin *plugin, FuUefiDevice *dev, GError **er
}
static void
fu_plugin_uefi_test_secure_boot (FuPlugin *plugin)
fu_plugin_uefi_capsule_test_secure_boot (FuPlugin *plugin)
{
const gchar *result_str = "Disabled";
if (fu_efivar_secure_boot_enabled ())
@ -571,7 +572,7 @@ fu_plugin_uefi_test_secure_boot (FuPlugin *plugin)
}
static gboolean
fu_plugin_uefi_smbios_enabled (FuPlugin *plugin, GError **error)
fu_plugin_uefi_capsule_smbios_enabled (FuPlugin *plugin, GError **error)
{
const guint8 *data;
gsize sz;
@ -629,7 +630,7 @@ fu_plugin_startup (FuPlugin *plugin, GError **error)
return TRUE;
/* check SMBIOS for 'UEFI Specification is supported' */
if (!fu_plugin_uefi_smbios_enabled (plugin, &error_local)) {
if (!fu_plugin_uefi_capsule_smbios_enabled (plugin, &error_local)) {
g_autofree gchar *fw = fu_common_get_path (FU_PATH_KIND_SYSFSDIR_FW);
g_autofree gchar *fn = g_build_filename (fw, "efi", NULL);
if (g_file_test (fn, G_FILE_TEST_EXISTS)) {
@ -668,7 +669,7 @@ fu_plugin_startup (FuPlugin *plugin, GError **error)
}
static gboolean
fu_plugin_uefi_ensure_efivarfs_rw (GError **error)
fu_plugin_uefi_capsule_ensure_efivarfs_rw (GError **error)
{
g_autofree gchar *sysfsfwdir = fu_common_get_path (FU_PATH_KIND_SYSFSDIR_FW);
g_autofree gchar *sysfsefivardir = g_build_filename (sysfsfwdir, "efi", "efivars", NULL);
@ -779,7 +780,7 @@ fu_plugin_coldplug (FuPlugin *plugin, GError **error)
return FALSE;
/* make sure that efivarfs is rw */
if (!fu_plugin_uefi_ensure_efivarfs_rw (&error_efivarfs)) {
if (!fu_plugin_uefi_capsule_ensure_efivarfs_rw (&error_efivarfs)) {
fu_plugin_add_flag (plugin, FWUPD_PLUGIN_FLAG_EFIVAR_NOT_MOUNTED);
fu_plugin_add_flag (plugin, FWUPD_PLUGIN_FLAG_CLEAR_UPDATABLE);
fu_plugin_add_flag (plugin, FWUPD_PLUGIN_FLAG_USER_WARNING);
@ -808,18 +809,18 @@ fu_plugin_coldplug (FuPlugin *plugin, GError **error)
fu_device_set_quirks (FU_DEVICE (dev), fu_plugin_get_quirks (plugin));
if (data->esp != NULL)
fu_uefi_device_set_esp (FU_UEFI_DEVICE (dev), data->esp);
if (!fu_plugin_uefi_coldplug_device (plugin, dev, error))
if (!fu_plugin_uefi_capsule_coldplug_device (plugin, dev, error))
return FALSE;
fu_device_add_flag (FU_DEVICE (dev), FWUPD_DEVICE_FLAG_UPDATABLE);
fu_device_add_flag (FU_DEVICE (dev), FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE);
/* load all configuration variables */
fu_plugin_uefi_load_config (plugin, FU_DEVICE (dev));
fu_plugin_uefi_capsule_load_config (plugin, FU_DEVICE (dev));
fu_plugin_device_add (plugin, FU_DEVICE (dev));
}
/* for debugging problems later */
fu_plugin_uefi_test_secure_boot (plugin);
fu_plugin_uefi_capsule_test_secure_boot (plugin);
if (!fu_uefi_bgrt_setup (data->bgrt, &error_local))
g_debug ("BGRT setup failed: %s", error_local->message);
str = fu_uefi_bgrt_get_supported (data->bgrt) ? "Enabled" : "Disabled";

View File

@ -1,19 +1,19 @@
subdir('efi')
cargs = ['-DG_LOG_DOMAIN="FuPluginUefi"']
cargs = ['-DG_LOG_DOMAIN="FuPluginUefiCapsule"']
efi_os_dir = get_option('efi_os_dir')
if efi_os_dir != ''
cargs += '-DEFI_OS_DIR="' + efi_os_dir + '"'
endif
install_data(['uefi.quirk'],
install_data(['uefi-capsule.quirk'],
install_dir: join_paths(datadir, 'fwupd', 'quirks.d'))
shared_module('fu_plugin_uefi',
shared_module('fu_plugin_uefi_capsule',
fu_hash,
sources : [
'fu-plugin-uefi.c',
'fu-plugin-uefi-capsule.c',
'fu-uefi-bgrt.c',
'fu-ucs2.c',
'fu-uefi-bootmgr.c',
@ -96,7 +96,7 @@ if get_option('man')
)
endif
install_data(['uefi.conf'],
install_data(['uefi_capsule.conf'],
install_dir: join_paths(sysconfdir, 'fwupd')
)

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -15,7 +15,7 @@ void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "uefi");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "uefi_capsule");
fu_plugin_add_firmware_gtype (plugin, NULL, FU_TYPE_EFI_SIGNATURE_LIST);
}

View File

@ -14,7 +14,7 @@ void
fu_plugin_init (FuPlugin *plugin)
{
/* make sure that UEFI plugin is ready to receive devices */
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "uefi");
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "uefi_capsule");
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
}

View File

@ -3,9 +3,9 @@ data/remotes.d/lvfs-testing.metainfo.xml
policy/org.freedesktop.fwupd.policy.in
plugins/dfu/dfu-tool.c
plugins/tpm-eventlog/fu-tpm-eventlog.c
plugins/uefi-capsule/fu-plugin-uefi-capsule.c
plugins/uefi-capsule/fu-uefi-tool.c
plugins/uefi-dbx/fu-dbxtool.c
plugins/uefi/fu-plugin-uefi.c
plugins/uefi/fu-uefi-tool.c
src/fu-agent.c
src/fu-debug.c
src/fu-engine-helper.c

View File

@ -5,7 +5,7 @@ i18n.gettext(meson.project_name(),
]
)
if get_option('plugin_uefi')
if get_option('plugin_uefi_capsule')
meson.add_install_script('make-images.sh', localedir, python3.path())
endif

View File

@ -982,7 +982,7 @@ fu_engine_device_priority_func (gconstpointer user_data)
fu_device_add_vendor_id (device3, "USB:FFFF");
fu_device_set_protocol (device3, "com.acme");
fu_device_set_priority (device3, 0);
fu_device_set_plugin (device3, "uefi");
fu_device_set_plugin (device3, "uefi_capsule");
fu_device_add_instance_id (device3, "GUID1");
fu_device_convert_instance_ids (device3);
fu_engine_add_device (engine, device3);
@ -1019,7 +1019,7 @@ fu_engine_device_priority_func (gconstpointer user_data)
fu_device_add_vendor_id (device5, "USB:FFFF");
fu_device_set_protocol (device5, "com.acme");
fu_device_set_priority (device5, 0);
fu_device_set_plugin (device5, "uefi");
fu_device_set_plugin (device5, "uefi_capsule");
fu_device_add_instance_id (device5, "GUID5");
fu_device_set_name (device5, "ABC");
fu_device_convert_instance_ids (device5);