From patchwork Mon Dec 2 20:57:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 16346 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 99A7C177FF; Mon, 2 Dec 2019 21:05:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 58141177ED for ; Mon, 2 Dec 2019 21:05:01 +0000 (GMT) Received: from localhost ([::1]:44458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibssO-00015e-Lh for patchwork@mira.cbaines.net; Mon, 02 Dec 2019 16:05:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56819) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibsol-0007JB-Cr for guix-patches@gnu.org; Mon, 02 Dec 2019 16:01:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibsof-0001fS-2S for guix-patches@gnu.org; Mon, 02 Dec 2019 16:01:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibsoX-0001dy-Tn for guix-patches@gnu.org; Mon, 02 Dec 2019 16:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ibsoX-0000FK-Rd for guix-patches@gnu.org; Mon, 02 Dec 2019 16:01:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38462] [PATCH] linux-boot: Don't ignore flags when mounting root file system. Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Dec 2019 21:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38462 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38462@debbugs.gnu.org Cc: Guillaume Le Vaillant X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1575320423867 (code B ref -1); Mon, 02 Dec 2019 21:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2019 21:00:23 +0000 Received: from localhost ([127.0.0.1]:39035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibsnv-0000Dv-4D for submit@debbugs.gnu.org; Mon, 02 Dec 2019 16:00:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:60083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibsnt-0000Do-RE for submit@debbugs.gnu.org; Mon, 02 Dec 2019 16:00:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56159) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibsns-00072M-6a for guix-patches@gnu.org; Mon, 02 Dec 2019 16:00:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibsno-000154-6G for guix-patches@gnu.org; Mon, 02 Dec 2019 16:00:17 -0500 Received: from mout01.posteo.de ([185.67.36.65]:55751) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ibsnl-0000zx-U7 for guix-patches@gnu.org; Mon, 02 Dec 2019 16:00:14 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id D1B2616008F for ; Mon, 2 Dec 2019 21:59:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1575320400; bh=Kt0gNhi8wnjza/0mCaieQv3glHrqNuKKjsvajms9Jps=; h=From:To:Cc:Subject:Date:From; b=VypnMhiE2U/aFQakQk0GtqczkuOvgfsQ9vIDGzvCfLfeEo6Dhdyq5QgJK0OWSNU64 y1frmXKlJ+u+lYApGJq683K33wDyZNRImYyFQLZp3DtgH3n5u9REFs7Px8Xvl2TkM1 yWUrV95H/lzTeyArTXwB1YhYqCdPCQfqFpm84EnXD94MHrj4q5SoyC+ZDYWBG9QXPu cDirjtii86f3JwRB+VqZ++H0UTXS3rxhm3Z+WB1y0IqpdAxexmkaX21gAX24nlkyOu pN95yR/8MjffUl73pI6kZWr1p/+fhICkISSqtvQJm2GGto1C1C635AzpSVW8hhgIj7 VnMbsSlJ77xVw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47Rcs86661z6tmG; Mon, 2 Dec 2019 21:58:20 +0100 (CET) From: Guillaume Le Vaillant Date: Mon, 2 Dec 2019 21:57:34 +0100 Message-Id: <20191202205734.7018-1-glv@posteo.net> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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 * gnu/build/linux-boot.scm (mount-root-file-system): Add the 'flags' keyword argument and use it when mounting the root file system. (boot-system): Pass the root file system flags to 'mount-root-file-system'. --- gnu/build/linux-boot.scm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 950a3507f2..fcec751f45 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -358,10 +358,10 @@ the last argument of `mknod'." (filter-map string->number (scandir "/proc"))))) (define* (mount-root-file-system root type - #:key volatile-root? options) - "Mount the root file system of type TYPE at device ROOT. If VOLATILE-ROOT? -is true, mount ROOT read-only and make it an overlay with a writable tmpfs -using the kernel built-in overlayfs. OPTIONS indicates the options to use + #:key volatile-root? (flags 0) options) + "Mount the root file system of type TYPE at device ROOT. If VOLATILE-ROOT? is +true, mount ROOT read-only and make it an overlay with a writable tmpfs using +the kernel built-in overlayfs. FLAGS and OPTIONS indicates the options to use to mount ROOT." (if volatile-root? @@ -384,7 +384,7 @@ to mount ROOT." "lowerdir=/real-root,upperdir=/rw-root/upper,workdir=/rw-root/work")) (begin (check-file-system root type) - (mount root "/root" type 0 options))) + (mount root "/root" type flags options))) ;; Make sure /root/etc/mtab is a symlink to /proc/self/mounts. (false-if-exception @@ -474,6 +474,13 @@ upon error." mounts) "ext4")) + (define root-fs-flags + (mount-flags->bit-mask (or (any (lambda (fs) + (and (root-mount-point? fs) + (file-system-flags fs))) + mounts) + 0))) + (define root-fs-options (any (lambda (fs) (and (root-mount-point? fs) @@ -533,6 +540,7 @@ upon error." (mount-root-file-system (canonicalize-device-spec root) root-fs-type #:volatile-root? volatile-root? + #:flags root-fs-flags #:options root-fs-options)) (mount "none" "/root" "tmpfs"))