vm: Reset file timestamps of the EFI image in ISO images.

Partly fixes <https://bugs.gnu.org/35283>.

* gnu/build/vm.scm (make-iso9660-image): Set the 'SOURCE_DATE_EPOCH'
environment variable.
This commit is contained in:
Ludovic Courtès 2019-04-20 22:34:28 +02:00
parent 833480cc1f
commit 6901b9248e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#:use-module (ice-9 popen) #:use-module (ice-9 popen)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-9) #:use-module (srfi srfi-9)
#:use-module (srfi srfi-19)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:export (qemu-command #:export (qemu-command
load-in-linux-vm load-in-linux-vm
@ -458,6 +459,15 @@ GRUB configuration and OS-DRV as the stuff in it."
closures) closures)
(register-bootcfg-root "/tmp/root" config-file)) (register-bootcfg-root "/tmp/root" config-file))
;; 'grub-mkrescue' calls out to mtools programs to create 'efi.img', a FAT
;; file system image, and mtools honors SOURCE_DATE_EPOCH for the mtime of
;; those files. The epoch for FAT is Jan. 1st 1980, not 1970, so choose
;; that.
(setenv "SOURCE_DATE_EPOCH"
(number->string
(time-second
(date->time-utc (make-date 0 0 0 0 1 1 1980 0)))))
(let ((pipe (let ((pipe
(apply open-pipe* OPEN_WRITE (apply open-pipe* OPEN_WRITE
grub-mkrescue "-o" target grub-mkrescue "-o" target