From patchwork Tue Mar 19 15:18:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Z572 X-Patchwork-Id: 61988 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DD69627BBED; Tue, 19 Mar 2024 15:25:45 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2A93C27BBE2 for ; Tue, 19 Mar 2024 15:25:45 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbLH-000738-S0; Tue, 19 Mar 2024 11:25:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbLB-0006zq-B2 for guix-patches@gnu.org; Tue, 19 Mar 2024 11:25:25 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbLB-0001jR-0B for guix-patches@gnu.org; Tue, 19 Mar 2024 11:25:25 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rmbLn-0001FN-OJ for guix-patches@gnu.org; Tue, 19 Mar 2024 11:26:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69899] [PATCH 3/7] vm: When target riscv64-linux, use u-boot-qemu-riscv64-bootloader. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Mar 2024 15:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69899@debbugs.gnu.org Received: via spool by 69899-submit@debbugs.gnu.org id=B69899.17108619184535 (code B ref 69899); Tue, 19 Mar 2024 15:26:03 +0000 Received: (at 69899) by debbugs.gnu.org; 19 Mar 2024 15:25:18 +0000 Received: from localhost ([127.0.0.1]:51148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmbL4-0001Az-1k for submit@debbugs.gnu.org; Tue, 19 Mar 2024 11:25:18 -0400 Received: from smtp84.cstnet.cn ([159.226.251.84]:51192 helo=cstnet.cn) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmbFa-0000gG-KK for 69899@debbugs.gnu.org; Tue, 19 Mar 2024 11:19:43 -0400 Received: from m.taildaf0f.ts.net (unknown [183.247.5.22]) by APP-05 (Coremail) with SMTP id zQCowAAnLLzZrPlljqBBBw--.46102S4; Tue, 19 Mar 2024 23:18:50 +0800 (CST) From: Zheng Junjie Date: Tue, 19 Mar 2024 23:18:37 +0800 Message-ID: <528b248a19b9debbaad5181749f49f5aa4e82f77.1710861023.git.zhengjunjie@iscas.ac.cn> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: zQCowAAnLLzZrPlljqBBBw--.46102S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Ary8Ww4kCFWDtr4kuFyUZFb_yoW8KF4rpF s5Za4Skw45GrW3Zw40gF9rKr1aqryvy3y5Aa4fuw1Fv3W5uryv9r13ta45JayUX34fCr18 Ary8tr15uryDXr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvEb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI 8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kE wVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x 0267AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x02 67AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I 80ewAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCj c4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUJVWUXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWI evJa73UjIFyTuYvjxUqqYpUUUUU X-Originating-IP: [183.247.5.22] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/system/vm.scm (virtualized-operating-system) When target riscv64-linux, use u-boot-qemu-riscv64-bootloader. Add system, target keyword. Change-Id: I22d64d00670a705e4b81427e44a83d504598b536 --- 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 @@ (define-module (gnu system vm) #: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 (mapping->file-system mapping) (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 to realize in the virtualized OS." @@ -167,15 +170,18 @@ (define* (virtualized-operating-system os (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 . (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 @@ (define* (system-qemu-image/shared-store-script os (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