mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
system: Store boot parameters in the system derivation.
* gnu/system.scm (operating-system-parameters-file): New procedure. (operating-system-derivation): Use it to produce a 'parameters' files.
This commit is contained in:
parent
2d23e6f051
commit
64e40dbb69
1 changed files with 17 additions and 1 deletions
|
@ -511,6 +511,20 @@ (define (operating-system-grub.cfg os)
|
||||||
(initrd #~(string-append #$system "/initrd"))))))
|
(initrd #~(string-append #$system "/initrd"))))))
|
||||||
(grub-configuration-file (operating-system-bootloader os) entries)))
|
(grub-configuration-file (operating-system-bootloader os) entries)))
|
||||||
|
|
||||||
|
(define (operating-system-parameters-file os)
|
||||||
|
"Return a file that describes the boot parameters of OS. The primary use of
|
||||||
|
this file is the reconstruction of GRUB menu entries for old configurations."
|
||||||
|
(mlet %store-monad ((initrd (operating-system-initrd-file os))
|
||||||
|
(root -> (operating-system-root-file-system os))
|
||||||
|
(label -> (kernel->grub-label
|
||||||
|
(operating-system-kernel os))))
|
||||||
|
(gexp->file "parameters"
|
||||||
|
#~(boot-parameters (version 0)
|
||||||
|
(label #$label)
|
||||||
|
(root-device #$(file-system-device root))
|
||||||
|
(kernel #$(operating-system-kernel os))
|
||||||
|
(initrd #$initrd)))))
|
||||||
|
|
||||||
(define (operating-system-derivation os)
|
(define (operating-system-derivation os)
|
||||||
"Return a derivation that builds OS."
|
"Return a derivation that builds OS."
|
||||||
(mlet* %store-monad
|
(mlet* %store-monad
|
||||||
|
@ -518,10 +532,12 @@ (define (operating-system-derivation os)
|
||||||
(etc (operating-system-etc-directory os))
|
(etc (operating-system-etc-directory os))
|
||||||
(boot (operating-system-boot-script os))
|
(boot (operating-system-boot-script os))
|
||||||
(kernel -> (operating-system-kernel os))
|
(kernel -> (operating-system-kernel os))
|
||||||
(initrd (operating-system-initrd-file os)))
|
(initrd (operating-system-initrd-file os))
|
||||||
|
(params (operating-system-parameters-file os)))
|
||||||
(file-union "system"
|
(file-union "system"
|
||||||
`(("boot" ,#~#$boot)
|
`(("boot" ,#~#$boot)
|
||||||
("kernel" ,#~#$kernel)
|
("kernel" ,#~#$kernel)
|
||||||
|
("parameters" ,#~#$params)
|
||||||
("initrd" ,initrd)
|
("initrd" ,initrd)
|
||||||
("profile" ,#~#$profile)
|
("profile" ,#~#$profile)
|
||||||
("etc" ,#~#$etc)))))
|
("etc" ,#~#$etc)))))
|
||||||
|
|
Loading…
Reference in a new issue