vm: Add support for i686.
Partially fixes <http://bugs.gnu.org/18002>. Reported by David Thompson <dthompson2@worcester.edu>. * guix/build/vm.scm (qemu-command): Add optional 'system' parameter. Special-case "^i[3456]86$". * gnu/system/vm.scm (system-qemu-image/shared-store-script): Use it.
This commit is contained in:
parent
ae9cb418df
commit
66670cf39c
|
@ -23,6 +23,8 @@
|
||||||
#:use-module (guix derivations)
|
#:use-module (guix derivations)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix monads)
|
#:use-module (guix monads)
|
||||||
|
#:use-module ((guix build vm)
|
||||||
|
#:select (qemu-command))
|
||||||
#:use-module ((gnu packages base)
|
#:use-module ((gnu packages base)
|
||||||
#:select (%final-inputs))
|
#:select (%final-inputs))
|
||||||
#:use-module (gnu packages guile)
|
#:use-module (gnu packages guile)
|
||||||
|
@ -414,7 +416,8 @@ OS that shares its store with the host."
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(display
|
(display
|
||||||
(string-append "#!" #$bash "/bin/sh
|
(string-append "#!" #$bash "/bin/sh
|
||||||
exec " #$qemu "/bin/qemu-system-x86_64 -enable-kvm -no-reboot -net nic,model=virtio \
|
exec " #$qemu "/bin/" #$(qemu-command (%current-system))
|
||||||
|
" -enable-kvm -no-reboot -net nic,model=virtio \
|
||||||
-virtfs local,path=" #$(%store-prefix) ",security_model=none,mount_tag=store \
|
-virtfs local,path=" #$(%store-prefix) ",security_model=none,mount_tag=store \
|
||||||
-net user \
|
-net user \
|
||||||
-kernel " #$(operating-system-kernel os) "/bzImage \
|
-kernel " #$(operating-system-kernel os) "/bzImage \
|
||||||
|
|
|
@ -21,10 +21,12 @@
|
||||||
#:use-module (guix build linux-initrd)
|
#:use-module (guix build linux-initrd)
|
||||||
#:use-module (guix build install)
|
#:use-module (guix build install)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (ice-9 regex)
|
||||||
#:use-module (ice-9 rdelim)
|
#:use-module (ice-9 rdelim)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:export (load-in-linux-vm
|
#:export (qemu-command
|
||||||
|
load-in-linux-vm
|
||||||
format-partition
|
format-partition
|
||||||
initialize-root-partition
|
initialize-root-partition
|
||||||
initialize-partition-table
|
initialize-partition-table
|
||||||
|
@ -37,12 +39,14 @@
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(define (qemu-command)
|
(define* (qemu-command #:optional (system %host-type))
|
||||||
"Return the default name of the QEMU command for the current host."
|
"Return the default name of the QEMU command for SYSTEM."
|
||||||
(string-append "qemu-system-"
|
(let ((cpu (substring %host-type 0
|
||||||
(substring %host-type 0
|
(string-index %host-type #\-))))
|
||||||
(string-index %host-type #\-))))
|
(string-append "qemu-system-"
|
||||||
|
(if (string-match "^i[3456]86$" cpu)
|
||||||
|
"i386"
|
||||||
|
cpu))))
|
||||||
|
|
||||||
(define* (load-in-linux-vm builder
|
(define* (load-in-linux-vm builder
|
||||||
#:key
|
#:key
|
||||||
|
|
Loading…
Reference in New Issue