gnu: WebKitGTK: Update to 2.28.0 [fixes CVE-2020-10018].
[jackhill/guix/guix.git] / gnu / build / vm.scm
index 6f920ae..9a9e5bd 100644 (file)
   (let ((cpu (substring system 0
                         (string-index system #\-))))
     (string-append "qemu-system-"
-                   (if (string-match "^i[3456]86$" cpu)
-                       "i386"
-                       cpu))))
+                   (cond
+                    ((string-match "^i[3456]86$" cpu) "i386")
+                    ((string-match "armhf" cpu) "arm")
+                    (else cpu)))))
 
 (define* (load-in-linux-vm builder
                            #:key
@@ -130,14 +131,7 @@ the #:references-graphs parameter of 'derivation'."
                       ;; The serial port name differs between emulated
                       ;; architectures/machines.
                       " console="
-                      (if target-arm? "ttyAMA0" "ttyS0"))
-
-      ;; NIC is not supported on ARM "virt" machine, so use a user mode
-      ;; network stack instead.
-      ,@(if target-arm?
-            '("-device" "virtio-net-pci,netdev=mynet"
-              "-netdev" "user,id=mynet")
-            '("-net" "nic,model=virtio"))))
+                      (if target-arm? "ttyAMA0" "ttyS0"))))
 
   (when make-disk-image?
     (format #t "creating ~a image of ~,2f MiB...~%"
@@ -162,6 +156,7 @@ the #:references-graphs parameter of 'derivation'."
          ;; CPU with the maximum possible feature set otherwise.
          "-cpu" "max"
          "-m" (number->string memory-size)
+         "-nic" "user,model=virtio-net-pci"
          "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
          "-device" "virtio-rng-pci,rng=guixsd-vm-rng"
          "-virtfs"