mhw pushed a commit to branch wip-loongson2f
in repository guix.
commit 350a7e97a2ac8deed910bbf92ea21218e71ea85c
Author: Mark H Weaver <[email protected]>
Date: Fri Aug 21 13:07:05 2015 -0400
PRELIMINARY: Attempts to get VMs working on MIPS.
---
gnu/build/vm.scm | 2 +-
gnu/system/vm.scm | 13 ++++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a095f9d..e4abcb2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -97,7 +97,7 @@ the #:references-graphs parameter of 'derivation'."
(_ #f))
(unless (zero?
- (apply system* qemu "-enable-kvm" "-nographic" "-no-reboot"
+ (apply system* qemu "-nographic" "-no-reboot"
"-m" (number->string memory-size)
"-net" "nic,model=virtio"
"-virtfs"
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index dfb6996..0fa8385 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <[email protected]>
+;;; Copyright © 2015 Mark H Weaver <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -90,7 +91,9 @@
(define* (expression->derivation-in-linux-vm name exp
#:key
(system (%current-system))
- (linux linux-libre)
+ (linux (if (string-prefix? "mips"
system)
+ linux-libre-loongson2f
+ linux-libre))
initrd
(qemu qemu-headless)
(env-vars '())
@@ -142,6 +145,9 @@ made available under the /xchg CIFS share."
%load-compiled-path))
(primitive-load #$user-builder))))
(coreutils -> (canonical-package coreutils))
+ (linux-image-name -> (if (string-prefix? "mips" system)
+ "vmlinuz"
+ "bzImage"))
(initrd (if initrd ; use the default initrd?
(return initrd)
(base-initrd %linux-vm-file-systems
@@ -156,7 +162,7 @@ made available under the /xchg CIFS share."
(gnu build vm))
(let ((inputs '#$(list qemu coreutils))
- (linux (string-append #$linux "/bzImage"))
+ (linux (string-append #$linux "/" #$linux-image-name))
(initrd (string-append #$initrd "/initrd"))
(loader #$loader)
(graphs '#$(match references-graphs
@@ -397,6 +403,7 @@ environment with the store shared with the host. MAPPINGS
is a list of
(operating-system (inherit os)
(initrd (lambda (file-systems . rest)
(apply base-initrd file-systems
+ #:linux (operating-system-kernel os)
#:volatile-root? #t
#:virtio? #t
#:qemu-networking? #t
@@ -455,7 +462,7 @@ with '-virtfs' options for the host file systems listed in
SHARED-FS."
"\" "))
#~(string-append
- " -enable-kvm -no-reboot -net nic,model=virtio \
+ " -no-reboot -net nic,model=virtio \
" #$@(map virtfs-option shared-fs) " \
-net user \
-serial stdio -vga std \