diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-07-13 16:07:26 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-07-13 16:37:11 +0200 |
commit | 66670cf39c2f3d294edf3596d8a9173e5289f3a0 (patch) | |
tree | cf6cd0500da4a5bf9ce1187ecec7a45e07f09b87 /guix/build/vm.scm | |
parent | ae9cb418dfe864d8b4383770662fc79484244240 (diff) | |
download | guix-patches-66670cf39c2f3d294edf3596d8a9173e5289f3a0.tar guix-patches-66670cf39c2f3d294edf3596d8a9173e5289f3a0.tar.gz |
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.
Diffstat (limited to 'guix/build/vm.scm')
-rw-r--r-- | guix/build/vm.scm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/guix/build/vm.scm b/guix/build/vm.scm index 805ce10bf9..11e05f70be 100644 --- a/guix/build/vm.scm +++ b/guix/build/vm.scm @@ -21,10 +21,12 @@ #:use-module (guix build linux-initrd) #:use-module (guix build install) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 rdelim) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (load-in-linux-vm + #:export (qemu-command + load-in-linux-vm format-partition initialize-root-partition initialize-partition-table @@ -37,12 +39,14 @@ ;;; ;;; Code: -(define (qemu-command) - "Return the default name of the QEMU command for the current host." - (string-append "qemu-system-" - (substring %host-type 0 - (string-index %host-type #\-)))) - +(define* (qemu-command #:optional (system %host-type)) + "Return the default name of the QEMU command for SYSTEM." + (let ((cpu (substring %host-type 0 + (string-index %host-type #\-)))) + (string-append "qemu-system-" + (if (string-match "^i[3456]86$" cpu) + "i386" + cpu)))) (define* (load-in-linux-vm builder #:key |