summaryrefslogtreecommitdiff
path: root/gnu/build/vm.scm
AgeCommit message (Expand)Author
2020-12-15database: Remove #:deduplicate? from 'register-items'....It is now up to the caller to deduplicate store contents. * guix/store/database.scm (register-items): Remove #:deduplicate? parameter and call to 'deduplicate'. (register-path): Call 'deduplicate' when #:deduplicate? is true. * gnu/build/image.scm (register-closure): Adjust call accordingly. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Likewise. * guix/scripts/pack.scm (store-database): Likewise. Ludovic Courtès
2020-12-15image: 'register-closure' leaves it up to the caller to deduplicate....* gnu/build/image.scm (register-closure): Remove #:deduplicate? parameter and pass #:deduplicate? #f to 'register-items'. (initialize-root-partition): Adjust accordingly. * gnu/build/vm.scm (register-closure, root-partition-initializer): Likewise. Ludovic Courtès
2020-12-15store-copy: 'populate-store' can optionally deduplicate files....Until now deduplication was performed as an additional pass after copying files, which involve re-traversing all the files that had just been copied. * guix/store/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'. Ludovic Courtès
2020-12-15database: Remove #:reset-timestamps? from 'register-items'....The assumption now is that the caller took care of resetting timestamps and permissions. * guix/store/database.scm (register-items): Remove #:reset-timestamps? parameter and the call to 'reset-timestamps'. (register-path): Adjust accordingly and add call to 'reset-timestamps'. * gnu/build/image.scm (register-closure): Remove #:reset-timestamps? parameter to 'register-items'. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Adjust accordingly. * guix/scripts/pack.scm (store-database)[build]: Likewise. Ludovic Courtès
2020-12-15image: 'register-closure' assumes already-reset timestamps....* gnu/build/image.scm (register-closure): Remove #:reset-timestamps? parameter. Pass #:reset-timestamps? #f to 'register-items'. (initialize-root-partition): Adjust accordingly. * gnu/build/vm.scm (register-closure, root-partition-initializer): Likewise. Ludovic Courtès
2020-12-15store-copy: 'populate-store' resets timestamps....Until now, 'populate-store' would reset permissions but not timestamps, so callers would resort to going through an extra directory traversal to reset timestamps. * guix/build/store-copy.scm (reset-permissions): Remove. (copy-recursively): New procedure. (populate-store): Pass #:keep-permissions? to 'copy-recursively'. Remove call to 'reset-permissions'. * tests/gexp.scm ("gexp->derivation, store copy"): In BUILD-DRV, check whether 'populate-store' canonicalizes permissions and timestamps. * gnu/build/image.scm (initialize-root-partition): Pass #:reset-timestamps? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. Ludovic Courtès
2020-06-18database: 'register-items' takes an open database....* guix/store/database.scm (store-database-directory) (store-database-file): New procedures. (call-with-database): Add call to 'mkdir-p'. (register-items): Add 'db' parameter and remove #:state-directory and #:schema. (register-path): Use 'store-database-file' and 'with-database', and parameterize SQL-SCHEMA. * gnu/build/image.scm (register-closure): Likewise. * gnu/build/vm.scm (register-closure): Likewise. * guix/scripts/pack.scm (store-database)[build]: Likewise. Ludovic Courtès
2020-06-06vm: 'expression->derivation-in-linux-vm' always returns a native build....* gnu/system/vm.scm (expression->derivation-in-linux-vm): Remove #:target. [builder]: Use #+. Don't pass #:target-arm32? and #:target-aarch64? to 'load-in-linux-vm'. Pass #:target #f to 'gexp->derivation'. (qemu-image): Adjust accordingly. * gnu/build/vm.scm (load-in-linux-vm): Remove #:target-aarch64? and #:target-arm32?. Define them as local variables. Ludovic Courtès
2020-05-05Merge branch 'master' into core-updatesMarius Bakke
2020-05-05vm: Remove obsolete procedures....* gnu/build/vm.scm (install-efi, make-iso9660-image): Remove those procedures that are now implemented in (gnu build image) module, (initialize-hard-disk): remove efi support. * gnu/system/vm.scm (iso9660-image): Remove it, (qemu-image): adapt it to remove ISO9660 support. Mathieu Othacehe
2020-05-05build: bootloader: Add install-efi procedure....* gnu/build/bootloader.scm (install-efi): New procedure copied from (gnu build vm). (install-efi-loader): New exported procedure, wrapping install-efi. * gnu/build/vm.scm (initialize-hard-disk): Adapt to use install-efi-loader. Mathieu Othacehe
2020-04-11vm: Make the device node procedure a parameter....* gnu/build/vm.scm (root-partition-initializer): Add #:make-device-nodes parameter and use it. * gnu/system/vm.scm (qemu-image): Add #:device-node parameter. Pass #:make-device-nodes to 'root-partition-initializer'. Ludovic Courtès
2020-04-11linux-boot: 'make-essential-device-nodes' root parameter is optional....* gnu/build/linux-boot.scm (make-essential-device-nodes): Change 'root' to an optional parameter. * gnu/build/vm.scm (root-partition-initializer): Adjust accordingly. Ludovic Courtès
2020-04-11vm: Preserve file permissions on /dev....Previously, when REGISTER-CLOSURES? was false, we'd set all the files under /dev to #o644, including /dev/null, /dev/zero, etc. * gnu/build/vm.scm (root-partition-initializer): Call 'reset-timestamps' separately for /dev, with #:preserve-permissions? #t. Ludovic Courtès
2020-04-11vm: 'qemu-image' can pass options to the 'mkfs' command....* gnu/build/vm.scm (<partition>)[file-system-options]: New field. (create-ext-file-system, create-fat-file-system) (format-partition): Add #:options and honor it. (initialize-partition): Pass #:options to 'format-partition'. * gnu/system/vm.scm (qemu-image): Add #:file-system-options and use it for the root partition. Ludovic Courtès
2020-04-11vm: 'qemu-image' accepts a list of extra populate directives....* gnu/build/vm.scm (root-partition-initializer): Add #:extra-directives parameter and pass it to 'populate-root-file-system'. * gnu/system/vm.scm (qemu-image): Add #:extra-directives parameter and pass it to 'root-partition-initializer'. Ludovic Courtès
2020-04-10vm: Transparently compress iso9660 images....* gnu/build/vm.scm (make-iso9660-image): Use the ‘--zisofs’ xorriso filter at the highest compression settings for supported directories. Tobias Geerinckx-Rice
2020-03-26vm: Distinguish between success and failure of the guest code....Fixes <https://bugs.gnu.org/34276>. Reported by Tobias Geerinckx-Rice <me@tobias.gr>. * gnu/system/vm.scm (expression->derivation-in-linux-vm)[loader]: Produce '/xchg/.exit-status' file upon success. * gnu/build/vm.scm (load-in-linux-vm): Check for 'xchg/.exit-status' once QEMU has completed and respond accordingly. Ludovic Courtès
2019-12-18gnu: Remove uses of deprecated Qemu network configuration....* gnu/build/vm.scm (load-in-linux-vm): Move Qemu network configuration from ARCH-SPECIFIC-FLAGS to the Qemu command line. Use the "-nic" option of Qemu instead of "-device" and "-net". * gnu/system/vm.scm (common-qemu-options): Do not add a '-net' command. (virtual-machine-compiler): Use "-nic user,..." instead of "-net". * doc/guix.texi (Installing Guix in a VM, Invoking guix system, Running Guix in a VM): Do the same for examples. Marius Bakke
2019-12-01build: vm: Fix qemu-command procedure....* gnu/build/vm.scm (qemu-command): When system is "armhf-linux", use "arm" as qemu cpu prefix. Mathieu Othacehe
2019-11-22system: vm: Add arm64 support....* gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it to pass correct arguments to qemu. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new target-arm64? argument added above. Do not add ESP partition on all ARM targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets. Mathieu Othacehe
2019-11-22build: vm: Fix arm32 support....* gnu/build/vm.scm (load-in-linux-vm): Disable qemu highmem support on ARM32 systems. Mathieu Othacehe
2019-05-18vm: Create installation media with MBR and HFS only, no GPT....* gnu/build/vm.scm (make-iso9660-image): Accept XORRISO, GRUB-MKRESCUE-ENVIRONMENT. * gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept GRUB-MKRESCUE-ENVIRONMENT. (system-disk-image): Pass GRUB-MKRESCUE-ENVIRONMENT. * gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file. * gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/cdrom.scm (xorriso)[source]: Add patches. [arguments]<#:phases>[install-frontends]: Add phase. Danny Milosavljevic
2019-04-29vm: Pass -smp to QEMU to allow use of multiple cores....* gnu/build/vm.scm (load-in-linux-vm): Pass (parallel-job-count) to QEMU with -smp to allow using multiple cores. Christopher Baines
2019-04-25vm: Adjust FAT serial number code to 32-bit Guile....On 32-bit systems, 'string-hash' would raise an out-of-range exception when the second argument was 2^32. * gnu/build/vm.scm (make-iso9660-image): Pass 2^32 - 1 to 'string-hash'. Ludovic Courtès
2019-04-21vm: Use a fixed FAT serial number for 'efi.img' in ISO images....Partly fixes <https://bugs.gnu.org/35283>. * gnu/build/vm.scm (make-iso9660-image): Set the 'GRUB_FAT_SERIAL_NUMBER' environment variable. Ludovic Courtès
2019-04-21vm: Reset file timestamps of the EFI image in ISO images....Partly fixes <https://bugs.gnu.org/35283>. * gnu/build/vm.scm (make-iso9660-image): Set the 'SOURCE_DATE_EPOCH' environment variable. Ludovic Courtès
2019-04-21vm: Reset file timestamps in ISO images....Partly fixes <https://bugs.gnu.org/35283>. Reported by Florian Pelz <pelzflorian@pelzflorian.de>. * gnu/build/vm.scm (make-iso9660-image): Pass "-volume_date all_file_dates =1". Ludovic Courtès
2019-04-14vm: Remove Xorriso "-padding" option....This is a followup to 66ec389580d4f1e4b81e1c72afe2749a547a0e7c. This reverts 178be030c0e4fdeac5e1c968b5c99d84bb4691db, which is no longer needed. * gnu/build/vm.scm (make-iso9660-image): Remove "-padding" option. Ludovic Courtès
2019-03-13Remove traces of "GuixSD"....* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Remove mentions of "GuixSD". * gnu/bootloader/grub.scm (install-grub-efi): Likewise. * gnu/build/vm.scm (make-iso9660-image): Change default #:volume-id to "Guix_image". (initialize-hard-disk): Search for the "Guix_image" label. * gnu/ci.scm (system-test-jobs, tarball-jobs): Remove "GuixSD". * gnu/installer/newt/welcome.scm (run-welcome-page): Likewise. * gnu/packages/audio.scm (supercollider)[description]: Likewise. * gnu/packages/curl.scm (curl): Likewise. * gnu/packages/emacs.scm (emacs): Likewise. * gnu/packages/gnome.scm (network-manager): Likewise. * gnu/packages/julia.scm (julia): Likewise. * gnu/packages/linux.scm (alsa-plugins): Likewise. (powertop, wireless-regdb): Likewise. * gnu/packages/package-management.scm (guix): Likewise. * gnu/packages/polkit.scm (polkit): Likewise. * gnu/packages/tex.scm (texlive-bin): Likewise. * gnu/services/base.scm (file-systems->fstab): Likewise. * gnu/services/cups.scm (%cups-activation): Likewise. * gnu/services/mail.scm (%dovecot-activation): Likewise. * gnu/services/messaging.scm (prosody-configuration)[log]: Likewise. * gnu/system/examples/vm-image.tmpl (vm-image-motd): Likewise. * gnu/system/install.scm (installation-os)[file-systems]: Change root file system label to "Guix_image". * gnu/system/mapped-devices.scm (check-device-initrd-modules): Remove "GuixSD". * gnu/system/vm.scm (system-docker-image): Likewise. (system-disk-image)[root-label]: Change to "Guix_image". * gnu/tests/install.scm (run-install): Remove "GuixSD". * guix/modules.scm (guix-module-name?): Likewise. * nix/libstore/optimise-store.cc: Likewise. Ludovic Courtès
2018-12-19vm: Re-enable KVM on i386....The workaround is apparently no longer needed with Linux-libre 4.19.2 in the host. * gnu/build/vm.scm (load-in-linux-vm): Remove special case for "qemu-system-i386", thereby re-enabling KVM. Ludovic Courtès
2018-12-06vm: Add padding in the ISO image....Fixes <https://bugs.gnu.org/33639>. Thanks to Ricardo Wurmus and Thomas Schmitt for their suggestions! * gnu/build/vm.scm (make-iso9660-image): Pass "-padding 10m" to xorriso. Ludovic Courtès
2018-11-06pack: Import (guix store database) only when '--localstatedir' is passed....This is another way to address <https://bugs.gnu.org/32184>, which was previously addressed in commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * gnu/build/install.scm (register-closure): Move to... * gnu/build/vm.scm (register-closure): ... here. New procedure. * guix/scripts/pack.scm (self-contained-tarball)[build]: Remove now unneeded 'with-extensions' form and custom (guix config) module. * tests/guix-pack.sh: Revert the strategy from commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * tests/pack.scm ("self-contained-tarball"): Likewise. Ludovic Courtès
2018-07-04vm: Disable KVM on i386....* gnu/build/vm.scm (load-in-linux-vm): Disable KVM on i386. Ludovic Courtès
2018-06-26vm: 'make-iso9660-image' makes 'grub.cfg' a GC root....* gnu/build/vm.scm (make-iso9660-image): Add call to 'register-bootcfg-root'. Ludovic Courtès
2018-06-26vm: 'make-iso9660-image' no longer includes unreferenced store items....Fixes <https://bugs.gnu.org/31757>. * gnu/build/vm.scm (make-iso9660-image): Invoke 'grub-mkrescue' in 'open-pipe*'. Use '-path-list -' instead of passing "gnu/store=…". Ludovic Courtès
2018-06-26vm: Don't try to modify the bind-mounted store....Previously 'guix system disk-image --file-system-type=iso9660' would fail because 'register-closure' would try to reset timestamps/ownership on the bind-mounted store, which fails with EPERM. * gnu/build/vm.scm (make-iso9660-image): Pass #:reset-timestamps? to 'register-closure'. Ludovic Courtès
2018-06-14Remove 'guix-register' and its traces....* Makefile.am (SH_TESTS): Remove tests/guix-register.sh. * build-aux/pre-inst-env.in (GUIX_REGISTER): Remove. * gnu/build/install.scm (directives): Remove outdated comment. * gnu/build/vm.scm (root-partition-initializer): Update comment. * gnu/packages/package-management.scm (guix-register): Remove. * guix/config.scm.in (%sbindir, %guix-register-program): Remove. * guix/scripts/system.scm (install): Adjust docstring. * guix/self.scm (make-config.scm): Remove #:guix. Do not generate %sbindir and %guix-register-program. (specification->package): Remove "guix". * nix/guix-register/guix-register.cc: Remove. * nix/libstore/store-api.cc (decodeValidPathInfo): Remove. * nix/libstore/store-api.hh (decodeValidPathInfo): Remove declaration. * nix/local.mk (sbin_PROGRAMS, guix_register_SOURCES) (guix_register_CPPFLAGS, guix_register_LDFLAGS): Remove. * tests/guix-register.sh: Remove. Ludovic Courtès
2018-06-14install: Use 'reset-timestamps' from (guix store database)....* gnu/build/install.scm (reset-timestamps): Remove. * gnu/build/vm.scm: Use 'reset-timestamps' from (guix store database). Ludovic Courtès
2018-06-14install: Use (guix store database) instead of 'guix-register'....* 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). Ludovic Courtès
2018-05-25vm: Pass "panic=1" to Linux....* gnu/build/vm.scm (load-in-linux-vm): Always pass "panic=1" after '-append'. Ludovic Courtès
2018-05-23vm: Print the label and UUID of partitions....* gnu/build/vm.scm (create-ext-file-system): Print the label and UUID. Ludovic Courtès
2018-03-24gnu: When building in a VM, share a temporary directory....* 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. Chris Marusich
2018-03-24vm: Allow control of deduplication in root-partition-initializer....* gnu/build/vm.scm (root-partition-initializer): Add #:deduplicate? keyword argument. Chris Marusich
2018-03-16vm: Pass "-append ..." only once....* gnu/build/vm.scm (load-in-linux-vm): Pass "-append ..." only once. Danny Milosavljevic
2018-03-15vm: Use 'invoke' instead of 'system*'....* gnu/build/vm.scm (load-in-linux-vm, initialize-partition-table) (create-ext-file-system, create-fat-file-system) (install-efi, make-iso9660-image): Use 'invoke' instead of (unless (zero? (system* ...)) (error ...)). Ludovic Courtès
2018-01-19gnu: Consistently Write ‘file system(s)’....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. Tobias Geerinckx-Rice
2017-12-18vm: Pass the host's /dev/urandom to the guest at /dev/hwrng....* gnu/build/vm.scm (load-in-linux-vm): Use QEMU's virtio-rng-pci. * gnu/system/vm.scm (common-qemu-options): Likewise. Leo Famulari
2017-12-15vm: Adapt qemu command to ARM....* 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. Mathieu Othacehe
2017-12-13vm: Use qemu drive device parameter....* gnu/build/vm.scm (load-in-linux-vm): Use device parameter to define drive device. Mathieu Othacehe