mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: hurd-vm: Support different hurd types.
* gnu/services/virtualization.scm (sanitize-hurd-vm-configuration-type): New procedure. (hurd-vm-confiuration): Add type field. (hurd-vm-disk-image): Use it. * doc/guix.texi (hurd-vm-configuration): Document it. * gnu/tests/virtualization.scm (%childhurd64-os): New variable. (run-childhurd-test): Add the os a parameter. (%test-childhurd): Adjust accordingly. (%test-childhurd64): New system test. Change-Id: Ie1c55a9414657ced4bf8b4324527037f1a1f78f4 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
4b03c71022
commit
fecaf550cf
3 changed files with 45 additions and 4 deletions
|
@ -61,6 +61,7 @@
|
|||
#:use-module (guix packages)
|
||||
#:use-module (guix records)
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix ui)
|
||||
#:use-module (guix utils)
|
||||
#:autoload (guix self) (make-config.scm)
|
||||
#:autoload (guix platform) (platform-system)
|
||||
|
@ -83,6 +84,7 @@
|
|||
hurd-vm-configuration?
|
||||
hurd-vm-configuration-os
|
||||
hurd-vm-configuration-qemu
|
||||
hurd-vm-configuration-type
|
||||
hurd-vm-configuration-image
|
||||
hurd-vm-configuration-disk-size
|
||||
hurd-vm-configuration-memory-size
|
||||
|
@ -1782,6 +1784,11 @@ preventing password-based authentication as 'root'."
|
|||
(inherit config)
|
||||
(authorize-key? #f))))))))
|
||||
|
||||
(define (sanitize-hurd-vm-configuration-type value)
|
||||
(unless (memq value '(hurd-qcow2 hurd64-qcow2))
|
||||
(leave (G_ "hurd-vm: '~a' is not a valid type~%") value))
|
||||
value)
|
||||
|
||||
(define-record-type* <hurd-vm-configuration>
|
||||
hurd-vm-configuration make-hurd-vm-configuration
|
||||
hurd-vm-configuration?
|
||||
|
@ -1789,6 +1796,9 @@ preventing password-based authentication as 'root'."
|
|||
(default %hurd-vm-operating-system))
|
||||
(qemu hurd-vm-configuration-qemu ;file-like
|
||||
(default qemu-minimal))
|
||||
(type hurd-vm-configuration-type ;symbol
|
||||
(default 'hurd-qcow2)
|
||||
(sanitize sanitize-hurd-vm-configuration-type))
|
||||
(image hurd-vm-configuration-image ;<image>
|
||||
(thunked)
|
||||
(default (hurd-vm-disk-image this-record)))
|
||||
|
@ -1825,7 +1835,8 @@ is added to the OS specified in CONFIG."
|
|||
|
||||
(let* ((os (transform (hurd-vm-configuration-os config)))
|
||||
(disk-size (hurd-vm-configuration-disk-size config))
|
||||
(type (lookup-image-type-by-name 'hurd-qcow2))
|
||||
(type (lookup-image-type-by-name
|
||||
(hurd-vm-configuration-type config)))
|
||||
(os->image (image-type-constructor type)))
|
||||
(image (inherit (os->image os))
|
||||
(size disk-size))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue