From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iFjXOF2Y9F62UgAA0tVLHw (envelope-from ) for ; Thu, 25 Jun 2020 12:28:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aEi7NF2Y9F4iEAAAB5/wlQ (envelope-from ) for ; Thu, 25 Jun 2020 12:28:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A73F89400C1 for ; Thu, 25 Jun 2020 12:28:12 +0000 (UTC) Received: from localhost ([::1]:54610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joQzB-00017N-Ls for larch@yhetil.org; Thu, 25 Jun 2020 08:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joQz4-00017B-0Y for guix-patches@gnu.org; Thu, 25 Jun 2020 08:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joQz3-0006ec-Oh for guix-patches@gnu.org; Thu, 25 Jun 2020 08:28:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1joQz3-00013M-LL for guix-patches@gnu.org; Thu, 25 Jun 2020 08:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42031] [PATCH] gnu: Add autofs. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Jun 2020 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42031 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Oleg Pykhalov Cc: 42031@debbugs.gnu.org Received: via spool by 42031-submit@debbugs.gnu.org id=B42031.15930880584017 (code B ref 42031); Thu, 25 Jun 2020 12:28:01 +0000 Received: (at 42031) by debbugs.gnu.org; 25 Jun 2020 12:27:38 +0000 Received: from localhost ([127.0.0.1]:39849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joQyg-00012i-4f for submit@debbugs.gnu.org; Thu, 25 Jun 2020 08:27:38 -0400 Received: from tobias.gr ([80.241.217.52]:48712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joQyd-00012X-IE for 42031@debbugs.gnu.org; Thu, 25 Jun 2020 08:27:37 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id 2aea7b49; Thu, 25 Jun 2020 12:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to:cc :subject:message-id:references:in-reply-to:date:mime-version :content-type; s=2018; i=me@tobias.gr; bh=jahM4sofIivy37Zi2xSNAm BQxfIhyxWQpfOtBH6FGIA=; b=gEhan+SdLAcJkBk8XU4P6uy1rJY/zp2V6CXkbe qTwp1YgqbuhMI7+QsAe2yzStuHlAD8y60FSC+FtGNZpEuPFE/VoiCIcbSxRZ9Qaf q2E34xSOoFcsttEbHbhJ4f0pXyNL530PFgRfWkF4vWc9VZA6tlQbvlmQ6u/ndf4b bWZ1X7g9AAzVEel0fKKtelaJIJus1AV5CZrOAgQLTFgdCzNipG6YPOBeBFZ34zC1 qtd9Ikc8T/t7zV7w8ZsnUMGLZJrMKcx4fL2PxKZyVoj63ZxyfTmyVhjbk+D069C0 2UOxUulbP5ZPHiI5YRQ7LIcWQc9RwvJ0UMyzdKYBEjnktGrQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 3d6b5075 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 25 Jun 2020 12:27:36 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; Message-ID: <875zbg41nu.fsf@nckx> References: <20200624155605.23002-1-go.wigust@gmail.com> In-reply-to: <20200624155605.23002-1-go.wigust@gmail.com> Date: Thu, 25 Jun 2020 14:27:31 +0200 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=tobias.gr header.s=2018 header.b=gEhan+Sd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.61 X-TUID: +ObRbuQk6Ima --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Oleg, Thank you for the patch! I'm superbly biased[1] but 3 cruel people have insisted we review=20 each others' patches so here you go :-) Oleg told me on #guix that this is basically a straight port from=20 Nix[0]. The Nix package is very=E2=80=A6 not good? There's nothing worth= =20 scavenging. A =E2=80=98reviewed=E2=80=99 version of Oleg's patch ends up=20 identical to mine, but without the SASL support. Oleg Pykhalov =E5=86=99=E9=81=93=EF=BC=9A > * gnu/packages/file-systems.scm (autofs): New variable. > --- > gnu/packages/file-systems.scm | 77=20 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 77 insertions(+) > > diff --git a/gnu/packages/file-systems.scm=20 > 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=20 > 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 > +=20 > "https://mirrors.edge.kernel.org/pub/linux/daemons/autofs/v" > + (version-major version) "/autofs-" version=20 > ".tar.xz")) > + (sha256 > + (base32 > +=20 > "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=20 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 =E2=80=98warning: foo not found, disabling the foo tests=E2=80= =99=20 ./configure warnings I didn't find them either. > + #:validate-runpath? #f This is a sign that something is broken & needs to be fixed, not=20 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 =E2=80=98requires init/service to actually=20 send the signal on shutdown to have any effect=E2=80=99. There's no=20 autofs service that does so yet. I don't have much of an opinion about it. Does anyone think it's=20 useful or unsafe? > "--with-path=3D$PATH" In Nix, everything between ''fun quotes'' is evaluated by a shell.=20 In Guix, unless ./configure does its own eval somewhere (I didn't=20 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=20 > inputs "sssd") > +=20 > "/lib/sssd/modules")) > + (setenv "HAVE_SSS_AUTOFS" "1") Pass these as #:configure-flags when possible =E2=80=94 it's declarative=C2= =AE. > + (setenv "YACC" (string-append (assoc-ref inputs=20 > "bison") > + "/bin/yacc")) > + (setenv "RANLIB" (string-append (assoc-ref inputs=20 > "binutils") > + "/bin/ranlib")) > + (setenv "RPCGEN" (string-append (assoc-ref inputs=20 > "rpcsvc-proto") > + "/bin/rpcgen")) > + (setenv "LEX" (string-append (assoc-ref inputs=20 > "flex") > + "/bin/flex")) > + (setenv "MOUNT" (string-append (assoc-ref inputs=20 > "util-linux") > + "/bin/mount")) > + (setenv "MOUNT_NFS" (string-append (assoc-ref=20 > inputs "nfs-utils") > +=20 > "/sbin/mount.nfs")) > + (setenv "UMOUNT" (string-append (assoc-ref inputs=20 > "util-linux") > + "/bin/umount")) > + (setenv "MODPROBE" (string-append (assoc-ref=20 > inputs "kmod") > +=20 > "/bin/modprobe")) > + (setenv "E2FSCK" (string-append (assoc-ref inputs=20 > "e2fsprogs") > +=20 > "/sbin/fsck.ext2")) > + (setenv "E3FSCK" (string-append (assoc-ref inputs=20 > "e2fsprogs") > +=20 > "/sbin/fsck.ext3")) > + (setenv "E4FSCK" (string-append (assoc-ref inputs=20 > "e2fsprogs") > +=20 > "/sbin/fsck.ext4")) All of this can be avoided with: + (add-before 'configure 'fix-hard-coded-search-path + (lambda _ + (substitute* "configure" + (("^searchpath=3D\".*\"") + "searchpath=3D\"$PATH\"")) + #t)) allowing the configure script to do the work of finding things. > + ;; Allow & co. to be found. > + (setenv "CPATH" (string-append (assoc-ref inputs=20 > "libtirpc") > + "/include/tirpc")) > + ;; Makefile.rules defines a usable STRIP only=20 > without the env var. > + (unsetenv "STRIP") > + #t))))) Here too: I don't know if you simply copied these from Nix[0]=20 because they were there, or if you encountered errors without=20 them, but neither should be needed. I suspect STRIP is only=20 needed because of the bogus binutils input above, if at all. > + (home-page=20 > "https://www.kernel.org/pub/linux/daemons/autofs/") > + (synopsis "Kernel-based automounter") Which kernel? ;-) > + (description "Autofs controls the operation of the=20 > automount daemons. The > +automount daemons automatically mount filesystems when they are=20 > used and > +unmount them after a period of inactivity. This is done based=20 > on a set of > +pre-configured maps.") The first sentence describes the autofs *command*. > + (license license:gpl2))) Kind regards, T G-R [0]:=20 https://github.com/NixOS/nixpkgs/blob/84cf00f98031e93f389f1eb93c4a7374a33cc= 0a9/pkgs/os-specific/linux/autofs/default.nix [1]: https://issues.guix.gnu.org/42033 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXvSYMwAKCRANsP+IT1Vt ecBmAP0fMlTaLJQZ2jLsQN3K343EpBEWBwlbjZQu8rUhrkDGXQD9GQYYRgq2YTrN LldJ72sN5fmiBhixlH4Pp/LLmVe9iAg= =uvqd -----END PGP SIGNATURE----- --=-=-=--