diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2021-01-19 18:09:28 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2021-02-17 10:52:28 +0100 |
| commit | ee2a5da80a9bda25542c00a7a35a9ddddcbd58af (patch) | |
| tree | a578e04f14dad512d5f2bbc66aeedc463a3a94c5 /gnu | |
| parent | 43b2e440c38a39eb64088bd6c08771c060aa10fc (diff) | |
scripts: system: Remove 'vm-image' command.
Remove the 'vm-image' command that has been superseded by the 'image'
command.
* gnu/system/vm.scm (system-qemu-image): Remove it.
* guix/scripts/system.scm (system-derivation-for-action): Mark 'vm-image'
command as deprecated and use the image API to produce the VM image.
(perform-action, show-help): Adapt accordingly.
* tests/guix-system.sh: Ditto.
* doc/guix.texi (Invoking guix system,
Running Guix in a VM): Ditto.
* etc/completion/fish/guix.fish: Ditto.
* etc/completion/zsh/_guix: Ditto.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/system/vm.scm | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 1afae6b4edf..d7ae048b81e 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm | |||
| @@ -73,7 +73,6 @@ | |||
| 73 | #:export (expression->derivation-in-linux-vm | 73 | #:export (expression->derivation-in-linux-vm |
| 74 | qemu-image | 74 | qemu-image |
| 75 | virtualized-operating-system | 75 | virtualized-operating-system |
| 76 | system-qemu-image | ||
| 77 | 76 | ||
| 78 | system-qemu-image/shared-store | 77 | system-qemu-image/shared-store |
| 79 | system-qemu-image/shared-store-script | 78 | system-qemu-image/shared-store-script |
| @@ -559,68 +558,6 @@ the operating system." | |||
| 559 | 558 | ||
| 560 | 559 | ||
| 561 | ;;; | 560 | ;;; |
| 562 | ;;; VM and disk images. | ||
| 563 | ;;; | ||
| 564 | |||
| 565 | (define* (system-qemu-image os | ||
| 566 | #:key | ||
| 567 | (file-system-type "ext4") | ||
| 568 | (disk-image-size (* 900 (expt 2 20)))) | ||
| 569 | "Return the derivation of a freestanding QEMU image of DISK-IMAGE-SIZE bytes | ||
| 570 | of the GNU system as described by OS." | ||
| 571 | (define file-systems-to-keep | ||
| 572 | ;; Keep only file systems other than root and not normally bound to real | ||
| 573 | ;; devices. | ||
| 574 | (remove (lambda (fs) | ||
| 575 | (let ((target (file-system-mount-point fs)) | ||
| 576 | (source (file-system-device fs))) | ||
| 577 | (or (string=? target "/") | ||
| 578 | (and (string? source) | ||
| 579 | (string-prefix? "/dev/" source)) | ||
| 580 | (uuid? source) | ||
| 581 | (file-system-label? source)))) | ||
| 582 | (operating-system-file-systems os))) | ||
| 583 | |||
| 584 | (define root-uuid | ||
| 585 | ;; UUID of the root file system. | ||
| 586 | (operating-system-uuid os | ||
| 587 | (if (string=? file-system-type "iso9660") | ||
| 588 | 'iso9660 | ||
| 589 | 'dce))) | ||
| 590 | |||
| 591 | |||
| 592 | (let* ((os (operating-system | ||
| 593 | (inherit os) | ||
| 594 | |||
| 595 | ;; As in 'virtualized-operating-system', use BIOS-style GRUB. | ||
| 596 | (bootloader (bootloader-configuration | ||
| 597 | (bootloader grub-bootloader) | ||
| 598 | (target "/dev/vda"))) | ||
| 599 | |||
| 600 | ;; Assume we have an initrd with the whole QEMU shebang. | ||
| 601 | |||
| 602 | ;; Force our own root file system. Refer to it by UUID so that | ||
| 603 | ;; it works regardless of how the image is used ("qemu -hda", | ||
| 604 | ;; Xen, etc.). | ||
| 605 | (file-systems (cons (file-system | ||
| 606 | (mount-point "/") | ||
| 607 | (device root-uuid) | ||
| 608 | (type file-system-type)) | ||
| 609 | file-systems-to-keep)))) | ||
| 610 | (bootcfg (operating-system-bootcfg os))) | ||
| 611 | (qemu-image #:os os | ||
| 612 | #:bootcfg-drv bootcfg | ||
| 613 | #:bootloader (bootloader-configuration-bootloader | ||
| 614 | (operating-system-bootloader os)) | ||
| 615 | #:disk-image-size disk-image-size | ||
| 616 | #:file-system-type file-system-type | ||
| 617 | #:file-system-uuid root-uuid | ||
| 618 | #:inputs `(("system" ,os) | ||
| 619 | ("bootcfg" ,bootcfg)) | ||
| 620 | #:copy-inputs? #t))) | ||
| 621 | |||
| 622 | |||
| 623 | ;;; | ||
| 624 | ;;; VMs that share file systems with the host. | 561 | ;;; VMs that share file systems with the host. |
| 625 | ;;; | 562 | ;;; |
| 626 | 563 | ||
