scripts: system: Add support for image-type.

* guix/scripts/system.scm (list-image-types): New procedure,
(%options): add "image-type" and "list-image-types" options, remove
"file-system-type" option,
(show-help): adapt accordingly,
(%default-options): also adapt, and set the default "image-type" to "raw",
(perform-action): add image-type argument and remove file-system-type argument,
(process-action):  adapt perform-action call,
(system-derivation-for-action): remove base-image
argument, add image-type argument, and use it to create the image passed to
"system-image".
* tests/guix-system.sh: Adapt accordingly and add a test for
"--list-image-types" command.
* doc/guix.texi (Building the Installation Image,
Invoking guix system): Adapt accordingly.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Mathieu Othacehe 2020-07-31 16:49:29 +02:00 committed by Mathieu Othacehe
parent 10b135cef5
commit 313f492657
No known key found for this signature in database
GPG key ID: 8354763531769CA6
4 changed files with 75 additions and 52 deletions

View file

@ -261,8 +261,8 @@ guix system vm "$tmpfile" -d | grep '\.drv$'
drv1="`guix system vm "$tmpfile" -d`"
drv2="`guix system vm "$tmpfile" -d`"
test "$drv1" = "$drv2"
drv1="`guix system disk-image --file-system-type=iso9660 "$tmpfile" -d`"
drv2="`guix system disk-image --file-system-type=iso9660 "$tmpfile" -d`"
drv1="`guix system disk-image -t iso9660 "$tmpfile" -d`"
drv2="`guix system disk-image -t iso9660 "$tmpfile" -d`"
test "$drv1" = "$drv2"
make_user_config "group-that-does-not-exist" "users"
@ -320,5 +320,8 @@ guix system -n vm gnu/system/examples/vm-image.tmpl
guix system -n vm-image gnu/system/examples/vm-image.tmpl
# This invocation was taken care of in the loop above:
# guix system -n disk-image gnu/system/examples/bare-bones.tmpl
guix system -n disk-image --file-system-type=iso9660 gnu/system/examples/bare-bones.tmpl
guix system -n disk-image -t iso9660 gnu/system/examples/bare-bones.tmpl
guix system -n docker-image gnu/system/examples/docker-image.tmpl
# Verify that at least the raw image type is available.
guix system --list-image-types | grep "raw"