unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob aec37d68e20f8f37aa9323ae485fa8f6929becd4 1310 bytes (raw)
name: packages/patches/grub-efi-fat-serial-number.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
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>.
Mangled (for GRUB 2.04) by Tobias Geerinckx-Rice <me@tobias.gr>.

--- grub-2.04/util/grub-mkrescue.c	2019-05-20 13:01:11.000000000 +0200
+++ grub-2.04/util/grub-mkrescue.c	2019-07-08 23:57:36.912104652 +0200
@@ -809,8 +809,15 @@
       free (efidir_efi_boot);
 
       efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img");
-      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 });

debug log:

solving aec37d68e20f8f37aa9323ae485fa8f6929becd4 ...
found aec37d68e20f8f37aa9323ae485fa8f6929becd4 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).