diff options
Diffstat (limited to 'gnu/build')
-rw-r--r-- | gnu/build/file-systems.scm | 15 | ||||
-rw-r--r-- | gnu/build/image.scm | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 6111cd747c..4eeb81cf26 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016, 2017 David Craven <david@craven.ch> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net> -;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019 David C. Trudgian <dave@trudgian.net> ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; @@ -239,15 +239,15 @@ if DEVICE does not contain an linux-swap file system." (define (read-bcachefs-superblock device) "Return the raw contents of DEVICE's bcachefs superblock as a bytevector, or #f if DEVICE does not contain a bcachefs file system." - ;; We completely ignore the back-up superblock & any checksum errors. - ;; Superblock field names, with offset & length respectively, in bytes: + ;; Field offsets & lengths, in bytes. There are more (and the superblock is + ;; extensible) but we need only some basic information here: ;; 0 16 bch_csum ;; 16 8 version ;; 24 16 magic - ;; 40 16 uuid ← ‘internal UUID’, you probably don't want this - ;; 56 16 user_uuid ← ‘external UUID’, the one by which to mount + ;; 40 16 uuid ← ‘internal’: you probably don't want this one + ;; 56 16 user_uuid ← ‘external’: user-visible one by which to mount ;; 72 32 label - ;; … there are more & the superblock is extensible, but we don't care yet. + ;; Assume a sane file system: ignore the back-up superblock & checksums. (read-superblock device 4096 104 bcachefs-superblock?)) (define (bcachefs-superblock-external-uuid sblock) @@ -264,11 +264,12 @@ bytevector." "Return the health of a bcachefs file system on DEVICE." (let ((ignored-bits (logior 2)) ; DEVICE was mounted read-only (status + ;; A number, or #f on abnormal termination (e.g., assertion failure). (status:exit-val (apply system* "bcachefs" "fsck" "-p" "-v" ;; Make each multi-device member a separate argument. (string-split device #\:))))) - (match (logand (lognot ignored-bits) status) + (match (and=> status (cut logand <> (lognot ignored-bits))) (0 'pass) (1 'errors-corrected) (_ 'fatal-error)))) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index f6e5cb42f6..45eed0b298 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -61,7 +61,7 @@ (inexact->exact (ceiling (/ size 1024))))) (define (estimate-partition-size root) - "Given the ROOT directory, evalute and return its size. As this doesn't + "Given the ROOT directory, evaluate and return its size. As this doesn't take the partition metadata size into account, take a 25% margin." (* 1.25 (file-size root))) |