all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: 49301@debbugs.gnu.org
Subject: [bug#49301] [PATCH 3/3] gnu: Don't abuse check-btrfs-file-system to scan.
Date: Wed, 30 Jun 2021 22:20:18 +0200	[thread overview]
Message-ID: <20210630202018.19124-3-me@tobias.gr> (raw)
In-Reply-To: <20210630202018.19124-1-me@tobias.gr>

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.
---
 gnu/build/file-systems.scm  |  2 --
 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 8f76d8d564..607d9f418f 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -327,8 +327,6 @@ the file system even if it's marked as clean.  This is not recommended!  See
 @uref{https://bugzilla.redhat.com/show_bug.cgi?id=625967#c8}.  If REPAIR is
 false, do not write to DEVICE.  If it's #t, fix any errors found.  Otherwise,
 fix only those considered safe to repair automatically."
-  ;; XXX Why make this conditional on (check? #t) at all?
-  (system* "btrfs" "device" "scan")     ; ignore errors
   (if force?
       (match (status:exit-val
               (apply system* `("btrfs" "check" "--progress"
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index c6ba9bb560..46fe24b24e 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -210,6 +210,16 @@ upon error."
              (open source targets)))
          mapped-devices))
 
+  (define file-system-scan-commands
+    ;; File systems like btrfs need help to assemble multi-device file systems
+    ;; but do not use manually-specified <mapped-devices>.
+    (let ((file-system-types (map file-system-type file-systems)))
+      (if (member "btrfs" file-system-types)
+          ;; Ignore errors: if the system manages to boot anyway, the better.
+          #~((system* (string-append #$btrfs-progs/static "/bin/btrfs")
+                      "device" "scan"))
+          #~())))
+
   (define kodir
     (flat-linux-module-directory linux linux-modules))
 
@@ -245,7 +255,8 @@ upon error."
                         (map spec->file-system
                              '#$(map file-system->spec file-systems))
                         #:pre-mount (lambda ()
-                                      (and #$@device-mapping-commands))
+                                      (and #$@device-mapping-commands
+                                           #$@file-system-scan-commands))
                         #:linux-modules '#$linux-modules
                         #:linux-module-directory '#$kodir
                         #:keymap-file #+(and=> keyboard-layout
-- 
2.32.0





  parent reply	other threads:[~2021-06-30 20:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 20:15 [bug#49301] [PATCH 0/3] Give users control over file system checks Tobias Geerinckx-Rice via Guix-patches via
2021-06-30 20:20 ` [bug#49301] [PATCH 1/3] file-systems: Support forced checks & repairs Tobias Geerinckx-Rice via Guix-patches via
2021-06-30 20:20   ` [bug#49301] [PATCH 2/3] linux-boot: Honour fsck.mode & fsck.repair Tobias Geerinckx-Rice via Guix-patches via
2021-06-30 20:20   ` Tobias Geerinckx-Rice via Guix-patches via [this message]
2021-07-07 15:09   ` [bug#49301] [PATCH 0/3] Give users control over file system checks Mathieu Othacehe
2021-08-31 14:05     ` Mathieu Othacehe
2021-09-23 16:40 ` bug#49301: " Tobias Geerinckx-Rice via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630202018.19124-3-me@tobias.gr \
    --to=guix-patches@gnu.org \
    --cc=49301@debbugs.gnu.org \
    --cc=me@tobias.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.