GNU bug report logs -
#73202
[PATCH] Preparation for bootloader rewrite.
Previous Next
Reported by: Herman Rimm <herman <at> rimm.ee>
Date: Thu, 12 Sep 2024 17:00:02 UTC
Severity: normal
Tags: patch
Fix blocked by 69343: [PATCH 00/12] Simplify bootloader data structures and procedures
Full log
Message #101 received at 73202 <at> debbugs.gnu.org (full text, mbox):
* gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
Add macros.
Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b
---
gnu/bootloader.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 6b08e61492..b1ed187aa2 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2022 Reza Alizadeh Majd <r.majd <at> pantherx.org>
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
;;; Copyright © 2024 Lilah Tascheter <lilah <at> lunabee.space>
+;;; Copyright © 2024 Herman Rimm <herman <at> rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -115,6 +116,9 @@ (define-module (gnu bootloader)
bootloader-configuration->gexp
bootloader-configurations->gexp
+ match-bootloader-configuration
+ match-menu-entry
+
%efi-supported-systems
efi-arch
install-efi
@@ -642,6 +646,20 @@ (define (bootloader-configurations->gexp bootloader-configs . rest)
(apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
bootloader-configs)))
+;; In lieu of exporting bootloader-configuration and menu-entry RTDs.
+(define-syntax match-bootloader-configuration
+ (syntax-rules ()
+ "Bind each BOOTLOADER-CONFIGURATION field in FIELDS."
+ ((_ bootloader-configuration (fields ...) body ...)
+ (match-record bootloader-configuration <bootloader-configuration>
+ (fields ...) body ...))))
+
+(define-syntax match-menu-entry
+ (syntax-rules ()
+ "Bind each MENU-ENTRY field in FIELDS."
+ ((_ menu-entry (fields ...) body ...)
+ (match-record menu-entry <menu-entry> (fields ...) body ...))))
+
;;;
;;; Bootloader installation to ESP.
--
2.45.2
This bug report was last modified 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.