From patchwork Wed Jun 30 20:20:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 30847 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1CF6127BC81; Wed, 30 Jun 2021 21:20:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D7D5927BC78 for ; Wed, 30 Jun 2021 21:20:20 +0100 (BST) Received: from localhost ([::1]:45444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lygh1-0002Oc-TY for patchwork@mira.cbaines.net; Wed, 30 Jun 2021 16:20:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyggl-0002O8-QS for guix-patches@gnu.org; Wed, 30 Jun 2021 16:20:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyggl-0007wq-IB for guix-patches@gnu.org; Wed, 30 Jun 2021 16:20:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyggl-0004HF-E0 for guix-patches@gnu.org; Wed, 30 Jun 2021 16:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49301] [PATCH 3/3] gnu: Don't abuse check-btrfs-file-system to scan. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Jun 2021 20:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49301 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49301@debbugs.gnu.org Received: via spool by 49301-submit@debbugs.gnu.org id=B49301.162508439616405 (code B ref 49301); Wed, 30 Jun 2021 20:20:03 +0000 Received: (at 49301) by debbugs.gnu.org; 30 Jun 2021 20:19:56 +0000 Received: from localhost ([127.0.0.1]:58892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lygge-0004GX-Ew for submit@debbugs.gnu.org; Wed, 30 Jun 2021 16:19:56 -0400 Received: from tobias.gr ([80.241.217.52]:49468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyggW-0004Fr-DA for 49301@debbugs.gnu.org; Wed, 30 Jun 2021 16:19:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=aVYLh5R2i7r2n h3aaH8KgGUMxUCytSGQR1wtkH6tD4g=; h=references:in-reply-to:date: subject:to:from; d=tobias.gr; b=op6tUSgpGmKuAUubSelJRvAS7Tjkd0R0ch2L9J R22xTnfs2Yh8aesIDZ2rECDzk7MESGElvwEg9Pd8LVpSTSpEve+3J8Z+nZGu0+WbLR08f7 fXKHv/OI1XG89rhzsrLWJFh3FFbUtRbRgoTxhdjWUu9rhllGDWU/NzpgcALJFeGzo+hWL9 weMifsGh7537KR84Tnc0uSb6k/yX854GC9oN1nCujH69wo8rsEIGpJJYLB9KxeldGlYu0v RESq8gYAVH/pIq9S+B2ZsajeOKj2XEi/ZD6mW/9h9wys6L/pJp/XHa0QCXEtJh8BeX8V7U TY1Yp3mTPBXXKjcu/Ov4LZ3g== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 455c21b6 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <49301@debbugs.gnu.org>; Wed, 30 Jun 2021 20:19:43 +0000 (UTC) Date: Wed, 30 Jun 2021 22:20:18 +0200 Message-Id: <20210630202018.19124-3-me@tobias.gr> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210630202018.19124-1-me@tobias.gr> References: <20210630202018.19124-1-me@tobias.gr> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: Tobias Geerinckx-Rice X-getmail-retrieved-from-mailbox: Patches 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 . + (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