From patchwork Wed Feb 12 08:47:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 20225 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 A25FB17B9D; Wed, 12 Feb 2020 08:48:19 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 ESMTP id 271F217B84 for ; Wed, 12 Feb 2020 08:48:18 +0000 (GMT) Received: from localhost ([::1]:33600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ngv-0001ZX-Hu for patchwork@mira.cbaines.net; Wed, 12 Feb 2020 03:48:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39849) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ngk-0001RJ-Er for guix-patches@gnu.org; Wed, 12 Feb 2020 03:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1ngg-0002Ei-SK for guix-patches@gnu.org; Wed, 12 Feb 2020 03:48:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1ngg-0002EH-Ks for guix-patches@gnu.org; Wed, 12 Feb 2020 03:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1ngg-0008K8-IL for guix-patches@gnu.org; Wed, 12 Feb 2020 03:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#37305] [PATCH] Allow booting from a Btrfs subvolume. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Feb 2020 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37305 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 37305@debbugs.gnu.org Received: via spool by 37305-submit@debbugs.gnu.org id=B37305.158149727231979 (code B ref 37305); Wed, 12 Feb 2020 08:48:02 +0000 Received: (at 37305) by debbugs.gnu.org; 12 Feb 2020 08:47:52 +0000 Received: from localhost ([127.0.0.1]:57804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1ngV-0008Ji-1X for submit@debbugs.gnu.org; Wed, 12 Feb 2020 03:47:52 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:35965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1ngS-0008JV-K5 for 37305@debbugs.gnu.org; Wed, 12 Feb 2020 03:47:49 -0500 Received: by mail-qk1-f193.google.com with SMTP id w25so1316227qki.3 for <37305@debbugs.gnu.org>; Wed, 12 Feb 2020 00:47:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XKv2g55ru1aZSrFdbEu74digtGxov61NKvpKWEeTZeU=; b=MrIGO4MEqTFlq2+M2ietGPHRRF4Yt/j8V+6v0kwwNYiR/1CZOTWs9Xc+HjOHMaJwZG 4QAKgu31iGWhJA/YRl9rV4Zk3hd/hU+0nESJte+1W6BmZ4cHQbnAhQPzep6o2+eYEIgJ eSM8dS0/HxTOe5xUg4WVXOMdToPjqHpiBRw/9+e1UcA+9UMo9myBkTu4WCbaar32Df1s j2PmqPvP6nYN7iT2YmauCqXPxzRCLHNNVt1f0iAq78mx/KoD5TN7aQc8Q4AIvDfwvPk3 J51BQZMst+oSuZyej8O50cxDSM72j/AW3fq+3LkJqHvB355ULnJkXgTDN1TGk+uJMLLy clYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XKv2g55ru1aZSrFdbEu74digtGxov61NKvpKWEeTZeU=; b=TpvAuuuK0NEZTp0f3SREaApAyYCUMcXoSUGSxtkNS9b3S0fs+PVAE6RLGKme6e0iMW QBLVRw5Evv7heQ+wWBOcEu/2IGpRKjTjbOpY4AXQvxSn9LkYr1j52sFaoDu5flHYFsR3 QsXWaicYr9iTD0ZxRqnRz5IuVHJcGw56LkXKrUcPRRiY7h7+aPzrfxRYTMPdNgSvOR2v o3B6JwIIfuN8UL3mm/KR4ITZd8gJ5BCZWl9RsUvjmLECSojwQhtDoty5JhRN0hKBkTej bTwhi6HhVIDvGY18iM48X+m5V3rsrNAQXWzlhbDQKvEwb2l/pwTehlP/rU3eZPem0o60 KEzA== X-Gm-Message-State: APjAAAXHVCSaEaRYWpUj9XAfBsDVuJ8JPlp0RUvZbVTwqU7S/iH4iW80 6Idgr6ZsZ26qj6coovuAbaH0/u0p X-Google-Smtp-Source: APXvYqygqWX0ihTxbD+KeuV30wlXd5nc3KOWupAB7qDcOHH5O55/eQqNxDoVa6xPueXYataldAPn2A== X-Received: by 2002:a37:2744:: with SMTP id n65mr9865174qkn.92.1581497262928; Wed, 12 Feb 2020 00:47:42 -0800 (PST) Received: from apteryx (dsl-154-45.b2b2c.ca. [66.158.154.45]) by smtp.gmail.com with ESMTPSA id m68sm3478583qke.17.2020.02.12.00.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 00:47:41 -0800 (PST) From: Maxim Cournoyer References: <87sgpby4p9.fsf@gmail.com> <87y2yg3t3s.fsf@gnu.org> Date: Wed, 12 Feb 2020 03:47:40 -0500 In-Reply-To: <87y2yg3t3s.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 22 Sep 2019 23:43:03 +0200") Message-ID: <87k14sfaz7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" X-getmail-retrieved-from-mailbox: Patches Hello Ludovic! My much delayed answer to your review are the attached, much improved patches. The new test passes and I'm already using this on one of my system successfully. Thanks for your patience, Maxim From 549d585266e32cf413ae0511edd315f615f0c3a9 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 11 Feb 2020 14:27:19 -0500 Subject: [PATCH 7/8] gnu: linux-boot: Filter out file system independent options. This fixes an issue where options such as "defaults", which are understood by the command line program "mount", are not understood by the system call of the same name, which is used in the initial RAM disk. * gnu/system/file-systems.scm (%file-system-independent-mount-options): New variable. (file-system-independent-mount-option?): New predicate. * gnu/build/linux-boot.scm (boot-system): Use the above predicate to filter out system independent mount options. --- gnu/build/linux-boot.scm | 3 ++- gnu/system/file-systems.scm | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index f65e942ebc..8e55797549 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -490,7 +490,8 @@ upon error." (or (and=> root-fs file-system-flags) '()))) (root-fs-options (if root-fs - (file-system-options root-fs) + (remove file-system-independent-mount-option? + (file-system-options root-fs)) '())) ;; --root-options takes precedence over the 'options' field of the ;; root record. diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index eff89f146c..2dcf41ba57 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -46,6 +46,7 @@ file-system-location file-system-type-predicate + file-system-independent-mount-option? file-system-label file-system-label? @@ -563,4 +564,20 @@ system has the given TYPE." (lambda (fs) (string=? (file-system-type fs) type))) +(define %file-system-independent-mount-options + ;; Taken from 'man 8 mount'. + '("async" "atime" "auto" "noatime" "noauto" "context" "defaults" "dev" "nodev" + "diratime" "nodiratime" "dirsync" "exec" "noexec" "group" "iversion" + "noiversion" "mand" "nomand" "_netdev" "nofail" "relatime" "norelatime" + "strictatime" "nostrictatime" "lazytime" "nolazytime" "suid" "nosuid" + "silent" "loud" "owner" "remount" "ro" "rw" "sync" "user" "nouser" "users")) + +(define (file-system-independent-mount-option? option) + "Predicate to check if a option is file system independent." + (let ((option-name (if (pair? option) + (car option) + option))) + (or (string-prefix-ci? "x-" option-name) + (member option-name %file-system-independent-mount-options)))) + ;;; file-systems.scm ends here -- 2.25.0