aboutsummaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-11-07 22:43:33 +0100
committerLudovic Courtès <ludo@gnu.org>2014-11-08 01:05:35 +0100
commitab11f0bed4084f19698752fa5451ea73a52400f9 (patch)
tree07d857fc35ec8182091e137f70f0c72084b85e51 /gnu/system
parentc1941588dd7d3ca34bcf7480bdc578b7a1110160 (diff)
downloadgnu-guix-ab11f0bed4084f19698752fa5451ea73a52400f9.tar
gnu-guix-ab11f0bed4084f19698752fa5451ea73a52400f9.tar.gz
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.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/vm.scm27
1 files changed, 16 insertions, 11 deletions
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))))