* 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>
* 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'.
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.
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.
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.
* 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.
* 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.
* gnu/system.scm (<operating-system>)[kernel-arguments]: New field.
(operating-system-grub.cfg): Honor it.
(operating-system-parameters-file): Add 'kernel-arguments' to the parameters
file.
* guix/scripts/system.scm (previous-grub-entries)[system->grub-entry]: Read
the 'kernel-arguments' field of the parameters file, when available.
* gnu/system/vm.scm (system-qemu-image/shared-store-script):
Use (operating-system-kernel-arguments os) in '-append'.
* doc/guix.texi (operating-system Reference): Document it.
This bug was introduced in commit 85c3127.
Thanks to Christopher Webber for reporting it.
* gnu/syste/linux-initrd.scm (base-initrd): Include (guix build syscalls)
module in derivation.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
* gnu/system/vm.scm (<file-system-mapping>): New record type.
(%store-mapping): New variable.
(host-9p-file-system): Rename to...
(mapping->file-system): ... this. Replace 'source' and 'target'
parameters with 'mapping'. Set 'flags' field.
(virtualized-operating-system): Add 'mappings' parameter and honor
it.
(system-qemu-image/shared-store-script): Add 'mappings' parameter.
Pass it to 'virtualized-operating-system'. Use it in argument to
'common-qemu-options'.
* gnu/system/vm.scm (file-system->mount-tag, host-9p-file-system): New
procedures.
(virtualized-operating-system): Use 'host-9p-file-system' for the
store.
(common-qemu-options): Add 'shared-fs' parameter.
[virtfs-option]: New procedure.
Use it.
(system-qemu-image/shared-store-script): Adjust accordingly.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Add "$@" at
the end of the script.
(common-qemu-options): Remove trailing newline.
* doc/guix.texi (Invoking guix system): Document it.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add
#:disk-image-size and #:full-boot? parameters and honor them. Pass
'#:copy-inputs? full-boot?', and change #:inputs argument.
* guix/scripts/system.scm (system-derivation-for-action): Pass
#:disk-image-size to 'system-qemu-image/shared-store'.
* doc/guix.texi (Invoking guix system): Mention use of '--image-size' in
conjunction with '--full-boot'.
This fixes regressions introduced in de1c158 ("system: Add support for
boot-time mapped devices.").
* doc/guix.texi (Initial RAM Disk): Adjust example with custom use of
'base-initrd'. Document #:mapped-devices parameter of 'base-initrd'.
* gnu/system/vm.scm (system-disk-image, system-qemu-image,
virtualized-operating-system): Adjust call to 'base-initrd' to new
signature.
* gnu/system/linux-initrd.scm (expression->initrd): Remove calls to
'imported-modules' and 'compiled-modules'. Use 'gexp->script' with
EXP. Add the result to TO-COPY. Make /init a symlink to that script,
and copy its closure into the "contents" directory. Add fake
/proc/self/exe symlink.
* gnu/build/linux-boot.scm (load-linux-module*): Add comment about mmap.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Add "-m
256". This turns out to be needed for initrds containing things like
e2fsck and several modules; with the default of 128 MiB, loading
libahci.ko may fail with -1.
* guix/gexp.scm (lower-reference-graphs): New procedure.
(gexp->derivation)[graphs-file-names]: New procedure.
Use 'lower-reference-graphs', and augment #:inputs argument as a
function of #:references-graphs.
* doc/guix.texi (G-Expressions): Adjust 'gexp->derivation' documentation
accordingly.
* tests/gexp.scm ("gexp->derivation, store copy"): Remove reference to
TWO in BUILD-DRV. Use TWO directly in #:references-graphs argument.
("gexp->derivation #:references-graphs"): New test.
* gnu/system/vm.scm (qemu-image): Remove variable 'graph'; use INPUTS as
the #:references-graphs argument to
'expression->derivation-in-linux-vm'.