mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
image: Error out when passed an unsupported partition type.
* gnu/build/image.scm (make-partition-image): Use 'raise' instead of 'format' when TYPE is not supported. (convert-disk-image): Remove unneeded 'begin'.
This commit is contained in:
parent
552e9fc163
commit
61d9c4458e
1 changed files with 5 additions and 5 deletions
|
@ -118,16 +118,16 @@ (define* (make-partition-image partition-sexp target root)
|
|||
((string=? type "vfat")
|
||||
(make-vfat-image partition target root))
|
||||
(else
|
||||
(format (current-error-port)
|
||||
"Unsupported partition type~%.")))))
|
||||
(raise (condition
|
||||
(&message
|
||||
(message "unsupported partition type"))))))))
|
||||
|
||||
(define (convert-disk-image image format output)
|
||||
"Convert IMAGE to OUTPUT according to the given FORMAT."
|
||||
(case format
|
||||
((compressed-qcow2)
|
||||
(begin
|
||||
(invoke "qemu-img" "convert" "-c" "-f" "raw"
|
||||
"-O" "qcow2" image output)))
|
||||
(invoke "qemu-img" "convert" "-c" "-f" "raw"
|
||||
"-O" "qcow2" image output))
|
||||
(else
|
||||
(copy-file image output))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue