guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/09: vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader


From: guix-commits
Subject: 05/09: vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader.
Date: Sun, 31 Mar 2024 17:05:16 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit ad9832f82e525834db2221ae462f2b7a6709fc05
Author: Zheng Junjie <zhengjunjie@iscas.ac.cn>
AuthorDate: Tue Mar 19 23:18:37 2024 +0800

    vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader.
    
    * gnu/system/vm.scm (virtualized-operating-system) When target 
riscv64-linux,
    use u-boot-qemu-riscv64-bootloader. Add system, target keyword.
    
    Change-Id: I22d64d00670a705e4b81427e44a83d504598b536
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/system/vm.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 40e965d272..d4044a4a39 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -52,6 +52,7 @@
 
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
+  #:use-module (gnu bootloader u-boot)
   #:use-module (gnu image)
   #:use-module (gnu system image)
   #:use-module (gnu system linux-container)
@@ -137,7 +138,9 @@
 
 (define* (virtualized-operating-system os
                                        #:optional (mappings '())
-                                       #:key (full-boot? #f) volatile?)
+                                       #:key (full-boot? #f) volatile?
+                                       (system (%current-system))
+                                       (target (%current-target-system)))
   "Return an operating system based on OS suitable for use in a virtualized
 environment with the store shared with the host.  MAPPINGS is a list of
 <file-system-mapping> to realize in the virtualized OS."
@@ -167,15 +170,18 @@ environment with the store shared with the host.  
MAPPINGS is a list of
           (append (map mapping->file-system mappings)
                   user-file-systems)))
 
-  (operating-system (inherit os)
-
+  (operating-system
+    (inherit os)
     ;; XXX: Until we run QEMU with UEFI support (with the OVMF firmware),
     ;; force the traditional i386/BIOS method.
     ;; See <https://bugs.gnu.org/28768>.
     (bootloader (bootloader-configuration
-                  (inherit (operating-system-bootloader os))
-                  (bootloader grub-bootloader)
-                  (targets '("/dev/vda"))))
+                 (inherit (operating-system-bootloader os))
+                 (bootloader
+                  (if (target-riscv64? (or target system))
+                      u-boot-qemu-riscv64-bootloader
+                      grub-bootloader))
+                 (targets '("/dev/vda"))))
 
     (initrd (lambda (file-systems . rest)
               (apply (operating-system-initrd os)
@@ -259,7 +265,9 @@ useful when FULL-BOOT?  is true."
   (mlet* %store-monad ((os ->  (virtualized-operating-system
                                 os mappings
                                 #:full-boot? full-boot?
-                                #:volatile? volatile?))
+                                #:volatile? volatile?
+                                #:system system
+                                #:target target))
                        (base-image -> (system-image
                                        (image
                                         (inherit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]