vm: Remove explicit calls to 'operating-system-derivation'.

* gnu/system/vm.scm (iso9660-image): Change 'os-drv' to 'os' and remove
call to 'operating-system-derivation'.
(system-qemu-image): Likewise.
(system-qemu-image/shared-store): Likewise.
This commit is contained in:
Ludovic Courtès 2018-11-16 09:05:45 +01:00
parent 9782c82217
commit 8bff7dc2ad
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -252,7 +252,7 @@ (define* (iso9660-image #:key
file-system-uuid
(system (%current-system))
(qemu qemu-minimal)
os-drv
os
bootcfg-drv
bootloader
register-closures?
@ -300,7 +300,7 @@ (define schema
(set-path-environment-variable "PATH" '("bin" "sbin") inputs)
(make-iso9660-image #$(bootloader-package bootloader)
#$bootcfg-drv
#$os-drv
#$os
"/xchg/guixsd.iso"
#:register-closures? #$register-closures?
#:closures graphs
@ -329,7 +329,7 @@ (define* (qemu-image #:key
(file-system-type "ext4")
file-system-label
file-system-uuid
os-drv
os
bootcfg-drv
bootloader
(register-closures? #t)
@ -395,7 +395,7 @@ (define schema
#:closures graphs
#:copy-closures? #$copy-inputs?
#:register-closures? #$register-closures?
#:system-directory #$os-drv
#:system-directory #$os
;; Disable deduplication to speed things up,
;; and because it doesn't help much for a
@ -625,7 +625,7 @@ (define file-systems-to-keep
(string=? (file-system-mount-point fs) "/"))
(operating-system-file-systems os)))
(let ((os (operating-system (inherit os)
(let* ((os (operating-system (inherit os)
;; Since this is meant to be used on real hardware, don't
;; install QEMU networking or anything like that. Assume USB
;; mass storage devices (usb-storage.ko) are available.
@ -646,23 +646,21 @@ (define file-systems-to-keep
(mount-point "/")
(device root-uuid)
(type file-system-type))
file-systems-to-keep)))))
(mlet* %store-monad ((os-drv (operating-system-derivation os))
(bootcfg -> (operating-system-bootcfg os)))
file-systems-to-keep))))
(bootcfg (operating-system-bootcfg os)))
(if (string=? "iso9660" file-system-type)
(iso9660-image #:name name
#:file-system-label root-label
#:file-system-uuid root-uuid
#:os-drv os-drv
#:os os
#:register-closures? #t
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
#:inputs `(("system" ,os-drv)
#:inputs `(("system" ,os)
("bootcfg" ,bootcfg)))
(qemu-image #:name name
#:os-drv os-drv
#:os os
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
@ -673,8 +671,8 @@ (define file-systems-to-keep
#:file-system-uuid root-uuid
#:copy-inputs? #t
#:register-closures? #t
#:inputs `(("system" ,os-drv)
("bootcfg" ,bootcfg)))))))
#:inputs `(("system" ,os)
("bootcfg" ,bootcfg))))))
(define* (system-qemu-image os
#:key
@ -700,7 +698,7 @@ (define root-uuid
'dce)))
(let ((os (operating-system (inherit os)
(let* ((os (operating-system (inherit os)
;; Assume we have an initrd with the whole QEMU shebang.
;; Force our own root file system. Refer to it by UUID so that
@ -710,20 +708,18 @@ (define root-uuid
(mount-point "/")
(device root-uuid)
(type file-system-type))
file-systems-to-keep)))))
(mlet* %store-monad
((os-drv (operating-system-derivation os))
(bootcfg -> (operating-system-bootcfg os)))
(qemu-image #:os-drv os-drv
file-systems-to-keep))))
(bootcfg (operating-system-bootcfg os)))
(qemu-image #:os os
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
#:disk-image-size disk-image-size
#:file-system-type file-system-type
#:file-system-uuid root-uuid
#:inputs `(("system" ,os-drv)
#:inputs `(("system" ,os)
("bootcfg" ,bootcfg))
#:copy-inputs? #t))))
#:copy-inputs? #t)))
;;;
@ -827,13 +823,14 @@ (define root-uuid
;; Use a fixed UUID to improve determinism.
(operating-system-uuid os 'dce))
(mlet* %store-monad ((os-drv (operating-system-derivation os))
(bootcfg -> (operating-system-bootcfg os)))
(define bootcfg
(operating-system-bootcfg os))
;; XXX: When FULL-BOOT? is true, we end up creating an image that contains
;; BOOTCFG and all its dependencies, including the output of OS-DRV.
;; BOOTCFG and all its dependencies, including the output of OS.
;; This is more than needed (we only need the kernel, initrd, GRUB for its
;; font, and the background image), but it's hard to filter that.
(qemu-image #:os-drv os-drv
(qemu-image #:os os
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
@ -845,7 +842,7 @@ (define root-uuid
;; XXX: Passing #t here is too slow, so let it off by default.
#:register-closures? #f
#:copy-inputs? full-boot?)))
#:copy-inputs? full-boot?))
(define* (common-qemu-options image shared-fs)
"Return the a string-value gexp with the common QEMU options to boot IMAGE,