GNU bug report logs - #59066
[PATCH 1/1] linux-initrd: raw-initrd: Add keyword argument #:pre-mount.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Sun, 6 Nov 2022 01:47:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59066 in the body.
You can then email your comments to 59066 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59066; Package guix-patches. (Sun, 06 Nov 2022 01:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hilton Chain <hako <at> ultrarare.space>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 06 Nov 2022 01:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: guix-patches <at> gnu.org
Subject: [PATCH 1/1] linux-initrd: raw-initrd: Add keyword argument
 #:pre-mount.
Date: Sun, 06 Nov 2022 09:45:45 +0800
* gnu/system/linux-initrd.scm (raw-initrd): Add keyword argument #:pre-mount.
---
 gnu/system/linux-initrd.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4c4c78e444..1e72aaee1c 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 '())
                       (mapped-devices '())
                       (keyboard-layout #f)
                       (helper-packages '())
@@ -255,7 +256,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
-- 
2.38.0





Information forwarded to guix-patches <at> gnu.org:
bug#59066; Package guix-patches. (Fri, 11 Nov 2022 21:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 59066 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: 59066 <at> debbugs.gnu.org
Subject: Re: bug#59066: [PATCH 1/1] linux-initrd: raw-initrd: Add keyword
 argument #:pre-mount.
Date: Fri, 11 Nov 2022 22:32:15 +0100
Hi!

Hilton Chain <hako <at> ultrarare.space> skribis:

> * gnu/system/linux-initrd.scm (raw-initrd): Add keyword argument #:pre-mount.

[...]

> +                      (pre-mount '())
>                        (mapped-devices '())
>                        (keyboard-layout #f)
>                        (helper-packages '())
> @@ -255,7 +256,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

I think #:pre-mount should be a single gexp (instead of a list),
defaulting to #t.  So we’d do:

  (lambda () (and #$pre-mount #$@device-mapping-commands …))

WDYT?

Also could you update the docstring and ‘doc/guix.texi’ accordingly?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#59066; Package guix-patches. (Sat, 12 Nov 2022 14:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 59066 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 59066 <at> debbugs.gnu.org
Subject: [PATCH v2] linux-initrd: raw-initrd: Add keyword argument #:pre-mount.
Date: Sat, 12 Nov 2022 21:59:26 +0800
* 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




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 18 Nov 2022 13:26:02 GMT) Full text and rfc822 format available.

Notification sent to Hilton Chain <hako <at> ultrarare.space>:
bug acknowledged by developer. (Fri, 18 Nov 2022 13:26:03 GMT) Full text and rfc822 format available.

Message #16 received at 59066-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: 59066-done <at> debbugs.gnu.org
Subject: Re: bug#59066: [PATCH 1/1] linux-initrd: raw-initrd: Add keyword
 argument #:pre-mount.
Date: Fri, 18 Nov 2022 14:25:03 +0100
Hi,

Hilton Chain <hako <at> ultrarare.space> skribis:

> * 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.

Applied, thanks!

> Haven't begun my SSH test yet :P

Heh, no rush.  :-)

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Dec 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.