diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2021-01-17 11:32:51 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2021-01-19 17:16:56 +0100 |
| commit | e74baa124592428f05b17562f180469e405037f3 (patch) | |
| tree | 71f1ea28df039f5d1bee63d8c70bea2b7683012c | |
| parent | 868c4dec0f8b4fd6099bcc95b7af1225c0de58aa (diff) | |
system: Rename 'disk-image' command 'image'.
* guix/scripts/system.scm (system-derivation-for-action): Rename 'disk-image'
command 'image'. Warn when using the now deprecated 'disk-image' command.
(show-help): Adapt accordingly.
(guix-system): Ditto.
* tests/guix-system.sh: Ditto.
* gnu/system/examples/bare-hurd.tmpl: Ditto.
* doc/guix.texi (Building the Installation Image,
Building the Installation Image for ARM Boards,
Invoking guix pack,
Invoking guix system): Adapt documentation.
| -rw-r--r-- | doc/guix.texi | 24 | ||||
| -rw-r--r-- | gnu/system/examples/bare-hurd.tmpl | 2 | ||||
| -rw-r--r-- | guix/scripts/system.scm | 21 | ||||
| -rw-r--r-- | tests/guix-system.sh | 4 |
4 files changed, 27 insertions, 24 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 0a82219e7a4..f02353d9fa3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -2661,7 +2661,7 @@ The installation image described above was built using the @command{guix | |||
| 2661 | system} command, specifically: | 2661 | system} command, specifically: |
| 2662 | 2662 | ||
| 2663 | @example | 2663 | @example |
| 2664 | guix system disk-image -t iso9660 gnu/system/install.scm | 2664 | guix system image -t iso9660 gnu/system/install.scm |
| 2665 | @end example | 2665 | @end example |
| 2666 | 2666 | ||
| 2667 | Have a look at @file{gnu/system/install.scm} in the source tree, | 2667 | Have a look at @file{gnu/system/install.scm} in the source tree, |
| @@ -2678,7 +2678,7 @@ If you build a disk image and the bootloader is not available otherwise | |||
| 2678 | includes the bootloader, specifically: | 2678 | includes the bootloader, specifically: |
| 2679 | 2679 | ||
| 2680 | @example | 2680 | @example |
| 2681 | guix system disk-image --system=armhf-linux -e '((@@ (gnu system install) os-with-u-boot) (@@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")' | 2681 | guix system image --system=armhf-linux -e '((@@ (gnu system install) os-with-u-boot) (@@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")' |
| 2682 | @end example | 2682 | @end example |
| 2683 | 2683 | ||
| 2684 | @code{A20-OLinuXino-Lime2} is the name of the board. If you specify an invalid | 2684 | @code{A20-OLinuXino-Lime2} is the name of the board. If you specify an invalid |
| @@ -31393,7 +31393,7 @@ size of the image. | |||
| 31393 | @cindex System images, creation in various formats | 31393 | @cindex System images, creation in various formats |
| 31394 | @cindex Creating system images in various formats | 31394 | @cindex Creating system images in various formats |
| 31395 | @item vm-image | 31395 | @item vm-image |
| 31396 | @itemx disk-image | 31396 | @itemx image |
| 31397 | @itemx docker-image | 31397 | @itemx docker-image |
| 31398 | Return a virtual machine, disk image, or Docker image of the operating | 31398 | Return a virtual machine, disk image, or Docker image of the operating |
| 31399 | system declared in @var{file} that stands alone. By default, | 31399 | system declared in @var{file} that stands alone. By default, |
| @@ -31403,22 +31403,22 @@ a value. Docker images are built to contain exactly what they need, so | |||
| 31403 | the @option{--image-size} option is ignored in the case of | 31403 | the @option{--image-size} option is ignored in the case of |
| 31404 | @code{docker-image}. | 31404 | @code{docker-image}. |
| 31405 | 31405 | ||
| 31406 | @cindex disk-image, creating disk images | 31406 | @cindex image, creating disk images |
| 31407 | The @code{disk-image} command can produce various image types. The | 31407 | The @code{image} command can produce various image types. The |
| 31408 | image type can be selected using the @option{--image-type} option. It | 31408 | image type can be selected using the @option{--image-type} option. It |
| 31409 | defaults to @code{efi-raw}. When its value is @code{iso9660}, the | 31409 | defaults to @code{efi-raw}. When its value is @code{iso9660}, the |
| 31410 | @option{--label} option can be used to specify a volume ID with | 31410 | @option{--label} option can be used to specify a volume ID with |
| 31411 | @code{disk-image}. By default, the root file system of a disk image is | 31411 | @code{image}. By default, the root file system of a disk image is |
| 31412 | mounted non-volatile; the @option{--volatile} option can be provided to | 31412 | mounted non-volatile; the @option{--volatile} option can be provided to |
| 31413 | make it volatile instead. When using @code{disk-image}, the bootloader | 31413 | make it volatile instead. When using @code{image}, the bootloader |
| 31414 | installed on the generated image is taken from the provided | 31414 | installed on the generated image is taken from the provided |
| 31415 | @code{operating-system} definition. The following example demonstrates | 31415 | @code{operating-system} definition. The following example demonstrates |
| 31416 | how to generate an image that uses the @code{grub-efi-bootloader} | 31416 | how to generate an image that uses the @code{grub-efi-bootloader} |
| 31417 | bootloader and boot it with QEMU: | 31417 | bootloader and boot it with QEMU: |
| 31418 | 31418 | ||
| 31419 | @example | 31419 | @example |
| 31420 | image=$(guix system disk-image --image-type=qcow2 \ | 31420 | image=$(guix system image --image-type=qcow2 \ |
| 31421 | gnu/system/examples/lightweight-desktop.tmpl) | 31421 | gnu/system/examples/lightweight-desktop.tmpl) |
| 31422 | cp $image /tmp/my-image.qcow2 | 31422 | cp $image /tmp/my-image.qcow2 |
| 31423 | chmod +w /tmp/my-image.qcow2 | 31423 | chmod +w /tmp/my-image.qcow2 |
| 31424 | qemu-system-x86_64 -enable-kvm -hda /tmp/my-image.qcow2 -m 1000 \ | 31424 | qemu-system-x86_64 -enable-kvm -hda /tmp/my-image.qcow2 -m 1000 \ |
| @@ -31431,7 +31431,7 @@ it can be copied as is to a USB stick, for instance. Assuming | |||
| 31431 | the image to it using the following command: | 31431 | the image to it using the following command: |
| 31432 | 31432 | ||
| 31433 | @example | 31433 | @example |
| 31434 | # dd if=$(guix system disk-image my-os.scm) of=/dev/sdc status=progress | 31434 | # dd if=$(guix system image my-os.scm) of=/dev/sdc status=progress |
| 31435 | @end example | 31435 | @end example |
| 31436 | 31436 | ||
| 31437 | The @code{--list-image-types} command lists all the available image | 31437 | The @code{--list-image-types} command lists all the available image |
| @@ -31551,7 +31551,7 @@ of the image. | |||
| 31551 | 31551 | ||
| 31552 | @item --image-type=@var{type} | 31552 | @item --image-type=@var{type} |
| 31553 | @itemx -t @var{type} | 31553 | @itemx -t @var{type} |
| 31554 | For the @code{disk-image} action, create an image with given @var{type}. | 31554 | For the @code{image} action, create an image with given @var{type}. |
| 31555 | 31555 | ||
| 31556 | When this option is omitted, @command{guix system} uses the | 31556 | When this option is omitted, @command{guix system} uses the |
| 31557 | @code{efi-raw} image type. | 31557 | @code{efi-raw} image type. |
| @@ -31563,7 +31563,7 @@ When this option is omitted, @command{guix system} uses the | |||
| 31563 | for burning on CDs and DVDs. | 31563 | for burning on CDs and DVDs. |
| 31564 | 31564 | ||
| 31565 | @item --image-size=@var{size} | 31565 | @item --image-size=@var{size} |
| 31566 | For the @code{vm-image} and @code{disk-image} actions, create an image | 31566 | For the @code{vm-image} and @code{image} actions, create an image |
| 31567 | of the given @var{size}. @var{size} may be a number of bytes, or it may | 31567 | of the given @var{size}. @var{size} may be a number of bytes, or it may |
| 31568 | include a unit as a suffix (@pxref{Block size, size specifications,, | 31568 | include a unit as a suffix (@pxref{Block size, size specifications,, |
| 31569 | coreutils, GNU Coreutils}). | 31569 | coreutils, GNU Coreutils}). |
diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index e4b795ff270..135ed23cb6e 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | ;; To build a disk image for a virtual machine, do | 6 | ;; To build a disk image for a virtual machine, do |
| 7 | ;; | 7 | ;; |
| 8 | ;; ./pre-inst-env guix system disk-image --target=i586-pc-gnu \ | 8 | ;; ./pre-inst-env guix system image --target=i586-pc-gnu \ |
| 9 | ;; gnu/system/examples/bare-hurd.tmpl | 9 | ;; gnu/system/examples/bare-hurd.tmpl |
| 10 | ;; | 10 | ;; |
| 11 | ;; You may run it like so | 11 | ;; You may run it like so |
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index eb7137b7a96..66225bff350 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm | |||
| @@ -705,9 +705,11 @@ checking this by themselves in their 'check' procedure." | |||
| 705 | image-size | 705 | image-size |
| 706 | (* 70 (expt 2 20))) | 706 | (* 70 (expt 2 20))) |
| 707 | #:mappings mappings)) | 707 | #:mappings mappings)) |
| 708 | ((disk-image) | 708 | ((image disk-image) |
| 709 | (let* ((base-image (os->image os #:type image-type)) | 709 | (let* ((base-image (os->image os #:type image-type)) |
| 710 | (base-target (image-target base-image))) | 710 | (base-target (image-target base-image))) |
| 711 | (when (eq? action 'disk-image) | ||
| 712 | (warning (G_ "'disk-image' is deprecated: use 'image' instead~%"))) | ||
| 711 | (lower-object | 713 | (lower-object |
| 712 | (system-image | 714 | (system-image |
| 713 | (image | 715 | (image |
| @@ -779,7 +781,7 @@ and TARGET arguments." | |||
| 779 | "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install | 781 | "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install |
| 780 | bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the | 782 | bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the |
| 781 | target root directory; IMAGE-SIZE is the size of the image to be built, for | 783 | target root directory; IMAGE-SIZE is the size of the image to be built, for |
| 782 | the 'vm-image' and 'disk-image' actions. IMAGE-TYPE is the type of image to | 784 | the 'vm-image' and 'image' actions. IMAGE-TYPE is the type of image to |
| 783 | be built. When VOLATILE-ROOT? is #t, the root file system is mounted | 785 | be built. When VOLATILE-ROOT? is #t, the root file system is mounted |
| 784 | volatile. | 786 | volatile. |
| 785 | 787 | ||
| @@ -968,7 +970,7 @@ Some ACTIONS support additional ARGS.\n")) | |||
| 968 | (display (G_ "\ | 970 | (display (G_ "\ |
| 969 | vm-image build a freestanding virtual machine image\n")) | 971 | vm-image build a freestanding virtual machine image\n")) |
| 970 | (display (G_ "\ | 972 | (display (G_ "\ |
| 971 | disk-image build a disk image, suitable for a USB stick\n")) | 973 | image build a Guix System image\n")) |
| 972 | (display (G_ "\ | 974 | (display (G_ "\ |
| 973 | docker-image build a Docker image\n")) | 975 | docker-image build a Docker image\n")) |
| 974 | (display (G_ "\ | 976 | (display (G_ "\ |
| @@ -994,15 +996,15 @@ Some ACTIONS support additional ARGS.\n")) | |||
| 994 | (display (G_ " | 996 | (display (G_ " |
| 995 | --list-image-types list available image types")) | 997 | --list-image-types list available image types")) |
| 996 | (display (G_ " | 998 | (display (G_ " |
| 997 | -t, --image-type=TYPE for 'disk-image', produce an image of TYPE")) | 999 | -t, --image-type=TYPE for 'image', produce an image of TYPE")) |
| 998 | (display (G_ " | 1000 | (display (G_ " |
| 999 | --image-size=SIZE for 'vm-image', produce an image of SIZE")) | 1001 | --image-size=SIZE for 'vm-image', produce an image of SIZE")) |
| 1000 | (display (G_ " | 1002 | (display (G_ " |
| 1001 | --no-bootloader for 'init', do not install a bootloader")) | 1003 | --no-bootloader for 'init', do not install a bootloader")) |
| 1002 | (display (G_ " | 1004 | (display (G_ " |
| 1003 | --volatile for 'disk-image', make the root file system volatile")) | 1005 | --volatile for 'image', make the root file system volatile")) |
| 1004 | (display (G_ " | 1006 | (display (G_ " |
| 1005 | --label=LABEL for 'disk-image', label disk image with LABEL")) | 1007 | --label=LABEL for 'image', label disk image with LABEL")) |
| 1006 | (display (G_ " | 1008 | (display (G_ " |
| 1007 | --save-provenance save provenance information")) | 1009 | --save-provenance save provenance information")) |
| 1008 | (display (G_ " | 1010 | (display (G_ " |
| @@ -1014,7 +1016,7 @@ Some ACTIONS support additional ARGS.\n")) | |||
| 1014 | (display (G_ " | 1016 | (display (G_ " |
| 1015 | -N, --network for 'container', allow containers to access the network")) | 1017 | -N, --network for 'container', allow containers to access the network")) |
| 1016 | (display (G_ " | 1018 | (display (G_ " |
| 1017 | -r, --root=FILE for 'vm', 'vm-image', 'disk-image', 'container', | 1019 | -r, --root=FILE for 'vm', 'vm-image', 'image', 'container', |
| 1018 | and 'build', make FILE a symlink to the result, and | 1020 | and 'build', make FILE a symlink to the result, and |
| 1019 | register it as a garbage collector root")) | 1021 | register it as a garbage collector root")) |
| 1020 | (display (G_ " | 1022 | (display (G_ " |
| @@ -1335,7 +1337,7 @@ argument list and OPTS is the option alist." | |||
| 1335 | (alist-cons 'argument arg result) | 1337 | (alist-cons 'argument arg result) |
| 1336 | (let ((action (string->symbol arg))) | 1338 | (let ((action (string->symbol arg))) |
| 1337 | (case action | 1339 | (case action |
| 1338 | ((build container vm vm-image disk-image reconfigure init | 1340 | ((build container vm vm-image image disk-image reconfigure init |
| 1339 | extension-graph shepherd-graph | 1341 | extension-graph shepherd-graph |
| 1340 | list-generations describe | 1342 | list-generations describe |
| 1341 | delete-generations roll-back | 1343 | delete-generations roll-back |
| @@ -1368,7 +1370,8 @@ argument list and OPTS is the option alist." | |||
| 1368 | (exit 1)) | 1370 | (exit 1)) |
| 1369 | 1371 | ||
| 1370 | (case action | 1372 | (case action |
| 1371 | ((build container vm vm-image disk-image docker-image reconfigure) | 1373 | ((build container vm vm-image image disk-image docker-image |
| 1374 | reconfigure) | ||
| 1372 | (unless (or (= count 1) | 1375 | (unless (or (= count 1) |
| 1373 | (and expr (= count 0))) | 1376 | (and expr (= count 0))) |
| 1374 | (fail))) | 1377 | (fail))) |
diff --git a/tests/guix-system.sh b/tests/guix-system.sh index e7e4c17e39f..f5ddd1dda34 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh | |||
| @@ -262,8 +262,8 @@ guix system vm "$tmpfile" -d | grep '\.drv$' | |||
| 262 | drv1="`guix system vm "$tmpfile" -d`" | 262 | drv1="`guix system vm "$tmpfile" -d`" |
| 263 | drv2="`guix system vm "$tmpfile" -d`" | 263 | drv2="`guix system vm "$tmpfile" -d`" |
| 264 | test "$drv1" = "$drv2" | 264 | test "$drv1" = "$drv2" |
| 265 | drv1="`guix system disk-image -t iso9660 "$tmpfile" -d`" | 265 | drv1="`guix system image -t iso9660 "$tmpfile" -d`" |
| 266 | drv2="`guix system disk-image -t iso9660 "$tmpfile" -d`" | 266 | drv2="`guix system image -t iso9660 "$tmpfile" -d`" |
| 267 | test "$drv1" = "$drv2" | 267 | test "$drv1" = "$drv2" |
| 268 | 268 | ||
| 269 | make_user_config "group-that-does-not-exist" "users" | 269 | make_user_config "group-that-does-not-exist" "users" |
