aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-20 23:52:09 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-21 00:51:18 +0200
commit52b5fe5bcf39ec54a7ff4f4230b4bd390b859a32 (patch)
treeee8d1f60fecce7b170e02bd1c142186dc43d05eb
parent6901b9248ea21f81f033e7b0de32502e389a5b71 (diff)
downloadguix-52b5fe5bcf39ec54a7ff4f4230b4bd390b859a32.tar
guix-52b5fe5bcf39ec54a7ff4f4230b4bd390b859a32.tar.gz
gnu: grub: 'grub-mkrescue' honors 'GRUB_FAT_SERIAL_NUMBER'.
* gnu/packages/patches/grub-efi-fat-serial-number.patch: New file. * gnu/packages/bootloaders.scm (grub)[source](patches): Add it. * gnu/local.mk (dist_patch_DATA): Add it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/bootloaders.scm3
-rw-r--r--gnu/packages/patches/grub-efi-fat-serial-number.patch27
3 files changed, 30 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 04d11cf467..c6f09df54d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -873,6 +873,7 @@ dist_patch_DATA = \
%D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \
%D%/packages/patches/grub-binutils-compat.patch \
%D%/packages/patches/grub-check-error-efibootmgr.patch \
+ %D%/packages/patches/grub-efi-fat-serial-number.patch \
%D%/packages/patches/gsl-test-i686.patch \
%D%/packages/patches/gspell-dash-test.patch \
%D%/packages/patches/gst-plugins-good-libvpx-compat.patch \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index d6ef7d52b5..b4eabaea48 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -90,7 +90,8 @@
(base32
"03vvdfhdmf16121v7xs8is2krwnv15wpkhkf16a4yf8nsfc3f2w1"))
(patches (search-patches "grub-check-error-efibootmgr.patch"
- "grub-binutils-compat.patch"))))
+ "grub-binutils-compat.patch"
+ "grub-efi-fat-serial-number.patch"))))
(build-system gnu-build-system)
(arguments
`(#:phases (modify-phases %standard-phases
diff --git a/gnu/packages/patches/grub-efi-fat-serial-number.patch b/gnu/packages/patches/grub-efi-fat-serial-number.patch
new file mode 100644
index 0000000000..ad92f9bc9e
--- /dev/null
+++ b/gnu/packages/patches/grub-efi-fat-serial-number.patch
@@ -0,0 +1,27 @@
+Change 'grub-mkrescue' to honor the 'GRUB_FAT_SERIAL_NUMBER'
+environment variable. That way, the caller can specify a fixed
+serial number (instead of the randomly chosen one) to create EFI
+images (the 'efi.img' file) that are reproducible bit-for-bit.
+
+Patch by Ludovic Courtès <ludo@gnu.org>.
+
+--- grub-2.02/util/grub-mkrescue.c 2019-04-20 19:15:26.180242812 +0200
++++ grub-2.02/util/grub-mkrescue.c 2019-04-20 21:56:34.672370849 +0200
+@@ -788,8 +788,15 @@ main (int argc, char *argv[])
+
+ efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img");
+ int rv;
+- rv = grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i",
+- efiimgfat, "::", NULL });
++
++ const char *fat_serial_number = getenv ("GRUB_FAT_SERIAL_NUMBER");
++ const char *mformat_args[] =
++ { "mformat", "-C", "-f", "2880", "-L", "16",
++ fat_serial_number != NULL ? "-N" : "-C",
++ fat_serial_number != NULL ? fat_serial_number : "-C",
++ "-i", efiimgfat, "::", NULL };
++
++ rv = grub_util_exec (mformat_args);
+ if (rv != 0)
+ grub_util_error ("`%s` invocation failed\n", "mformat");
+ rv = grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL });