summaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
AgeCommit message (Collapse)Author
2017-11-26vm: Use os-defined initrd intead of base-initrd.Mathieu Othacehe
* 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.
2017-11-06system: vm: Use 2^32 - 1 as hash size.Mathieu Othacehe
* 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).
2017-10-19vm: Always use GRUB/i386.Ludovic Courtès
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.
2017-10-04vm: Add disk-image-size to <virtual-machine>.Christopher Baines
* gnu/system/vm.scm (<virtual-machine>): Add disk-image-size. (port-forwardings->qemu-options): Use disk-image-size from <virtual-machine>.
2017-10-04vm: Add a minimum root size.Christopher Baines
* 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.
2017-09-11vm: Generate a UUID to identify the root file system.Ludovic Courtès
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'.
2017-09-11vm: Allow users to specify a UUID for the root partition.Ludovic Courtès
* gnu/system/vm.scm (qemu-image): Add #:file-system-uuid parameter; pass it as the 'uuid' field of the root partition.
2017-09-11system: Introduce a disjoint UUID type.Ludovic Courtès
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.
2017-09-06vm: Call iso9660-image with #:register-closures? as #t.Christopher Baines
* gnu/system/vm.scm (system-disk-image): Call iso9660-image with #:register-closures? as #t.
2017-09-06vm: Add support for registering closures to iso9660-image.Christopher Baines
* gnu/system/vm.scm (iso9660-image): Add support for registering closures.
2017-09-04vm: Remove redundant conditional in system-disk-image.Christopher Baines
* gnu/system/vm.scm (system-disk-image): Remove redundant conditional for #:file-system-type when calling qemu-image.
2017-08-03vm: Use grub-hybrid's grub-mkrescue.Danny Milosavljevic
* gnu/system/vm.scm (system-disk-image): Use grub-hybrid's grub-mkrescue. * gnu/bootlader/grub.scm (grub-mkrescue-bootloader): New variable.
2017-07-20vm: Add a <virtual-machine> type and associated gexp compiler.Ludovic Courtès
* 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.
2017-07-18vm: 'iso9660-image' produces a single-file output.Ludovic Courtès
* 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.
2017-07-17build, vm: Use a less common label.Tobias Geerinckx-Rice
* 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.
2017-07-15gnu: Rename (gnu packages qemu) to (gnu packages virtualization).宋文武
* 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.
2017-07-10build, vm: Use "GuixSD" or "GUIXSD" as volume label.Danny Milosavljevic
* 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>
2017-07-07guix system: Add file system label and uuid to iso9660-image.Danny Milosavljevic
* gnu/system/vm.scm (system-disk-image): Pass root-label to ... (iso9660-image): ... here. Add keyword arguments #:file-system-label and #:file-system-uuid.
2017-07-03build: Add iso9660 system image generator.Danny Milosavljevic
* 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.
2017-06-30vm: Estimate the disk size by default.Ludovic Courtès
* 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.
2017-06-16tests: Allow setting of qemu memory-size for system tests.Jan Nieuwenhuizen
* gnu/system/vm.scm (common-qemu-options): Remove hardcoded "-m 256". (system-qemu-image/shared-store-script): New keyword argument: #:memory-size.
2017-05-21vm: Increase default disk size to account for ESP partition.Marius Bakke
Fixes a test regression introduced by ecf5d5376979fadd971559367bf553df89fcc62b. * gnu/system/vm.scm (system-qemu-image/shared-store-script): 30MiB -> 70MiB.
2017-05-19vm: Add UEFI loader to disk images.Marius Bakke
* 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.
2017-05-19vm: Support creating FAT partitions.Marius Bakke
* 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.
2017-05-19vm: Support arbitrary partition flags.Marius Bakke
* gnu/build/vm.scm (<partition>): Change BOOTABLE? to FLAGS. (initialize-partition-table): Pass each flag to parted. (initialize-hard-disk): Locate boot partition. * gnu/system/vm.scm (qemu-image): Adjust partition flags.
2017-05-16bootloader: Adapt vm to new bootloader API.Mathieu Othacehe
* gnu/build/install.scm (install-boot-config): New procedure. (install-grub): Move to (gnu bootloader grub). * gnu/build/vm.scm (register-bootcfg-root): Rename register-grub.cfg-root and adjust accordingly. (initialize-hard-disk): Takes a bootloader-package, bootcfg, bootcfg-location and bootloader-installer procedure. Adjust accordingly. * gnu/system/vm.scm (qemu-image): Adjust to initialize-hard-disk. (system-disk-image, system-qemu-image, system-qemu-image/shared-store): Adjust to qemu-image.
2017-05-16bootloader: Add extlinux support.Mathieu Othacehe
* gnu/bootloader.scm: New file. * gnu/bootloader/extlinux.scm: New file. * gnu/bootloader/grub.scm: New file. * gnu/local.mk: Build new files. * gnu/system.scm: Adapt to new bootloader api. * gnu/scripts/system.scm: Adapt to new bootloader api. * gnu.scm: Remove (gnu system grub) and replace by (gnu bootloader) and (gnu bootloader grub) modules. * gnu/system/grub.scm: Moved content to gnu/bootloader/grub.scm. * gnu/system/vm: Replace (gnu system grub) module by (gnu bootloader). * gnu/tests.scm: Ditto. * gnu/tests/nfs.scm: Ditto.
2017-05-05system: vm: Use operating-system-kernel-arguments.Danny Milosavljevic
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use operating-system-kernel-arguments.
2017-04-22system: Rename operating-system-kernel-arguments to ↵Danny Milosavljevic
operating-system-user-kernel-arguments. * gnu/system.scm (operating-system-kernel-arguments): Rename to ... (operating-system-user-kernel-arguments): ... this. (<operating-system>): Adapt accordingly. (operating-system-bootcfg): Adapt accordingly. (operating-system-parameters-file): Adapt accordingly. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Adapt accordingly.
2017-04-15vm: Reword grub.cfg to bootcfg.Mathieu Othacehe
* gnu/build/vm.scm (register-grub.cfg-root): Reword grub.cfg to bootcfg, (initialize-hard-disk): ditto, * gnu/system/vm.scm (system-disk-image): ditto, (system-qemu-image): ditto, (system-qemu-image/shared-store): ditto. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15system: Rename operating-system-grub.cfg to operating-system-bootcfg.Mathieu Othacehe
* gnu/system.scm (operating-system-grub.cfg): Rename to... (operating-system-bootcfg): ... this. * gnu/system/vm.scm (system-disk-image): Use operating-system-bootcfg. (system-qemu-image): Use operating-system-bootcfg. (system-qemu-image/shared-store): Use operating-system-bootcfg. * guix/scripts/system.scm (perform-action): Use operating-system-bootcfg. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-03-06vm: Fix full-boot? option.David Craven
* gnu/system/vm.scm (virtualized-operating-system): Add full-boot? option. Don't add a %store-mapping when full-boot? is passed. This leads the grub-configuration-file procedure to look for the kernel and initrd in / instead of /gnu/store. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01vm: Improve readability of run-vm.sh generation.David Craven
* gnu/system/vm.scm (common-qemu-options, system-qemu-image/shared-store-script): Improve readability.
2017-02-28vm: Remove hard coded kernel file name.David Craven
* gnu/system/vm.scm (system-qemu-image/shared-store-script, expression->derivation-in-linux-vm): Use operating-system-kernel-file and system-linux-image-file-name. * gnu/system.scm (system-linux-image-file-name): Add ARM.
2017-02-10gnu: Move (gnu packages grub) and (gnu packages u-boot) ...David Craven
to (gnu packages bootloaders). * gnu/packages/grub.scm: Rename to bootloaders.scm. * gnu/packages/u-boot.scm: Move to bootloaders.scm. * gnu/local.mk (GNU_SYSTEM_MODULES): Add bootloaders.scm, remove grub.scm and u-boot.scm; * gnu/system/grub.scm: Import (gnu packages bootloaders). * gnu/system/install.scm: Import (gnu packages bootloaders). * gnu/system/vm.scm: Import (gnu packages bootloaders).
2016-11-19vm: Disable initrd-time QEMU networking for VM images.Ludovic Courtès
Fixes <http://bugs.gnu.org/24943>. Reported by dian_cecht@zoho.com. * gnu/system/vm.scm (system-qemu-image)[initrd]: Remove #:qemu-networking? #t. (virtualized-operating-system): Likewise
2016-09-06system: vm: Remove -net user flag.David Craven
* gnu/system/vm.scm (common-qemu-options): Remove -net user flag.
2016-09-05system: Use 'source-module-closure' where needed.Ludovic Courtès
* gnu/system/vm.scm (%vm-module-closure): Remove. (expression->derivation-in-linux-vm): Use 'source-module-closure' instead of %VM-MODULE-CLOSURE. (qemu-image): Likewise. * gnu/system/linux-initrd.scm (expression->initrd): Likewise. (flat-linux-module-directory, base-initrd): Likewise. * gnu/system/mapped-devices.scm (open-luks-device): Likewise.
2016-07-12gnu: Use 'gexp->file' in conjunction with 'with-imported-modules'.Ludovic Courtès
* gnu/services.scm (activation-script): Remove code to set '%load-path' and use 'with-imported-modules' instead. (cleanup-gexp): Likewise. * gnu/system/vm.scm (%vm-module-closure): New variable. (expression->derivation-in-linux-vm): Remove #:modules. [loader]: Remove code to set '%load-path'. [builder]: Use %VM-MODULE-CLOSURE. (qemu-image): Use 'with-imported-modules'.
2016-07-12gnu: Switch to 'with-imported-modules'.Ludovic Courtès
* gnu/services.scm (directory-union): Use 'with-imported-modules' instead of the '#:modules' argument of 'computed-file'. * gnu/services/base.scm (udev-rules-union): Likewise. * gnu/services/dbus.scm (system-service-directory): Likewise. * gnu/services/desktop.scm (wrapped-dbus-service): (polkit-directory): Likewise. * gnu/services/networking.scm (tor-configuration->torrc): Likewise. * gnu/services/xorg.scm (xorg-configuration-directory): Likewise. * gnu/system/install.scm (self-contained-tarball): Likewise. * gnu/system/linux-container.scm (container-script): Likewise. * gnu/system/linux-initrd.scm (expression->initrd): Likewise, and remove #:modules parameter. (flat-linux-module-directory): Use 'with-imported-modules'. (base-initrd): Likewise. * gnu/system/locale.scm (locale-directory): Likewise. * gnu/system/shadow.scm (default-skeletons): Likewise. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise. * gnu/tests/base.scm (run-basic-test): Likewise. * gnu/tests/install.scm (run-install): Likewise. * doc/guix.texi (Initial RAM Disk): Update 'expression->initrd' documentation.
2016-05-04tests: Add whole-system test.Ludovic Courtès
* gnu/system/vm.scm (virtualized-operating-system): Export. * gnu/tests/base.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * Makefile.am (check-system): New target.
2016-05-04Add (gnu tests) and (gnu build marionette).Ludovic Courtès
* gnu/build/marionette.scm, gnu/tests.scm: New files. * gnu/local.mk (GNU_SYSTEM_MODULES): Add them. * gnu/system/vm.scm (common-qemu-options): Remove '-serial stdio'.
2016-04-29guix system: Reduce size of image produced for 'vm' action.Ludovic Courtès
This reduces the size of the image produced by 'guix system vm' from 26 MiB to 9 MiB. * gnu/system/vm.scm (system-qemu-image/shared-store): (system-qemu-image/shared-store-script): Change the default value of #:disk-image-size to 30 MiB when not FULL-BOOT?. * guix/scripts/system.scm (system-derivation-for-action): Likewise for the 'vm' action.
2016-02-22vm: Only pass "-enable-kvm" to qemu if /dev/kvm is present.Christopher Allan Webber
Fixes <http://bugs.gnu.org/22633>. * gnu/build/vm.scm (load-in-linux-vm): Only pass "-enable-kvm" flag to qemu if "/dev/kvm" is present. * gnu/system/vm.scm (common-kvm-options): Same as above.
2016-02-08file-systems: Spawn a Bournish REPL upon fsck failure.Ludovic Courtès
Fixes <http://bugs.gnu.org/22588>. Reported by Mark H Weaver <mhw@netris.org>. * gnu/build/file-systems.scm (check-file-system): Pass %BOURNISH-LANGUAGE as the argument to 'start-repl'. * gnu/services.scm (activation-script): Add (guix build bournish). * gnu/services/base.scm (file-system-shepherd-service)[imported-modules]: Likewise. * gnu/system/linux-container.scm (container-script): Likewise. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
2016-01-01system: Allow the root file system to have a UUID.Ludovic Courtès
This is a followup to ab64483. * gnu/system.scm (mapped-device-user): Check whether the title of FS is 'device before calling 'string=?'. * gnu/system/vm.scm (virtualized-operating-system)[user-file-systems]: Likewise.
2015-11-21gnu: Add qemu-minimal.Ludovic Courtès
* gnu/packages/qemu.scm (qemu): Exchange with former QEMU-HEADLESS. (qemu-headless): Rename to... (qemu-minimal): ... this. New variable. Pass --target-list. * gnu/packages/debug.scm (qemu-2.3.0): Inherit from QEMU-MINIMAL. * gnu/packages/grub.scm (qemu-for-tests): Likewise. * gnu/system/vm.scm (expression->derivation-in-linux-vm, qemu-image): Update to name change.
2015-11-03system: Rename (gnu system linux) to (gnu system pam).Ludovic Courtès
* gnu/system/linux.scm: Rename to... * gnu/system/pam.scm: ... this. * gnu-system.am (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu.scm, gnu/services/base.scm, gnu/services/desktop.scm, gnu/services/networking.scm, gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system.scm, gnu/system/vm.scm: Likewise.
2015-07-26vm: Make the list of partitions to build a parameter.Ludovic Courtès
* gnu/build/vm.scm (<partition>): New record type. (fold2): New procedure. (initialize-partition-table): Remove #:bootable? and 'partition-size' parameters. Add 'partitions' parameter. Invoke 'parted' with '--script'. (initialize-root-partition): Remove. (initialize-partition, root-partition-initializer): New procedures. (initialize-hard-disk): Remove #:system-directory, #:disk-image-size, #:file-system-type, #:file-system-label, #:closures, #:copy-closures?, #:bootable?, and #:register-closures? parameters. Add #:partitions. Rewrite to use 'initialize-partition' for each item of PARTITIONS. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add (guix records) to #:modules default value. (qemu-image): Adjust accordingly.
2015-07-24vm: Use the 'umount' procedure instead of util-linux's 'umount' command.Ludovic Courtès
* gnu/build/vm.scm (initialize-root-partition, initialize-hard-disk): Use the 'umount' procedure instead of invoking the 'umount' command. * gnu/system/vm.scm (qemu-image): Remove UTIL-LINUX from INPUTS.