aboutsummaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-21 00:16:57 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-21 00:51:18 +0200
commit605815023cd21becc0156916f4ce08950b4459e5 (patch)
tree232f1624c8867f7874d62f7a760b2e6d60e660bf /gnu/build
parent52b5fe5bcf39ec54a7ff4f4230b4bd390b859a32 (diff)
downloadguix-605815023cd21becc0156916f4ce08950b4459e5.tar
guix-605815023cd21becc0156916f4ce08950b4459e5.tar.gz
vm: Use a fixed FAT serial number for 'efi.img' in ISO images.
Partly fixes <https://bugs.gnu.org/35283>. * gnu/build/vm.scm (make-iso9660-image): Set the 'GRUB_FAT_SERIAL_NUMBER' environment variable.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/vm.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a63a5d2eea..f2953621ec 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -468,6 +468,16 @@ GRUB configuration and OS-DRV as the stuff in it."
(time-second
(date->time-utc (make-date 0 0 0 0 1 1 1980 0)))))
+ ;; Our patched 'grub-mkrescue' honors this environment variable and passes
+ ;; it to 'mformat', which makes it the serial number of 'efi.img'. This
+ ;; allows for deterministic builds.
+ (setenv "GRUB_FAT_SERIAL_NUMBER"
+ (number->string (if volume-uuid
+ (string-hash (iso9660-uuid->string volume-uuid)
+ (expt 2 32))
+ #x77777777)
+ 16))
+
(let ((pipe
(apply open-pipe* OPEN_WRITE
grub-mkrescue "-o" target