diff options
| author | Rutherther <rutherther@ditigal.xyz> | 2026-02-04 21:26:53 +0100 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-02-23 11:56:12 +0900 |
| commit | 7e7487166b02aa41d42e96a1dfccaceda7fefc12 (patch) | |
| tree | a6704bc27382a99ebd9040361fa91de61bb183ac /gnu/build | |
| parent | e3d8fc1147d03b6e6a47f8f1976068ad0faec9ab (diff) | |
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>
Diffstat (limited to 'gnu/build')
| -rw-r--r-- | gnu/build/file-systems.scm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 72d7f5f2601..33b035aa967 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm | |||
| @@ -1220,15 +1220,16 @@ file name or an nfs-root containing ':/')." | |||
| 1220 | (sleep 1) | 1220 | (sleep 1) |
| 1221 | (loop (+ 1 count)))))))) | 1221 | (loop (+ 1 count)))))))) |
| 1222 | 1222 | ||
| 1223 | (define (device-exists? device) | ||
| 1224 | (and (file-exists? device) | ||
| 1225 | device)) | ||
| 1226 | |||
| 1223 | (match spec | 1227 | (match spec |
| 1224 | ((? string?) | 1228 | ((? string?) |
| 1225 | (if (or (string-contains spec ":/") ;nfs | 1229 | (if (string-prefix? "/dev/" spec) |
| 1226 | (and (>= (string-length spec) 2) | ||
| 1227 | (equal? (string-take spec 2) "//")) ;cifs | ||
| 1228 | (string=? spec "none")) | ||
| 1229 | spec ; do not resolve NFS / CIFS / tmpfs devices | ||
| 1230 | ;; Nothing to do, but wait until SPEC shows up. | 1230 | ;; Nothing to do, but wait until SPEC shows up. |
| 1231 | (resolve identity spec identity))) | 1231 | (resolve device-exists? spec identity) |
| 1232 | spec)) ; do not resolve NFS / CIFS / tmpfs devices | ||
| 1232 | ((? file-system-label?) | 1233 | ((? file-system-label?) |
| 1233 | ;; Resolve the label. | 1234 | ;; Resolve the label. |
| 1234 | (resolve find-partition-by-label | 1235 | (resolve find-partition-by-label |
