Commit c3ab38fc authored by Colin Watson's avatar Colin Watson
Browse files

Minimise writes to EFI variable storage

Closes: #891434
parents cf46e0b1 649e5a39
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,11 @@ configuring the GRUB.
* Other standard GNU/Unix tools
* a libc with large file support (e.g. glibc 2.1 or later)

On Unix-based systems, you also need:

* libefivar (recommended)
* libefiboot (recommended; your OS may ship this together with libefivar)

On GNU/Linux, you also need:

* libdevmapper 1.02.34 or later (recommended)
+20 −0
Original line number Diff line number Diff line
@@ -548,6 +548,8 @@ program = {
  common = grub-core/osdep/compress.c;
  extra_dist = grub-core/osdep/unix/compress.c;
  extra_dist = grub-core/osdep/basic/compress.c;
  common = grub-core/osdep/efivar.c;
  extra_dist = grub-core/osdep/unix/efivar.c;
  common = util/editenv.c;
  common = grub-core/osdep/blocklist.c;
  common = grub-core/osdep/config.c;
@@ -561,12 +563,15 @@ program = {
  common = grub-core/kern/emu/argp_common.c;
  common = grub-core/osdep/init.c;

  cflags = '$(EFIVAR_CFLAGS)';

  ldadd = '$(LIBLZMA)';
  ldadd = libgrubmods.a;
  ldadd = libgrubgcry.a;
  ldadd = libgrubkern.a;
  ldadd = grub-core/gnulib/libgnu.a;
  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
  ldadd = '$(EFIVAR_LIBS)';

  condition = COND_HAVE_EXEC;
};
@@ -595,6 +600,8 @@ program = {
  extra_dist = grub-core/osdep/basic/no_platform.c;
  extra_dist = grub-core/osdep/unix/platform.c;
  common = grub-core/osdep/compress.c;
  common = grub-core/osdep/efivar.c;
  extra_dist = grub-core/osdep/unix/efivar.c;
  common = util/editenv.c;
  common = grub-core/osdep/blocklist.c;
  common = grub-core/osdep/config.c;
@@ -608,12 +615,15 @@ program = {
  common = grub-core/kern/emu/argp_common.c;
  common = grub-core/osdep/init.c;

  cflags = '$(EFIVAR_CFLAGS)';

  ldadd = '$(LIBLZMA)';
  ldadd = libgrubmods.a;
  ldadd = libgrubgcry.a;
  ldadd = libgrubkern.a;
  ldadd = grub-core/gnulib/libgnu.a;
  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
  ldadd = '$(EFIVAR_LIBS)';
};

program = {
@@ -635,6 +645,8 @@ program = {
  common = grub-core/osdep/platform.c;
  common = grub-core/osdep/platform_unix.c;
  common = grub-core/osdep/compress.c;
  common = grub-core/osdep/efivar.c;
  extra_dist = grub-core/osdep/unix/efivar.c;
  common = util/editenv.c;
  common = grub-core/osdep/blocklist.c;
  common = grub-core/osdep/config.c;
@@ -647,12 +659,15 @@ program = {
  common = grub-core/kern/emu/argp_common.c;
  common = grub-core/osdep/init.c;

  cflags = '$(EFIVAR_CFLAGS)';

  ldadd = '$(LIBLZMA)';
  ldadd = libgrubmods.a;
  ldadd = libgrubgcry.a;
  ldadd = libgrubkern.a;
  ldadd = grub-core/gnulib/libgnu.a;
  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
  ldadd = '$(EFIVAR_LIBS)';
};

program = {
@@ -674,6 +689,8 @@ program = {
  common = grub-core/osdep/platform.c;
  common = grub-core/osdep/platform_unix.c;
  common = grub-core/osdep/compress.c;
  common = grub-core/osdep/efivar.c;
  extra_dist = grub-core/osdep/unix/efivar.c;
  common = util/editenv.c;
  common = grub-core/osdep/blocklist.c;
  common = grub-core/osdep/config.c;
@@ -683,12 +700,15 @@ program = {
  common = grub-core/kern/emu/argp_common.c;
  common = grub-core/osdep/init.c;

  cflags = '$(EFIVAR_CFLAGS)';

  ldadd = '$(LIBLZMA)';
  ldadd = libgrubmods.a;
  ldadd = libgrubgcry.a;
  ldadd = libgrubkern.a;
  ldadd = grub-core/gnulib/libgnu.a;
  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
  ldadd = '$(EFIVAR_LIBS)';
};

script = {
+12 −0
Original line number Diff line number Diff line
@@ -426,6 +426,18 @@ AC_CHECK_HEADER([util.h], [
])
AC_SUBST([LIBUTIL])

case "$host_os" in
  cygwin | windows* | mingw32* | aros*)
    ;;
  *)
    # For setting EFI variables in grub-install.
    PKG_CHECK_MODULES([EFIVAR], [efivar efiboot], [
      AC_DEFINE([HAVE_EFIVAR], [1],
                [Define to 1 if you have the efivar and efiboot libraries.])
    ], [:])
    ;;
esac

AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
  SAVED_CFLAGS="$CFLAGS"
  CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror"
+2 −2
Original line number Diff line number Diff line
# see git-dpm(1) from git-dpm package
ec64736811599e752ed4b4dff04a3029179e9f56
ec64736811599e752ed4b4dff04a3029179e9f56
649e5a39cc5ddf42f6853a0bf818685a625f7cab
649e5a39cc5ddf42f6853a0bf818685a625f7cab
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
grub2_2.02+dfsg1.orig.tar.xz
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ grub2 (2.02+dfsg1-14) UNRELEASED; urgency=medium
    attempt to prevent incorrect testing migrations (closes: #924814).
  * Cherry-pick from upstream:
    - xfs: Accept filesystem with sparse inodes (closes: #924760).
  * Minimise writes to EFI variable storage (closes: #891434).

 -- Colin Watson <cjwatson@debian.org>  Wed, 20 Mar 2019 00:38:30 +0000

Loading