[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69343] [PATCH v3 03/12] Also move boot-parameters->menu-entry.
From: |
Lilah Tascheter |
Subject: |
[bug#69343] [PATCH v3 03/12] Also move boot-parameters->menu-entry. |
Date: |
Sat, 3 Aug 2024 22:13:25 -0500 |
From: Felix Lechner <felix.lechner@lease-up.com>
* gnu/system.scm (boot-parameters->menu-entry): Move to...
* gnu/system/boot.scm (boot-parameters->menu-entry): ...here.
Change-Id: I794198e074b6d3012526a3056599ee3db1f1cdba
---
gnu/system.scm | 28 ----------------------------
gnu/system/boot.scm | 25 ++++++++++++++++++++++++-
2 files changed, 24 insertions(+), 29 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 2e4b10e2fb..4a084b2ecf 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -151,8 +151,6 @@ (define-module (gnu system)
hurd-default-essential-services
- boot-parameters->menu-entry
-
local-host-aliases ;deprecated
%root-account
%setuid-programs
@@ -314,32 +312,6 @@ (define* (operating-system-kernel-arguments
(append (bootable-kernel-arguments os root-device version)
(operating-system-user-kernel-arguments os)))
-
-;;;
-;;; Boot parameters
-;;;
-
-(define (boot-parameters->menu-entry conf)
- "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
- (let* ((kernel (boot-parameters-kernel conf))
- (multiboot-modules (boot-parameters-multiboot-modules conf))
- (multiboot? (pair? multiboot-modules)))
- (menu-entry
- (label (boot-parameters-label conf))
- (device (boot-parameters-store-device conf))
- (device-mount-point (boot-parameters-store-mount-point conf))
- (linux (and (not multiboot?) kernel))
- (linux-arguments (if (not multiboot?)
- (boot-parameters-kernel-arguments conf)
- '()))
- (initrd (boot-parameters-initrd conf))
- (multiboot-kernel (and multiboot? kernel))
- (multiboot-arguments (if multiboot?
- (boot-parameters-kernel-arguments conf)
- '()))
- (multiboot-modules (if multiboot?
- (boot-parameters-multiboot-modules conf)
- '())))))
;;;
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 7bae9d2102..df27b8aea4 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -70,6 +70,8 @@ (define-module (gnu system boot)
read-boot-parameters-file
bootable-kernel-arguments
+ boot-parameters->menu-entry
+
ensure-not-/dev
system-linux-image-file-name))
@@ -294,6 +296,28 @@ (define* (bootable-kernel-arguments system root-device
version)
#~(string-append (if #$version>0? "gnu.load=" "--load=")
#$system "/boot")))))
+(define (boot-parameters->menu-entry conf)
+ "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
+ (let* ((kernel (boot-parameters-kernel conf))
+ (multiboot-modules (boot-parameters-multiboot-modules conf))
+ (multiboot? (pair? multiboot-modules)))
+ (menu-entry
+ (label (boot-parameters-label conf))
+ (device (boot-parameters-store-device conf))
+ (device-mount-point (boot-parameters-store-mount-point conf))
+ (linux (and (not multiboot?) kernel))
+ (linux-arguments (if (not multiboot?)
+ (boot-parameters-kernel-arguments conf)
+ '()))
+ (initrd (boot-parameters-initrd conf))
+ (multiboot-kernel (and multiboot? kernel))
+ (multiboot-arguments (if multiboot?
+ (boot-parameters-kernel-arguments conf)
+ '()))
+ (multiboot-modules (if multiboot?
+ (boot-parameters-multiboot-modules conf)
+ '())))))
+
(define (ensure-not-/dev device)
"If DEVICE starts with a slash, return #f. This is meant to filter out
Linux device names such as /dev/sda, and to preserve GRUB device names and
@@ -314,5 +338,4 @@ (define* (system-linux-image-file-name #:optional
((string-prefix? "riscv64" target) "Image")
(else "bzImage")))
-
;;; boot.scm ends here
--
2.45.2
- [bug#69343] [PATCH v3 00/12] Simplify bootloader data structures and procedures, Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 03/12] Also move boot-parameters->menu-entry.,
Lilah Tascheter <=
- [bug#69343] [PATCH v3 05/12] Move epoch->date-string to gnu/system/boot.scm and use it elsewhere., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 06/12] Offer a uniform decorated-boot-label and use it., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 02/12] Move <boot-parameters> record to a separate file., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 07/12] Rename boot-parameters to boot-alternatives when appropriate., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 10/12] Simplify profile->boot-alternatives., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 11/12] Split generation->boot-parameters out of profile->boot-alternatives., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 12/12] Encapsulate <boot-parameters> to retain generation, system-path and epoch., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 01/12] Fix bug where the extra menu entries for a bootloader were shown twice., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 04/12] Rename seconds->string procedure to epoch->date-string., Lilah Tascheter, 2024/08/03
- [bug#69343] [PATCH v3 08/12] Rename two remote variables confusingly named 'generations'., Lilah Tascheter, 2024/08/03