diff options
| author | nckx <me@tobias.gr> | 2026-03-29 13:12:19 +0200 |
|---|---|---|
| committer | nckx <me@tobias.gr> | 2026-03-29 13:12:19 +0200 |
| commit | 9ea6ba31b92ca2e20cf41ca40860178da5838104 (patch) | |
| tree | c891d186e8ba8e62d222db35b738301ebcc98614 /gnu | |
| parent | 21946173a05869dd40a38012e65b9e35dc47a9fc (diff) | |
revert 7e7487166b02aa41d42e96a1dfccaceda7fefc12nckx-patch-1
Since commit 7e7487166b02aa41d42e96a1dfccaceda7fefc12, Guix System treats devices starting with "/dev/" as special and won't even try to mount them if the whole string isn't an existing file name.
This strict naming policy is (AFAIK?) Guix-specific and breaks things like booting multi-device bcachefs file systems:
waiting for partition '/dev/sda1:/dev/sdb1' to appear...
waiting for partition '/dev/sda1:/dev/sdb1' to appear...
…ad infinitum until crashing to a Guile prompt.
Guix must not enforce custom naming policies like this. On the contrary: we should defer mounting to the kernel whenever possible, and handle failures only when they occur.
We can still delay mounts, retry failed mounts, and try to set up favourable mount conditions based on what we think the mount(2) SOURCE looks like, without adding our own arbitrary rules.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/build/file-systems.scm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 33b035aa967..72d7f5f2601 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm | |||
| @@ -1220,16 +1220,15 @@ 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 | |||
| 1227 | (match spec | 1223 | (match spec |
| 1228 | ((? string?) | 1224 | ((? string?) |
| 1229 | (if (string-prefix? "/dev/" spec) | 1225 | (if (or (string-contains spec ":/") ;nfs |
| 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 device-exists? spec identity) | 1231 | (resolve identity spec identity))) |
| 1232 | spec)) ; do not resolve NFS / CIFS / tmpfs devices | ||
| 1233 | ((? file-system-label?) | 1232 | ((? file-system-label?) |
| 1234 | ;; Resolve the label. | 1233 | ;; Resolve the label. |
| 1235 | (resolve find-partition-by-label | 1234 | (resolve find-partition-by-label |
