diff mbox

linux-initrd: Introduce way to add more packages to initrd.

Message ID 20160725201002.7211-1-sleep_walker@gnu.org
State New
Headers show

Commit Message

Tomáš Čech July 25, 2016, 8:10 p.m. UTC
* gnu/system/linux-initrd.scm(base-initrd): Add `extra-packages' parameter.
---
 gnu/system/linux-initrd.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tomáš Čech Aug. 1, 2016, 10:39 a.m. UTC | #1
Ping after week - is there interest in this patch?

I know that

- it doesn't apply cleanly as it depends on the other one I sent later
  and was discussed
  
- documentation needs to be adjusted as well

- it's a bit corner case but improves flexibility of the configuration
  and is useful for debugging, early HW init, fixing filesystems from
  initial tmpfs etc.

WDYT?

S_W
Andy Wingo Aug. 1, 2016, 3:44 p.m. UTC | #2
On Mon 01 Aug 2016 12:39, Tomáš Čech <sleep_walker@gnu.org> writes:

> Ping after week - is there interest in this patch?
>
> I know that
>
> - it doesn't apply cleanly as it depends on the other one I sent later
>  and was discussed
>  - documentation needs to be adjusted as well
>
> - it's a bit corner case but improves flexibility of the configuration
>  and is useful for debugging, early HW init, fixing filesystems from
>  initial tmpfs etc.
>
> WDYT?

Makes sense to me; needs a documentation addition though.

Andy
Ludovic Courtès Aug. 1, 2016, 4:09 p.m. UTC | #3
Hello,

Tomáš Čech <sleep_walker@gnu.org> skribis:

> Ping after week - is there interest in this patch?

I didn’t comment on the patch specifically because I thought my reply
might make you change your mind.  ;-)

  https://lists.gnu.org/archive/html/guix-devel/2016-07/msg01241.html

All the packages used by the initrd are automatically part of the
initrd.  The proposed patch would allow people to add unused packages to
the initrd.

Could you explain how/when this would be used?  Maybe as commands for
use by Bournish when it’s used as a rescue shell?

Thanks,
Ludo’.
Tomáš Čech Aug. 1, 2016, 6:26 p.m. UTC | #4
On Mon, Aug 01, 2016 at 06:09:12PM +0200, Ludovic Courtès wrote:
>Hello,
>
>Tomáš Čech <sleep_walker@gnu.org> skribis:
>
>> Ping after week - is there interest in this patch?
>
>I didn’t comment on the patch specifically because I thought my reply
>might make you change your mind.  ;-)
>
>  https://lists.gnu.org/archive/html/guix-devel/2016-07/msg01241.html

Thanks for that, I'm still trying to digest that bite. I'm sorry for
being a bit slow on Guile.

>All the packages used by the initrd are automatically part of the
>initrd.  The proposed patch would allow people to add unused packages to
>the initrd.

It is for the packages which you may want to use interactivelly in
case of failure or for some extra initrd hacking you may not want/be
able to write in Guile.

Features like
- extra authentication
- full disk encryption
- root on NFS
- LVM :)
- ...

when kernel+initrd is booted from another source.

>Could you explain how/when this would be used?  Maybe as commands for
>use by Bournish when it’s used as a rescue shell?

I agree that it is more for debugging and to balance my inability to
express it in Guile but it lowers the barrier a bit.

Bournish is too young to rely on it. I miss pipes, accessing files in
different directories or `ls' with wildcards. I can put in minimal
static busybox which is more than sufficient for rescue, problem
analysis or even data recovery.

I like the idea of Bournish but I'd rather have an alternative
until it is more capable.

And yes, it could be also used from Bournish in interactive session as
a command.

S_W
Tomáš Čech Aug. 2, 2016, 7:43 a.m. UTC | #5
I have made the patch applicable and added documentation in a way I find
useful. As English is not my mother tounge, it may need to be corrected.

Thanks in advance for review.

S_W
Ludovic Courtès Aug. 2, 2016, 12:53 p.m. UTC | #6
Hello,

Tomáš Čech <sleep_walker@gnu.org> skribis:

> On Mon, Aug 01, 2016 at 06:09:12PM +0200, Ludovic Courtès wrote:
>>Hello,
>>
>>Tomáš Čech <sleep_walker@gnu.org> skribis:
>>
>>> Ping after week - is there interest in this patch?
>>
>>I didn’t comment on the patch specifically because I thought my reply
>>might make you change your mind.  ;-)
>>
>>  https://lists.gnu.org/archive/html/guix-devel/2016-07/msg01241.html
>
> Thanks for that, I'm still trying to digest that bite. I'm sorry for
> being a bit slow on Guile.

No problem.  Since you pinged, I thought you had digested it.  ;-)

>>All the packages used by the initrd are automatically part of the
>>initrd.  The proposed patch would allow people to add unused packages to
>>the initrd.
>
> It is for the packages which you may want to use interactivelly in
> case of failure or for some extra initrd hacking you may not want/be
> able to write in Guile.
>
> Features like
> - extra authentication
> - full disk encryption
> - root on NFS
> - LVM :)
> - ...

OK but if you need these packages, for instance because you have a LUKS
boot device, they’ll already be in the initrd.  No need to manually list
them in #:extra-packages.

>>Could you explain how/when this would be used?  Maybe as commands for
>>use by Bournish when it’s used as a rescue shell?
>
> I agree that it is more for debugging and to balance my inability to
> express it in Guile but it lowers the barrier a bit.
>
> Bournish is too young to rely on it. I miss pipes, accessing files in
> different directories or `ls' with wildcards. I can put in minimal
> static busybox which is more than sufficient for rescue, problem
> analysis or even data recovery.
>
> I like the idea of Bournish but I'd rather have an alternative
> until it is more capable.

I agree, but hopefully, you don’t run into Bournish too often?

I guess my main concern (again, as a lazy maintainer) is the cost of
turning ‘base-initrd’ into a kitchen sink, as discussed in the other
thread about #:extra-modules.

I would prefer to provide simple tools that people can build upon, like
‘expression->initrd’ or the ‘raw-initrd’ procedure I proposed, than
trying to come up with a one-size-fits-all procedure with many
parameters.

WDYT?

Thanks,
Ludo’.
Tomáš Čech Aug. 2, 2016, 6:03 p.m. UTC | #7
On Tue, Aug 02, 2016 at 02:53:58PM +0200, Ludovic Courtès wrote:
>Hello,
>
>Tomáš Čech <sleep_walker@gnu.org> skribis:
>>>All the packages used by the initrd are automatically part of the
>>>initrd.  The proposed patch would allow people to add unused packages to
>>>the initrd.
>>
>> It is for the packages which you may want to use interactivelly in
>> case of failure or for some extra initrd hacking you may not want/be
>> able to write in Guile.
>>
>> Features like
>> - extra authentication
>> - full disk encryption
>> - root on NFS
>> - LVM :)
>> - ...
>
>OK but if you need these packages, for instance because you have a LUKS
>boot device, they’ll already be in the initrd.  No need to manually list
>them in #:extra-packages.

That is correct only for cases which are already handle. Last time I
booted from LVM it didn't work. IOW your answer is valid for user but
not for (potential) contributor.

This can help me (and possibly others) to write it.

Otherwise it is hard to write for Guix in Guile because it is hard to
write for Guix in Guile. My solution is not perfect but helps.

>>>Could you explain how/when this would be used?  Maybe as commands for
>>>use by Bournish when it’s used as a rescue shell?
>>
>> I agree that it is more for debugging and to balance my inability to
>> express it in Guile but it lowers the barrier a bit.
>>
>> Bournish is too young to rely on it. I miss pipes, accessing files in
>> different directories or `ls' with wildcards. I can put in minimal
>> static busybox which is more than sufficient for rescue, problem
>> analysis or even data recovery.
>>
>> I like the idea of Bournish but I'd rather have an alternative
>> until it is more capable.
>
>I agree, but hopefully, you don’t run into Bournish too often?

Of course I did until I used exactly this patch and was able to solve
my problem.

>I guess my main concern (again, as a lazy maintainer) is the cost of
>turning ‘base-initrd’ into a kitchen sink, as discussed in the other
>thread about #:extra-modules.
>
>I would prefer to provide simple tools that people can build upon, like
>‘expression->initrd’ or the ‘raw-initrd’ procedure I proposed, than
>trying to come up with a one-size-fits-all procedure with many
>parameters.

I know that your approach is cleaner and nicer for any Guile
programmer. On the other hand it can be harder to use for the rest of
the world.

Kitchen sink issue is matter of configuration and we're all adults
here, we can make our decisions.

I'm not ignoring your proposal but

- I haven't seen a way how it could help me in previous thread
- I'm afraid I can't deliver you such solution until I improve my
  Guile skills.

I'm fine with keeping my patches out of tree (they can be found in
devel mailing list if anyone is interested in it), I just don't think
that I'm the only one facing this sort of problems.

I'm sorry I didn't provide you more constructive answer.

S_W
diff mbox

Patch

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 4934c92..1ba6692 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -139,6 +139,7 @@  MODULES and taken from LINUX."
                       (virtio? #t)
                       volatile-root?
                       (linux-modules #f)
+		      (extra-packages '())
                       (extra-modules '()))
   "Return a monadic derivation that builds a generic initrd, with kernel
 modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
@@ -209,7 +210,8 @@  loaded at boot time in the order in which they appear."
             '())
       ,@(if volatile-root?
             (list unionfs-fuse/static)
-            '())))
+            '())
+      ,@extra-packages))
 
   (define device-mapping-commands
     ;; List of gexps to open the mapped devices.