From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Re: ARM VM with networking support? Date: Sun, 01 Dec 2019 17:30:12 +0100 Message-ID: <878snwvwiz.fsf@gmail.com> References: <87r22p3trp.fsf@gnu.org> <87ftj4vqcy.fsf@gmail.com> <87mud59d47.fsf@gnu.org> <877e46b9ld.fsf@gmail.com> <878soeo2c5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:40039) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibS77-0004YZ-HE for guix-devel@gnu.org; Sun, 01 Dec 2019 11:30:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibS76-0007hi-Bd for guix-devel@gnu.org; Sun, 01 Dec 2019 11:30:25 -0500 In-reply-to: <878soeo2c5.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey Ludo, > Here=E2=80=99s my tentative config file. I just generated a disk-image with your config file! Just like you, I did hit the "unsupported ioctl" issue on both master and core-updates branch. The reason is that the command run when producing the disk image is: qemu-arm qemu-system-arm disk-image-builder ^ ^ | |-- Native qemu (so for armhf-linux architecture). | Run by binfmt because qemu-system-arm is a binary for armhf architecture. So a syscall issued somewhere in disk-image-builder goes through the kernel emulated by qemu-system-arm and via qemu-arm to your host kernel. The failing syscall is number 47601 (FS_IOC32_GETVERSION), I don't know why it is not supported by our host kernel. However, using a qemu-system-arm built for arm doesn't make much sense here, because we add an unecessary (and failing) layer of emulation. So what I would propose is to produce a disk-image using a qemu-system-* built for the host architecture (and not the system specified by --system argument). This remains true when cross-compiling a system. The attached patch does thin in an ugly way but that solves the issue. WDYT? Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-vm-Force-native-qemu-usage.patch >From e107692f3a98c19d2457050635818226ee675c52 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 1 Dec 2019 16:49:36 +0100 Subject: [PATCH] vm: Force native qemu usage. --- gnu/system/vm.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 8609bd2ace..e760e7f42d 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -68,6 +68,7 @@ #:use-module (gnu system uuid) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (rnrs bytevectors) #:use-module (ice-9 match) @@ -141,6 +142,16 @@ packages)))) (list guile-gcrypt guile-sqlite3))) +(define-record-type + (%native-qemu qemu system) + native-qemu? + (qemu native-qemu-qemu) + (system native-qemu-system)) + +(define-gexp-compiler (native-qemu-compiler (native-qemu ) system target) + (package->derivation (native-qemu-qemu native-qemu) + (native-qemu-system native-qemu))) + (define* (expression->derivation-in-linux-vm name exp #:key (system (%current-system)) target @@ -193,6 +204,9 @@ made available under the /xchg CIFS share." (reboot) (exit 1)))) + (define qemu-native + (%native-qemu qemu (@ (guix config) %system))) + (let ((initrd (or initrd (base-initrd file-systems #:on-error 'backtrace @@ -215,7 +229,7 @@ made available under the /xchg CIFS share." (gnu build vm)) (let* ((native-inputs - '#+(list qemu (canonical-package coreutils))) + '#+(list qemu-native (canonical-package coreutils))) (linux (string-append #$linux "/" #$(system-linux-image-file-name))) (initrd #$initrd) -- 2.24.0 --=-=-=--