Some UEFI firmware is easily provoked into running out of space in its variable storage. This is usually due to certain kernel drivers (e.g. pstore), but regardless of the cause it can cause grub-install to fail because it currently asks efibootmgr to delete and re-add entries, and the deletion often doesn't result in an immediate garbage collection. Writing variables frequently also increases wear on the NVRAM which may have limited write cycles. For these reasons, it's desirable to find a way to minimise writes while still allowing grub-install to ensure that a suitable boot entry exists.
This short patch series does so by using the efivar and efiboot libraries directly. v2: simplify grub_lltoa; use free_efi_variable in more error paths v3: avoid -Wcast-align diagnostics on ARM Colin Watson (2): Add %X to grub_vsnprintf_real and friends Minimise writes to EFI variable storage INSTALL | 5 + Makefile.util.def | 20 ++ configure.ac | 12 + grub-core/kern/misc.c | 7 +- grub-core/osdep/efivar.c | 3 + grub-core/osdep/unix/efivar.c | 508 ++++++++++++++++++++++++++++++++ grub-core/osdep/unix/platform.c | 100 +------ include/grub/util/install.h | 5 + util/grub-install.c | 4 +- 9 files changed, 567 insertions(+), 97 deletions(-) create mode 100644 grub-core/osdep/efivar.c create mode 100644 grub-core/osdep/unix/efivar.c -- 2.17.1 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel