From 05a9d1f378e2e13e8f759be926ea368358afc27c Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 16 Dec 2021 13:32:11 +0100 Subject: Remove VM generation dead-code. This code duplicates the (gnu system image) and (gnu build image) code. Using VM for image generation is not needed, not portable and really slow. Remove all the VM image generation code to make sure that only the image API is used. * gnu/build/vm.scm: Remove it. Move the qemu-command procedure to ... * gnu/build/marionette.scm: ... here. * gnu/local.mk (GNU_SYSTEM_MODULES): Adapt it. * tests/modules.scm: Ditto. * gnu/tests/install.scm: Ditto. * gnu/system/vm.scm: Adapt it and remove expression->derivation-in-linux-vm, qemu-img, system-qemu-image/shared-store and system-docker-image procedures. * doc/guix.texi (G-Expressions): Adapt it. --- gnu/build/marionette.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gnu/build/marionette.scm') diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 0ebe535526..b336024610 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -24,6 +24,7 @@ #:use-module (rnrs io ports) #:use-module (ice-9 match) #:use-module (ice-9 popen) + #:use-module (ice-9 regex) #:export (marionette? make-marionette marionette-eval @@ -36,7 +37,8 @@ %qwerty-us-keystrokes marionette-type - system-test-runner)) + system-test-runner + qemu-command)) ;;; Commentary: ;;; @@ -426,4 +428,14 @@ LOG-DIRECTORY is specified, create log file within it." (exit success?)))) runner)) +(define* (qemu-command #:optional (system %host-type)) + "Return the default name of the QEMU command for SYSTEM." + (let ((cpu (substring system 0 + (string-index system #\-)))) + (string-append "qemu-system-" + (cond + ((string-match "^i[3456]86$" cpu) "i386") + ((string-match "armhf" cpu) "arm") + (else cpu))))) + ;;; marionette.scm ends here -- cgit v1.2.3