From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CHsTFJv+2F6iPQAA0tVLHw (envelope-from ) for ; Thu, 04 Jun 2020 14:00:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AAjyD5v+2F6JWQAA1q6Kng (envelope-from ) for ; Thu, 04 Jun 2020 14:00:59 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0A75C940D34 for ; Thu, 4 Jun 2020 14:00:39 +0000 (UTC) Received: from localhost ([::1]:43602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgqQ9-0002OO-WD for larch@yhetil.org; Thu, 04 Jun 2020 10:00:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgqPa-0001MB-TP for bug-guix@gnu.org; Thu, 04 Jun 2020 10:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgqPa-00024R-HJ for bug-guix@gnu.org; Thu, 04 Jun 2020 10:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgqPa-0004YO-Fe for bug-guix@gnu.org; Thu, 04 Jun 2020 10:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41541: [PATCH 2/8] bootloader: Extend `' for multiboot. Resent-From: "Jan (janneke) Nieuwenhuizen" Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 04 Jun 2020 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41541 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 41541@debbugs.gnu.org Received: via spool by 41541-submit@debbugs.gnu.org id=B41541.159127916917341 (code B ref 41541); Thu, 04 Jun 2020 14:00:02 +0000 Received: (at 41541) by debbugs.gnu.org; 4 Jun 2020 13:59:29 +0000 Received: from localhost ([127.0.0.1]:47125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgqP2-0004Va-It for submit@debbugs.gnu.org; Thu, 04 Jun 2020 09:59:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgqP1-0004V1-0U for 41541@debbugs.gnu.org; Thu, 04 Jun 2020 09:59:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33093) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgqOv-0001v2-MZ; Thu, 04 Jun 2020 09:59:21 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=43728 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1jgqOu-0000GG-2e; Thu, 04 Jun 2020 09:59:20 -0400 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 4 Jun 2020 15:59:08 +0200 Message-Id: <20200604135914.4499-3-janneke@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200604135914.4499-1-janneke@gnu.org> References: <20200604135914.4499-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: SygeniYAliRH * gnu/bootloader.scm ()[multiboot-kernel,multiboot-arguments, multiboot-modules]: New fields. [linux,initrd]: Add default value '#f'. (menu-entry->sexp, sexp->menu-entry): Support multiboot entry. --- gnu/bootloader.scm | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 668caa7fc3..2eebb8e9d9 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017, 2020 Mathieu Othacehe ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,9 @@ menu-entry-linux-arguments menu-entry-initrd menu-entry-device-mount-point + menu-entry-multiboot-kernel + menu-entry-multiboot-arguments + menu-entry-multiboot-modules menu-entry->sexp sexp->menu-entry @@ -77,22 +81,41 @@ (default #f)) (device-mount-point menu-entry-device-mount-point (default #f)) - (linux menu-entry-linux) + (linux menu-entry-linux + (default #f)) (linux-arguments menu-entry-linux-arguments (default '())) ; list of string-valued gexps - (initrd menu-entry-initrd)) ; file name of the initrd as a gexp + (initrd menu-entry-initrd ; file name of the initrd as a gexp + (default #f)) + (multiboot-kernel menu-entry-multiboot-kernel + (default #f)) + (multiboot-arguments menu-entry-multiboot-arguments + (default '())) ; list of string-valued gexps + (multiboot-modules menu-entry-multiboot-modules + (default '()))) ; list of multiboot commands, where + ; a command is a list of (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." (match entry - (($ label device mount-point linux linux-arguments initrd) + (($ label device mount-point linux linux-arguments initrd #f + ()) `(menu-entry (version 0) (label ,label) (device ,device) (device-mount-point ,mount-point) (linux ,linux) (linux-arguments ,linux-arguments) - (initrd ,initrd))))) + (initrd ,initrd))) + (($ label device mount-point #f () #f + multiboot-kernel multiboot-arguments multiboot-modules) + `(menu-entry (version 0) + (label ,label) + (device ,device) + (device-mount-point ,mount-point) + (multiboot-kernel ,multiboot-kernel) + (multiboot-arguments ,multiboot-arguments) + (multiboot-modules ,multiboot-modules))))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a @@ -109,7 +132,20 @@ record." (device-mount-point mount-point) (linux linux) (linux-arguments linux-arguments) - (initrd initrd))))) + (initrd initrd))) + (('menu-entry ('version 0) + ('label label) ('device device) + ('device-mount-point mount-point) + ('multiboot-kernel multiboot-kernel) + ('multiboot-arguments multiboot-arguments) + ('multiboot-modules multiboot-modules) _ ...) + (menu-entry + (label label) + (device device) + (device-mount-point mount-point) + (multiboot-kernel multiboot-kernel) + (multiboot-arguments multiboot-arguments) + (multiboot-modules multiboot-modules))))) ;;; -- 2.26.2