From f6e3f0f9b1287eca120517a0161e3d0b1ed6ed44 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 14 Apr 2019 23:31:28 +0200 Subject: vm: Remove Xorriso "-padding" option. This is a followup to 66ec389580d4f1e4b81e1c72afe2749a547a0e7c. This reverts 178be030c0e4fdeac5e1c968b5c99d84bb4691db, which is no longer needed. * gnu/build/vm.scm (make-iso9660-image): Remove "-padding" option. --- gnu/build/vm.scm | 5 ----- 1 file changed, 5 deletions(-) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 6d6a0c4cb4..e15ca4d5fb 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -471,11 +471,6 @@ GRUB configuration and OS-DRV as the stuff in it." "mnt=/tmp/root/mnt" "-path-list" "-" "--" - - ;; XXX: Add padding to avoid I/O errors on i686: - ;; . - "-padding" "10m" - "-volid" (string-upcase volume-id) (if volume-uuid `("-volume_date" "uuid" -- cgit v1.2.3 From 833480cc1fa934b64a192fe7b2401491d4f169df Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 20 Apr 2019 14:42:53 +0200 Subject: vm: Reset file timestamps in ISO images. Partly fixes . Reported by Florian Pelz . * gnu/build/vm.scm (make-iso9660-image): Pass "-volume_date all_file_dates =1". --- gnu/build/vm.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index e15ca4d5fb..75f1394d1a 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -471,6 +471,10 @@ GRUB configuration and OS-DRV as the stuff in it." "mnt=/tmp/root/mnt" "-path-list" "-" "--" + + ;; Set all timestamps to 1. + "-volume_date" "all_file_dates" "=1" + "-volid" (string-upcase volume-id) (if volume-uuid `("-volume_date" "uuid" -- cgit v1.2.3 From 6901b9248ea21f81f033e7b0de32502e389a5b71 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 20 Apr 2019 22:34:28 +0200 Subject: vm: Reset file timestamps of the EFI image in ISO images. Partly fixes . * gnu/build/vm.scm (make-iso9660-image): Set the 'SOURCE_DATE_EPOCH' environment variable. --- gnu/build/vm.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 75f1394d1a..a63a5d2eea 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 -- cgit v1.2.3 From 605815023cd21becc0156916f4ce08950b4459e5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 21 Apr 2019 00:16:57 +0200 Subject: vm: Use a fixed FAT serial number for 'efi.img' in ISO images. Partly fixes . * gnu/build/vm.scm (make-iso9660-image): Set the 'GRUB_FAT_SERIAL_NUMBER' environment variable. --- gnu/build/vm.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/build/vm.scm') 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 -- cgit v1.2.3 From ecb33b87aafd9e240c2cb351525814cb1bb5ceb1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 25 Apr 2019 00:43:42 +0200 Subject: vm: Adjust FAT serial number code to 32-bit Guile. On 32-bit systems, 'string-hash' would raise an out-of-range exception when the second argument was 2^32. * gnu/build/vm.scm (make-iso9660-image): Pass 2^32 - 1 to 'string-hash'. --- gnu/build/vm.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index f2953621ec..372cf63c68 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -473,8 +473,12 @@ GRUB configuration and OS-DRV as the stuff in it." ;; allows for deterministic builds. (setenv "GRUB_FAT_SERIAL_NUMBER" (number->string (if volume-uuid + + ;; On 32-bit systems the 2nd argument must be + ;; lower than 2^32. (string-hash (iso9660-uuid->string volume-uuid) - (expt 2 32)) + (- (expt 2 32) 1)) + #x77777777) 16)) -- cgit v1.2.3 From 05344275517e12ea60039272b5d8936d18fd4338 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 27 Apr 2019 21:43:25 +0100 Subject: vm: Pass -smp to QEMU to allow use of multiple cores. * gnu/build/vm.scm (load-in-linux-vm): Pass (parallel-job-count) to QEMU with -smp to allow using multiple cores. --- gnu/build/vm.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 372cf63c68..ac99d6b1a3 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -145,6 +145,7 @@ the #:references-graphs parameter of 'derivation'." (_ #f)) (apply invoke qemu "-nographic" "-no-reboot" + "-smp" (number->string (parallel-job-count)) "-m" (number->string memory-size) "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng" "-device" "virtio-rng-pci,rng=guixsd-vm-rng" -- cgit v1.2.3