mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
bootloader: Add bootloader name to boot-parameters record.
* gnu/system.scm (<boot-parameters>)[name]: New field. (boot-parameters-boot-name): Ditto. (operating-system-boot-parameters-file): Add new field. (operating-system-boot-parameters): Ditto. (read-boot-parameters): Ditto.
This commit is contained in:
parent
9121ce553d
commit
bcaf67c44f
1 changed files with 12 additions and 0 deletions
|
@ -104,6 +104,7 @@ (define-module (gnu system)
|
||||||
boot-parameters?
|
boot-parameters?
|
||||||
boot-parameters-label
|
boot-parameters-label
|
||||||
boot-parameters-root-device
|
boot-parameters-root-device
|
||||||
|
boot-parameters-boot-name
|
||||||
boot-parameters-store-device
|
boot-parameters-store-device
|
||||||
boot-parameters-store-mount-point
|
boot-parameters-store-mount-point
|
||||||
boot-parameters-kernel
|
boot-parameters-kernel
|
||||||
|
@ -214,6 +215,7 @@ (define-record-type* <boot-parameters>
|
||||||
;; exactly to the device field of the <file-system> object representing the
|
;; exactly to the device field of the <file-system> object representing the
|
||||||
;; OS's root file system, so it might be a device path like "/dev/sda3".
|
;; OS's root file system, so it might be a device path like "/dev/sda3".
|
||||||
(root-device boot-parameters-root-device)
|
(root-device boot-parameters-root-device)
|
||||||
|
(boot-name boot-parameters-boot-name)
|
||||||
(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)
|
||||||
(kernel boot-parameters-kernel)
|
(kernel boot-parameters-kernel)
|
||||||
|
@ -232,6 +234,11 @@ (define (read-boot-parameters port)
|
||||||
(label label)
|
(label label)
|
||||||
(root-device root)
|
(root-device root)
|
||||||
|
|
||||||
|
(boot-name
|
||||||
|
(match (assq 'boot-name rest)
|
||||||
|
((_ args) args)
|
||||||
|
(#f 'grub))) ; for compatibility reasons.
|
||||||
|
|
||||||
;; In the past, we would store the directory name of the kernel instead
|
;; In the past, we would store the directory name of the kernel instead
|
||||||
;; of the absolute file name of its image. Detect that and correct it.
|
;; of the absolute file name of its image. Detect that and correct it.
|
||||||
(kernel (if (string=? linux (direct-store-path linux))
|
(kernel (if (string=? linux (direct-store-path linux))
|
||||||
|
@ -869,6 +876,9 @@ (define (operating-system-boot-parameters os system.drv root-device)
|
||||||
(mlet* %store-monad
|
(mlet* %store-monad
|
||||||
((initrd (operating-system-initrd-file os))
|
((initrd (operating-system-initrd-file os))
|
||||||
(store -> (operating-system-store-file-system os))
|
(store -> (operating-system-store-file-system os))
|
||||||
|
(bootloader -> (bootloader-configuration-bootloader
|
||||||
|
(operating-system-bootloader os)))
|
||||||
|
(boot-name -> (bootloader-name bootloader))
|
||||||
(label -> (kernel->boot-label (operating-system-kernel os))))
|
(label -> (kernel->boot-label (operating-system-kernel os))))
|
||||||
(return (boot-parameters
|
(return (boot-parameters
|
||||||
(label label)
|
(label label)
|
||||||
|
@ -879,6 +889,7 @@ (define (operating-system-boot-parameters os system.drv root-device)
|
||||||
(operating-system-kernel-arguments os system.drv root-device)
|
(operating-system-kernel-arguments os system.drv root-device)
|
||||||
(operating-system-user-kernel-arguments os)))
|
(operating-system-user-kernel-arguments os)))
|
||||||
(initrd initrd)
|
(initrd initrd)
|
||||||
|
(boot-name boot-name)
|
||||||
(store-device (fs->boot-device store))
|
(store-device (fs->boot-device store))
|
||||||
(store-mount-point (file-system-mount-point store))))))
|
(store-mount-point (file-system-mount-point store))))))
|
||||||
|
|
||||||
|
@ -904,6 +915,7 @@ (define* (operating-system-boot-parameters-file os #:optional (system.drv #f))
|
||||||
(kernel-arguments
|
(kernel-arguments
|
||||||
#$(boot-parameters-kernel-arguments params))
|
#$(boot-parameters-kernel-arguments params))
|
||||||
(initrd #$(boot-parameters-initrd params))
|
(initrd #$(boot-parameters-initrd params))
|
||||||
|
(boot-name #$(boot-parameters-boot-name params))
|
||||||
(store
|
(store
|
||||||
(device #$(boot-parameters-store-device params))
|
(device #$(boot-parameters-store-device params))
|
||||||
(mount-point #$(boot-parameters-store-mount-point params))))
|
(mount-point #$(boot-parameters-store-mount-point params))))
|
||||||
|
|
Loading…
Reference in a new issue