guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 03/07: vm: Reset file timestamps of the EFI image in ISO images.
Date: Sat, 20 Apr 2019 18:52:28 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 6901b9248ea21f81f033e7b0de32502e389a5b71
Author: Ludovic Court├Ęs <address@hidden>
Date:   Sat Apr 20 22:34:28 2019 +0200

    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.
---
 gnu/build/vm.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 75f1394..a63a5d2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -37,6 +37,7 @@
   #:use-module (ice-9 popen)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
+  #:use-module (srfi srfi-19)
   #:use-module (srfi srfi-26)
   #:export (qemu-command
             load-in-linux-vm
@@ -458,6 +459,15 @@ GRUB configuration and OS-DRV as the stuff in it."
               closures)
     (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
          (apply open-pipe* OPEN_WRITE
                 grub-mkrescue "-o" target



reply via email to

[Prev in Thread] Current Thread [Next in Thread]