From ded5410f6d80df9f332bf0ba3260a0d4489ba9ed Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 26 Oct 2020 16:54:28 +0000 Subject: [PATCH] Delete unused EFI variables when deploying firmware Unconditionally delete FWUPDATE_VERBOSE and FWUPDATE_DEBUG_LOG when deploying the update using fwupdtool or fwupd and leave it to fwupdate. If you want to debug the efi binary you then have to use fwupdate and squirt the .cap file rather than using all the other layers. --- plugins/uefi/fu-uefi-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/uefi/fu-uefi-device.c b/plugins/uefi/fu-uefi-device.c index 80f204125..9fe66de28 100644 --- a/plugins/uefi/fu-uefi-device.c +++ b/plugins/uefi/fu-uefi-device.c @@ -571,6 +571,10 @@ fu_uefi_device_write_firmware (FuDevice *device, if (!fu_common_set_contents_bytes (fn, fixed_fw, error)) return FALSE; + /* delete the logs to save space; use fwupdate to debug the EFI binary */ + fu_efivar_delete (FU_EFIVAR_GUID_FWUPDATE, "FWUPDATE_VERBOSE", NULL); + fu_efivar_delete (FU_EFIVAR_GUID_FWUPDATE, "FWUPDATE_DEBUG_LOG", NULL); + /* set the blob header shared with fwupd.efi */ if (!fu_uefi_device_write_update_info (self, fn, varname, self->fw_class, error)) return FALSE;