Adding filesystem utilities based on file-systems

OpenSubmitted by Leo Famulari.
Details
3 participants
  • Leo Famulari
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Severity
normal
L
L
Leo Famulari wrote on 8 Feb 2020 01:31
(address . bug-guix@gnu.org)
20200208003122.GA31711@jasmine.lan
As discussed in #39332 [0], it would be great if filesystem utility
packages were added to the system profile if a file-systems entry uses
that filesystem type.

For example, btrfs-progs could be added if a btrfs filesystem was listed
in file-systems.

[0]
L
L
Ludovic Courtès wrote on 10 Feb 2020 23:06
(name . Leo Famulari)(address . leo@famulari.name)(address . 39505@debbugs.gnu.org)
87r1z2gkqo.fsf@gnu.org
Hi Leo,

Leo Famulari <leo@famulari.name> skribis:

Toggle quote (7 lines)
> As discussed in #39332 [0], it would be great if filesystem utility
> packages were added to the system profile if a file-systems entry uses
> that filesystem type.
>
> For example, btrfs-progs could be added if a btrfs filesystem was listed
> in file-systems.

This could be done with something like:
Toggle diff (17 lines)
diff --git a/gnu/system.scm b/gnu/system.scm
index 01baa248a2..3ff3073017 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -203,7 +203,11 @@
          (default %default-issue))
 
   (packages operating-system-packages             ; list of (PACKAGE OUTPUT...)
-            (default %base-packages))             ; or just PACKAGE
+            (thunked)                             ; or just PACKAGE
+            (default (append (file-system-packages
+                              (operating-system-file-systems
+                               this-operating-system))
+                             %base-packages)))
 
   (timezone operating-system-timezone)            ; string
   (locale   operating-system-locale               ; string
However, this would only work for the default values of ‘packages’. In
other cases, users would have to add (file-system-packages …) explicitly
by themselves, which is not great.

Alternately, we could turn ‘%base-packages’ into a macro that expands
to something like:

(gimme-the-base-packages this-operating-system)

but that wouldn’t be great because now you’d be unable to refer to
‘%base-packages’ like a regular variable, outside the lexical context of
an ‘operating-system’ form.

Thoughts?

Ludo’.
M
M
Maxim Cournoyer wrote on 20 Feb 2020 04:31
(name . Leo Famulari)(address . leo@famulari.name)(address . 39505@debbugs.gnu.org)
87blpu2av8.fsf@apteryx.i-did-not-set--mail-host-address--so-tickle-me
Hello Leo,

Leo Famulari <leo@famulari.name> writes:

Toggle quote (10 lines)
> As discussed in #39332 [0], it would be great if filesystem utility
> packages were added to the system profile if a file-systems entry uses
> that filesystem type.
>
> For example, btrfs-progs could be added if a btrfs filesystem was listed
> in file-systems.
>
> [0]
> https://issues.guix.info/issue/39332#3

What is the use case? Just having btrfs utilities to manage Btrfs file
systems, or is there some problems to avoid? I know that for NFS you
must add nfs-utils so that the util-linux provided 'mount' is able to
mount NFS shares.

If the later is the use case, perhaps we could try to hard reference to
each file system utility in util-linux, instead of having it dispatch
some tool supposed to be in the PATH? I'm not sure how difficult that
would be, and it'd for sure increase the size of util-linux, but perhaps
the pros outweighs the cons.

Maxim
L
L
Leo Famulari wrote on 20 Feb 2020 19:37
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 39505@debbugs.gnu.org)
20200220183726.GA6891@jasmine.lan
On Wed, Feb 19, 2020 at 10:31:07PM -0500, Maxim Cournoyer wrote:
Toggle quote (5 lines)
> What is the use case? Just having btrfs utilities to manage Btrfs file
> systems, or is there some problems to avoid? I know that for NFS you
> must add nfs-utils so that the util-linux provided 'mount' is able to
> mount NFS shares.

It's just to manage the filesystems. For example, the equivalent of `df
-h` requires btrfs-progs.

Toggle quote (6 lines)
> If the later is the use case, perhaps we could try to hard reference to
> each file system utility in util-linux, instead of having it dispatch
> some tool supposed to be in the PATH? I'm not sure how difficult that
> would be, and it'd for sure increase the size of util-linux, but perhaps
> the pros outweighs the cons.

Is there some integration between util-linux and btrfs-progs?
M
M
Maxim Cournoyer wrote on 20 Feb 2020 21:32
(name . Leo Famulari)(address . leo@famulari.name)(address . 39505@debbugs.gnu.org)
87k14hxanr.fsf@gmail.com
Leo Famulari <leo@famulari.name> writes:

Toggle quote (9 lines)
> On Wed, Feb 19, 2020 at 10:31:07PM -0500, Maxim Cournoyer wrote:
>> What is the use case? Just having btrfs utilities to manage Btrfs file
>> systems, or is there some problems to avoid? I know that for NFS you
>> must add nfs-utils so that the util-linux provided 'mount' is able to
>> mount NFS shares.
>
> It's just to manage the filesystems. For example, the equivalent of `df
> -h` requires btrfs-progs.

OK; so just as a convenience.

Toggle quote (8 lines)
>> If the later is the use case, perhaps we could try to hard reference to
>> each file system utility in util-linux, instead of having it dispatch
>> some tool supposed to be in the PATH? I'm not sure how difficult that
>> would be, and it'd for sure increase the size of util-linux, but perhaps
>> the pros outweighs the cons.
>
> Is there some integration between util-linux and btrfs-progs?

No, at least mounting Btrfs doesn't require a mount.btrfs helper like
NFS does.

Maxim
?