GNU bug report logs - #73654
[PATCH] gnu: luks-device-mapping-with-options: Add allow-discards? argument.

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: Sisiutl <sisiutl@HIDDEN>; Keywords: patch; dated Sun, 6 Oct 2024 09:45:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 73654) by debbugs.gnu.org; 15 Dec 2024 16:31:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 15 11:31:22 2024
Received: from localhost ([127.0.0.1]:51748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMrWc-0006iH-CI
	for submit <at> debbugs.gnu.org; Sun, 15 Dec 2024 11:31:22 -0500
Received: from eggs.gnu.org ([209.51.188.92]:55922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1tMrWa-0006i4-KJ
 for 73654 <at> debbugs.gnu.org; Sun, 15 Dec 2024 11:31:21 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1tMrWS-0007KD-OZ; Sun, 15 Dec 2024 11:31:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=hUzTWOkA6XU1mCNA52VY4RjI+WXFKG6gxjeYKxDAbkE=; b=Pe9GHXH1gz4Npq3FaMZW
 a6zmKS/YFKWajv0XeKWseII2ISPwRtNx3OrIcFYG0AsY0AJpSw/yi4sJQrEC8F9IqTnX6SEUcRb1/
 YxbjJPvH7gJSXvq/G7b29piAWx39oxQjVtvbOoPs8kddeMrJu+22B3MCsduqEZEerE0PQo9rIEw91
 cB7xkbVYE/pOFrdgTSZFO9mpFnlevJg1k8wbGsSHiyy/GbQT4VfGJLNLm9LRLZiIRxAF1GlH6jRLw
 Sh1p16nfiogySYsiTBSgYvems5IinIY2LTxvhofUgmWfsYc7dI9RhvmD20yUAafQiY69Z4uQO1C0P
 kAWY7+xMC1k3SQ==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Sisiutl <sisiutl@HIDDEN>
Subject: Re: [bug#73654] [PATCH] gnu: luks-device-mapping-with-options: Add
 allow-discards? argument.
In-Reply-To: <20241006094239.7157-1-sisiutl@HIDDEN>
 (sisiutl@HIDDEN's message of "Sun, 6 Oct 2024 11:42:28 +0200")
References: <20241006094239.7157-1-sisiutl@HIDDEN>
Date: Sun, 15 Dec 2024 17:31:10 +0100
Message-ID: <87msgwj4c1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.3 (/)
X-Debbugs-Envelope-To: 73654
Cc: 73654 <at> debbugs.gnu.org, Tomas Volf <~@wolfsden.cz>
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.3 (-)

Hi,

(Cc: Tomas, who I believe initially worked on this.)

Sisiutl <sisiutl@HIDDEN> skribis:

> * gnu/system/mapped-devices.scm (luks-device-mapping-with-options): Add a=
llow-discards? argument.
>
> Change-Id: I0a43c13570a223d17698c7fe9ef4607e587bb8d0

> -
> +

This is a linefeed and it facilitates navigation in the file; please
preserve it.  :-)

> +(define* (open-luks-device source targets #:key key-file allow-discards?)
>    "Return a gexp that maps SOURCE to TARGET as a LUKS device, using
>  'cryptsetup'."

Please briefly document =E2=80=98allow-discards?=E2=80=99 in the docstring=
=E2=80=A6

> +(define* (luks-device-mapping-with-options #:key key-file allow-discards=
?)
>    "Return a luks-device-mapping object with open modified to pass the ar=
guments
>  into the open-luks-device procedure."

=E2=80=A6 also here, and also in a bit more detail in the relevant place in
=E2=80=98doc/guix.texi=E2=80=99.

Thanks in advance!

Ludo=E2=80=99.




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

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


Received: (at 73654) by debbugs.gnu.org; 6 Nov 2024 15:34:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 06 10:34:05 2024
Received: from localhost ([127.0.0.1]:45119 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t8i2m-0005yv-GB
	for submit <at> debbugs.gnu.org; Wed, 06 Nov 2024 10:34:04 -0500
Received: from mail.boiledscript.com ([144.168.59.46]:55418)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hako@HIDDEN>) id 1t8i2i-0005yQ-RC
 for 73654 <at> debbugs.gnu.org; Wed, 06 Nov 2024 10:34:02 -0500
Date: Wed, 06 Nov 2024 21:57:16 +0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=dkim; t=1730907233;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=YCpXCOexKzuVmkEr4oDInF0UQH1vkExOBNuwWdeuPe0=;
 b=Y2QIOVc65RJ5njPuz/hoj4AvqXDUEMZcphulWGIDHHGdjGzsW2XaZECBYUTH2fGoXHskMk
 X1JfQFDowndE0A85PEzTwM0MSpIxm18E9STGRtsbydekZn33PtBuWqjgKz8LaNU7lfGQa8
 Na4G07qJV1DETraxpevALExCvbIojyOql+mVa02ns4pvshvZdXAqVrDaN1fNVNC6tm7MaQ
 2ht2db48TcQMXXNtL0H7TtwhNX0hrO9jBSILlcItFwONi2DaFL9ioEvqqNpwwmqCBb4mBq
 NSKHH3NrRV1XWfTcf6m3wuDrSKjm5cbfDW1kNSCxe9xBBNnMwSEu+L5JrcyWFg==
Authentication-Results: mail.boiledscript.com;
 auth=pass smtp.mailfrom=hako@HIDDEN
Message-ID: <87ikt0ihxf.wl-hako@HIDDEN>
From: Hilton Chain <hako@HIDDEN>
To: Sisiutl <sisiutl@HIDDEN>
Subject: Re: [PATCH] gnu: luks-device-mapping-with-options: Add
 allow-discards? argument.
In-Reply-To: <20241006094239.7157-1-sisiutl@HIDDEN>
References: <20241006094239.7157-1-sisiutl@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: --
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73654
Cc: 73654 <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 (-)

Hi Sisiutl,

On Sun, 06 Oct 2024 17:42:28 +0800,
Sisiutl wrote:
>
> * gnu/system/mapped-devices.scm (luks-device-mapping-with-options): Add a=
llow-discards? argument.
>
> Change-Id: I0a43c13570a223d17698c7fe9ef4607e587bb8d0
> ---
>  gnu/system/mapped-devices.scm | 36 +++++++++++++++++++----------------
>  1 file changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
> index 931c371425..674e8708a4 100644
> --- a/gnu/system/mapped-devices.scm
> +++ b/gnu/system/mapped-devices.scm
> @@ -189,12 +189,12 @@ (define missing
>               (&error-location
>                (location (source-properties->location location))))))))
>
> -=0C
> +


This character (=A1=0C=A2) is a form feed, please leave it here :)


>  ;;;
>  ;;; Common device mappings.
>  ;;;
>
> -(define* (open-luks-device source targets #:key key-file)
> +(define* (open-luks-device source targets #:key key-file allow-discards?)
>    "Return a gexp that maps SOURCE to TARGET as a LUKS device, using
>  'cryptsetup'."
>    (with-imported-modules (source-module-closure
> @@ -234,17 +234,19 @@ (define* (open-luks-device source targets #:key key=
-file)
>                                              (loop (- tries-left 1))))))
>                            (error "LUKS partition not found" source))
>                        source)))
> -             ;; We want to fallback to the password unlock if the keyfil=
e fails.
> -             (or (and keyfile
> -                      (zero? (system*/tty
> -                              #$(file-append cryptsetup-static "/sbin/cr=
yptsetup")
> -                              "open" "--type" "luks"
> -                              "--key-file" keyfile
> -                              partition #$target)))
> -                 (zero? (system*/tty
> -                         #$(file-append cryptsetup-static "/sbin/cryptse=
tup")
> -                         "open" "--type" "luks"
> -                         partition #$target)))))))))
> +             (let* ((cryptsetup-flags (list "open" "--type" "luks" parti=
tion #$target))
> +                    (cryptsetup-flags (if allow-discards?
> +                                          (cons "--allow-discards" crypt=
setup-flags)
> +                                          cryptsetup-flags)))
> +               ;; We want to fallback to the password unlock if the keyf=
ile fails.
> +               (or (and keyfile
> +                        (zero? (apply system*/tty
> +                                      #$(file-append cryptsetup-static "=
/sbin/cryptsetup")
> +                                      "--key-file" keyfile
> +                                      cryptsetup-flags)))
> +                   (zero? (apply system*/tty
> +                                 #$(file-append cryptsetup-static "/sbin=
/cryptsetup")
> +                                 cryptsetup-flags))))))))))
>  (define (close-luks-device source targets)
>    "Return a gexp that closes TARGET, a LUKS device."
> @@ -286,13 +288,15 @@ (define luks-device-mapping
>                ((gnu build file-systems)
>                 #:select (find-partition-by-luks-uuid system*/tty))))))
>
> -(define* (luks-device-mapping-with-options #:key key-file)
> +(define* (luks-device-mapping-with-options #:key key-file allow-discards=
?)
>    "Return a luks-device-mapping object with open modified to pass the ar=
guments
>  into the open-luks-device procedure."
>    (mapped-device-kind
>     (inherit luks-device-mapping)
> -   (open (=EB (source targets) (open-luks-device source targets
> -                                               #:key-file key-file)))))
> +   (open (=EB (source targets)
> +           (open-luks-device source targets
> +                             #:key-file key-file
> +                             #:allow-discards? allow-discards?)))))
>
>  (define (open-raid-device sources targets)
>    "Return a gexp that assembles SOURCES (a list of devices) to the RAID =
device
> --
> 2.46.0


Can you also add documentation for this option in doc/guix.texi?


Thanks




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

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


Received: (at submit) by debbugs.gnu.org; 6 Oct 2024 09:44:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 05:44:10 2024
Received: from localhost ([127.0.0.1]:40192 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sxNoA-0005Uj-2Q
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2024 05:44:10 -0400
Received: from lists.gnu.org ([209.51.188.17]:58064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sisiutl@HIDDEN>) id 1sxNo8-0005Ub-P2
 for submit <at> debbugs.gnu.org; Sun, 06 Oct 2024 05:44:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sisiutl@HIDDEN>)
 id 1sxNnz-00076J-1j
 for guix-patches@HIDDEN; Sun, 06 Oct 2024 05:43:59 -0400
Received: from 2a02-8428-4716-0c01-eecc-61c0-3286-ff35.rev.sfr.net
 ([2a02:8428:4716:c01:eecc:61c0:3286:ff35] helo=fujo.egregore.fun)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <sisiutl@HIDDEN>) id 1sxNnu-0004uw-JF
 for guix-patches@HIDDEN; Sun, 06 Oct 2024 05:43:57 -0400
Received: from localhost (2a02-8428-4716-0c01-69f4-ade7-72a4-dc0f.rev.sfr.net
 [IPv6:2a02:8428:4716:c01:69f4:ade7:72a4:dc0f])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1)
 server-digest SHA256) (No client certificate requested)
 (Authenticated sender: sisiutl@HIDDEN)
 by fujo.egregore.fun (Postfix) with ESMTPSA id 6128C673C2;
 Sun,  6 Oct 2024 11:42:49 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egregore.fun;
 s=fujo; t=1728207769;
 bh=5lrmfn2esld5af0pvbw5lj1OtT1ysVDQkV4VxYXInpw=;
 h=From:To:Cc:Subject:Date;
 b=WFUTiuAkFL1hnIKS+NXglFD/oUQvVU3+qZR2S1q8mVBjd428DKcNVKGpVy0XLgSEY
 kYcjIrOeyyykYBJr3vR6h2UyULBPtvq0qMqoE1L6txyOwauxmNIMkf6lq2Hr3pWSqe
 98bPSvlvd6VIQAEwAYgMJ5j+NgSDZkmxp5H3gOmA=
From: Sisiutl <sisiutl@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: luks-device-mapping-with-options: Add allow-discards?
 argument.
Date: Sun,  6 Oct 2024 11:42:28 +0200
Message-ID: <20241006094239.7157-1-sisiutl@HIDDEN>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a02:8428:4716:c01:eecc:61c0:3286:ff35;
 envelope-from=sisiutl@HIDDEN; helo=fujo.egregore.fun
X-Spam_score_int: 67
X-Spam_score: 6.7
X-Spam_bar: ++++++
X-Spam_report: (6.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499,
 FROM_SUSPICIOUS_NTLD_FP=1.999, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_PBL=3.335,
 RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: reject
X-Spam-Score: 3.2 (+++)
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: * gnu/system/mapped-devices.scm
 (luks-device-mapping-with-options):
 Add allow-discards? argument. Change-Id:
 I0a43c13570a223d17698c7fe9ef4607e587bb8d0
 --- gnu/system/mapped-devices.scm | 36 +++++++++++++++++++ 1 file changed,
 20 insertions(+), 16 deletions(-) 
 Content analysis details:   (3.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [209.51.188.17 listed in bl.score.senderscore.com]
 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [209.51.188.17 listed in sa-accredit.habeas.com]
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: egregore.fun (fun)]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.51.188.17 listed in wl.mailspike.net]
 -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,
 medium trust [209.51.188.17 listed in list.dnswl.org]
 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD
 0.5 FROM_SUSPICIOUS_NTLD   From abused NTLD
X-Debbugs-Envelope-To: submit
Cc: Sisiutl <sisiutl@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.2 (/)

* gnu/system/mapped-devices.scm (luks-device-mapping-with-options): Add allow-discards? argument.

Change-Id: I0a43c13570a223d17698c7fe9ef4607e587bb8d0
---
 gnu/system/mapped-devices.scm | 36 +++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 931c371425..674e8708a4 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -189,12 +189,12 @@ (define missing
              (&error-location
               (location (source-properties->location location))))))))
 
-
+
 ;;;
 ;;; Common device mappings.
 ;;;
 
-(define* (open-luks-device source targets #:key key-file)
+(define* (open-luks-device source targets #:key key-file allow-discards?)
   "Return a gexp that maps SOURCE to TARGET as a LUKS device, using
 'cryptsetup'."
   (with-imported-modules (source-module-closure
@@ -234,17 +234,19 @@ (define* (open-luks-device source targets #:key key-file)
                                             (loop (- tries-left 1))))))
                           (error "LUKS partition not found" source))
                       source)))
-             ;; We want to fallback to the password unlock if the keyfile fails.
-             (or (and keyfile
-                      (zero? (system*/tty
-                              #$(file-append cryptsetup-static "/sbin/cryptsetup")
-                              "open" "--type" "luks"
-                              "--key-file" keyfile
-                              partition #$target)))
-                 (zero? (system*/tty
-                         #$(file-append cryptsetup-static "/sbin/cryptsetup")
-                         "open" "--type" "luks"
-                         partition #$target)))))))))
+             (let* ((cryptsetup-flags (list "open" "--type" "luks" partition #$target))
+                    (cryptsetup-flags (if allow-discards?
+                                          (cons "--allow-discards" cryptsetup-flags)
+                                          cryptsetup-flags)))
+               ;; We want to fallback to the password unlock if the keyfile fails.
+               (or (and keyfile
+                        (zero? (apply system*/tty
+                                      #$(file-append cryptsetup-static "/sbin/cryptsetup")
+                                      "--key-file" keyfile
+                                      cryptsetup-flags)))
+                   (zero? (apply system*/tty
+                                 #$(file-append cryptsetup-static "/sbin/cryptsetup")
+                                 cryptsetup-flags))))))))))
 
 (define (close-luks-device source targets)
   "Return a gexp that closes TARGET, a LUKS device."
@@ -286,13 +288,15 @@ (define luks-device-mapping
               ((gnu build file-systems)
                #:select (find-partition-by-luks-uuid system*/tty))))))
 
-(define* (luks-device-mapping-with-options #:key key-file)
+(define* (luks-device-mapping-with-options #:key key-file allow-discards?)
   "Return a luks-device-mapping object with open modified to pass the arguments
 into the open-luks-device procedure."
   (mapped-device-kind
    (inherit luks-device-mapping)
-   (open (λ (source targets) (open-luks-device source targets
-                                               #:key-file key-file)))))
+   (open (λ (source targets)
+           (open-luks-device source targets
+                             #:key-file key-file
+                             #:allow-discards? allow-discards?)))))
 
 (define (open-raid-device sources targets)
   "Return a gexp that assembles SOURCES (a list of devices) to the RAID device
-- 
2.46.0





Acknowledgement sent to Sisiutl <sisiutl@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#73654; 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: Sun, 12 Jan 2025 05:45:02 UTC

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