GNU logs - #41820, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 11 Jun 2020 23:38:02 +0000
Resent-Message-ID: <handler.41820.B.159191864422126 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 41820 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.159191864422126
          (code B ref -1); Thu, 11 Jun 2020 23:38:02 +0000
Received: (at submit) by debbugs.gnu.org; 11 Jun 2020 23:37:24 +0000
Received: from localhost ([127.0.0.1]:38366 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jjWl9-0005kl-KK
	for submit <at> debbugs.gnu.org; Thu, 11 Jun 2020 19:37:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:48468)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jjWl7-0005kd-9U
 for submit <at> debbugs.gnu.org; Thu, 11 Jun 2020 19:37:22 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43316)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefan-guix@HIDDEN>)
 id 1jjWl7-0002PO-2E
 for guix-patches@HIDDEN; Thu, 11 Jun 2020 19:37:21 -0400
Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:9405)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefan-guix@HIDDEN>)
 id 1jjWl4-0000lI-A7
 for guix-patches@HIDDEN; Thu, 11 Jun 2020 19:37:20 -0400
Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198])
 by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 7EE00F35139;
 Thu, 11 Jun 2020 23:37:11 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.74])
 by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 2081819B4CA;
 Thu, 11 Jun 2020 23:37:06 +0000 (UTC)
From: Stefan <stefan-guix@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Date: Fri, 12 Jun 2020 01:37:06 +0200
Message-Id: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
Received-SPF: pass client-ip=153.92.174.90;
 envelope-from=stefan-guix@HIDDEN;
 helo=vsmx012.vodafonemail.xion.oxcs.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 19:37:11
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x (no timestamps) [generic]
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

* doc/guix.texi: Add description for 'nfs-share'.
* gnu/bootloader/grub.scm (grub-root-search): Support 'nfs-share'.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support =
'nfs-share'.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
'nfs-share'.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Support
'nfs-share'.
* gnu/services/base.scm (file-system->fstab-entry): Support 'nfs-share'.
* gnu/system.scm (read-boot-parameters, device-sexp->device, =
device->sexp):
Support 'nfs-share'.
* gnu/system/file-systems.scm (<nfs-share>): New record type with =
printer.
(nfs-share): New function to conditionally construct an 'nfs-share' =
record.
(nfs-share->string): New function.
(nfs-share?): New predicate.
(file-system-device->string, file-system->spec, spec->file-system): =
Support
'nfs-share'.
* guix/scripts/system.scm (display-system-generation, =
check-initrd-modules):
Support 'nfs-share'.
---
 doc/guix.texi               | 38 ++++++++++++++++++++++++++++++-------
 gnu/bootloader.scm          |  4 ++--
 gnu/bootloader/grub.scm     |  2 ++
 gnu/build/file-systems.scm  | 12 ++++++------
 gnu/build/linux-boot.scm    |  7 ++++---
 gnu/machine/ssh.scm         | 23 ++++++++++++++++++++++
 gnu/services/base.scm       |  2 ++
 gnu/system.scm              |  4 ++++
 gnu/system/file-systems.scm | 36 +++++++++++++++++++++++++++++++++--
 guix/scripts/system.scm     |  9 +++++++--
 10 files changed, 115 insertions(+), 22 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 15e077a41c..4fd3793a4f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11723,10 +11723,10 @@ This is a string specifying the type of the =
file system---e.g.,
 This designates the place where the file system is to be mounted.
=20
 @item @code{device}
-This names the ``source'' of the file system.  It can be one of three
-things: a file system label, a file system UUID, or the name of a
-@file{/dev} node.  Labels and UUIDs offer a way to refer to file
-systems without having to hard-code their actual device
+This names the ``source'' of the file system.  It can be one of four
+things: a file system label, a file system UUID, the name of a
+@file{/dev} node, or an NFS share.  Labels and UUIDs offer a way to
+refer to file systems without having to hard-code their actual device
 name@footnote{Note that, while it is tempting to use
 @file{/dev/disk/by-uuid} and similar device names to achieve the same
 result, this is not recommended: These special device nodes are created
@@ -11735,9 +11735,10 @@ mounted.}.
=20
 @findex file-system-label
 File system labels are created using the @code{file-system-label}
-procedure, UUIDs are created using @code{uuid}, and @file{/dev} node =
are
-plain strings.  Here's an example of a file system referred to by its
-label, as shown by the @command{e2label} command:
+procedure, UUIDs are created using @code{uuid}, NFS shares are created
+using @code{nfs-share}, and @file{/dev} nodes are plain strings.  =
Here's
+an example of a file system referred to by its label, as shown by the
+@command{e2label} command:
=20
 @lisp
 (file-system
@@ -11762,6 +11763,29 @@ like this:
   (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
 @end lisp
=20
+@findex nfs-share
+An NFS share is defined in one of the following ways. Please note that
+the NFS server for a root file system needs to be passed as IP address
+via the @code{options} field as @code{"addr=3D"} option.
+
+@lisp
+(file-system
+  (mount-point "/")
+  (type "nfs")
+  (device (nfs-share ":/srv/nfs/guix-root"))
+  (options "addr=3D10.10.10.10,vers=3D4.1")
+  (needed-for-boot? #t))
+@end lisp
+
+@lisp
+(file-system
+  (mount-point "/music")
+  (type "nfs")
+  (device (nfs-share "music-server.local:/srv/nfs/music"))
+  (options "vers=3D4.1")
+  (needed-for-boot? #f))
+@end lisp
+
 When the source of a file system is a mapped device (@pxref{Mapped
 Devices}), its @code{device} field @emph{must} refer to the mapped
 device name---e.g., @file{"/dev/mapper/root-partition"}.
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 2eebb8e9d9..62c585670b 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -77,8 +77,8 @@
   menu-entry make-menu-entry
   menu-entry?
   (label           menu-entry-label)
-  (device          menu-entry-device       ; file system uuid, label, =
or #f
-                   (default #f))
+  (device          menu-entry-device       ; uuid, file-system-label,
+                   (default #f))           ; nfs-share, or #f
   (device-mount-point menu-entry-device-mount-point
                    (default #f))
   (linux           menu-entry-linux
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index b905ae360c..d82c09a79d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -295,6 +295,8 @@ code."
         ((? file-system-label? label)
          (format #f "search --label --set ~a"
                  (file-system-label->string label)))
+        ((? nfs-share?)
+         "set root=3D(tftp)")
         ((or #f (? string?))
          #~(format #f "search --file --set ~a" #$file)))))
=20
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index ad92d8a496..306cff75fb 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -636,8 +636,8 @@ were found."
=20
 ^L
 (define (canonicalize-device-spec spec)
-  "Return the device name corresponding to SPEC, which can be a <uuid>, =
a
-<file-system-label>, or a string (typically a /dev file name)."
+  "Return the device name corresponding to SPEC, which can be a <uuid>, =
an
+<nfs-share>, a <file-system-label>, or a string (typically a /dev file =
name)."
   (define max-trials
     ;; Number of times we retry partition label resolution, 1 second =
per
     ;; trial.  Note: somebody reported a delay of 16 seconds (!) before =
their
@@ -661,10 +661,10 @@ were found."
=20
   (match spec
     ((? string?)
-     (if (string-contains spec ":/")
-         spec                  ; do not resolve NFS devices
-         ;; Nothing to do, but wait until SPEC shows up.
-         (resolve identity spec identity)))
+     ;; Nothing to do, but wait until SPEC shows up.
+     (resolve identity spec identity))
+    ((? nfs-share?)
+     (nfs-share->string spec))
     ((? file-system-label?)
      ;; Resolve the label.
      (resolve find-partition-by-label
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 80fe0cfb9d..8a609f6eff 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -469,10 +469,11 @@ upon error."
=20
   (define (device-string->file-system-device device-string)
     ;; The "--root=3DSPEC" kernel command-line option always provides a
-    ;; string, but the string can represent a device, a UUID, or a
-    ;; label.  So check for all three.
-    (cond ((string-prefix? "/" device-string) device-string)
+    ;; string, but the string can represent a device, a UUID, an =
nfs-share,
+    ;; or a label.  So check for all of theme.
+    (cond ((nfs-share device-string #:on-error (const #f)) =3D> =
identity)
           ((uuid device-string) =3D> identity)
+          ((string-prefix? "/" device-string) device-string)
           (else (file-system-label device-string))))
=20
   (display "Welcome, this is GNU's early boot Guile.\n")
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 116da86327..aa42a082c2 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -222,6 +222,24 @@ exist on the machine."
                  (message (format #f (G_ "no file system with UUID =
'~a'")
                                   (uuid->string (file-system-device =
fs))))))))))
=20
+  (define (check-nfs-share fs)
+    (define remote-exp
+      (with-imported-modules (source-module-closure
+                              '((gnu build file-systems)))
+        #~(begin
+            (use-modules (gnu build file-systems))
+
+            ;; TODO: Try to mount the share or to ping the server.
+            (nfs-share->string (nfs-share
+                                 #$(nfs-share->string =
(file-system-device fs)))))))
+
+    (remote-let ((result remote-exp))
+      (unless result
+        (raise (condition
+                (&message
+                 (message (format #f (G_ "no nfs-share '~a'")
+                                  (nfs-share->string =
(file-system-device fs))))))))))
+
   (append (map check-literal-file-system
                (filter (lambda (fs)
                          (string? (file-system-device fs)))
@@ -233,6 +251,10 @@ exist on the machine."
           (map check-uuid-file-system
                (filter (lambda (fs)
                          (uuid? (file-system-device fs)))
+                       file-systems))
+          (map check-nfs-share
+               (filter (lambda (fs)
+                         (nfs-share? (file-system-device fs)))
                        file-systems))))
=20
 (define (machine-check-initrd-modules machine)
@@ -257,6 +279,7 @@ not available in the initrd."
=20
               (define dev
                 #$(cond ((string? device) device)
+                        ((nfs-share? device) (nfs-share->string =
device))
                         ((uuid? device) #~(find-partition-by-uuid
                                            (string->uuid
                                             #$(uuid->string device))))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6ea7ef8e7e..beef30fdf4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -200,6 +200,8 @@
                                    (file-system-label->string label)))
                    ((? uuid? uuid)
                     (string-append "UUID=3D" (uuid->string uuid)))
+                   ((? nfs-share? share)
+                    (nfs-share->string share))
                    ((? string? device)
                     device))
                  "\t"
diff --git a/gnu/system.scm b/gnu/system.scm
index d51691fe76..660255b9e9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -306,6 +306,8 @@ file system labels."
        (bytevector->uuid bv type))
       (('file-system-label (? string? label))
        (file-system-label label))
+      (('nfs-share (? string? share))
+       (nfs-share share))
       ((? bytevector? bv)                         ;old format
        (bytevector->uuid bv 'dce))
       ((? string? device)
@@ -1240,6 +1242,8 @@ such as '--root' and '--load' to =
<boot-parameters>."
      `(uuid ,(uuid-type uuid) ,(uuid-bytevector uuid)))
     ((? file-system-label? label)
      `(file-system-label ,(file-system-label->string label)))
+    ((? nfs-share? share)
+     `(nfs-share ,(nfs-share->string share)))
     (_
      device)))
=20
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 0f94577760..13ef38e490 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -59,6 +59,10 @@
             file-system-label?
             file-system-label->string
=20
+            nfs-share
+            nfs-share?
+            nfs-share->string
+
             file-system->spec
             spec->file-system
             specification->file-system-mapping
@@ -102,7 +106,8 @@
 (define-record-type* <file-system> %file-system
   make-file-system
   file-system?
-  (device           file-system-device) ; string | <uuid> | =
<file-system-label>
+  (device           file-system-device) ; <uuid> | <file-system-label>
+                                        ; <nfs-share> | string
   (mount-point      file-system-mount-point)      ; string
   (type             file-system-type)             ; string
   (flags            file-system-flags             ; list of symbols
@@ -134,6 +139,27 @@
                             (format port "#<file-system-label ~s>"
                                     (file-system-label->string obj))))
=20
+;; An nfs-share for use in the 'device' field.
+(define-record-type <nfs-share>
+  (make-nfs-share share)
+  nfs-share?
+  (share nfs-share->string))
+
+(define* (nfs-share share #:key (on-error
+                                  (lambda (share)
+                                    (error "The nfs-share is missing =
\":/\" in"
+                                           share))))
+  "Try to construct an nfs-share, return (on-errer share) if share is =
invalid.
+Use #:on-error (const #f)' to check validity and avoid an error to be =
thrown."
+  (if (string-contains share ":/")
+      (make-nfs-share share)
+      (on-error share)))
+
+(set-record-type-printer! <nfs-share>
+                          (lambda (obj port)
+                            (format port "#<nfs-share ~s>"
+                                    (nfs-share->string obj))))
+
 (define-syntax report-deprecation
   (lambda (s)
     "Report the use of the now-deprecated 'title' field."
@@ -149,7 +175,7 @@
                  file line column)
          #t)))))
=20
-;; Helper for 'process-file-system-declaration'.
+;; Helper for the deprecated 'process-file-system-declaration'.
 (define-syntax device-expression
   (syntax-rules (quote label uuid device)
     ((_ (quote label) dev)
@@ -257,6 +283,8 @@ UUID-TYPE, a symbol such as 'dce or 'iso9660."
      (if uuid-type
          (uuid->string (uuid-bytevector device) uuid-type)
          (uuid->string device)))
+    ((? nfs-share?)
+     (nfs-share->string device))
     ((? string?)
      device)))
=20
@@ -303,6 +331,8 @@ initrd code."
                   `(uuid ,(uuid-type device) ,(uuid-bytevector =
device)))
                  ((file-system-label? device)
                   `(file-system-label ,(file-system-label->string =
device)))
+                 ((nfs-share? device)
+                  `(nfs-share ,(nfs-share->string device)))
                  (else device))
            mount-point type flags options check?))))
=20
@@ -316,6 +346,8 @@ initrd code."
                   (bytevector->uuid bv type))
                  (('file-system-label (? string? label))
                   (file-system-label label))
+                 (('nfs-share (? string? share))
+                  (nfs-share share))
                  (_
                   device)))
        (mount-point mount-point) (type type)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3d7aa77cb7..27b324deac 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -497,12 +497,15 @@ list of services."
       ;;   root device: UUID: 12345-678
       ;; or:
       ;;   root device: label: "my-root"
+      ;; or:
+      ;;  root device: nfs-share: 0.0.0.0:/my-root
       ;; or just:
       ;;   root device: /dev/sda3
-      (format #t (G_ "  root device: ~[UUID: ~a~;label: ~s~;~a~]~%")
+      (format #t (G_ "  root device: ~[UUID: ~a~;label: ~s~;nfs-share: =
~a~;~a~]~%")
               (cond ((uuid? root-device) 0)
                     ((file-system-label? root-device) 1)
-                    (else 2))
+                    ((nfs-share? root-device) 2)
+                    (else 3))
               (file-system-device->string root-device))
=20
       (format #t (G_ "  kernel: ~a~%") kernel)
@@ -649,6 +652,8 @@ checking this by themselves in their 'check' =
procedure."
       (match device
         ((? string?)
          device)
+        ((? nfs-share?)
+         (nfs-share->string device))
         ((? uuid?)
          (find-partition-by-uuid device))
         ((? file-system-label?)
--=20
2.26.0





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Stefan <stefan-guix@HIDDEN>
Subject: bug#41820: Acknowledgement ([PATCH] file-systems: Add record type
 <nfs-share> for a file system device.)
Message-ID: <handler.41820.B.159191864422126.ack <at> debbugs.gnu.org>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
X-Gnu-PR-Message: ack 41820
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 41820 <at> debbugs.gnu.org
Date: Thu, 11 Jun 2020 23:38:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 41820 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
41820: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D41820
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 11 Jun 2020 23:45:01 +0000
Resent-Message-ID: <handler.41820.B41820.159191905222923 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Danny Milosavljevic <dannym@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Cc: 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.159191905222923
          (code B ref 41820); Thu, 11 Jun 2020 23:45:01 +0000
Received: (at 41820) by debbugs.gnu.org; 11 Jun 2020 23:44:12 +0000
Received: from localhost ([127.0.0.1]:38392 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jjWrj-0005xf-Pw
	for submit <at> debbugs.gnu.org; Thu, 11 Jun 2020 19:44:11 -0400
Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:28617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jjWri-0005xS-IS
 for 41820 <at> debbugs.gnu.org; Thu, 11 Jun 2020 19:44:11 -0400
Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192])
 by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 692726050DB;
 Thu, 11 Jun 2020 23:44:04 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.74])
 by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id D29356050CF;
 Thu, 11 Jun 2020 23:43:57 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <87bllqi66g.fsf@HIDDEN>
Date: Fri, 12 Jun 2020 01:43:57 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <BF3FCAF4-4B69-41AF-8B41-C82EBDC1CACE@HIDDEN>
References: <9AAFEFF4-8ACE-4C95-975F-67C3F4FDAF81@HIDDEN>
 <87a72gi4kz.fsf@HIDDEN>
 <1179D890-7D6C-43D8-A286-DA7A0F61D585@HIDDEN>
 <87h7w7cc55.fsf@HIDDEN>
 <92DB8E2B-1CA2-41AE-9265-53C4F5337686@HIDDEN>
 <CE315407-AD1A-45A8-A232-FC1512C4569E@HIDDEN>
 <CA441935-DB65-4DF8-BB7F-844B541BB554@HIDDEN>
 <20200606193721.1e126131@HIDDEN>
 <46CD97B3-9994-4AB7-AA7D-4DE39AB7A238@HIDDEN>
 <20200609154400.4c7d2f90@HIDDEN> <87bllqi66g.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Now that the new record <nfs-share> is working and seeing the amount of =
changes to make this working, I get the impression that this is =
unnecessarily complicated.

In the end there will be the "--root=3D" option for the kernel, which is =
only a plain string. And most of the device record related functions in =
the end target to produce a string.

And then there is (device-string->file-system-device) in =
gnu/build/linux-boot.scm to convert this string back into a device =
record.

As long as this conversion to and from string is necessary, there is no =
real benefit in having different record types for (file-system (device =
=E2=80=A6)), it could just be a string. Then there would only be the =
need for a simple parser function like (device-string->device-type) to =
determine the type of device to be used in places where the type =
matters.


Bye

Stefan





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 20 Jun 2020 13:54:02 +0000
Resent-Message-ID: <handler.41820.B41820.15926611827556 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Danny Milosavljevic <dannym@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>
Cc: 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.15926611827556
          (code B ref 41820); Sat, 20 Jun 2020 13:54:02 +0000
Received: (at 41820) by debbugs.gnu.org; 20 Jun 2020 13:53:02 +0000
Received: from localhost ([127.0.0.1]:57534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jmdvZ-0001xj-TN
	for submit <at> debbugs.gnu.org; Sat, 20 Jun 2020 09:53:02 -0400
Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:41030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jmdvW-0001xR-Rk
 for 41820 <at> debbugs.gnu.org; Sat, 20 Jun 2020 09:53:00 -0400
Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197])
 by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 498E259D090;
 Sat, 20 Jun 2020 13:52:53 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [178.8.228.237])
 by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 7841B539A4B;
 Sat, 20 Jun 2020 13:52:44 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <BF3FCAF4-4B69-41AF-8B41-C82EBDC1CACE@HIDDEN>
Date: Sat, 20 Jun 2020 15:52:43 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3E9A3851-44B1-4062-A4ED-983BB0114D5D@HIDDEN>
References: <9AAFEFF4-8ACE-4C95-975F-67C3F4FDAF81@HIDDEN>
 <87a72gi4kz.fsf@HIDDEN>
 <1179D890-7D6C-43D8-A286-DA7A0F61D585@HIDDEN>
 <87h7w7cc55.fsf@HIDDEN>
 <92DB8E2B-1CA2-41AE-9265-53C4F5337686@HIDDEN>
 <CE315407-AD1A-45A8-A232-FC1512C4569E@HIDDEN>
 <CA441935-DB65-4DF8-BB7F-844B541BB554@HIDDEN>
 <20200606193721.1e126131@HIDDEN>
 <46CD97B3-9994-4AB7-AA7D-4DE39AB7A238@HIDDEN>
 <20200609154400.4c7d2f90@HIDDEN> <87bllqi66g.fsf@HIDDEN>
 <BF3FCAF4-4B69-41AF-8B41-C82EBDC1CACE@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

A friendly ping.

What about this patch? This is what has been requested. Can it be pushed =
or does someone have further requests?


Bye

Stefan=




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Mathieu Othacehe <othacehe@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sun, 21 Jun 2020 09:37:02 +0000
Resent-Message-ID: <handler.41820.B41820.159273218132032 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Stefan <stefan-guix@HIDDEN>
Cc: Danny Milosavljevic <dannym@HIDDEN>, 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.159273218132032
          (code B ref 41820); Sun, 21 Jun 2020 09:37:02 +0000
Received: (at 41820) by debbugs.gnu.org; 21 Jun 2020 09:36:21 +0000
Received: from localhost ([127.0.0.1]:59246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jmwOj-0008Ka-Hn
	for submit <at> debbugs.gnu.org; Sun, 21 Jun 2020 05:36:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <othacehe@HIDDEN>) id 1jmwOf-0008KH-QQ
 for 41820 <at> debbugs.gnu.org; Sun, 21 Jun 2020 05:36:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51396)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <othacehe@HIDDEN>)
 id 1jmwOY-0001zz-MM; Sun, 21 Jun 2020 05:36:10 -0400
Received: from [2a01:e0a:fa:a50:34a1:eac3:9800:4a6e] (port=53124 helo=meru)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <othacehe@HIDDEN>)
 id 1jmwOO-0008Aw-It; Sun, 21 Jun 2020 05:36:10 -0400
From: Mathieu Othacehe <othacehe@HIDDEN>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
Date: Sun, 21 Jun 2020 11:35:59 +0200
In-Reply-To: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN> (Stefan's
 message of "Fri, 12 Jun 2020 01:37:06 +0200")
Message-ID: <87tuz44v7k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Hello Stefan,

Thanks a lot for this patch, overall it look nice! Without going into
details here are a few remarks:

* As you probably noticed the bootloading & system part of Guix is
moving a lot recently. This patch does not apply on master, so it would
be nice if you could rebase it and pass "--base=auto" option to "git
format-patch" so that it's easier to apply it.

* It would be nice to have tests for this functionality. There's already
a (gnu tests nfs) module, testing the NFS service. Maybe you could add a
test case of a marionette booting from a local NFS share.

* Finally, now that file-system "device" field can be a label, a UUID, a
"/dev" node and an "nfs-share", it makes me think that we could need a
new layer of abstraction here, but this can come later and I need to
think more about it.

Thanks,

Mathieu




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 01 Jul 2020 18:49:02 +0000
Resent-Message-ID: <handler.41820.B41820.15936293394165 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Mathieu Othacehe <othacehe@HIDDEN>
Cc: Danny Milosavljevic <dannym@HIDDEN>, 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.15936293394165
          (code B ref 41820); Wed, 01 Jul 2020 18:49:02 +0000
Received: (at 41820) by debbugs.gnu.org; 1 Jul 2020 18:48:59 +0000
Received: from localhost ([127.0.0.1]:53744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jqhn1-000156-66
	for submit <at> debbugs.gnu.org; Wed, 01 Jul 2020 14:48:59 -0400
Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:16381)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jqhmy-00014n-JX
 for 41820 <at> debbugs.gnu.org; Wed, 01 Jul 2020 14:48:58 -0400
Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197])
 by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 6314559D4AC;
 Wed,  1 Jul 2020 18:48:50 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.123])
 by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id E154F539BE3;
 Wed,  1 Jul 2020 18:48:43 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <87tuz44v7k.fsf@HIDDEN>
Date: Wed, 1 Jul 2020 20:48:42 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <39F7973C-8A64-4B6D-9A26-D98AA7F37475@HIDDEN>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
 <87tuz44v7k.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Mathieu!

> * As you probably noticed the bootloading & system part of Guix is
> moving a lot recently. This patch does not apply on master, so it =
would
> be nice if you could rebase it and pass "--base=3Dauto" option to "git
> format-patch" so that it's easier to apply it.

OK.

> * It would be nice to have tests for this functionality. There's =
already
> a (gnu tests nfs) module, testing the NFS service. Maybe you could add =
a
> test case of a marionette booting from a local NFS share.

I tried. Unfortunately on my little aarch64 SBC compiling the necessary =
packages takes days =E2=80=93 there are no substitutes available =E2=80=93=
 and in the end qemu-5 has a failing test. I retried and rebased and =
retried and wasted days in the end. I=E2=80=99m a bit frustrated. :-(

  TEST    iotest-qcow2: 244 [fail]
QEMU          -- =
"/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../aarc=
h64-softmmu/qemu-system-aarch64" -nodefaults -display none -machine
 virt -accel qtest
QEMU_IMG      -- =
"/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu=
-img"
QEMU_IO       -- =
"/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu=
-io"  --cache writeback --aio threads -f qcow2
QEMU_NBD      -- =
"/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu=
-nbd"
IMGFMT        -- qcow2 (compat=3D1.1)
IMGPROTO      -- file
PLATFORM      -- Linux/aarch64  5.5.9
TEST_DIR      -- =
/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/scratch
SOCK_DIR      -- /tmp/guix-build-qemu-5.0.0.drv-0/tmp.qUme9gv2Jy
SOCKET_SCM_HELPER -- =
/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/socket_scm_=
helper

--- =
/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out   =
   2020-04-28 16:49:25.000000000 +0000
+++ =
/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out.bad=
  2020-06-29 10:27:02.036147483 +0000
@@ -74,6 +74,7 @@
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 1048576/1048576 bytes at offset 1048576
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Pattern verification failed at offset 2097152, 2097152 bytes
 read 2097152/2097152 bytes at offset 2097152
 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 1048576/1048576 bytes at offset 4194304
@@ -108,7 +109,7 @@
 read 4194304/4194304 bytes at offset 2097152
 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

-Images are identical.
+Content mismatch at offset 2097152!
 qcow2 file size after I/O: 327680

 =3D=3D=3D bdrv_co_block_status test for file and offset=3D0 =3D=3D=3D



This is the test that I wrote and wanted to try. Maybe you can pick it =
up and give it a try.


(define (run-nfs-root-fs-test)
  "Run a test of an OS mounting its root file system via NFS."
  (define nfs-root-server-os
    (marionette-operating-system
     (operating-system
       (inherit %nfs-os)
       (file-systems %base-file-systems)
       (services
         (modify-services (operating-system-user-services %nfs-os)
           (nfs-service-type
            config
            =3D>
            (nfs-configuration
             (debug '(nfs nfsd mountd))
             (exports '(("/export"
                         =
"*(rw,insecure,no_subtree_check,crossmnt,fsid=3Droot,no_root_squash,insecu=
re,async)"))))))))
     #:requirements '(nscd)
     #:imported-modules '((gnu services herd)
                          (guix combinators))))

  (define nfs-root-client-os
    (marionette-operating-system
     (operating-system
       (inherit %nfs-os)
       (kernel-arguments '("ip=3Ddhcp"))
       (file-systems (cons
                      (file-system
                        (type "nfs")
                        (mount-point "/")
                        (device (nfs-share ":/export"))
                        (options "addr=3D0.0.0.0,vers=3D4.2"))
                     %base-file-systems)))
     #:requirements '(nscd)
     #:imported-modules '((gnu services herd)
                          (guix combinators))))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (gnu build marionette)
                       (srfi srfi-64))

          (define server-marionette
            (make-marionette (list #$(virtual-machine =
nfs-root-server-os))))
          (define client-marionette
            (make-marionette (list #$(virtual-machine =
nfs-root-client-os))))

          (mkdir #$output)
          (chdir #$output)

          (test-begin "start-nfs-root-server")
          (marionette-eval
           '(begin
              (use-modules (gnu services herd))

              (current-output-port
               (open-file "/dev/console" "w0"))
              (chmod "/export" #o777)
              (symlink "/gnu" "/export/gnu")
              (start-service 'nscd))
              (start-service 'networking)
              (start-service 'nfs)
          server-marionette)

          ;; Wait for the NFS services to be up and running.
          (test-assert "nfs services are running"
           (wait-for-file "/var/run/rpc.statd.pid" server-marionette))

          (test-begin "boot-nfs-root-client")
          (marionette-eval
           '(begin
              (use-modules (gnu services herd))

              (current-output-port
               (open-file "/dev/console" "w0"))
               (with-output-to-file "/var/run/mounts"
                (lambda () (system* "mount")))
               (chmod "/var/run/mounts" #o777))
          client-marionette)

          (test-assert "nfs-root-client booted")
          (marionelle-eval
           '(begin
              (and (file-exists? "/export/var/run/mounts")
                   (system* "cat" "/export/var/run/mounts")))
          server-marionette)

          (test-end)
          (exit (=3D (test-runner-fail-count (test-runner-current)) =
0)))))

  (gexp->derivation "nfs-server-test" test))

(define %test-nfs-root-fs
  (system-test
   (name "nfs-root-fs")
   (description "Test that an NFS server can be started and exported
directories can be mounted.")
   (value (run-nfs-root-fs-test))))


Bye

Stefan





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 01 Jul 2020 18:50:01 +0000
Resent-Message-ID: <handler.41820.B41820.15936293464211 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Mathieu Othacehe <othacehe@HIDDEN>
Cc: Danny Milosavljevic <dannym@HIDDEN>, 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.15936293464211
          (code B ref 41820); Wed, 01 Jul 2020 18:50:01 +0000
Received: (at 41820) by debbugs.gnu.org; 1 Jul 2020 18:49:06 +0000
Received: from localhost ([127.0.0.1]:53748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jqhn7-00015r-Iw
	for submit <at> debbugs.gnu.org; Wed, 01 Jul 2020 14:49:06 -0400
Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:41511)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jqhn5-00014y-Ol
 for 41820 <at> debbugs.gnu.org; Wed, 01 Jul 2020 14:49:04 -0400
Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197])
 by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 32AFF59D4BC;
 Wed,  1 Jul 2020 18:48:58 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.123])
 by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id C0C4D539B8B;
 Wed,  1 Jul 2020 18:48:50 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <87tuz44v7k.fsf@HIDDEN>
Date: Wed, 1 Jul 2020 20:48:46 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <ED6CDFDF-A011-47CE-B506-C822F9D3EA40@HIDDEN>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
 <87tuz44v7k.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* doc/guix.texi: Add description for 'nfs-share'.
* gnu/bootloader/grub.scm (grub-root-search): Support 'nfs-share'.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support =
'nfs-share'.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
'nfs-share'.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Support
'nfs-share'.
* gnu/services/base.scm (file-system->fstab-entry): Support 'nfs-share'.
* gnu/system.scm (read-boot-parameters, device-sexp->device, =
device->sexp):
Support 'nfs-share'.
* gnu/system/file-systems.scm (<nfs-share>): New record type with =
printer.
(nfs-share): New function to conditionally construct an 'nfs-share' =
record.
(nfs-share->string): New function.
(nfs-share?): New predicate.
(file-system-device->string, file-system->spec, spec->file-system): =
Support
'nfs-share'.
* guix/scripts/system.scm (display-system-generation, =
check-initrd-modules):
Support 'nfs-share'.
---
 doc/guix.texi               | 38 ++++++++++++++++++++++++++++++-------
 gnu/bootloader.scm          |  4 ++--
 gnu/bootloader/grub.scm     |  2 ++
 gnu/build/file-systems.scm  | 12 ++++++------
 gnu/build/linux-boot.scm    |  7 ++++---
 gnu/machine/ssh.scm         | 23 ++++++++++++++++++++++
 gnu/services/base.scm       |  2 ++
 gnu/system.scm              |  4 ++++
 gnu/system/file-systems.scm | 36 +++++++++++++++++++++++++++++++++--
 guix/scripts/system.scm     |  9 +++++++--
 10 files changed, 115 insertions(+), 22 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 15e077a41c..4fd3793a4f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11723,10 +11723,10 @@ This is a string specifying the type of the =
file system---e.g.,
 This designates the place where the file system is to be mounted.
=20
 @item @code{device}
-This names the ``source'' of the file system.  It can be one of three
-things: a file system label, a file system UUID, or the name of a
-@file{/dev} node.  Labels and UUIDs offer a way to refer to file
-systems without having to hard-code their actual device
+This names the ``source'' of the file system.  It can be one of four
+things: a file system label, a file system UUID, the name of a
+@file{/dev} node, or an NFS share.  Labels and UUIDs offer a way to
+refer to file systems without having to hard-code their actual device
 name@footnote{Note that, while it is tempting to use
 @file{/dev/disk/by-uuid} and similar device names to achieve the same
 result, this is not recommended: These special device nodes are created
@@ -11735,9 +11735,10 @@ mounted.}.
=20
 @findex file-system-label
 File system labels are created using the @code{file-system-label}
-procedure, UUIDs are created using @code{uuid}, and @file{/dev} node =
are
-plain strings.  Here's an example of a file system referred to by its
-label, as shown by the @command{e2label} command:
+procedure, UUIDs are created using @code{uuid}, NFS shares are created
+using @code{nfs-share}, and @file{/dev} nodes are plain strings.  =
Here's
+an example of a file system referred to by its label, as shown by the
+@command{e2label} command:
=20
 @lisp
 (file-system
@@ -11762,6 +11763,29 @@ like this:
   (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
 @end lisp
=20
+@findex nfs-share
+An NFS share is defined in one of the following ways. Please note that
+the NFS server for a root file system needs to be passed as IP address
+via the @code{options} field as @code{"addr=3D"} option.
+
+@lisp
+(file-system
+  (mount-point "/")
+  (type "nfs")
+  (device (nfs-share ":/srv/nfs/guix-root"))
+  (options "addr=3D10.10.10.10,vers=3D4.1")
+  (needed-for-boot? #t))
+@end lisp
+
+@lisp
+(file-system
+  (mount-point "/music")
+  (type "nfs")
+  (device (nfs-share "music-server.local:/srv/nfs/music"))
+  (options "vers=3D4.1")
+  (needed-for-boot? #f))
+@end lisp
+
 When the source of a file system is a mapped device (@pxref{Mapped
 Devices}), its @code{device} field @emph{must} refer to the mapped
 device name---e.g., @file{"/dev/mapper/root-partition"}.
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 2eebb8e9d9..62c585670b 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -77,8 +77,8 @@
   menu-entry make-menu-entry
   menu-entry?
   (label           menu-entry-label)
-  (device          menu-entry-device       ; file system uuid, label, =
or #f
-                   (default #f))
+  (device          menu-entry-device       ; uuid, file-system-label,
+                   (default #f))           ; nfs-share, or #f
   (device-mount-point menu-entry-device-mount-point
                    (default #f))
   (linux           menu-entry-linux
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index b905ae360c..d82c09a79d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -295,6 +295,8 @@ code."
         ((? file-system-label? label)
          (format #f "search --label --set ~a"
                  (file-system-label->string label)))
+        ((? nfs-share?)
+         "set root=3D(tftp)")
         ((or #f (? string?))
          #~(format #f "search --file --set ~a" #$file)))))
=20
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index ad92d8a496..306cff75fb 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -636,8 +636,8 @@ were found."
=20
 ^L
 (define (canonicalize-device-spec spec)
-  "Return the device name corresponding to SPEC, which can be a <uuid>, =
a
-<file-system-label>, or a string (typically a /dev file name)."
+  "Return the device name corresponding to SPEC, which can be a <uuid>, =
an
+<nfs-share>, a <file-system-label>, or a string (typically a /dev file =
name)."
   (define max-trials
     ;; Number of times we retry partition label resolution, 1 second =
per
     ;; trial.  Note: somebody reported a delay of 16 seconds (!) before =
their
@@ -661,10 +661,10 @@ were found."
=20
   (match spec
     ((? string?)
-     (if (string-contains spec ":/")
-         spec                  ; do not resolve NFS devices
-         ;; Nothing to do, but wait until SPEC shows up.
-         (resolve identity spec identity)))
+     ;; Nothing to do, but wait until SPEC shows up.
+     (resolve identity spec identity))
+    ((? nfs-share?)
+     (nfs-share->string spec))
     ((? file-system-label?)
      ;; Resolve the label.
      (resolve find-partition-by-label
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 80fe0cfb9d..8a609f6eff 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -469,10 +469,11 @@ upon error."
=20
   (define (device-string->file-system-device device-string)
     ;; The "--root=3DSPEC" kernel command-line option always provides a
-    ;; string, but the string can represent a device, a UUID, or a
-    ;; label.  So check for all three.
-    (cond ((string-prefix? "/" device-string) device-string)
+    ;; string, but the string can represent a device, a UUID, an =
nfs-share,
+    ;; or a label.  So check for all of theme.
+    (cond ((nfs-share device-string #:on-error (const #f)) =3D> =
identity)
           ((uuid device-string) =3D> identity)
+          ((string-prefix? "/" device-string) device-string)
           (else (file-system-label device-string))))
=20
   (display "Welcome, this is GNU's early boot Guile.\n")
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 116da86327..aa42a082c2 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -222,6 +222,24 @@ exist on the machine."
                  (message (format #f (G_ "no file system with UUID =
'~a'")
                                   (uuid->string (file-system-device =
fs))))))))))
=20
+  (define (check-nfs-share fs)
+    (define remote-exp
+      (with-imported-modules (source-module-closure
+                              '((gnu build file-systems)))
+        #~(begin
+            (use-modules (gnu build file-systems))
+
+            ;; TODO: Try to mount the share or to ping the server.
+            (nfs-share->string (nfs-share
+                                 #$(nfs-share->string =
(file-system-device fs)))))))
+
+    (remote-let ((result remote-exp))
+      (unless result
+        (raise (condition
+                (&message
+                 (message (format #f (G_ "no nfs-share '~a'")
+                                  (nfs-share->string =
(file-system-device fs))))))))))
+
   (append (map check-literal-file-system
                (filter (lambda (fs)
                          (string? (file-system-device fs)))
@@ -233,6 +251,10 @@ exist on the machine."
           (map check-uuid-file-system
                (filter (lambda (fs)
                          (uuid? (file-system-device fs)))
+                       file-systems))
+          (map check-nfs-share
+               (filter (lambda (fs)
+                         (nfs-share? (file-system-device fs)))
                        file-systems))))
=20
 (define (machine-check-initrd-modules machine)
@@ -257,6 +279,7 @@ not available in the initrd."
=20
               (define dev
                 #$(cond ((string? device) device)
+                        ((nfs-share? device) (nfs-share->string =
device))
                         ((uuid? device) #~(find-partition-by-uuid
                                            (string->uuid
                                             #$(uuid->string device))))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6ea7ef8e7e..beef30fdf4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -200,6 +200,8 @@
                                    (file-system-label->string label)))
                    ((? uuid? uuid)
                     (string-append "UUID=3D" (uuid->string uuid)))
+                   ((? nfs-share? share)
+                    (nfs-share->string share))
                    ((? string? device)
                     device))
                  "\t"
diff --git a/gnu/system.scm b/gnu/system.scm
index d51691fe76..660255b9e9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -306,6 +306,8 @@ file system labels."
        (bytevector->uuid bv type))
       (('file-system-label (? string? label))
        (file-system-label label))
+      (('nfs-share (? string? share))
+       (nfs-share share))
       ((? bytevector? bv)                         ;old format
        (bytevector->uuid bv 'dce))
       ((? string? device)
@@ -1240,6 +1242,8 @@ such as '--root' and '--load' to =
<boot-parameters>."
      `(uuid ,(uuid-type uuid) ,(uuid-bytevector uuid)))
     ((? file-system-label? label)
      `(file-system-label ,(file-system-label->string label)))
+    ((? nfs-share? share)
+     `(nfs-share ,(nfs-share->string share)))
     (_
      device)))
=20
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 0f94577760..13ef38e490 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -59,6 +59,10 @@
             file-system-label?
             file-system-label->string
=20
+            nfs-share
+            nfs-share?
+            nfs-share->string
+
             file-system->spec
             spec->file-system
             specification->file-system-mapping
@@ -102,7 +106,8 @@
 (define-record-type* <file-system> %file-system
   make-file-system
   file-system?
-  (device           file-system-device) ; string | <uuid> | =
<file-system-label>
+  (device           file-system-device) ; <uuid> | <file-system-label>
+                                        ; <nfs-share> | string
   (mount-point      file-system-mount-point)      ; string
   (type             file-system-type)             ; string
   (flags            file-system-flags             ; list of symbols
@@ -134,6 +139,27 @@
                             (format port "#<file-system-label ~s>"
                                     (file-system-label->string obj))))
=20
+;; An nfs-share for use in the 'device' field.
+(define-record-type <nfs-share>
+  (make-nfs-share share)
+  nfs-share?
+  (share nfs-share->string))
+
+(define* (nfs-share share #:key (on-error
+                                  (lambda (share)
+                                    (error "The nfs-share is missing =
\":/\" in"
+                                           share))))
+  "Try to construct an nfs-share, return (on-errer share) if share is =
invalid.
+Use #:on-error (const #f)' to check validity and avoid an error to be =
thrown."
+  (if (string-contains share ":/")
+      (make-nfs-share share)
+      (on-error share)))
+
+(set-record-type-printer! <nfs-share>
+                          (lambda (obj port)
+                            (format port "#<nfs-share ~s>"
+                                    (nfs-share->string obj))))
+
 (define-syntax report-deprecation
   (lambda (s)
     "Report the use of the now-deprecated 'title' field."
@@ -149,7 +175,7 @@
                  file line column)
          #t)))))
=20
-;; Helper for 'process-file-system-declaration'.
+;; Helper for the deprecated 'process-file-system-declaration'.
 (define-syntax device-expression
   (syntax-rules (quote label uuid device)
     ((_ (quote label) dev)
@@ -257,6 +283,8 @@ UUID-TYPE, a symbol such as 'dce or 'iso9660."
      (if uuid-type
          (uuid->string (uuid-bytevector device) uuid-type)
          (uuid->string device)))
+    ((? nfs-share?)
+     (nfs-share->string device))
     ((? string?)
      device)))
=20
@@ -303,6 +331,8 @@ initrd code."
                   `(uuid ,(uuid-type device) ,(uuid-bytevector =
device)))
                  ((file-system-label? device)
                   `(file-system-label ,(file-system-label->string =
device)))
+                 ((nfs-share? device)
+                  `(nfs-share ,(nfs-share->string device)))
                  (else device))
            mount-point type flags options check?))))
=20
@@ -316,6 +346,8 @@ initrd code."
                   (bytevector->uuid bv type))
                  (('file-system-label (? string? label))
                   (file-system-label label))
+                 (('nfs-share (? string? share))
+                  (nfs-share share))
                  (_
                   device)))
        (mount-point mount-point) (type type)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3d7aa77cb7..27b324deac 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -497,12 +497,15 @@ list of services."
       ;;   root device: UUID: 12345-678
       ;; or:
       ;;   root device: label: "my-root"
+      ;; or:
+      ;;  root device: nfs-share: 0.0.0.0:/my-root
       ;; or just:
       ;;   root device: /dev/sda3
-      (format #t (G_ "  root device: ~[UUID: ~a~;label: ~s~;~a~]~%")
+      (format #t (G_ "  root device: ~[UUID: ~a~;label: ~s~;nfs-share: =
~a~;~a~]~%")
               (cond ((uuid? root-device) 0)
                     ((file-system-label? root-device) 1)
-                    (else 2))
+                    ((nfs-share? root-device) 2)
+                    (else 3))
               (file-system-device->string root-device))
=20
       (format #t (G_ "  kernel: ~a~%") kernel)
@@ -649,6 +652,8 @@ checking this by themselves in their 'check' =
procedure."
       (match device
         ((? string?)
          device)
+        ((? nfs-share?)
+         (nfs-share->string device))
         ((? uuid?)
          (find-partition-by-uuid device))
         ((? file-system-label?)

base-commit: cbd9581acc41cd49eb81c2432452cad4de805cbd
--=20
2.26.0





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Stefan <stefan-guix@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 Jul 2020 13:57:01 +0000
Resent-Message-ID: <handler.41820.B41820.15950805684144 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Mathieu Othacehe <othacehe@HIDDEN>
Cc: Danny Milosavljevic <dannym@HIDDEN>, 41820 <at> debbugs.gnu.org
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.15950805684144
          (code B ref 41820); Sat, 18 Jul 2020 13:57:01 +0000
Received: (at 41820) by debbugs.gnu.org; 18 Jul 2020 13:56:08 +0000
Received: from localhost ([127.0.0.1]:59103 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jwnJw-00014m-Ec
	for submit <at> debbugs.gnu.org; Sat, 18 Jul 2020 09:56:08 -0400
Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:22585)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1jwnJs-00014L-G4
 for 41820 <at> debbugs.gnu.org; Sat, 18 Jul 2020 09:56:07 -0400
Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198])
 by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 3D3DDF34F4D;
 Sat, 18 Jul 2020 13:55:58 +0000 (UTC)
Received: from macbook-pro.kuh-wiese.my-router.de (unknown [2.206.141.233])
 by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 9492919AEF5;
 Sat, 18 Jul 2020 13:55:51 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <ED6CDFDF-A011-47CE-B506-C822F9D3EA40@HIDDEN>
Date: Sat, 18 Jul 2020 15:55:50 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <8F500F26-7E4B-4FA1-B7E9-009ACE01DD5B@HIDDEN>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
 <87tuz44v7k.fsf@HIDDEN>
 <ED6CDFDF-A011-47CE-B506-C822F9D3EA40@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-VADE-STATUS: LEGIT
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

A friendly ping =E2=80=A6=




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
Resent-From: Danny Milosavljevic <dannym@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 21 Jul 2020 14:34:01 +0000
Resent-Message-ID: <handler.41820.B41820.159534199223118 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 41820
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Stefan <stefan-guix@HIDDEN>
Cc: Mathieu Othacehe <othacehe@HIDDEN>, 41820 <at> debbugs.gnu.org, Brice Waegeneire <brice@HIDDEN>
Received: via spool by 41820-submit <at> debbugs.gnu.org id=B41820.159534199223118
          (code B ref 41820); Tue, 21 Jul 2020 14:34:01 +0000
Received: (at 41820) by debbugs.gnu.org; 21 Jul 2020 14:33:12 +0000
Received: from localhost ([127.0.0.1]:40031 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jxtKS-00060o-5F
	for submit <at> debbugs.gnu.org; Tue, 21 Jul 2020 10:33:12 -0400
Received: from dd26836.kasserver.com ([85.13.145.193]:51374)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1jxtKP-00060e-HY
 for 41820 <at> debbugs.gnu.org; Tue, 21 Jul 2020 10:33:10 -0400
Received: from localhost (80-110-127-146.cgn.dynamic.surfer.at
 [80.110.127.146])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id AE7033360ED2;
 Tue, 21 Jul 2020 16:33:07 +0200 (CEST)
Date: Tue, 21 Jul 2020 16:33:02 +0200
From: Danny Milosavljevic <dannym@HIDDEN>
Message-ID: <20200721153601.0cdd5234@HIDDEN>
In-Reply-To: <8F500F26-7E4B-4FA1-B7E9-009ACE01DD5B@HIDDEN>
References: <E27E841A-D3EB-472A-911C-D92CE0224B44@HIDDEN>
 <87tuz44v7k.fsf@HIDDEN>
 <ED6CDFDF-A011-47CE-B506-C822F9D3EA40@HIDDEN>
 <8F500F26-7E4B-4FA1-B7E9-009ACE01DD5B@HIDDEN>
X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/SZqwaorz0.tcL3Qf.rCUL/d";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--Sig_/SZqwaorz0.tcL3Qf.rCUL/d
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Stefan,

just a heads-up, I've forwarded this to Brice Waegeneire, who I think is be=
st
qualified to review and merge your work.  He is working on PXE booting,
starting with regular x86_64 machines.  So NFS root is totally something he
both needs and can help with.

Myself, I'm quite satisfied with your version, I'd just like there to be so=
me
minimal tests of the functionality and that's pretty much it.

About the <nfs-share> record, if you think it's better without the record, =
we
can also do without--but I'd like to know Brice's opinion on it.

The idea was to have the record be something like

  https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

if we could have used it.  We can't use "nfsroot=3D" directly because we do=
n't
have network drivers built into the kernel and instead use modules for thos=
e.
That also means that the initrd modules have to be automatically extended
by network card drivers, I guess.

So the initrd would basically emulate the fields of "nfsroot=3D" from the l=
ink
above.

So it would be <nfs-root> and would have fields like=20

  server-ip
  root-dir
  nfs-options (a list)

You're right that having a <nfs-share> with just the host and directory does
not make much sense as a record.  But we actually need to configure the
machine as a client in the network to be able to reach the nfs server,
right?

I guess we could ignore the problem and have the DHCP server do
it, and I'm all for it--but some use cases might need manual configuration,
too.  Even then, is it possible to know which NFS protocol version to use
for the NFS root automatically?  Even in your case, you don't actually
get the nfs IP from the DHCP server either, but you make the user pass it
by splicing it to some string, right?

So some kind of <nfs-root-client> or whatever record is necessary, I'd say.

@Brice: ?

--Sig_/SZqwaorz0.tcL3Qf.rCUL/d
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl8W/J4ACgkQ5xo1VCww
uqWa6Qf/R3I1rySpJy0aMgGAaKFlQKT5sPr1W9LJasI34vXIO3SJcmoKPlYI8X85
2evBxv1ak3aW9tBmML9O5u8gOGXSdjiZMpAAQJSLIYXjkUtGlXl0z2iz15zuLho6
XTjALntDAd+KJvvAlys8aAvRFr8b0//6Y1C/heccgLpWP4W/cq4oFS9bWxl6X+65
oSoo1jhNjwm/S8y1ksm1Q3qhDjcLat9iATVQ6D6rXXRTmiJIlmzB7WVz6D5TvHga
YmP7lAUI9RGQxVL7ojfOpZnUWnl6uetE6nIWxzCEL2Uo8Da6GEJNDbfQ+4v3mL/d
xFGgp3UP1Dz7PQNDyC8/EQ7TZgfcbw==
=5/Xd
-----END PGP SIGNATURE-----

--Sig_/SZqwaorz0.tcL3Qf.rCUL/d--





Last modified: Tue, 21 Jul 2020 14:45:02 UTC

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