diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-10-19 12:51:57 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-10-19 13:11:40 -0400 |
commit | 5e2140511c1ad9ccd731438b74d61b62111da1e6 (patch) | |
tree | a4ff748ad26e121b88469b5d921001ef1382be8f /gnu/build/image.scm | |
parent | 9e3a5ee417ea7fe9721be8804ff047e80c4f22ed (diff) | |
parent | 353bdae32f72b720c7ddd706576ccc40e2b43f95 (diff) | |
download | guix-5e2140511c1ad9ccd731438b74d61b62111da1e6.tar.gz guix-5e2140511c1ad9ccd731438b74d61b62111da1e6.zip |
Merge branch 'staging'
Conflicts:
gnu/packages/admin.scm
gnu/packages/commencement.scm
gnu/packages/gdb.scm
gnu/packages/llvm.scm
gnu/packages/package-management.scm
gnu/packages/tls.scm
Diffstat (limited to 'gnu/build/image.scm')
-rw-r--r-- | gnu/build/image.scm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gnu/build/image.scm b/gnu/build/image.scm index b6bf259f1b..ff63039c16 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -37,6 +37,7 @@ #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (make-partition-image + convert-disk-image genimage initialize-efi-partition initialize-root-partition @@ -120,13 +121,22 @@ ROOT directory to populate the image." (format (current-error-port) "Unsupported partition type~%."))))) -(define* (genimage config target) +(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))) + (else + (copy-file image output)))) + +(define* (genimage config) "Use genimage to generate in TARGET directory, the image described in the given CONFIG file." ;; genimage needs a 'root' directory. (mkdir "root") - (invoke "genimage" "--config" config - "--outputpath" target)) + (invoke "genimage" "--config" config)) (define* (register-closure prefix closure #:key |