From ab11f0bed4084f19698752fa5451ea73a52400f9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 7 Nov 2014 22:43:33 +0100 Subject: vm: Support 'guix system vm --full-boot'. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Add #:full-boot? parameter and honor it. * guix/scripts/system.scm (system-derivation-for-action): Likewise. (perform-action): Likewise. (show-help): Document '--full-boot'. (%options): Add '--full-boot'. (guix-system): Add #:full-boot? argument in call to 'perform-action'. * doc/guix.texi (Invoking guix system): Document it. --- gnu/system/vm.scm | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'gnu/system/vm.scm') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index dc5b1bafd4..c687bb43f5 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -402,13 +402,15 @@ with the host." ",if=virtio,cache=writeback,werror=report,readonly \ -m 256\n")) -(define* (system-qemu-image/shared-store-script - os - #:key - (qemu qemu) - (graphic? #t)) +(define* (system-qemu-image/shared-store-script os + #:key + (qemu qemu) + (graphic? #t) + full-boot?) "Return a derivation that builds a script to run a virtual machine image of -OS that shares its store with the host." +OS that shares its store with the host. When FULL-BOOT? is true, the returned +script runs everything starting from the bootloader; otherwise it directly +starts the operating system kernel." (mlet* %store-monad ((os -> (virtualized-operating-system os)) (os-drv (operating-system-derivation os)) @@ -419,11 +421,14 @@ OS that shares its store with the host." (display (string-append "#!" #$bash "/bin/sh exec " #$qemu "/bin/" #$(qemu-command (%current-system)) -" -kernel " #$(operating-system-kernel os) "/bzImage \ - -initrd " #$os-drv "/initrd \ - -append \"" #$(if graphic? "" "console=ttyS0 ") - "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1\" " - #$(common-qemu-options image)) + +#$@(if full-boot? + #~() + #~(" -kernel " #$(operating-system-kernel os) "/bzImage \ + -initrd " #$os-drv "/initrd \ + -append \"" #$(if graphic? "" "console=ttyS0 ") + "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1\" ")) +#$(common-qemu-options image)) port) (chmod port #o555)))) -- cgit v1.2.3