summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/grub-efi-fat-serial-number.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-04-23 19:43:59 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-04-23 19:43:59 +0200
commit37da4fbe1562583589eeddb4be8e11bece80fd35 (patch)
tree4d8a454b27e62f9b8d7b0fe641a9f6aa6de2402c /gnu/packages/patches/grub-efi-fat-serial-number.patch
parent73326e742d82b6706333885eca770f7518636b1f (diff)
parente01bd1a67447c1f2a2b5b03e8ea8fbbccd2cd5bd (diff)
downloadguix-patches-37da4fbe1562583589eeddb4be8e11bece80fd35.tar
guix-patches-37da4fbe1562583589eeddb4be8e11bece80fd35.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches/grub-efi-fat-serial-number.patch')
-rw-r--r--gnu/packages/patches/grub-efi-fat-serial-number.patch27
1 files changed, 27 insertions, 0 deletions
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 });