From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 59066@debbugs.gnu.org
Subject: [bug#59066] [PATCH v2] linux-initrd: raw-initrd: Add keyword argument #:pre-mount.
Date: Sat, 12 Nov 2022 21:59:26 +0800 [thread overview]
Message-ID: <y76zgcwe0jl.wl-hako@ultrarare.space> (raw)
In-Reply-To: <87wn81dvog.fsf@gnu.org>
* gnu/system/linux-initrd.scm (raw-initrd): Add keyword argument #:pre-mount.
Document it.
* doc/guix.texi (initial RAM disk): Likewise.
---
v1 -> v2:
1. Use gexp instead of a list.
2. Documentation.
Haven't begun my SSH test yet :P
doc/guix.texi | 8 +++++---
gnu/system/linux-initrd.scm | 7 +++++--
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3f76184495..35eb128f6e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37844,15 +37844,17 @@ here is how to use it and customize it further.
@cindex initrd
@cindex initial RAM disk
@deffn {Scheme Procedure} raw-initrd @var{file-systems} @
- [#:linux-modules '()] [#:mapped-devices '()] @
- [#:keyboard-layout #f] @
- [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f]
+ [#:linux-modules '()] [#:pre-mount #t] [#:mapped-devices '()] @
+ [#:keyboard-layout #f] [#:helper-packages '()] @
+ [#:qemu-networking? #f] [#:volatile-root? #f]
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
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{mapped-devices} is a list of device mappings to realize before
@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.
It may
include @code{e2fsck/static} or other packages needed by the initrd to check
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..58e95a1312 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -172,6 +172,7 @@ (define* (raw-initrd file-systems
#:key
(linux linux-libre)
(linux-modules '())
+ (pre-mount #t)
(mapped-devices '())
(keyboard-layout #f)
(helper-packages '())
@@ -183,7 +184,8 @@ (define* (raw-initrd file-systems
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
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
e2fsck/static or other packages needed by the initrd to check root partition.
@@ -255,7 +257,8 @@ (define kodir
(map spec->file-system
'#$(map file-system->spec file-systems))
#:pre-mount (lambda ()
- (and #$@device-mapping-commands
+ (and #$pre-mount
+ #$@device-mapping-commands
#$@file-system-scan-commands))
#:linux-modules '#$linux-modules
#:linux-module-directory '#$kodir
base-commit: 2757de2e2b271d87f6f72ba4161c2225fbdc9e78
--
2.38.1
next prev parent reply other threads:[~2022-11-12 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-06 1:45 [bug#59066] [PATCH 1/1] linux-initrd: raw-initrd: Add keyword argument #:pre-mount Hilton Chain via Guix-patches via
2022-11-11 21:32 ` Ludovic Courtès
2022-11-12 13:59 ` Hilton Chain via Guix-patches via [this message]
2022-11-18 13:25 ` bug#59066: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=y76zgcwe0jl.wl-hako@ultrarare.space \
--to=guix-patches@gnu.org \
--cc=59066@debbugs.gnu.org \
--cc=hako@ultrarare.space \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).