From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IGmPBxJ2U1/TLwAA0tVLHw (envelope-from ) for ; Sat, 05 Sep 2020 11:27:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WDEUAxJ2U19bGwAA1q6Kng (envelope-from ) for ; Sat, 05 Sep 2020 11:27:14 +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 9CAD8940365 for ; Sat, 5 Sep 2020 11:27:13 +0000 (UTC) Received: from localhost ([::1]:44958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEWLg-0004ik-Ku for larch@yhetil.org; Sat, 05 Sep 2020 07:27:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEWLW-0004gt-LG for guix-patches@gnu.org; Sat, 05 Sep 2020 07:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEWLV-0000gs-Rw for guix-patches@gnu.org; Sat, 05 Sep 2020 07:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEWLV-0003gT-Om for guix-patches@gnu.org; Sat, 05 Sep 2020 07:27:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43219] [PATCH] gnu: Handle nfs-root device strings. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Sep 2020 11:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43219 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43219@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159930519814126 (code B ref -1); Sat, 05 Sep 2020 11:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Sep 2020 11:26:38 +0000 Received: from localhost ([127.0.0.1]:41631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEWL8-0003fm-9I for submit@debbugs.gnu.org; Sat, 05 Sep 2020 07:26:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:52842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEWL6-0003fd-Df for submit@debbugs.gnu.org; Sat, 05 Sep 2020 07:26:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEWL6-0004fs-8A for guix-patches@gnu.org; Sat, 05 Sep 2020 07:26:36 -0400 Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:17862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEWL3-0000ej-Sm for guix-patches@gnu.org; Sat, 05 Sep 2020 07:26:35 -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 66556F35165 for ; Sat, 5 Sep 2020 11:26:29 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [178.5.77.113]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 28A1D19ADD9 for ; Sat, 5 Sep 2020 11:26:26 +0000 (UTC) From: Stefan Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <4D0B1280-3FB5-48E5-B985-24773F966618@vodafonemail.de> Date: Sat, 5 Sep 2020 13:26:25 +0200 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@vodafonemail.de; helo=vsmx012.vodafonemail.xion.oxcs.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/05 07:26:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: -0.51 X-TUID: VcqBJL1NlJUE * gnu/bootloader/grub.scm (grub-root-search): Suppor nfs-root device = strings to set the root to tftp. * gnu/build/file-systems.scm (canonicalize-device-spec): Support = nfs-root device strings. * gnu/build/linux-boot.scm (device-string->file-system-device): Support = nfs-root device strings. * gnu/machine/ssh.scm (machine-check-file-system-availability): Avoid = checking of nfs file systems as in guix/scripts/system.scm. * gnu/system.scm (read-boot-parameters, device-sexp->device): Support = nfs-root device strings. --- gnu/bootloader/grub.scm | 3 +++ gnu/build/file-systems.scm | 3 ++- gnu/build/linux-boot.scm | 5 +++-- gnu/machine/ssh.scm | 2 ++ gnu/system.scm | 12 +++++++----- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index b905ae360c..b3efcfa1db 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -295,6 +295,9 @@ code." ((? file-system-label? label) (format #f "search --label --set ~a" (file-system-label->string label))) + ((? (lambda (device) + (and (string? device) (string-contains device ":/"))) = nfs-uri) + "set root=3D(tftp)") ((or #f (? string?)) #~(format #f "search --file --set ~a" #$file))))) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 4ba1503b9f..734d648575 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -675,7 +675,8 @@ were found." ^L (define (canonicalize-device-spec spec) "Return the device name corresponding to SPEC, which can be a , = a -, or a string (typically a /dev file name)." +, or a string (typically a /dev file name or an = nfs-root +containing ':/')." (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 diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 80fe0cfb9d..32e3536039 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -469,9 +469,10 @@ upon error." (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. + ;; string, but the string can represent a device, an nfs-root, a = UUID, or a + ;; label. So check for all four. (cond ((string-prefix? "/" device-string) device-string) + ((string-contains device-string ":/") device-string) ; = nfs-root ((uuid device-string) =3D> identity) (else (file-system-label device-string)))) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 4e31baa4b9..35b42add48 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -172,6 +172,8 @@ exist on the machine." (and (file-system-mount? fs) (not (member (file-system-type fs) %pseudo-file-system-types)) + ;; Don't try to validate network file systems. + (not (string-prefix? "nfs" (file-system-type fs))) (not (memq 'bind-mount (file-system-flags fs))))) (operating-system-file-systems (machine-operating-system = machine)))) diff --git a/gnu/system.scm b/gnu/system.scm index f092df56ce..bdb696fe2e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -316,11 +316,13 @@ file system labels." ((? bytevector? bv) ;old format (bytevector->uuid bv 'dce)) ((? string? device) - ;; It used to be that we would not distinguish between labels = and - ;; device names. Try to infer the right thing here. - (if (string-prefix? "/dev/" device) - device - (file-system-label device))))) + (if (string-contains device ":/") + device ; nfs-root + ;; It used to be that we would not distinguish between = labels and + ;; device names. Try to infer the right thing here. + (if (string-prefix? "/" device) + device + (file-system-label device)))))) (match (read port) (('boot-parameters ('version 0) --=20 2.26.0