summaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
Commit message (Collapse)AuthorAge
* install: Use (guix store database) instead of 'guix-register'.Ludovic Courtès2018-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/build/install.scm (register-closure): Add #:reset-timestamps? and and #:schema; honor them. Rewrite in terms of 'register-path'. (populate-single-profile-directory): Add #:schema and honor it. Make /var/guix/profiles and /var/guix/gcroots. * gnu/build/vm.scm (root-partition-initializer): Pass #:reset-timestamps? to 'register-closure'. * gnu/system/vm.scm (not-config?): New procedure. (guile-sqlite3&co): New variable. (expression->derivation-in-linux-vm)[config]: New variable. [builder]: Use 'with-extensions'. (iso9660-image)[schema, config]: New variables. Wrap build expression in 'with-extensions'; add 'sql-schema' call. Remove GUIX from INPUTS. (qemu-image)[schema, config]: New variables. Wrap body in 'with-extensions'. (system-docker-image)[not-config?]: Remove. [config]: Use 'make-config.scm'. [schema]: New variable. [build]: Use 'with-extensions'. Add call to 'sql-schema'. Remove GUIX from INPUTS. * gnu/system/file-systems.scm (%store-prefix): Check whether '%store-prefix' is defined. * guix/scripts/pack.scm (self-contained-tarball)[not-config?] [libgcrypt, schema]: New variables. [build]: Wrap in 'with-extensions'. Adjust imported module list to use 'make-config.scm' for (guix config).
* vm: 'expression->derivation-in-linux-vm' code can now use dlopen.Ludovic Courtès2018-06-14
| | | | | | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm) [user-builder]: Define in non-monadic style as 'program-file'. [loader]: Likewise, and 'execl' USER-BUILDER instead of loading it. (system-docker-image): Pass BUILD as the second argument to 'expression->derivation-in-linux-vm'. (make-iso9660-image, qemu-image): Remove call to 'reboot'.
* store-copy: 'read-reference-graph' returns a list of records.Ludovic Courtès2018-06-14
| | | | | | | | | | | | | | The previous implementation of 'read-reference-graph' was good enough for many use cases, but it discarded the graph structure, which is useful information in some cases. * guix/build/store-copy.scm (<store-info>): New record type. (read-reference-graph): Rewrite to return a list of <store-info>. (closure-size, populate-store): Adjust accordingly. * gnu/services/base.scm (references-file): Adjust accordingly. * gnu/system/vm.scm (system-docker-image): Likewise. * guix/scripts/pack.scm (squashfs-image, docker-image): Likewise. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
* vm: 'iso9660-image' uses a local /tmp.Ludovic Courtès2018-06-08
| | | | | | | | Fixes <https://bugs.gnu.org/31752>. Regression introduced in commit 8c9bf2946a1cb58c5b7b941db3a37830ece80708. * gnu/system/vm.scm (iso9660-image): Pass #:file-systems to 'expression->derivation-in-linux-vm'.
* vm: 'expression->derivation-in-linux-vm' takes a #:file-systems parameter.Ludovic Courtès2018-06-08
| | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add #:file-systems and use it instead of %LINUX-VM-FILE-SYSTEMS.
* vm: Use 'with-extensions'.Ludovic Courtès2018-06-01
| | | | | * gnu/system/vm.scm (system-docker-image)[build]: Use 'with-extensions'. Remove 'add-to-load-path' calls.
* vm: Remove unneeded dependency on Guile-JSON.Ludovic Courtès2018-05-29
| | | | | | | Fixes <https://bugs.gnu.org/31581>. Reported by Leo Famulari <leo@famulari.name>. * gnu/system/vm.scm: Remove unneeded (guix docker) import.
* system: Remove uses of the 'title' field of <file-system>.Ludovic Courtès2018-05-28
| | | | | | | | | | | | | | * gnu/system/install.scm (installation-os): Remove uses of the 'title' field of 'file-system'; use 'file-system-label' as appropriate. * gnu/system/vm.scm (system-disk-image, system-qemu-image): Likewise. * gnu/tests.scm (%simple-os): Likewise. * gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os) (%minimal-os-on-vda, %separate-home-os, %separate-store-os) (%raid-root-os, %encrypted-root-os, %btrfs-root-os): Likewise. * gnu/build/shepherd.scm (default-mounts)[tmpfs]: Likewise. * tests/guix-system.sh: Likewise. * tests/system.scm (%root-fs): Likewise. ("operating-system-boot-mapped-devices, implicit dependency"): Likewise.
* file-systems: Remove 'title' field and add <file-system-label>.Ludovic Courtès2018-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'title' field was easily overlooked and was an endless source of confusion. Now, the value of the 'device' field is self-contained. * gnu/system/file-systems.scm (<file-system>): Change constructor name to '%file-system'. [title]: Remove. (<file-system-label>): New record type with printer. (report-deprecation, device-expression) (process-file-system-declaration, file-system): New macros. (file-system-title): New procedure. (file-system->spec, spec->file-system): Adjust to handle <file-system-label>. * gnu/system.scm (bootable-kernel-arguments): Add case for 'file-system-label?'. (read-boot-parameters): Likewise. (mapped-device-user): Avoid 'file-system-title'. (fs->boot-device): Remove. (operating-system-boot-parameters): Use 'file-system-device' instead of 'fs->boot-device'. (device->sexp): Add case for 'file-system-label?'. * gnu/bootloader/grub.scm (grub-root-search): Add case for 'file-system-label?'. * gnu/system/examples/bare-bones.tmpl, gnu/system/examples/beaglebone-black.tmpl, gnu/system/examples/lightweight-desktop.tmpl, gnu/system/examples/vm-image.tmpl: Remove uses of 'title'. * gnu/system/vm.scm (virtualized-operating-system): Remove uses of 'file-system-title'. * guix/scripts/system.scm (check-file-system-availability): Likewise, and adjust fix-it hint. (check-initrd-modules)[file-system-/dev]: Likewise. * gnu/build/file-systems.scm (canonicalize-device-spec): Remove 'title' parameter. [canonical-title]: Remove. Match on SPEC's type rather than on CANONICAL-TITLE. (mount-file-system): Adjust caller. * gnu/build/linux-boot.scm (boot-system): Interpret ROOT here. * gnu/services/base.scm (file-system->fstab-entry): Remove use of 'file-system-title'. * doc/guix.texi (File Systems): Remove documentation of the 'title' field. Rewrite documentation of 'device' and document 'file-system-label'.
* vm: Use a deterministic file system UUID in shared-store VMs.Ludovic Courtès2018-05-23
| | | | | * gnu/system/vm.scm (system-qemu-image/shared-store): Pass #:file-system-uuid to 'qemu-image'.
* system: Add "guix system docker-image" command.Chris Marusich2018-03-24
| | | | | | | | | | | * gnu/system/vm.scm (system-docker-image): New procedure. * guix/scripts/system.scm (system-derivation-for-action): Add a case for docker-image, and in that case, call system-docker-image. (show-help): Document docker-image. (guix-system): Parse arguments for docker-image. * doc/guix.texi (Invoking guix system): Document "guix system docker-image". * gnu/system/examples/docker-image.tmpl: New file.
* gnu: When building in a VM, share a temporary directory.Chris Marusich2018-03-24
| | | | | | * gnu/build/vm.scm (load-in-linux-vm): Make a shared temporary directory available in the VM. * gnu/system/vm.scm (%linux-vm-file-systems): Add a corresponding entry.
* vm: Display a backtrace upon error by default.Ludovic Courtès2018-03-18
| | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass #:on-error to 'base-initrd'.
* vm: Use 9p mount tags below 32 chars.Ludovic Courtès2018-03-08
| | | | | | | | Fixes <https://bugs.gnu.org/30667>. Reported by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>. * gnu/system/vm.scm (file-system->mount-tag): Use 'sha1' to compute the tag.
* linux-initrd: Add virtio modules to '%base-initrd-modules'.Ludovic Courtès2018-03-03
| | | | | | | | | | | | | | | | | | | Fixes a regression in installation tests, whereby 'guix system init' would report that virtio modules are missing for the target devices. In practice virtio modules were always available since 'base-initrd' was always called with #:virtio? #t. This commit simply moves them to '%base-initrd-modules' so that 'guix system' knows they're available. Reported by Danny Milosavljevic <dannym@scratchpost.org> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30629#112>. * gnu/system/linux-initrd.scm (default-initrd-modules): Add virtio modules. (base-initrd): Remove #:virtio? and 'virtio-modules'. * gnu/system/vm.scm (expression->derivation-in-linux-vm) (system-qemu-image, virtualized-operating-system): Remove uses of #:virtio?. * doc/guix.texi (Initial RAM Disk): Update 'base-initrd' doc.
* vm: Add missing modules to the 'expression->derivation-in-linux-vm' initrd.Ludovic Courtès2018-03-03
| | | | | | | | | | Fixes a regression introduced in bc499b113a598c0e7863da9887a4133472985713, whereby the default initrd used by 'expression->derivation-in-linux-vm' would lack all the usual modules: virtio, nls_iso8859-1, etc. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass #:linux-modules to 'base-initrd'.
* gnu: Consistently Write ‘file system(s)’.Tobias Geerinckx-Rice2018-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | It is the GNU way. * doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’. * gnu/build/vm.scm (create-ext-file-system, create-fat-file-system): Likewise. * gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise. * gnu/packages/check.scm (python-testpath)[description]: Likewise. * gnu/packages/disk.scm (pydf)[description]: Likewise. * gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise. (glusterfs)[description]: Likewise. * gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap) (ghc-system-fileio)[synopsis]: Likewise. (ghc-fsnotify)[description]: Likewise. * gnu/packages/linux.scm (proot)[description]: Likewise. (jmtpfs)[synopsis, description]: Likewise. * gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise. * gnu/packages/storage.scm (ceph)[description]: Likewise. * gnu/packages/sync.scm (lsyncd)[description]: Likewise. * gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise. (go-github-com-zillode-notify)[description]: Likewise. * gnu/services/nfs.scm (pipefs-service-type): Likewise. * guix/scripts/system.scm (perform-action): Likewise.
* vm: 'vm-image' images refer to the root file system by UUID.Ludovic Courtès2018-01-07
| | | | | | | | | | | This avoids the hard-coded "/dev/sda1", which only made sense when the image is run with "qemu-system-x86_64 -hda", not when it's passed to Xen, etc. Reported by Andreas Enge <andreas@enge.fr>. * gnu/system/vm.scm (system-qemu-image): Define 'root-uuid', use it as the 'device' field for "/", and pass it to 'qemu-image'.
* vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.Leo Famulari2017-12-18
| | | | | * gnu/build/vm.scm (load-in-linux-vm): Use QEMU's virtio-rng-pci. * gnu/system/vm.scm (common-qemu-options): Likewise.
* gnu: system: vm: Use loose cache for 9p file system.Christopher Baines2017-12-17
| | | | | | | This improves the performance of the shared store for operations involving lots of files, e.g. searching through the store. * gnu/system/vm.scm (mapping->file-system): Add cache=loose to options.
* bootloader: Factorize write-file-on-device.Mathieu Othacehe2017-12-15
| | | | | | | | | | | * gnu/bootloader/extlinux.scm (install-extlinux): Factorize bootloader writing in a new procedure write-file-on-device defined in (gnu build bootloader). * gnu/build/bootloader.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add new file. * gnu/system/vm.scm (qemu-img): Adapt to import and use (gnu build bootloader) module during derivation building. * gnu/scripts/system.scm (bootloader-installer-derivation): Ditto.
* vm: Adapt qemu command to ARM.Mathieu Othacehe2017-12-15
| | | | | | | | | | | * gnu/build/vm.scm (load-in-linux-vm): New argument #:target-arm32. Use it to adapt command for qemu-system-arm. This implies to choose a machine ("virt"), use the correct console port "ttyAMA0", disable KVM use that is buggy on some ARM boards (Odroid XU4 for example) and use user mode network stack instead of NIC. Gather all those options in a new variable "arch-specific-flags". * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass to load-in-linux-vm "#:target-arm32?" argument.
* bootloader: extlinux: Stop using dd binary.Mathieu Othacehe2017-12-04
| | | | | | | | * gnu/bootloader/extlinux.scm (dd): Remove it, (install-extlinux): replace dd call by Guile I/O procedures. * gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to used-modules list to provide "get-bytevector-n" and "put-bytevector". * guix/scripts/system.scm (bootloader-installer-derivation): Ditto.
* system: vm: Fix typo in comment.Mathieu Othacehe2017-12-02
| | | | * gnu/system/vm.scm (qemu-image): Fix typo targetting -> targeting.
* system: vm: Do not add EFI partition on ARM system.Mathieu Othacehe2017-12-01
| | | | | | | | * gnu/system/vm.scm (qemu-img): Do not add EFI partition if we are targetting ARM. UEFI support on u-boot is still experimental, so do not add EFI partition on ARM for now.
* vm: Filter out file systems that refer to UUIDs or labels.Ludovic Courtès2017-11-30
| | | | | * gnu/system/vm.scm (virtualized-operating-system)[user-file-systems]: Filter out things that refer to file system UUIDs or labels.
* vm: Use os-defined initrd intead of base-initrd.Mathieu Othacehe2017-11-26
| | | | | | | | | * gnu/system/vm.scm (system-disk-image, system-qemu-image, virtualized-operating-system): Replace base-initrd by (operating-system-initrd os). The system produced were always using base-initrd even if the user had defined a custom initrd based on raw-initrd in the os declaration.
* system: vm: Use 2^32 - 1 as hash size.Mathieu Othacehe2017-11-06
| | | | | | | | * gnu/system/vm.scm (operating-system-uuid): Use 2^32 - 1 instead of 2^32 as hash size. On some 32 bit system (ARM for example), 2^32 exceeds hash max size (ULONG_MAX = 2^32 - 1).
* vm: Always use GRUB/i386.Ludovic Courtès2017-10-19
| | | | | | | | Fixes <https://bugs.gnu.org/28768>. Reported by Oleg Pykhalov <go.wigust@gmail.com>. * gnu/system/vm.scm (virtualized-operating-system): Override the 'bootloader' field.
* vm: Add disk-image-size to <virtual-machine>.Christopher Baines2017-10-04
| | | | | | * gnu/system/vm.scm (<virtual-machine>): Add disk-image-size. (port-forwardings->qemu-options): Use disk-image-size from <virtual-machine>.
* vm: Add a minimum root size.Christopher Baines2017-10-04
| | | | | | * gnu/system/vm.scm (qemu-image): When guessing the root-size, use a lower bound of 20 MiB, otherwise the root file system size is sometimes 0 MiB in size.
* vm: Generate a UUID to identify the root file system.Ludovic Courtès2017-09-11
| | | | | | | | | This makes collisions less likely than when using a label to look up the partition. See <https://bugs.gnu.org/27735>. * gnu/system/vm.scm (operating-system-uuid): New procedure. (system-disk-image): Define 'root-uuid' and use it for the root file system. Pass it to 'iso9660-image' and 'qemu-image'.
* vm: Allow users to specify a UUID for the root partition.Ludovic Courtès2017-09-11
| | | | | * gnu/system/vm.scm (qemu-image): Add #:file-system-uuid parameter; pass it as the 'uuid' field of the root partition.
* system: Introduce a disjoint UUID type.Ludovic Courtès2017-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conceptually a UUID is just a bytevector. However, there's software out there such as GRUB that relies on the string representation of different UUID types (e.g., the string representation of DCE UUIDs differs from that of ISO-9660 UUIDs, even if they are actually bytevectors of the same length). This new <uuid> record type allows us to preserve information about the type of UUID so we can eventually convert it to a string using the right representation. * gnu/system/uuid.scm (<uuid>): New record type. (bytevector->uuid): New procedure. (uuid): Return calls to 'make-uuid'. (uuid->string): Rewrite using 'match-lambda*' to accept a single 'uuid?' argument. * gnu/bootloader/grub.scm (grub-root-search): Check for 'uuid?' instead of 'bytevector?'. * gnu/system.scm (bootable-kernel-arguments): Check whether ROOT-DEVICE is 'uuid?'. (read-boot-parameters): Use 'bytevector->uuid' when the store device is a bytevector. (read-boot-parameters-file): Check for 'uuid?' instead of 'bytevector?'. (device->sexp): New procedure. (operating-system-boot-parameters-file): Use it for 'root-device' and 'store'. (operating-system-bootcfg): Remove conditional in definition of 'root-device'. * gnu/system/file-systems.scm (file-system->spec): Check for 'uuid?' on DEVICE and take its bytevector. * gnu/system/mapped-devices.scm (open-luks-device): Likewise. * gnu/system/vm.scm (iso9660-image): Call 'uuid-bytevector' for the #:volume-uuid argument.
* vm: Call iso9660-image with #:register-closures? as #t.Christopher Baines2017-09-06
| | | | | * gnu/system/vm.scm (system-disk-image): Call iso9660-image with #:register-closures? as #t.
* vm: Add support for registering closures to iso9660-image.Christopher Baines2017-09-06
| | | | * gnu/system/vm.scm (iso9660-image): Add support for registering closures.
* vm: Remove redundant conditional in system-disk-image.Christopher Baines2017-09-04
| | | | | * gnu/system/vm.scm (system-disk-image): Remove redundant conditional for #:file-system-type when calling qemu-image.
* vm: Use grub-hybrid's grub-mkrescue.Danny Milosavljevic2017-08-03
| | | | | * gnu/system/vm.scm (system-disk-image): Use grub-hybrid's grub-mkrescue. * gnu/bootlader/grub.scm (grub-mkrescue-bootloader): New variable.
* vm: Add a <virtual-machine> type and associated gexp compiler.Ludovic Courtès2017-07-20
| | | | | | | | | * gnu/system/vm.scm (system-qemu-image/shared-store-script): Add #:options parameter and honor it. (<virtual-machine>): New record type. (virtual-machine): New macro. (port-forwardings->qemu-options, virtual-machine-compiler): New procedures.
* vm: 'iso9660-image' produces a single-file output.Ludovic Courtès2017-07-18
| | | | | | | | | * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add #:single-file-output? and pass it to 'load-in-linux-vm'. (iso9660-image): Pass #:single-file-output? to 'expression->derivation-in-linux-vm'. * gnu/build/vm.scm (load-in-linux-vm): Add #:single-file-output? and honor it.
* build, vm: Use a less common label.Tobias Geerinckx-Rice2017-07-17
| | | | | | * gnu/build/vm.scm (initialize-hard-disk): Use "GuixSD_image" as label. * gnu/system/install.scm (installation-os): Likewise. * gnu/system/vm.scm (system-disk-image): Likewise.
* gnu: Rename (gnu packages qemu) to (gnu packages virtualization).宋文武2017-07-15
| | | | | | | | | * gnu/packages/qemu.scm: Rename this ... * gnu/packages/virtualization.scm: ... to this. * gnu/local.mk (GNU_SYSTEM_MODULES), gnu/packages/bootloaders.scm, gnu/packages/debug.scm, gnu/packages/gnome.scm, gnu/system/vm.scm, gnu/tests/install.scm: Adjust accordingly.
* build, vm: Use "GuixSD" or "GUIXSD" as volume label.Danny Milosavljevic2017-07-10
| | | | | | | | | * gnu/build/vm.scm (initialize-hard-disk): Use "GuixSD" as label. * gnu/system/install.scm (installation-os): Use "GuixSD" as label. * gnu/system/vm.scm (system-disk-image): Use "GuixSD" or "GUIXSD" as volume label. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix system: Add file system label and uuid to iso9660-image.Danny Milosavljevic2017-07-07
| | | | | | * gnu/system/vm.scm (system-disk-image): Pass root-label to ... (iso9660-image): ... here. Add keyword arguments #:file-system-label and #:file-system-uuid.
* build: Add iso9660 system image generator.Danny Milosavljevic2017-07-03
| | | | | | | * build-aux/hydra/gnu-system.scm (qemu-jobs): Add 'iso9660-image . * gnu/build/vm.scm (make-iso9660-image): New variable. Export it. * gnu/system/vm.scm (iso9660-image): New variable. Use make-iso9660-image. (system-disk-image): Use iso9660-image.
* vm: Estimate the disk size by default.Ludovic Courtès2017-06-30
| | | | | | | | | | | | | | | * gnu/build/vm.scm (estimated-partition-size): New procedure. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Change #:disk-image-size default to 'guess. [builder]: When DISK-IMAGE-SIZE is 'guess, use 'estimated-partition-size' and compute and estimate of the image size. (qemu-image): Likewise. * guix/build/store-copy.scm (file-size, closure-size): New procedures. * guix/scripts/system.scm (%default-options): Change 'image-size' to 'guess. * doc/guix.texi (Building the Installation Image): Remove '--image-size' flag from example. (Invoking guix system): Document the image size estimate.
* tests: Allow setting of qemu memory-size for system tests.Jan Nieuwenhuizen2017-06-16
| | | | | * gnu/system/vm.scm (common-qemu-options): Remove hardcoded "-m 256". (system-qemu-image/shared-store-script): New keyword argument: #:memory-size.
* vm: Increase default disk size to account for ESP partition.Marius Bakke2017-05-21
| | | | | | Fixes a test regression introduced by ecf5d5376979fadd971559367bf553df89fcc62b. * gnu/system/vm.scm (system-qemu-image/shared-store-script): 30MiB -> 70MiB.
* vm: Add UEFI loader to disk images.Marius Bakke2017-05-19
| | | | | | * gnu/build/vm.scm (install-efi): New procedure. (initialize-hard-disk): Generate EFI blob when ESP is present. * gnu/system/vm.scm (qemu-image): Append 40MiB EFI System Partition.
* vm: Support creating FAT partitions.Marius Bakke2017-05-19
| | | | | | | * gnu/build/vm.scm (create-ext-file-system, create-fat-file-system): New procedures. (format-partition): Use them. Error for unknown file systems. * gnu/system/vm.scm (qemu-image): Include DOSFSTOOLS. * gnu/system/linux-initrd.scm (base-initrd): Always add nls_is8859-1.ko.