vm: 'expression->derivation-in-linux-vm' always returns a native build.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Remove #:target. [builder]: Use #+. Don't pass #:target-arm32? and #:target-aarch64? to 'load-in-linux-vm'. Pass #:target #f to 'gexp->derivation'. (qemu-image): Adjust accordingly. * gnu/build/vm.scm (load-in-linux-vm): Remove #:target-aarch64? and #:target-arm32?. Define them as local variables.
This commit is contained in:
parent
0c053a3973
commit
b347723445
2 changed files with 15 additions and 12 deletions
|
@ -84,8 +84,6 @@
|
||||||
linux initrd
|
linux initrd
|
||||||
make-disk-image?
|
make-disk-image?
|
||||||
single-file-output?
|
single-file-output?
|
||||||
target-arm32?
|
|
||||||
target-aarch64?
|
|
||||||
(disk-image-size (* 100 (expt 2 20)))
|
(disk-image-size (* 100 (expt 2 20)))
|
||||||
(disk-image-format "qcow2")
|
(disk-image-format "qcow2")
|
||||||
(references-graphs '()))
|
(references-graphs '()))
|
||||||
|
@ -101,7 +99,14 @@ access it via /dev/hda.
|
||||||
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
|
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
|
||||||
the #:references-graphs parameter of 'derivation'."
|
the #:references-graphs parameter of 'derivation'."
|
||||||
|
|
||||||
(define target-arm? (or target-arm32? target-aarch64?))
|
(define target-arm32?
|
||||||
|
(string-prefix? "arm-" %host-type))
|
||||||
|
|
||||||
|
(define target-aarch64?
|
||||||
|
(string-prefix? "aarch64-" %host-type))
|
||||||
|
|
||||||
|
(define target-arm?
|
||||||
|
(or target-arm32? target-aarch64?))
|
||||||
|
|
||||||
(define arch-specific-flags
|
(define arch-specific-flags
|
||||||
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
|
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
|
|
||||||
(define* (expression->derivation-in-linux-vm name exp
|
(define* (expression->derivation-in-linux-vm name exp
|
||||||
#:key
|
#:key
|
||||||
(system (%current-system)) target
|
(system (%current-system))
|
||||||
(linux linux-libre)
|
(linux linux-libre)
|
||||||
initrd
|
initrd
|
||||||
(qemu qemu-minimal)
|
(qemu qemu-minimal)
|
||||||
|
@ -226,10 +226,11 @@ substitutable."
|
||||||
|
|
||||||
(let* ((native-inputs
|
(let* ((native-inputs
|
||||||
'#+(list qemu (canonical-package coreutils)))
|
'#+(list qemu (canonical-package coreutils)))
|
||||||
(linux (string-append #$linux "/"
|
(linux (string-append
|
||||||
#$(system-linux-image-file-name)))
|
#+linux "/"
|
||||||
(initrd #$initrd)
|
#+(system-linux-image-file-name system)))
|
||||||
(loader #$loader)
|
(initrd #+initrd)
|
||||||
|
(loader #+loader)
|
||||||
(graphs '#$(match references-graphs
|
(graphs '#$(match references-graphs
|
||||||
(((graph-files . _) ...) graph-files)
|
(((graph-files . _) ...) graph-files)
|
||||||
(_ #f)))
|
(_ #f)))
|
||||||
|
@ -249,8 +250,6 @@ substitutable."
|
||||||
#:memory-size #$memory-size
|
#:memory-size #$memory-size
|
||||||
#:make-disk-image? #$make-disk-image?
|
#:make-disk-image? #$make-disk-image?
|
||||||
#:single-file-output? #$single-file-output?
|
#:single-file-output? #$single-file-output?
|
||||||
#:target-arm32? #$(check target-arm32?)
|
|
||||||
#:target-aarch64? #$(check target-aarch64?)
|
|
||||||
#:disk-image-format #$disk-image-format
|
#:disk-image-format #$disk-image-format
|
||||||
#:disk-image-size size
|
#:disk-image-size size
|
||||||
#:references-graphs graphs))))))
|
#:references-graphs graphs))))))
|
||||||
|
@ -258,7 +257,7 @@ substitutable."
|
||||||
(gexp->derivation name builder
|
(gexp->derivation name builder
|
||||||
;; TODO: Require the "kvm" feature.
|
;; TODO: Require the "kvm" feature.
|
||||||
#:system system
|
#:system system
|
||||||
#:target target
|
#:target #f ;EXP is always executed natively
|
||||||
#:env-vars env-vars
|
#:env-vars env-vars
|
||||||
#:guile-for-build guile-for-build
|
#:guile-for-build guile-for-build
|
||||||
#:references-graphs references-graphs
|
#:references-graphs references-graphs
|
||||||
|
@ -430,7 +429,6 @@ system that is passed to 'populate-root-file-system'."
|
||||||
#:bootloader-installer
|
#:bootloader-installer
|
||||||
#$(bootloader-installer bootloader)))))))
|
#$(bootloader-installer bootloader)))))))
|
||||||
#:system system
|
#:system system
|
||||||
#:target target
|
|
||||||
#:make-disk-image? #t
|
#:make-disk-image? #t
|
||||||
#:disk-image-size disk-image-size
|
#:disk-image-size disk-image-size
|
||||||
#:disk-image-format disk-image-format
|
#:disk-image-format disk-image-format
|
||||||
|
|
Reference in a new issue