GNU bug report logs - #40662
[PATCH 0/2] Add efivarfs support.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Mathieu Othacehe <m.othacehe@HIDDEN>; Keywords: patch; dated Thu, 16 Apr 2020 15:05:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 40662 <at> debbugs.gnu.org:


Received: (at 40662) by debbugs.gnu.org; 30 Apr 2020 16:06:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 30 12:06:37 2020
Received: from localhost ([127.0.0.1]:47519 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jUBht-00081y-9r
	for submit <at> debbugs.gnu.org; Thu, 30 Apr 2020 12:06:37 -0400
Received: from pelzflorian.de ([5.45.111.108]:57474 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1jUBhq-00081l-Sx
 for 40662 <at> debbugs.gnu.org; Thu, 30 Apr 2020 12:06:35 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 5BEA236055C;
 Thu, 30 Apr 2020 18:06:33 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1588262793;
 bh=PvbZ5sJ6IA1DPU9CAYxn0dmIGqaq6QM+ekNo1EfSj9c=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=ZabR8gXHKf8vsPxG4EexhQSDZEgBHMvI8dqcDwsiXCs1zQohi/0S5h49RSat4oIqE
 vtlO/o9Hm/sDM52KwWWW21hQV1KT77Rt02s4AQ7RAS6M5qKi0qPb5eDsMENpWfATDk
 R949dQSXXnUINdi5v9BP25juKZ0qI8FnAme3EzNY=
Date: Thu, 30 Apr 2020 18:06:32 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#40662] [PATCH 0/2] Add efivarfs support.
Message-ID: <20200430160632.xh5wzhxwoylvd44s@HIDDEN>
References: <20200416150436.3274-1-m.othacehe@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20200416150436.3274-1-m.othacehe@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40662
Cc: 40662 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Apr 16, 2020 at 05:04:36PM +0200, Mathieu Othacehe wrote:
> Here's a small serie to add support for efivarfs and fix the issue reported
> here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.

When I reconfigure the first time with your patch, I get a harmless error:

building /gnu/store/klnbdxbw2jqglrdqyslv87c9y72g80f7-upgrade-shepherd-services.scm.drv
guix system: error: exception caught while executing 'start' on service 'file-system-/sys/firmware/efi/efivars':
Throw to key `match-error' with args `("match" "no matching pattern" ("efivarfs" "/sys/firmware/efi/efivars" "efivarfs" () #f #t #f))

I don’t know why it happens.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.

Message received at 40662 <at> debbugs.gnu.org:


Received: (at 40662) by debbugs.gnu.org; 30 Apr 2020 15:41:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 30 11:41:56 2020
Received: from localhost ([127.0.0.1]:47505 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jUBJz-0007PV-QG
	for submit <at> debbugs.gnu.org; Thu, 30 Apr 2020 11:41:55 -0400
Received: from pelzflorian.de ([5.45.111.108]:57430 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1jUBJx-0007PM-EC
 for 40662 <at> debbugs.gnu.org; Thu, 30 Apr 2020 11:41:54 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id E028336055C;
 Thu, 30 Apr 2020 17:41:51 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1588261312;
 bh=EcGgZJVxVXL4R3odoH67YDaMLufEUqMiQR8B6U7FLsM=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=OjTusUcxJcKXdaEOShZtJXDtAZEzj6yK8CamR6eDoYyWQZG/ZH93pJBYPL0gUnVMf
 9eSuxBG7w+PnyRIRFuY1orBkhmtNsautbNhFAQsoPu6H3hJ2amQdfckHvxptFQ/TYm
 sd6c0x4vCdBogrxFn8nr6dNRl7lgIo3iE+WHa4is=
Date: Thu, 30 Apr 2020 17:41:50 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#40662] [PATCH 0/2] Add efivarfs support.
Message-ID: <20200430154150.eogbhn6crje4tho6@HIDDEN>
References: <20200416150436.3274-1-m.othacehe@HIDDEN>
 <20200430124618.r4yck2mmenup6p5n@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20200430124618.r4yck2mmenup6p5n@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40662
Cc: 40662 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Apr 30, 2020 at 02:46:18PM +0200, pelzflorian (Florian Pelz) wrote:
> On Thu, Apr 16, 2020 at 05:04:36PM +0200, Mathieu Othacehe wrote:
> > Here's a small serie to add support for efivarfs and fix the issue reported
> > here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.
> Well I had no issues with efivars on install without your patch.  I
> will try to provoke the error by adding more efivars.  I did not yet
> manage to create a new efivar via dd or via the efivar program though.

Actually I see no reason to test after provoking Keyhenge’s error.
How does your patch fix a full NVRAM?  I thought Keyhenge resolved
their error by deleting “files” from the full NVRAM.  Do I
misunderstand Keyhenge’s issue?

But /sys/firmware/efi/efivars probably should be mounted anyway.

Do you know why

efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)

is mounted even without your patch once I add %desktop-services to my
config.scm?

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.

Message received at 40662 <at> debbugs.gnu.org:


Received: (at 40662) by debbugs.gnu.org; 30 Apr 2020 12:46:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 30 08:46:24 2020
Received: from localhost ([127.0.0.1]:45467 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jU8a8-0008BU-BJ
	for submit <at> debbugs.gnu.org; Thu, 30 Apr 2020 08:46:24 -0400
Received: from pelzflorian.de ([5.45.111.108]:57254 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1jU8a6-00088h-Gv
 for 40662 <at> debbugs.gnu.org; Thu, 30 Apr 2020 08:46:23 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 910C936055C;
 Thu, 30 Apr 2020 14:46:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1588250780;
 bh=tVwOym5AGlF9784GnX63/54iJk9xzW84NK6762JR8Go=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=A+TtQYScDnUrJRfDNwDq+jaZLt78hlRGkg2+gpC3a8FZxA+sLAlIK0JfqLrl7T+GE
 w41TZ8L72EiZHq3zsyR2TuFZRk7Ruqt2Mg6EPsy+IVtesov3WDDP7iKPDZHfmaEXlL
 IubuULGz2ZYz7Wfea8lCuBz3RJtwqFfvM9IhP5sw=
Date: Thu, 30 Apr 2020 14:46:18 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Mathieu Othacehe <m.othacehe@HIDDEN>
Subject: Re: [bug#40662] [PATCH 0/2] Add efivarfs support.
Message-ID: <20200430124618.r4yck2mmenup6p5n@HIDDEN>
References: <20200416150436.3274-1-m.othacehe@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20200416150436.3274-1-m.othacehe@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40662
Cc: 40662 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Apr 16, 2020 at 05:04:36PM +0200, Mathieu Othacehe wrote:
> Hello,
> 
> Here's a small serie to add support for efivarfs and fix the issue reported
> here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.

I have no idea why I only ever got the [Patch 0/2] e-mail delivered to
my inbox.  I look at <https://issues.guix.info/issue/40662#1> now.


> [PATCH 2/2] file-system: Add efivarfs support.
> […]
> Tools such as efibootmgr rely on the deprecated /sys/firmware/efi/vars API as
> well as on the new /sys/firmware/efi/efivars API. The later needs to be
> mounted.

Typo: The latter needs to be mounted.


Well I had no issues with efivars on install without your patch.  I
will try to provoke the error by adding more efivars.  I did not yet
manage to create a new efivar via dd or via the efivar program though.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.

Message received at 40662 <at> debbugs.gnu.org:


Received: (at 40662) by debbugs.gnu.org; 16 Apr 2020 15:06:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 11:06:08 2020
Received: from localhost ([127.0.0.1]:39116 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP65f-0002MU-Th
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:06:08 -0400
Received: from mail-wr1-f68.google.com ([209.85.221.68]:43290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1jP65c-0002Lc-9T
 for 40662 <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:06:04 -0400
Received: by mail-wr1-f68.google.com with SMTP id i10so5210456wrv.10
 for <40662 <at> debbugs.gnu.org>; Thu, 16 Apr 2020 08:06:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=l9G0Ml6w04h4XZCB7BogHvk4yI7+RZQxFCxAaNzgIlc=;
 b=bIzHBxKxogyx94pwEHwK8/JBj5W9U/OlGMGwf7+qvpCGZmJ+K9Fp7hwWjQoYe84iVx
 hKESXGv3plDaeSQRaECASwvjWpJorYWsm9EntDgt0QDtzUEZko8zGsblJ8Wk/o4X3Gsh
 0L3CakJlrcTLHBaD9mDCfa+nR6WYtd4PJ9I4k8I6aQd6nhpFD0z/Q7BfIc1zhodFzr2X
 bArUekvvJtgHLJ3SmEuazpY9JKcnrGMIzoARRqwo1Rjz8CAGKoh8LKkuh9ugNOu3FFlJ
 JHS6hjl0PlaUP9s00TEqf3keFJuiBfJEQ2do7api5fBsIJgVIL4ONW/O2Qz4K6o4iZqb
 yELQ==
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:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=l9G0Ml6w04h4XZCB7BogHvk4yI7+RZQxFCxAaNzgIlc=;
 b=Ot75F3uB0FlRK7tE+OoynDtbPn7zh6bG/l/HHAGQCWN8EzC2Tn4dPHpR6bxxC/3nUs
 5BKV9Mt7kq51BNSBe8TjuXdbRnyIKHs2OvkF96XtXWmJkkq8tskBUiAKEkzYs+U0GXPj
 hsVNgmaw0mH6YTFlHsaMF+3PHGvpzAqCvS+YjHTPJnPojsWmRncyhew7Xl8XFLCE5kUg
 vxI0noRHvjWvxUxGZPrqPEaI2yUbR9ywWg3l0SQcgsIeB/qY117GLKHaq00ko+PwfhVc
 AOEoHEsN4Ov8V+/ftsaKE0uF2UpO0ZhHV13Jtdt5mngcRDKLUks6+95ZBhb5Y5241PDp
 m1jg==
X-Gm-Message-State: AGi0PubYsWgo7mwzDDdm8hYabqKFfa0682BcTIuPa2vJ2VK1UBrqDzoy
 0c42kgWQozDbY0/9XfLj9E5Nu1eZo9I=
X-Google-Smtp-Source: APiQypJTiUZuyCsuujz77zc8PgMFdRaArcLoWzLPE7PO+lcO41qYJu2623J5lQsdORViymB7mAT1Tw==
X-Received: by 2002:a5d:660a:: with SMTP id n10mr34069842wru.74.1587049558391; 
 Thu, 16 Apr 2020 08:05:58 -0700 (PDT)
Received: from meru.fronius.com ([2a01:cb18:832e:5f00:25e7:da4f:b379:3b41])
 by smtp.gmail.com with ESMTPSA id h16sm30816664wrw.36.2020.04.16.08.05.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Apr 2020 08:05:57 -0700 (PDT)
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: 40662 <at> debbugs.gnu.org.
Subject: [PATCH 2/2] file-system: Add efivarfs support.
Date: Thu, 16 Apr 2020 17:05:48 +0200
Message-Id: <20200416150548.3426-2-m.othacehe@HIDDEN>
X-Mailer: git-send-email 2.26.0
In-Reply-To: <20200416150548.3426-1-m.othacehe@HIDDEN>
References: <20200416150548.3426-1-m.othacehe@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40662
Cc: Mathieu Othacehe <m.othacehe@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

Tools such as efibootmgr rely on the deprecated /sys/firmware/efi/vars API as
well as on the new /sys/firmware/efi/efivars API. The later needs to be
mounted.

Reported by Keyhenge here:
https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html

Here is the efivarfs documentation:
https://www.kernel.org/doc/Documentation/filesystems/efivarfs.txt.

* gnu/system/file-systems.scm (%efivars-file-system): New exported variable,
(%base-file-systems): add it.
* gnu/system/install.scm (%efivars-file-system): Add it.
---
 gnu/system/file-systems.scm | 12 ++++++++++++
 gnu/system/install.scm      |  1 +
 2 files changed, 13 insertions(+)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 5180eca8d9..644a90d42b 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -57,6 +57,7 @@
             %pseudo-file-system-types
             %fuse-control-file-system
             %binary-format-file-system
+            %efivars-file-system
             %shared-memory-file-system
             %pseudo-terminal-file-system
             %tty-gid
@@ -334,6 +335,16 @@ TARGET in the other system."
     (type "binfmt_misc")
     (check? #f)))
 
+(define %efivars-file-system
+  ;; Support for EFI variables file system.
+  (file-system
+    (device "efivarfs")
+    (mount-point "/sys/firmware/efi/efivars")
+    (type "efivarfs")
+    (mount-may-fail? #t)
+    (needed-for-boot? #f)
+    (check? #f)))
+
 (define %tty-gid
   ;; ID of the 'tty' group.  Allocate it statically to make it easy to refer
   ;; to it from here and from the 'tty' group definitions.
@@ -434,6 +445,7 @@ TARGET in the other system."
   ;; currently mounted by the initrd.
   (list %pseudo-terminal-file-system
         %shared-memory-file-system
+        %efivars-file-system
         %immutable-store))
 
 ;; File systems for Linux containers differ from %base-file-systems in that
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 0965c4d237..e78c61ed62 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -501,6 +501,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
             ;; elogind's cgroup file systems.
             (list %pseudo-terminal-file-system
                   %shared-memory-file-system
+                  %efivars-file-system
                   %immutable-store)))
 
     (users (list (user-account
-- 
2.26.0





Information forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.

Message received at 40662 <at> debbugs.gnu.org:


Received: (at 40662) by debbugs.gnu.org; 16 Apr 2020 15:06:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 11:06:05 2020
Received: from localhost ([127.0.0.1]:39114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP65d-0002MK-Gc
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:06:05 -0400
Received: from mail-wr1-f65.google.com ([209.85.221.65]:42603)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1jP65b-0002La-M3
 for 40662 <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:06:04 -0400
Received: by mail-wr1-f65.google.com with SMTP id j2so5218357wrs.9
 for <40662 <at> debbugs.gnu.org>; Thu, 16 Apr 2020 08:06:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=2lRHya2CmbWEoTd1fT+1Hb3Qg5D3U0H7O8ebWJRzO6g=;
 b=miqDjel7oEoodJbSAr4N1wFAFfCuj323SJNKSEc/hNWt3V2Nhf2NM5f8l8mgV6eKF4
 W01hHcpAxssnJNTl7v8OnjgcULZS0wOpvoLZK3VGvF6CnOToruk0Rd9hiKE11jPxKKBl
 IAGgPhl83Bu+lW423+gILOFKxpOxVZxUIBJL7IwSBPiMyf8j1iv4Yke94HjZEO91c/ZJ
 WUIuRxukgXDTOFVGYlb0g2W3H9ZpiJG2Z+U5gz7DVpS36HpDyE16eoQNTXp++U4BxV4m
 Bul4jBbe2RdM505qafL6SXbE0XTvruiQBTTI1hkUzIDLizIYSyW2dsJoymi7oIhMwvzI
 pgiw==
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:date:message-id:mime-version
 :content-transfer-encoding;
 bh=2lRHya2CmbWEoTd1fT+1Hb3Qg5D3U0H7O8ebWJRzO6g=;
 b=Uuw6czFxp+4QluK+pl0a77SQbgiOULreHjF5/63GDtT8SiRaGqDead0C0A8Fe23al6
 CQB15AHcdWgi36kaz5glxD00pCpT4JBIJ2PTNbwI8xYr8jx+LdqR5iBZetRrbGrsMwNs
 Q8EtJHry31fuAFFDfYqAK8FM3YyMS+RicAVdyv8TK0krUfD2GIQ7Gw06EFTRhw/SS6HZ
 khqhECOfUroNd1zdTgPQMQpew5pCovNdnSgW1+Hx6+OnnK8DRWDvfEuwVSOHewTo1sJu
 Z1pOwuCxThjZdo/tNt87eJ+NRF0Z9spUYxkgPS1Xb9oAvdQrhsjVR5QBovoaMhZdsJWf
 HiQQ==
X-Gm-Message-State: AGi0PuYDYl5bwNNukxN07V/wSet7DQvD+nrIwg7t13TnC/wMNnsNEKw5
 yHsVmS8zzw3VUBzJPxIWh0lzpXZRAvw=
X-Google-Smtp-Source: APiQypKG0u4qJ3VRSCZZ6+Y85xxqhT54bAkbonNHigkxpww/udGNtNl53Tybka58svBMYFuGNW2/lQ==
X-Received: by 2002:adf:e986:: with SMTP id h6mr34655954wrm.256.1587049557390; 
 Thu, 16 Apr 2020 08:05:57 -0700 (PDT)
Received: from meru.fronius.com ([2a01:cb18:832e:5f00:25e7:da4f:b379:3b41])
 by smtp.gmail.com with ESMTPSA id h16sm30816664wrw.36.2020.04.16.08.05.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Apr 2020 08:05:56 -0700 (PDT)
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: 40662 <at> debbugs.gnu.org.
Subject: [PATCH 1/2] file-system: Add mount-may-fail? option.
Date: Thu, 16 Apr 2020 17:05:47 +0200
Message-Id: <20200416150548.3426-1-m.othacehe@HIDDEN>
X-Mailer: git-send-email 2.26.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40662
Cc: Mathieu Othacehe <m.othacehe@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

* gnu/system/file-systems.scm (<file-system>): Add a mount-may-fail? field.
(file-system->spec): adapt accordingly,
(spec->file-system): ditto.
* gnu/build/file-systems.scm (mount-file-system): If 'system-error is raised
and mount-may-fail? is true, ignore it. Otherwise, re-raise the exception.
---
 gnu/build/file-systems.scm  | 49 +++++++++++++++++++++----------------
 gnu/system/file-systems.scm | 11 ++++++---
 2 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 902563b219..2f7987f334 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -673,26 +673,33 @@ corresponds to the symbols listed in FLAGS."
     (when (file-system-check? fs)
       (check-file-system source type))
 
-    ;; Create the mount point.  Most of the time this is a directory, but
-    ;; in the case of a bind mount, a regular file or socket may be needed.
-    (if (and (= MS_BIND (logand flags MS_BIND))
-             (not (file-is-directory? source)))
-        (unless (file-exists? mount-point)
-          (mkdir-p (dirname mount-point))
-          (call-with-output-file mount-point (const #t)))
-        (mkdir-p mount-point))
-
-    (cond
-     ((string-prefix? "nfs" type)
-      (mount-nfs source mount-point type flags options))
-     (else
-      (mount source mount-point type flags options)))
-
-    ;; For read-only bind mounts, an extra remount is needed, as per
-    ;; <http://lwn.net/Articles/281157/>, which still applies to Linux 4.0.
-    (when (and (= MS_BIND (logand flags MS_BIND))
-               (= MS_RDONLY (logand flags MS_RDONLY)))
-      (let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY)))
-        (mount source mount-point type flags #f)))))
+    (catch 'system-error
+      (lambda ()
+        ;; Create the mount point.  Most of the time this is a directory, but
+        ;; in the case of a bind mount, a regular file or socket may be
+        ;; needed.
+        (if (and (= MS_BIND (logand flags MS_BIND))
+                 (not (file-is-directory? source)))
+            (unless (file-exists? mount-point)
+              (mkdir-p (dirname mount-point))
+              (call-with-output-file mount-point (const #t)))
+            (mkdir-p mount-point))
+
+        (cond
+         ((string-prefix? "nfs" type)
+          (mount-nfs source mount-point type flags options))
+         (else
+          (mount source mount-point type flags options)))
+
+        ;; For read-only bind mounts, an extra remount is needed, as per
+        ;; <http://lwn.net/Articles/281157/>, which still applies to Linux
+        ;; 4.0.
+        (when (and (= MS_BIND (logand flags MS_BIND))
+                   (= MS_RDONLY (logand flags MS_RDONLY)))
+          (let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY)))
+            (mount source mount-point type flags #f))))
+      (lambda args
+        (or (file-system-mount-may-fail? fs)
+            (apply throw args))))))
 
 ;;; file-systems.scm ends here
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 3b599efa8e..5180eca8d9 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -38,6 +38,7 @@
             file-system-flags
             file-system-options
             file-system-mount?
+            file-system-mount-may-fail?
             file-system-check?
             file-system-create-mount-point?
             file-system-dependencies
@@ -101,6 +102,8 @@
                     (default #f))
   (mount?           file-system-mount?            ; Boolean
                     (default #t))
+  (mount-may-fail?  file-system-mount-may-fail?   ; Boolean
+                    (default #f))
   (needed-for-boot? %file-system-needed-for-boot? ; Boolean
                     (default #f))
   (check?           file-system-check?            ; Boolean
@@ -261,18 +264,19 @@ store--e.g., if FS is the root file system."
   "Return a list corresponding to file-system FS that can be passed to the
 initrd code."
   (match fs
-    (($ <file-system> device mount-point type flags options _ _ check?)
+    (($ <file-system> device mount-point type flags options mount?
+                      mount-may-fail? needed-for-boot? check?)
      (list (cond ((uuid? device)
                   `(uuid ,(uuid-type device) ,(uuid-bytevector device)))
                  ((file-system-label? device)
                   `(file-system-label ,(file-system-label->string device)))
                  (else device))
-           mount-point type flags options check?))))
+           mount-point type flags options mount-may-fail? check?))))
 
 (define (spec->file-system sexp)
   "Deserialize SEXP, a list, to the corresponding <file-system> object."
   (match sexp
-    ((device mount-point type flags options check?)
+    ((device mount-point type flags options mount-may-fail? check?)
      (file-system
        (device (match device
                  (('uuid (? symbol? type) (? bytevector? bv))
@@ -283,6 +287,7 @@ initrd code."
                   device)))
        (mount-point mount-point) (type type)
        (flags flags) (options options)
+       (mount-may-fail? mount-may-fail?)
        (check? check?)))))
 
 (define (specification->file-system-mapping spec writable?)
-- 
2.26.0





Information forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Apr 2020 15:04:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 11:04:51 2020
Received: from localhost ([127.0.0.1]:39108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP64R-0002Ja-5p
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:04:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:53814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.othacehe@HIDDEN>) id 1jP64O-0002JQ-DV
 for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 11:04:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47622)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <m.othacehe@HIDDEN>) id 1jP64N-00052e-8I
 for guix-patches@HIDDEN; Thu, 16 Apr 2020 11:04:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.othacehe@HIDDEN>) id 1jP64M-0000TE-5h
 for guix-patches@HIDDEN; Thu, 16 Apr 2020 11:04:47 -0400
Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:56202)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <m.othacehe@HIDDEN>)
 id 1jP64M-0000Sr-00
 for guix-patches@HIDDEN; Thu, 16 Apr 2020 11:04:46 -0400
Received: by mail-wm1-x342.google.com with SMTP id e26so4936686wmk.5
 for <guix-patches@HIDDEN>; Thu, 16 Apr 2020 08:04:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=MgcdPo5CRoPmBYL61SI5+rOBriqE30G1grxfr4Im+m0=;
 b=EoTl4cCOy51hxU7kWzAaduKipXEnlkoL8tNCSLFe9MaVxtdXiZ4BNr3Yli78A/bbDH
 m1+wrBBe9QamKCPZrEP7LVGbrCBEruz2w0zuYaAoap9fxf5FpyCw+ztiej3q+5B4h8Kj
 //xUyMlo4C7uLL9+fDg3VnJ5UEYJX7VUPJPd14CPDld0HkM5KV9v8Rt3pKGXXrsrfNpz
 tJ55Q2bgNqvdYnKdTKoCc4OWNEZTdmWo6NtOsH88bxpgLn27CMkTU8yvNt5TG6Ekito3
 BNFOBG1AqxQTY5+ZZcJZCK5GRtPJnI8OSKh8xVFB8jeqCF83NBiK2g1WFaiE37b9uIUS
 QntQ==
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:date:message-id:mime-version
 :content-transfer-encoding;
 bh=MgcdPo5CRoPmBYL61SI5+rOBriqE30G1grxfr4Im+m0=;
 b=RgIYuSm15epHspD2q491LU1/1EyB+LshgOJaNTXx+DYzKhDH10G++DEIfT3dtAWhs7
 igcZ+I/wMy74BNHx+Rot32cBCiCBnjtsao3XsKYB53H2nrwH6qYPskRzQoTun6JMO5U8
 cEOiwfTo0NsSEV03l3HNlFwZdrqNpSCIKK5w5//MJkw0Yh436lZD+ow13XaGTRi0ljtH
 s1VT7gws+eB3HEfUfXhen0LlTSvyNs1zin8nhi2QhisRkZrLCZQ1XLKpcs/sknXzIE6z
 Y/K0YQ55JKPKIIegurmwGT9QNhUZAC8uZNExc9t43f79GxR+o2BeLKy4W01o6hlS61c0
 QMEQ==
X-Gm-Message-State: AGi0PubBr1z/87GmzzBEe9PNLDF00gx6JiZyMUuFLd5UgelqI98xoY0o
 uzu+BxNC9mYyejbXIFmzWzwcQWbo2cQ=
X-Google-Smtp-Source: APiQypLtFJNi/x5PAqToReYS9L009Dcaq665UEo7dWLPlkpy9p7b+fH7mXnv6oyH7YTIMHSyHNzG9Q==
X-Received: by 2002:a7b:c10d:: with SMTP id w13mr5209167wmi.78.1587049484426; 
 Thu, 16 Apr 2020 08:04:44 -0700 (PDT)
Received: from meru.fronius.com ([2a01:cb18:832e:5f00:25e7:da4f:b379:3b41])
 by smtp.gmail.com with ESMTPSA id p3sm9890102wrx.82.2020.04.16.08.04.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Apr 2020 08:04:43 -0700 (PDT)
From: Mathieu Othacehe <m.othacehe@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Add efivarfs support.
Date: Thu, 16 Apr 2020 17:04:36 +0200
Message-Id: <20200416150436.3274-1-m.othacehe@HIDDEN>
X-Mailer: git-send-email 2.26.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::342
X-Spam-Score: 2.3 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hello, Here's a small serie to add support for efivarfs and
 fix the issue reported here:
 https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.
 The first patch is a bit hacky, so I didn't bother to write the documentation, 
 in case we find another solution. 
 Content analysis details:   (2.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: gnu.org]
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (m.othacehe[at]gmail.com)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [209.51.188.17 listed in list.dnswl.org]
 2.0 SPOOFED_FREEMAIL       No description available.
X-Debbugs-Envelope-To: submit
Cc: Mathieu Othacehe <m.othacehe@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hello,

Here's a small serie to add support for efivarfs and fix the issue reported
here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.

The first patch is a bit hacky, so I didn't bother to write the documentation,
in case we find another solution.

Thanks,

Mathieu

Mathieu Othacehe (2):
  file-system: Add mount-may-fail? option.
  file-system: Add efivarfs support.

 gnu/build/file-systems.scm  | 49 +++++++++++++++++++++----------------
 gnu/system/file-systems.scm | 23 ++++++++++++++---
 gnu/system/install.scm      |  1 +
 3 files changed, 49 insertions(+), 24 deletions(-)

-- 
2.26.0





Acknowledgement sent to Mathieu Othacehe <m.othacehe@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#40662; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 30 Apr 2020 16:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.