mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gnu: system: Remove useless boot parameters.
* gnu/system.scm (operating-system-boot-parameters, operating-system-boot-parameters-file): Delete bootloader-menu-entries. * gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]: Delete field. (read-boot-parameters): Don't read bootloader-menu-entries. * tests/boot-parameters.scm (%grub-boot-parameters, test-read-boot-parameters, test-read-boot-parameters): Don't include bootloader-menu-entries. ("read, bootloader-menu-entries, default value"): Delete test. Change-Id: I46d9cff4604dbfcf654b0820fdb77e72aecffbb4
This commit is contained in:
parent
fa711c6979
commit
9ba07f90f2
3 changed files with 5 additions and 28 deletions
|
@ -1298,8 +1298,6 @@ (define* (operating-system-boot-parameters os root-device
|
||||||
(initrd initrd)
|
(initrd initrd)
|
||||||
(multiboot-modules multiboot-modules)
|
(multiboot-modules multiboot-modules)
|
||||||
(bootloader-name bootloader-name)
|
(bootloader-name bootloader-name)
|
||||||
(bootloader-menu-entries
|
|
||||||
(bootloader-configuration-menu-entries (operating-system-bootloader os)))
|
|
||||||
(locale locale)
|
(locale locale)
|
||||||
(store-device (ensure-not-/dev (file-system-device store)))
|
(store-device (ensure-not-/dev (file-system-device store)))
|
||||||
(store-directory-prefix (btrfs-store-subvolume-file-name file-systems))
|
(store-directory-prefix (btrfs-store-subvolume-file-name file-systems))
|
||||||
|
@ -1341,11 +1339,6 @@ (define* (operating-system-boot-parameters-file os)
|
||||||
#$(boot-parameters-multiboot-modules params)))
|
#$(boot-parameters-multiboot-modules params)))
|
||||||
#~())
|
#~())
|
||||||
(bootloader-name #$(boot-parameters-bootloader-name params))
|
(bootloader-name #$(boot-parameters-bootloader-name params))
|
||||||
(bootloader-menu-entries
|
|
||||||
#$(map menu-entry->sexp
|
|
||||||
(or (and=> (operating-system-bootloader os)
|
|
||||||
bootloader-configuration-menu-entries)
|
|
||||||
'())))
|
|
||||||
(locale #$(boot-parameters-locale params))
|
(locale #$(boot-parameters-locale params))
|
||||||
(store
|
(store
|
||||||
(device
|
(device
|
||||||
|
|
|
@ -51,7 +51,6 @@ (define-module (gnu system boot)
|
||||||
boot-parameters-label
|
boot-parameters-label
|
||||||
boot-parameters-root-device
|
boot-parameters-root-device
|
||||||
boot-parameters-bootloader-name
|
boot-parameters-bootloader-name
|
||||||
boot-parameters-bootloader-menu-entries
|
|
||||||
boot-parameters-store-crypto-devices
|
boot-parameters-store-crypto-devices
|
||||||
boot-parameters-store-device
|
boot-parameters-store-device
|
||||||
boot-parameters-store-directory-prefix
|
boot-parameters-store-directory-prefix
|
||||||
|
@ -110,8 +109,6 @@ (define-record-type* <boot-parameters>
|
||||||
;; partition.
|
;; partition.
|
||||||
(root-device boot-parameters-root-device)
|
(root-device boot-parameters-root-device)
|
||||||
(bootloader-name boot-parameters-bootloader-name)
|
(bootloader-name boot-parameters-bootloader-name)
|
||||||
(bootloader-menu-entries ;list of <menu-entry>
|
|
||||||
boot-parameters-bootloader-menu-entries)
|
|
||||||
(store-device boot-parameters-store-device)
|
(store-device boot-parameters-store-device)
|
||||||
(store-mount-point boot-parameters-store-mount-point)
|
(store-mount-point boot-parameters-store-mount-point)
|
||||||
(store-directory-prefix boot-parameters-store-directory-prefix)
|
(store-directory-prefix boot-parameters-store-directory-prefix)
|
||||||
|
@ -172,11 +169,6 @@ (define (version? n)
|
||||||
((_ args) args)
|
((_ args) args)
|
||||||
(#f 'grub))) ; for compatibility reasons.
|
(#f 'grub))) ; for compatibility reasons.
|
||||||
|
|
||||||
(bootloader-menu-entries
|
|
||||||
(match (assq 'bootloader-menu-entries rest)
|
|
||||||
((_ entries) (map sexp->menu-entry entries))
|
|
||||||
(#f '())))
|
|
||||||
|
|
||||||
;; In the past, we would store the directory name of linux instead of
|
;; In the past, we would store the directory name of linux instead of
|
||||||
;; the absolute file name of its image. Detect that and correct it.
|
;; the absolute file name of its image. Detect that and correct it.
|
||||||
(kernel (if (string=? kernel (direct-store-path kernel))
|
(kernel (if (string=? kernel (direct-store-path kernel))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
|
;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
|
||||||
;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
|
;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
|
||||||
|
;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -34,6 +35,7 @@ (define-module (test-boot-parameters)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix store)
|
#:use-module (guix store)
|
||||||
#:use-module (guix tests)
|
#:use-module (guix tests)
|
||||||
|
#:use-module (ice-9 format)
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
#:use-module (srfi srfi-64)
|
#:use-module (srfi srfi-64)
|
||||||
#:use-module (rnrs bytevectors))
|
#:use-module (rnrs bytevectors))
|
||||||
|
@ -64,7 +66,6 @@ (define %root-path "/")
|
||||||
(define %grub-boot-parameters
|
(define %grub-boot-parameters
|
||||||
(boot-parameters
|
(boot-parameters
|
||||||
(bootloader-name 'grub)
|
(bootloader-name 'grub)
|
||||||
(bootloader-menu-entries '())
|
|
||||||
(root-device %default-root-device)
|
(root-device %default-root-device)
|
||||||
(label %default-label)
|
(label %default-label)
|
||||||
(kernel %default-kernel)
|
(kernel %default-kernel)
|
||||||
|
@ -107,7 +108,6 @@ (define* (test-read-boot-parameters
|
||||||
#:key
|
#:key
|
||||||
(version %boot-parameters-version)
|
(version %boot-parameters-version)
|
||||||
(bootloader-name 'grub)
|
(bootloader-name 'grub)
|
||||||
(bootloader-menu-entries '())
|
|
||||||
(label %default-label)
|
(label %default-label)
|
||||||
(root-device (quote-uuid %default-root-device))
|
(root-device (quote-uuid %default-root-device))
|
||||||
(kernel %default-kernel)
|
(kernel %default-kernel)
|
||||||
|
@ -127,7 +127,7 @@ (define (sexp-or-nothing fmt val)
|
||||||
(cond ((eq? 'false val) (format #false fmt #false))
|
(cond ((eq? 'false val) (format #false fmt #false))
|
||||||
(val (format #false fmt val))
|
(val (format #false fmt val))
|
||||||
(else "")))
|
(else "")))
|
||||||
(format #false "(boot-parameters~a~a~a~a~a~a~a~a~a~a)"
|
(format #f "(boot-parameters~@{~a~})"
|
||||||
(sexp-or-nothing " (version ~S)" version)
|
(sexp-or-nothing " (version ~S)" version)
|
||||||
(sexp-or-nothing " (label ~S)" label)
|
(sexp-or-nothing " (label ~S)" label)
|
||||||
(sexp-or-nothing " (root-device ~S)" root-device)
|
(sexp-or-nothing " (root-device ~S)" root-device)
|
||||||
|
@ -135,7 +135,7 @@ (define (sexp-or-nothing fmt val)
|
||||||
(sexp-or-nothing " (kernel-arguments ~S)" kernel-arguments)
|
(sexp-or-nothing " (kernel-arguments ~S)" kernel-arguments)
|
||||||
(sexp-or-nothing " (initrd ~S)" initrd)
|
(sexp-or-nothing " (initrd ~S)" initrd)
|
||||||
(if with-store
|
(if with-store
|
||||||
(format #false " (store~a~a~a~a)"
|
(format #f " (store~@{~a~})"
|
||||||
(sexp-or-nothing " (device ~S)" store-device)
|
(sexp-or-nothing " (device ~S)" store-device)
|
||||||
(sexp-or-nothing " (mount-point ~S)"
|
(sexp-or-nothing " (mount-point ~S)"
|
||||||
store-mount-point)
|
store-mount-point)
|
||||||
|
@ -145,9 +145,7 @@ (define (sexp-or-nothing fmt val)
|
||||||
store-crypto-devices))
|
store-crypto-devices))
|
||||||
"")
|
"")
|
||||||
(sexp-or-nothing " (locale ~S)" locale)
|
(sexp-or-nothing " (locale ~S)" locale)
|
||||||
(sexp-or-nothing " (bootloader-name ~a)" bootloader-name)
|
(sexp-or-nothing " (bootloader-name ~a)" bootloader-name)))
|
||||||
(sexp-or-nothing " (bootloader-menu-entries ~S)"
|
|
||||||
bootloader-menu-entries)))
|
|
||||||
(let ((str (generate-boot-parameters)))
|
(let ((str (generate-boot-parameters)))
|
||||||
(call-with-input-string str read-boot-parameters)))
|
(call-with-input-string str read-boot-parameters)))
|
||||||
|
|
||||||
|
@ -170,7 +168,6 @@ (define (sexp-or-nothing fmt val)
|
||||||
|
|
||||||
(test-assert "read, construction, optional fields"
|
(test-assert "read, construction, optional fields"
|
||||||
(and (test-read-boot-parameters #:bootloader-name #false)
|
(and (test-read-boot-parameters #:bootloader-name #false)
|
||||||
(test-read-boot-parameters #:bootloader-menu-entries #false)
|
|
||||||
(test-read-boot-parameters #:kernel-arguments #false)
|
(test-read-boot-parameters #:kernel-arguments #false)
|
||||||
(test-read-boot-parameters #:with-store #false)
|
(test-read-boot-parameters #:with-store #false)
|
||||||
(test-read-boot-parameters #:store-device #false)
|
(test-read-boot-parameters #:store-device #false)
|
||||||
|
@ -223,11 +220,6 @@ (define (sexp-or-nothing fmt val)
|
||||||
(boot-parameters-bootloader-name
|
(boot-parameters-bootloader-name
|
||||||
(test-read-boot-parameters #:bootloader-name #false)))
|
(test-read-boot-parameters #:bootloader-name #false)))
|
||||||
|
|
||||||
(test-eq "read, bootloader-menu-entries, default value"
|
|
||||||
'()
|
|
||||||
(boot-parameters-bootloader-menu-entries
|
|
||||||
(test-read-boot-parameters #:bootloader-menu-entries #false)))
|
|
||||||
|
|
||||||
(test-eq "read, kernel-arguments, default value"
|
(test-eq "read, kernel-arguments, default value"
|
||||||
'()
|
'()
|
||||||
(boot-parameters-kernel-arguments
|
(boot-parameters-kernel-arguments
|
||||||
|
|
Loading…
Reference in a new issue