vm: Provide a root partition for the freestanding VM image.

Fixes a regression introduced in 83bcd0b.

* gnu/system/vm.scm (system-qemu-image): Override the 'file-systems'
  field of OS.  Add #:file-system-type parameter and honor it.
master
Ludovic Courtès 2014-05-03 12:45:43 +02:00
parent 03ddfaf5fb
commit 66f23d6621
1 changed files with 22 additions and 13 deletions

View File

@ -296,19 +296,28 @@ basic contents of the root file system of OS."
(operating-system-users os)))))) (operating-system-users os))))))
(define* (system-qemu-image os (define* (system-qemu-image os
#:key (disk-image-size (* 900 (expt 2 20)))) #:key
"Return the derivation of a QEMU image of DISK-IMAGE-SIZE bytes of the GNU (file-system-type "ext4")
system as described by OS." (disk-image-size (* 900 (expt 2 20))))
(mlet* %store-monad "Return the derivation of a freestanding QEMU image of DISK-IMAGE-SIZE bytes
((os-drv (operating-system-derivation os)) of the GNU system as described by OS."
(os-dir -> (derivation->output-path os-drv)) (let ((os (operating-system (inherit os)
(grub.cfg -> (string-append os-dir "/grub.cfg")) ;; The mounted file systems are under our control.
(populate (operating-system-default-contents os))) (file-systems (list (file-system
(qemu-image #:grub-configuration grub.cfg (mount-point "/")
#:populate populate (device "/dev/sda1")
#:disk-image-size disk-image-size (type file-system-type)))))))
#:initialize-store? #t (mlet* %store-monad
#:inputs-to-copy `(("system" ,os-drv))))) ((os-drv (operating-system-derivation os))
(os-dir -> (derivation->output-path os-drv))
(grub.cfg -> (string-append os-dir "/grub.cfg"))
(populate (operating-system-default-contents os)))
(qemu-image #:grub-configuration grub.cfg
#:populate populate
#:disk-image-size disk-image-size
#:file-system-type file-system-type
#:initialize-store? #t
#:inputs-to-copy `(("system" ,os-drv))))))
(define (virtualized-operating-system os) (define (virtualized-operating-system os)
"Return an operating system based on OS suitable for use in a virtualized "Return an operating system based on OS suitable for use in a virtualized