bootloader: grub: Rename the btrfs-subvolume-file-name parameter.
Following discussion in <https://issues.guix.gnu.org/37305>, it seems more appropriate to give the parameter a more generic name that better describes what it does. * gnu/bootloader/grub.scm (normalize-file): Rename the BTRFS-SUBVOLUME-FILE-NAME parameter to STORE-DIRECTORY-PREFIX, and always assume this argument to be a string. (eye-candy): Likewise. Default STORE-DIRECTORY-PREFIX to "". (grub-configuration-file): Likewise. * gnu/system.scm (operating-system-bootcfg): Adapt.master
parent
c08fac0f7d
commit
e7b86a0d88
|
@ -58,8 +58,8 @@
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(define* (normalize-file file mount-point btrfs-subvolume-file-name)
|
(define* (normalize-file file mount-point store-directory-prefix)
|
||||||
"Strip MOUNT-POINT and prepend BTRFS-SUBVOLUME-FILE-NAME to FILE, a
|
"Strip MOUNT-POINT and prepend STORE-DIRECTORY-PREFIX, if any, to FILE, a
|
||||||
G-expression or other lowerable object denoting a file name."
|
G-expression or other lowerable object denoting a file name."
|
||||||
|
|
||||||
(define (strip-mount-point mount-point file)
|
(define (strip-mount-point mount-point file)
|
||||||
|
@ -72,13 +72,13 @@ G-expression or other lowerable object denoting a file name."
|
||||||
file)))
|
file)))
|
||||||
file))
|
file))
|
||||||
|
|
||||||
(define (prepend-btrfs-subvolume-file-name btrfs-subvolume-file-name file)
|
(define (prepend-store-directory-prefix store-directory-prefix file)
|
||||||
(if btrfs-subvolume-file-name
|
(if store-directory-prefix
|
||||||
#~(string-append #$btrfs-subvolume-file-name #$file)
|
#~(string-append #$store-directory-prefix #$file)
|
||||||
file))
|
file))
|
||||||
|
|
||||||
(prepend-btrfs-subvolume-file-name btrfs-subvolume-file-name
|
(prepend-store-directory-prefix store-directory-prefix
|
||||||
(strip-mount-point mount-point file)))
|
(strip-mount-point mount-point file)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,14 +135,14 @@ file with the resolution provided in CONFIG."
|
||||||
(_ #f)))))
|
(_ #f)))))
|
||||||
|
|
||||||
(define* (eye-candy config store-device store-mount-point
|
(define* (eye-candy config store-device store-mount-point
|
||||||
#:key btrfs-store-subvolume-file-name system port)
|
#:key store-directory-prefix system port)
|
||||||
"Return a gexp that writes to PORT (a port-valued gexp) the 'grub.cfg' part
|
"Return a gexp that writes to PORT (a port-valued gexp) the 'grub.cfg' part
|
||||||
concerned with graphics mode, background images, colors, and all that.
|
concerned with graphics mode, background images, colors, and all that.
|
||||||
STORE-DEVICE designates the device holding the store, and STORE-MOUNT-POINT is
|
STORE-DEVICE designates the device holding the store, and STORE-MOUNT-POINT is
|
||||||
its mount point; these are used to determine where the background image and
|
its mount point; these are used to determine where the background image and
|
||||||
fonts must be searched for. SYSTEM must be the target system string---e.g.,
|
fonts must be searched for. SYSTEM must be the target system string---e.g.,
|
||||||
\"x86_64-linux\". BTRFS-STORE-SUBVOLUME-FILE-NAME is the file name of the
|
\"x86_64-linux\". STORE-DIRECTORY-PREFIX is a directory prefix to prepend to
|
||||||
Btrfs subvolume, to be prepended to any store path, if any."
|
any store file name."
|
||||||
(define setup-gfxterm-body
|
(define setup-gfxterm-body
|
||||||
(let ((gfxmode
|
(let ((gfxmode
|
||||||
(or (and-let* ((theme (bootloader-configuration-theme config))
|
(or (and-let* ((theme (bootloader-configuration-theme config))
|
||||||
|
@ -181,12 +181,12 @@ fi~%" #+font-file)
|
||||||
(define font-file
|
(define font-file
|
||||||
(normalize-file (file-append grub "/share/grub/unicode.pf2")
|
(normalize-file (file-append grub "/share/grub/unicode.pf2")
|
||||||
store-mount-point
|
store-mount-point
|
||||||
btrfs-store-subvolume-file-name))
|
store-directory-prefix))
|
||||||
|
|
||||||
(define image
|
(define image
|
||||||
(normalize-file (grub-background-image config)
|
(normalize-file (grub-background-image config)
|
||||||
store-mount-point
|
store-mount-point
|
||||||
btrfs-store-subvolume-file-name))
|
store-directory-prefix))
|
||||||
|
|
||||||
(and image
|
(and image
|
||||||
#~(format #$port "
|
#~(format #$port "
|
||||||
|
@ -320,13 +320,13 @@ code."
|
||||||
#:key
|
#:key
|
||||||
(system (%current-system))
|
(system (%current-system))
|
||||||
(old-entries '())
|
(old-entries '())
|
||||||
btrfs-subvolume-file-name)
|
store-directory-prefix)
|
||||||
"Return the GRUB configuration file corresponding to CONFIG, a
|
"Return the GRUB configuration file corresponding to CONFIG, a
|
||||||
<bootloader-configuration> object, and where the store is available at
|
<bootloader-configuration> object, and where the store is available at
|
||||||
STORE-FS, a <file-system> object. OLD-ENTRIES is taken to be a list
|
STORE-FS, a <file-system> object. OLD-ENTRIES is taken to be a list of menu
|
||||||
of menu entries corresponding to old generations of the system.
|
entries corresponding to old generations of the system.
|
||||||
BTRFS-SUBVOLUME-FILE-NAME may be used to specify on which subvolume a
|
STORE-DIRECTORY-PREFIX may be used to specify a store prefix, as is required
|
||||||
Btrfs root file system resides."
|
when booting a root file system on a Btrfs subvolume."
|
||||||
(define all-entries
|
(define all-entries
|
||||||
(append entries (bootloader-configuration-menu-entries config)))
|
(append entries (bootloader-configuration-menu-entries config)))
|
||||||
(define (menu-entry->gexp entry)
|
(define (menu-entry->gexp entry)
|
||||||
|
@ -336,17 +336,14 @@ Btrfs root file system resides."
|
||||||
(arguments (menu-entry-linux-arguments entry))
|
(arguments (menu-entry-linux-arguments entry))
|
||||||
(kernel (normalize-file (menu-entry-linux entry)
|
(kernel (normalize-file (menu-entry-linux entry)
|
||||||
device-mount-point
|
device-mount-point
|
||||||
btrfs-subvolume-file-name))
|
store-directory-prefix))
|
||||||
(initrd (normalize-file (menu-entry-initrd entry)
|
(initrd (normalize-file (menu-entry-initrd entry)
|
||||||
device-mount-point
|
device-mount-point
|
||||||
btrfs-subvolume-file-name)))
|
store-directory-prefix)))
|
||||||
;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
|
;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point.
|
||||||
;; Use the right file names for KERNEL and INITRD in case
|
;; Use the right file names for KERNEL and INITRD in case
|
||||||
;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
|
;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a
|
||||||
;; separate partition.
|
;; separate partition.
|
||||||
|
|
||||||
;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the kernel and
|
|
||||||
;; initrd paths, to allow booting from a Btrfs subvolume.
|
|
||||||
#~(format port "menuentry ~s {
|
#~(format port "menuentry ~s {
|
||||||
~a
|
~a
|
||||||
linux ~a ~a
|
linux ~a ~a
|
||||||
|
@ -360,7 +357,7 @@ Btrfs root file system resides."
|
||||||
(eye-candy config
|
(eye-candy config
|
||||||
(menu-entry-device (first all-entries))
|
(menu-entry-device (first all-entries))
|
||||||
(menu-entry-device-mount-point (first all-entries))
|
(menu-entry-device-mount-point (first all-entries))
|
||||||
#:btrfs-store-subvolume-file-name btrfs-subvolume-file-name
|
#:store-directory-prefix store-directory-prefix
|
||||||
#:system system
|
#:system system
|
||||||
#:port #~port))
|
#:port #~port))
|
||||||
|
|
||||||
|
@ -371,8 +368,8 @@ Btrfs root file system resides."
|
||||||
(keymap* (and layout
|
(keymap* (and layout
|
||||||
(keyboard-layout-file layout #:grub grub)))
|
(keyboard-layout-file layout #:grub grub)))
|
||||||
(keymap (and keymap*
|
(keymap (and keymap*
|
||||||
(if btrfs-subvolume-file-name
|
(if store-directory-prefix
|
||||||
#~(string-append #$btrfs-subvolume-file-name
|
#~(string-append #$store-directory-prefix
|
||||||
#$keymap*)
|
#$keymap*)
|
||||||
keymap*))))
|
keymap*))))
|
||||||
#~(when #$keymap
|
#~(when #$keymap
|
||||||
|
|
|
@ -1118,7 +1118,7 @@ a list of <menu-entry>, to populate the \"old entries\" menu."
|
||||||
|
|
||||||
(generate-config-file bootloader-conf (list entry)
|
(generate-config-file bootloader-conf (list entry)
|
||||||
#:old-entries old-entries
|
#:old-entries old-entries
|
||||||
#:btrfs-subvolume-file-name
|
#:store-directory-prefix
|
||||||
(btrfs-store-subvolume-file-name file-systems))))
|
(btrfs-store-subvolume-file-name file-systems))))
|
||||||
|
|
||||||
(define* (operating-system-boot-parameters os root-device
|
(define* (operating-system-boot-parameters os root-device
|
||||||
|
|
Reference in New Issue