mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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 <dannym@scratchpost.org>
This commit is contained in:
parent
0e5a68a271
commit
1c3b709edb
4 changed files with 14 additions and 8 deletions
|
@ -675,7 +675,8 @@ (define find-partition-by-luks-uuid
|
|||
|
||||
(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)."
|
||||
<file-system-label>, 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
|
||||
|
|
|
@ -469,9 +469,10 @@ (define (root-mount-point? fs)
|
|||
|
||||
(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))))
|
||||
|
||||
|
|
|
@ -172,6 +172,8 @@ (define file-systems
|
|||
(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))))
|
||||
|
||||
|
|
|
@ -316,11 +316,13 @@ (define device-sexp->device
|
|||
((? 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)
|
||||
|
|
Loading…
Reference in a new issue