GNU bug report logs - #42031
[PATCH] gnu: Add autofs.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Wed, 24 Jun 2020 15:57:02 UTC

Severity: normal

Tags: patch

Merged with 42033

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

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 42031 in the body.
You can then email your comments to 42031 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#42031; Package guix-patches. (Wed, 24 Jun 2020 15:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 24 Jun 2020 15:57:02 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] gnu: Add autofs.
Date: Wed, 24 Jun 2020 18:56:05 +0300
* gnu/packages/file-systems.scm (autofs): New variable.
---
 gnu/packages/file-systems.scm | 77 +++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index dd72152c51..c8d881e542 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -36,6 +36,7 @@
   #:use-module (gnu packages acl)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
@@ -57,6 +58,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages rsync)
+  #:use-module (gnu packages sssd)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages valgrind)
@@ -782,3 +784,78 @@ directory onto a single drive and create FreeDesktop.org Trash specification
 compatible directories.")
       (home-page "https://github.com/trapexit/mergerfs-tools")
       (license license:isc))))
+
+(define-public autofs
+  (package
+    (name "autofs")
+    (version "5.1.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://mirrors.edge.kernel.org/pub/linux/daemons/autofs/v"
+                    (version-major version) "/autofs-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1vya21mb4izj3khcr3flibv7xc15vvx2v0rjfk5yd31qnzcy7pnx"))))
+    (build-system gnu-build-system)
+    (inputs `(("util-linux" ,util-linux)
+              ("nfs-utils" ,nfs-utils)
+              ("kmod" ,kmod)
+              ("e2fsprogs" ,e2fsprogs)
+              ("sssd" ,sssd)
+              ("linux-headers" ,linux-libre-headers)
+              ("libtirpc", libtirpc)
+              ("binutils" ,binutils)
+              ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
+              ("libxml2" ,libxml2)))
+    (native-inputs
+     `(("flex" ,flex)
+       ("bison" ,bison)
+       ("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:tests? #f ; no tests
+       #:validate-runpath? #f
+       #:configure-flags '("--enable-force-shutdown" "--with-path=$PATH"
+                           "--enable-ignore-busy")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'pre-configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "exportsssldir" (string-append (assoc-ref inputs "sssd")
+                                                    "/lib/sssd/modules"))
+             (setenv "HAVE_SSS_AUTOFS" "1")
+             (setenv "YACC" (string-append (assoc-ref inputs "bison")
+                                           "/bin/yacc"))
+             (setenv "RANLIB" (string-append (assoc-ref inputs "binutils")
+                                             "/bin/ranlib"))
+             (setenv "RPCGEN" (string-append (assoc-ref inputs "rpcsvc-proto")
+                                             "/bin/rpcgen"))
+             (setenv "LEX" (string-append (assoc-ref inputs "flex")
+                                          "/bin/flex"))
+             (setenv "MOUNT" (string-append (assoc-ref inputs "util-linux")
+                                            "/bin/mount"))
+             (setenv "MOUNT_NFS" (string-append (assoc-ref inputs "nfs-utils")
+                                                "/sbin/mount.nfs"))
+             (setenv "UMOUNT" (string-append (assoc-ref inputs "util-linux")
+                                             "/bin/umount"))
+             (setenv "MODPROBE" (string-append (assoc-ref inputs "kmod")
+                                               "/bin/modprobe"))
+             (setenv "E2FSCK" (string-append (assoc-ref inputs "e2fsprogs")
+                                             "/sbin/fsck.ext2"))
+             (setenv "E3FSCK" (string-append (assoc-ref inputs "e2fsprogs")
+                                             "/sbin/fsck.ext3"))
+             (setenv "E4FSCK" (string-append (assoc-ref inputs "e2fsprogs")
+                                             "/sbin/fsck.ext4"))
+             ;; Allow <rpc/rpc.h> & co. to be found.
+             (setenv "CPATH" (string-append (assoc-ref inputs "libtirpc")
+                                            "/include/tirpc"))
+             ;; Makefile.rules defines a usable STRIP only without the env var.
+             (unsetenv "STRIP")
+             #t)))))
+    (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
+    (synopsis "Kernel-based automounter")
+    (description "Autofs controls the operation of the automount daemons.  The
+automount daemons automatically mount filesystems when they are used and
+unmount them after a period of inactivity.  This is done based on a set of
+pre-configured maps.")
+    (license license:gpl2)))
-- 
2.26.2





Merged 42031 42033. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 25 Jun 2020 10:13:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#42031; Package guix-patches. (Thu, 25 Jun 2020 10:14:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 42031 <at> debbugs.gnu.org
Subject: Re: [bug#42031] [PATCH] gnu: Add autofs.
Date: Thu, 25 Jun 2020 12:12:56 +0200
Hey comrades!

Since you both submitted a patch adding autofs, I suggest that you
review each other’s patch.  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#42031; Package guix-patches. (Thu, 25 Jun 2020 12:28:01 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 42031 <at> debbugs.gnu.org
Subject: Re: [bug#42031] [PATCH] gnu: Add autofs.
Date: Thu, 25 Jun 2020 14:27:31 +0200
[Message part 1 (text/plain, inline)]
Oleg,

Thank you for the patch!

I'm superbly biased[1] but 3 cruel people have insisted we review 
each others' patches so here you go :-)

Oleg told me on #guix that this is basically a straight port from 
Nix[0].  The Nix package is very… not good?  There's nothing worth 
scavenging.  A ‘reviewed’ version of Oleg's patch ends up 
identical to mine, but without the SASL support.

Oleg Pykhalov 写道:
> * gnu/packages/file-systems.scm (autofs): New variable.
> ---
>  gnu/packages/file-systems.scm | 77 
>  +++++++++++++++++++++++++++++++++++
>  1 file changed, 77 insertions(+)
>
> diff --git a/gnu/packages/file-systems.scm 
> b/gnu/packages/file-systems.scm
> index dd72152c51..c8d881e542 100644
> --- a/gnu/packages/file-systems.scm
> +++ b/gnu/packages/file-systems.scm
> @@ -36,6 +36,7 @@
>    #:use-module (gnu packages acl)
>    #:use-module (gnu packages attr)
>    #:use-module (gnu packages autotools)
> +  #:use-module (gnu packages base)
>    #:use-module (gnu packages bison)
>    #:use-module (gnu packages check)
>    #:use-module (gnu packages compression)
> @@ -57,6 +58,7 @@
>    #:use-module (gnu packages python-xyz)
>    #:use-module (gnu packages readline)
>    #:use-module (gnu packages rsync)
> +  #:use-module (gnu packages sssd)
>    #:use-module (gnu packages sqlite)
>    #:use-module (gnu packages tls)
>    #:use-module (gnu packages valgrind)
> @@ -782,3 +784,78 @@ directory onto a single drive and create 
> FreeDesktop.org Trash specification
>  compatible directories.")
>        (home-page "https://github.com/trapexit/mergerfs-tools")
>        (license license:isc))))
> +
> +(define-public autofs
> +  (package
> +    (name "autofs")
> +    (version "5.1.6")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> + 
> "https://mirrors.edge.kernel.org/pub/linux/daemons/autofs/v"
> +                    (version-major version) "/autofs-" version 
> ".tar.xz"))
> +              (sha256
> +               (base32
> + 
> "1vya21mb4izj3khcr3flibv7xc15vvx2v0rjfk5yd31qnzcy7pnx"))))
> +    (build-system gnu-build-system)
> +    (inputs `(("util-linux" ,util-linux)
> +              ("nfs-utils" ,nfs-utils)
> +              ("kmod" ,kmod)
> +              ("e2fsprogs" ,e2fsprogs)
> +              ("sssd" ,sssd)
> +              ("linux-headers" ,linux-libre-headers)
> +              ("libtirpc", libtirpc)
> +              ("binutils" ,binutils)
> +              ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
> +              ("libxml2" ,libxml2)))

Order *inputs alphabetically.

rpcsvc-proto should be native.  So would binutils, but including 
it at all is probably a mistake.

linux-libre-headers aren't necessary.  Nor is kmod.

Sometimes, configure scripts check for things just for fun.

> +    (native-inputs
> +     `(("flex" ,flex)
> +       ("bison" ,bison)
> +       ("pkg-config" ,pkg-config)))
> +    (arguments
> +     `(#:tests? #f ; no tests

Despite the ‘warning: foo not found, disabling the foo tests’ 
./configure warnings I didn't find them either.

> +       #:validate-runpath? #f

This is a sign that something is broken & needs to be fixed, not 
ignored.

> +       #:configure-flags '("--enable-force-shutdown"

INSTALL describes this as:

  --enable-force-shutdown
  This option enables the use of the USR1 signal to force an
  unconditional unlink umount of all mounts at shutdown.

Safety aside, I read that as ‘requires init/service to actually 
send the signal on shutdown to have any effect’.  There's no 
autofs service that does so yet.

I don't have much of an opinion about it.  Does anyone think it's 
useful or unsafe?

> "--with-path=$PATH"

In Nix, everything between ''fun quotes'' is evaluated by a shell. 
In Guix, unless ./configure does its own eval somewhere (I didn't 
check), this just sets the path to (literally) "$PATH".

> +                           "--enable-ignore-busy")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'configure 'pre-configure
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (setenv "exportsssldir" (string-append (assoc-ref 
> inputs "sssd")
> + 
> "/lib/sssd/modules"))
> +             (setenv "HAVE_SSS_AUTOFS" "1")

Pass these as #:configure-flags when possible — it's declarative®.

> +             (setenv "YACC" (string-append (assoc-ref inputs 
> "bison")
> +                                           "/bin/yacc"))
> +             (setenv "RANLIB" (string-append (assoc-ref inputs 
> "binutils")
> +                                             "/bin/ranlib"))
> +             (setenv "RPCGEN" (string-append (assoc-ref inputs 
> "rpcsvc-proto")
> +                                             "/bin/rpcgen"))
> +             (setenv "LEX" (string-append (assoc-ref inputs 
> "flex")
> +                                          "/bin/flex"))
> +             (setenv "MOUNT" (string-append (assoc-ref inputs 
> "util-linux")
> +                                            "/bin/mount"))
> +             (setenv "MOUNT_NFS" (string-append (assoc-ref 
> inputs "nfs-utils")
> + 
> "/sbin/mount.nfs"))
> +             (setenv "UMOUNT" (string-append (assoc-ref inputs 
> "util-linux")
> +                                             "/bin/umount"))
> +             (setenv "MODPROBE" (string-append (assoc-ref 
> inputs "kmod")
> + 
> "/bin/modprobe"))
> +             (setenv "E2FSCK" (string-append (assoc-ref inputs 
> "e2fsprogs")
> + 
> "/sbin/fsck.ext2"))
> +             (setenv "E3FSCK" (string-append (assoc-ref inputs 
> "e2fsprogs")
> + 
> "/sbin/fsck.ext3"))
> +             (setenv "E4FSCK" (string-append (assoc-ref inputs 
> "e2fsprogs")
> + 
> "/sbin/fsck.ext4"))

All of this can be avoided with:

+         (add-before 'configure 'fix-hard-coded-search-path
+           (lambda _
+             (substitute* "configure"
+               (("^searchpath=\".*\"")
+                "searchpath=\"$PATH\""))
+             #t))

allowing the configure script to do the work of finding things.

> +             ;; Allow <rpc/rpc.h> & co. to be found.
> +             (setenv "CPATH" (string-append (assoc-ref inputs 
> "libtirpc")
> +                                            "/include/tirpc"))
> +             ;; Makefile.rules defines a usable STRIP only 
> without the env var.
> +             (unsetenv "STRIP")
> +             #t)))))

Here too: I don't know if you simply copied these from Nix[0] 
because they were there, or if you encountered errors without 
them, but neither should be needed.  I suspect STRIP is only 
needed because of the bogus binutils input above, if at all.

> +    (home-page 
> "https://www.kernel.org/pub/linux/daemons/autofs/")
> +    (synopsis "Kernel-based automounter")

Which kernel?  ;-)

> +    (description "Autofs controls the operation of the 
> automount daemons.  The
> +automount daemons automatically mount filesystems when they are 
> used and
> +unmount them after a period of inactivity.  This is done based 
> on a set of
> +pre-configured maps.")

The first sentence describes the autofs *command*.

> +    (license license:gpl2)))

Kind regards,

T G-R

[0]: 
https://github.com/NixOS/nixpkgs/blob/84cf00f98031e93f389f1eb93c4a7374a33cc0a9/pkgs/os-specific/linux/autofs/default.nix
[1]: https://issues.guix.gnu.org/42033
[signature.asc (application/pgp-signature, inline)]

Merged 42031 42033. Request was from Tobias Geerinckx-Rice <me <at> tobias.gr> to control <at> debbugs.gnu.org. (Thu, 25 Jun 2020 12:29:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#42031; Package guix-patches. (Thu, 25 Jun 2020 20:00:02 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 42031 <at> debbugs.gnu.org
Subject: Re: [bug#42031] [PATCH] gnu: Add autofs.
Date: Thu, 25 Jun 2020 22:59:20 +0300
[Message part 1 (text/plain, inline)]
Hi,

Your patch looks good for me except minor:
[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 7c3a19305f..0d62e64bf0 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -59,6 +59,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages sssd)
   #:use-module (gnu packages rsync)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
[Message part 3 (text/plain, inline)]
I've tested your autofs recipe with my ext4 flash drive and sshfs.  Both
works great.  I think you could go a head with merging your cleaner
recipe.

Oleg.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sun, 28 Jun 2020 09:41:02 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Sun, 28 Jun 2020 09:41:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 42031-done <at> debbugs.gnu.org
Subject: Re: [bug#42031] [PATCH] gnu: Add autofs.
Date: Sun, 28 Jun 2020 11:40:34 +0200
[Message part 1 (text/plain, inline)]
Oleg,

Oleg Pykhalov 写道:
> Hi,
>
> Your patch looks good for me except minor:

Thanks!  Lost in the git dance.

> I've tested your autofs recipe with my ext4 flash drive and 
> sshfs.  Both
> works great.  I think you could go a head with merging your 
> cleaner
> recipe.

Pushed as 5c10200b5499826a2e430a46fdb664d269857278!

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sun, 28 Jun 2020 09:41:02 GMT) Full text and rfc822 format available.

Notification sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
bug acknowledged by developer. (Sun, 28 Jun 2020 09:41:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Jul 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 275 days ago.

Previous Next


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