mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-11 15:40:31 +02:00
file-systems: canonicalize-device-spec: Wait for device to exist.
Waits for devices specified by a string. Fixes: #6134 Change-Id: I430483deccb70fad44fe0e141afc050ae41308dc Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
This commit is contained in:
committed by
Maxim Cournoyer
parent
e3d8fc1147
commit
7e7487166b
@@ -1220,15 +1220,16 @@ file name or an nfs-root containing ':/')."
|
||||
(sleep 1)
|
||||
(loop (+ 1 count))))))))
|
||||
|
||||
(define (device-exists? device)
|
||||
(and (file-exists? device)
|
||||
device))
|
||||
|
||||
(match spec
|
||||
((? string?)
|
||||
(if (or (string-contains spec ":/") ;nfs
|
||||
(and (>= (string-length spec) 2)
|
||||
(equal? (string-take spec 2) "//")) ;cifs
|
||||
(string=? spec "none"))
|
||||
spec ; do not resolve NFS / CIFS / tmpfs devices
|
||||
(if (string-prefix? "/dev/" spec)
|
||||
;; Nothing to do, but wait until SPEC shows up.
|
||||
(resolve identity spec identity)))
|
||||
(resolve device-exists? spec identity)
|
||||
spec)) ; do not resolve NFS / CIFS / tmpfs devices
|
||||
((? file-system-label?)
|
||||
;; Resolve the label.
|
||||
(resolve find-partition-by-label
|
||||
|
||||
Reference in New Issue
Block a user