diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-06-12 21:36:08 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-09-23 18:17:16 +0200 |
| commit | 68b219b9f482f09e7c55aaee4b64222d8c86172a (patch) | |
| tree | ac557b08cd1ab581cf501627f5d55f7d7bb888cc /gnu | |
| parent | a75a3d71329d3ca07a2ef18b81fc7b463f703ed7 (diff) | |
gnu: Don't abuse check-btrfs-file-system to scan.
It was never guaranteed to be run for non-root file systems. It was for
root file systems only due to a bug now fixed.
* gnu/build/file-systems.scm (check-btrfs-file-system): Don't invoke
‘btrfs device scan’ here.
* gnu/system/linux-initrd.scm (raw-initrd): Do so here if any btrfs file
systems are present.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/build/file-systems.scm | 2 | ||||
| -rw-r--r-- | gnu/system/linux-initrd.scm | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index a54127e8886..251ca51fc42 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm | |||
| @@ -328,8 +328,6 @@ When FORCE? is true, do perform a real check. This is not recommended! See | |||
| 328 | @uref{https://bugzilla.redhat.com/show_bug.cgi?id=625967#c8}. If REPAIR is | 328 | @uref{https://bugzilla.redhat.com/show_bug.cgi?id=625967#c8}. If REPAIR is |
| 329 | false, do not write to DEVICE. If it's #t, fix any errors found. Otherwise, | 329 | false, do not write to DEVICE. If it's #t, fix any errors found. Otherwise, |
| 330 | fix only those considered safe to repair automatically." | 330 | fix only those considered safe to repair automatically." |
| 331 | ;; XXX Why make this conditional on (check? #t) at all? | ||
| 332 | (system* "btrfs" "device" "scan") ; ignore errors | ||
| 333 | (if force? | 331 | (if force? |
| 334 | (match (status:exit-val | 332 | (match (status:exit-val |
| 335 | (apply system* `("btrfs" "check" "--progress" | 333 | (apply system* `("btrfs" "check" "--progress" |
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 8c245b8445d..7f7740dd6ef 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm | |||
| @@ -210,6 +210,16 @@ upon error." | |||
| 210 | (open source targets))) | 210 | (open source targets))) |
| 211 | mapped-devices)) | 211 | mapped-devices)) |
| 212 | 212 | ||
| 213 | (define file-system-scan-commands | ||
| 214 | ;; File systems like btrfs need help to assemble multi-device file systems | ||
| 215 | ;; but do not use manually-specified <mapped-devices>. | ||
| 216 | (let ((file-system-types (map file-system-type file-systems))) | ||
| 217 | (if (member "btrfs" file-system-types) | ||
| 218 | ;; Ignore errors: if the system manages to boot anyway, the better. | ||
| 219 | #~((system* (string-append #$btrfs-progs/static "/bin/btrfs") | ||
| 220 | "device" "scan")) | ||
| 221 | #~()))) | ||
| 222 | |||
| 213 | (define kodir | 223 | (define kodir |
| 214 | (flat-linux-module-directory linux linux-modules)) | 224 | (flat-linux-module-directory linux linux-modules)) |
| 215 | 225 | ||
| @@ -245,7 +255,8 @@ upon error." | |||
| 245 | (map spec->file-system | 255 | (map spec->file-system |
| 246 | '#$(map file-system->spec file-systems)) | 256 | '#$(map file-system->spec file-systems)) |
| 247 | #:pre-mount (lambda () | 257 | #:pre-mount (lambda () |
| 248 | (and #$@device-mapping-commands)) | 258 | (and #$@device-mapping-commands |
| 259 | #$@file-system-scan-commands)) | ||
| 249 | #:linux-modules '#$linux-modules | 260 | #:linux-modules '#$linux-modules |
| 250 | #:linux-module-directory '#$kodir | 261 | #:linux-module-directory '#$kodir |
| 251 | #:keymap-file #+(and=> keyboard-layout | 262 | #:keymap-file #+(and=> keyboard-layout |
