From 1c3b709edb8e6248a9a84dde57b27f3fdc997f21 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 7 Sep 2020 10:04:19 +0200 Subject: linux-boot: Handle nfs-root device strings. * gnu/build/linux-boot.scm (device-string->file-system-device): Support nfs-root "device" strings. * gnu/build/file-systems.scm (canonicalize-device-spec): Support nfs-root "device" strings. * gnu/machine/ssh.scm (machine-check-file-system-availability): Avoid checking of NFS file systems. * gnu/system.scm (read-boot-parameters, device-sexp->device): Support nfs-root "device" strings. Signed-off-by: Danny Milosavljevic --- gnu/build/file-systems.scm | 3 ++- gnu/build/linux-boot.scm | 5 +++-- gnu/machine/ssh.scm | 2 ++ gnu/system.scm | 12 +++++++----- 4 files changed, 14 insertions(+), 8 deletions(-) (limited to 'gnu') 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." (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=SPEC" 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) => 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) -- cgit v1.2.3