linux-initrd: raw-initrd: Add keyword argument #:pre-mount.

* gnu/system/linux-initrd.scm (raw-initrd): Add keyword argument #:pre-mount.
Document it.
* doc/guix.texi (initial RAM disk): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Hilton Chain 2022-11-12 21:59:26 +08:00 committed by Ludovic Courtès
parent 383b0f0590
commit a6da50d60a
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 10 additions and 5 deletions

View file

@ -37869,15 +37869,17 @@ here is how to use it and customize it further.
@cindex initrd @cindex initrd
@cindex initial RAM disk @cindex initial RAM disk
@deffn {Scheme Procedure} raw-initrd @var{file-systems} @ @deffn {Scheme Procedure} raw-initrd @var{file-systems} @
[#:linux-modules '()] [#:mapped-devices '()] @ [#:linux-modules '()] [#:pre-mount #t] [#:mapped-devices '()] @
[#:keyboard-layout #f] @ [#:keyboard-layout #f] [#:helper-packages '()] @
[#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f] [#:qemu-networking? #f] [#:volatile-root? #f]
Return a derivation that builds a raw initrd. @var{file-systems} is Return a derivation that builds a raw initrd. @var{file-systems} is
a list of file systems to be mounted by the initrd, possibly in addition to a list of file systems to be mounted by the initrd, possibly in addition to
the root file system specified on the kernel command line via @option{root}. the root file system specified on the kernel command line via @option{root}.
@var{linux-modules} is a list of kernel modules to be loaded at boot time. @var{linux-modules} is a list of kernel modules to be loaded at boot time.
@var{mapped-devices} is a list of device mappings to realize before @var{mapped-devices} is a list of device mappings to realize before
@var{file-systems} are mounted (@pxref{Mapped Devices}). @var{file-systems} are mounted (@pxref{Mapped Devices}).
@var{pre-mount} is a G-expression to evaluate before realizing
@var{mapped-devices}.
@var{helper-packages} is a list of packages to be copied in the initrd. @var{helper-packages} is a list of packages to be copied in the initrd.
It may It may
include @code{e2fsck/static} or other packages needed by the initrd to check include @code{e2fsck/static} or other packages needed by the initrd to check

View file

@ -172,6 +172,7 @@ (define* (raw-initrd file-systems
#:key #:key
(linux linux-libre) (linux linux-libre)
(linux-modules '()) (linux-modules '())
(pre-mount #t)
(mapped-devices '()) (mapped-devices '())
(keyboard-layout #f) (keyboard-layout #f)
(helper-packages '()) (helper-packages '())
@ -183,7 +184,8 @@ (define* (raw-initrd file-systems
mounted by the initrd, possibly in addition to the root file system specified mounted by the initrd, possibly in addition to the root file system specified
on the kernel command line via 'root'. LINUX-MODULES is a list of kernel on the kernel command line via 'root'. LINUX-MODULES is a list of kernel
modules to be loaded at boot time. MAPPED-DEVICES is a list of device modules to be loaded at boot time. MAPPED-DEVICES is a list of device
mappings to realize before FILE-SYSTEMS are mounted. mappings to realize before FILE-SYSTEMS are mounted. PRE-MOUNT is a
G-expression to evaluate before realizing MAPPED-DEVICES.
HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include
e2fsck/static or other packages needed by the initrd to check root partition. e2fsck/static or other packages needed by the initrd to check root partition.
@ -255,7 +257,8 @@ (define kodir
(map spec->file-system (map spec->file-system
'#$(map file-system->spec file-systems)) '#$(map file-system->spec file-systems))
#:pre-mount (lambda () #:pre-mount (lambda ()
(and #$@device-mapping-commands (and #$pre-mount
#$@device-mapping-commands
#$@file-system-scan-commands)) #$@file-system-scan-commands))
#:linux-modules '#$linux-modules #:linux-modules '#$linux-modules
#:linux-module-directory '#$kodir #:linux-module-directory '#$kodir