1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-26 11:01:48 +02:00

linux-initrd: Return file-like objects instead of monadic values.

This is an incompatible change visible to users via the 'initrd' field
of 'operating-system'.  However, assuming the user's 'initrd' value
tail-calls to 'raw-initrd' or 'base-initrd', the switch to non-monadic
style is invisible.

* gnu/system/linux-initrd.scm (expression->initrd): Use 'computed-file'
instead of 'gexp->derivation'.
(raw-initrd, base-initrd): Adjust docstring to mention non-monadic
return.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Adjust
accordingly.
* gnu/system.scm (operating-system-directory-base-entries)
(operating-system-initrd-file)
(operating-system-boot-parameters): Adjust accordingly.
* doc/guix.texi (operating-system Reference)
(Initial RAM Disk): Update.
This commit is contained in:
Ludovic Courtès
2018-11-15 18:39:18 +01:00
parent a7ef45d9de
commit e34ae75dc1
4 changed files with 28 additions and 31 deletions
+9 -9
View File
@@ -154,7 +154,7 @@
(default '())) ; list of gexps/strings
(bootloader operating-system-bootloader) ; <bootloader-configuration>
(initrd operating-system-initrd ; (list fs) -> M derivation
(initrd operating-system-initrd ; (list fs) -> file-like
(default base-initrd))
(initrd-modules operating-system-initrd-modules ; list of strings
(thunked) ; it's system-dependent
@@ -442,7 +442,7 @@ value of the SYSTEM-SERVICE-TYPE service."
(return `(("locale" ,locale)))
(mlet %store-monad
((kernel -> (operating-system-kernel os))
(initrd (operating-system-initrd-file os))
(initrd -> (operating-system-initrd-file os))
(params (operating-system-boot-parameters-file os)))
(return `(("kernel" ,kernel)
("parameters" ,params)
@@ -870,12 +870,12 @@ hardware-related operations as necessary when booting a Linux container."
(define make-initrd
(operating-system-initrd os))
(mlet %store-monad ((initrd (make-initrd boot-file-systems
#:linux (operating-system-kernel os)
#:linux-modules
(operating-system-initrd-modules os)
#:mapped-devices mapped-devices)))
(return (file-append initrd "/initrd"))))
(let ((initrd (make-initrd boot-file-systems
#:linux (operating-system-kernel os)
#:linux-modules
(operating-system-initrd-modules os)
#:mapped-devices mapped-devices)))
(file-append initrd "/initrd")))
(define (locale-name->definition* name)
"Variant of 'locale-name->definition' that raises an error upon failure."
@@ -957,7 +957,7 @@ listed in OS. The C library expects to find it under
parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments
such as '--root' and '--load' to <boot-parameters>."
(mlet* %store-monad
((initrd (operating-system-initrd-file os))
((initrd -> (operating-system-initrd-file os))
(store -> (operating-system-store-file-system os))
(bootloader -> (bootloader-configuration-bootloader
(operating-system-bootloader os)))