From unknown Fri Aug 15 18:08:00 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#70826 <70826@debbugs.gnu.org> To: bug#70826 <70826@debbugs.gnu.org> Subject: Status: luks-device-mapping-with-options breaks bootloader Reply-To: bug#70826 <70826@debbugs.gnu.org> Date: Sat, 16 Aug 2025 01:08:00 +0000 retitle 70826 luks-device-mapping-with-options breaks bootloader reassign 70826 guix submitter 70826 Tadhg McDonald-Jensen severity 70826 important thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 07 18:24:55 2024 Received: (at submit) by debbugs.gnu.org; 7 May 2024 22:24:55 +0000 Received: from localhost ([127.0.0.1]:45104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4TEz-00051L-Re for submit@debbugs.gnu.org; Tue, 07 May 2024 18:24:55 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4Pxq-0007sZ-Cu for submit@debbugs.gnu.org; Tue, 07 May 2024 14:55:01 -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 ) id 1s4PxL-0005Sc-Gp for bug-guix@gnu.org; Tue, 07 May 2024 14:54:27 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4PxK-0003d5-0D for bug-guix@gnu.org; Tue, 07 May 2024 14:54:27 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a59d0810f59so520640566b.0 for ; Tue, 07 May 2024 11:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715108064; x=1715712864; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=6+otGiHlmRN59JlK8AWDmNyXiAw5T82zirPgrMn8miQ=; b=QcctjIby60b6sVfpTkKbGIiM3l5JCQoegwvg8DIuDpp/U7GnQnvvVnT/pYoOSa417N 91QWP/oEHclRS3wXwQ93eZGj6YL7h03LlEPxNf/kPnUZObyVXQ73MEtBUXKkhqAmxvMC GR7yMZWy8OFEqk4xS3k15WeGnSsA5JlnC7PTjXcYiW8WV/hzOXSgPYEUHTHBMhZNrgnr f3gzNkrah84rF3osm0iO36iFrxO93McvrjC5fFJIB6kM6okBfFeN6gfR2KgT2bq8S5OA 9eXVmXdOlZSN86a3PugPNMFkXj54NVG8zdpB32fzRyeiGIV1tUTq5OFDYmxFmQrM3P41 c03Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715108064; x=1715712864; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6+otGiHlmRN59JlK8AWDmNyXiAw5T82zirPgrMn8miQ=; b=q9/XHjLjBvbV9SKX5HoJl6SSeEkLcwonD0GY0W6Jo0FokUuieGUPDzSEqYeqH8KXq2 Xg3KCuKBzC4SpkOott5bsEbC60E+7WQNQ3xWvEBjPMKEIJe7gFATdtYxzbclOwJrYGfr izEq04kFcTtmsELmNh9bDuDLb3chnlmfzCkiw2AUD7xrJAwwx7guseAqy3x5yf7YEUFa kw+BXCR5MpgG7g8EidflW06hl4oZpZyx5699kttZl4n2lgtUItkqXSsVuXnpX+1npr7q ebL9fEF3DGxB6o7ZmBCSxHttxOfEF3lBYKBV6TFha34sBsFl94Rx1Ny1icrpPBJA7QpY petg== X-Gm-Message-State: AOJu0YwTCloq4T/D3bx3wfOso+3ARtPdG9JS/uFd12Q7SzNcdVubewdE MhA61ydzMhoW1N00p/k/z9q6WTEbRHQhDlEqv295Uy3E46DowBnM93j1a/TzER8kg2EGacuRAB/ OqWK2PAi1h9NkkhLQ7R4//TEiLeccFkto+SA= X-Google-Smtp-Source: AGHT+IEl2K4yT+hVmcHtVycNGbC1qT0KhoPllr0xdNEQeMD05bZCBvIqaa2vZzuJt6lZZlDcP5hhIhwzqaFF7bHl+P8= X-Received: by 2002:a17:906:2795:b0:a59:af85:17e9 with SMTP id a640c23a62f3a-a59fb9b88d6mr21869166b.55.1715108063600; Tue, 07 May 2024 11:54:23 -0700 (PDT) MIME-Version: 1.0 From: Tadhg McDonald-Jensen Date: Tue, 7 May 2024 14:54:12 -0400 Message-ID: Subject: luks-device-mapping-with-options breaks bootloader To: bug-guix@gnu.org Content-Type: multipart/alternative; boundary="000000000000e1e6390617e1b64a" Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=tadhgmister@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 07 May 2024 18:24:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --000000000000e1e6390617e1b64a Content-Type: text/plain; charset="UTF-8" using the `luks-device-mapping-with-options` mapped device type defined in (gnu system mapped-devices) causes grub or other bootloaders to not properly attempt to mount the encrypted drive. This is caused by the commit 39a9404 which identifies luks mapped devices by checking if the type is equal to `luks-device-mapping`, so by using a different routine that is a proxy to that one it doesn't forward it to grub in the store-crypto-devices list. For anyone who finds this before it is fixed, you can boot your device by hitting 'c' in grub and typing these commands: grub> insmod luks grub> insmod luks2 grub> cryptomount (XXX) grub> set root=(crypto) grub> configfile (YYY)/grub/grub.cfg Where (XXX) is the encrypted partition and (YYY) is the boot partition with the grub config, these can be found by doing `ls` command. --000000000000e1e6390617e1b64a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
using the `luks-device-mapping-with-options` mapped device= type defined in (gnu system mapped-devices) causes grub or other bootloade= rs to not properly attempt to mount the encrypted drive. This is caused by = the commit=C2=A039a9404 which identifies luks mapped devices by checking if= the type is equal to `luks-device-mapping`, so by using a different=C2=A0r= outine that is a proxy to that one it doesn't forward it to grub in the= store-crypto-devices list.

For anyone who finds this be= fore it is fixed, you can boot your device by hitting 'c' in grub a= nd typing these commands:
grub> insmod luks
grub>= insmod luks2
grub> cryptomount (XXX)
grub> set r= oot=3D(crypto)
grub> configfile (YYY)/grub/grub.cfg
=
Where (XXX) is the encrypted partition and (YYY) is the boot= partition with the grub config, these can be found by doing `ls` command.<= /div>
--000000000000e1e6390617e1b64a-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 25 05:40:20 2024 Received: (at control) by debbugs.gnu.org; 25 May 2024 09:40:20 +0000 Received: from localhost ([127.0.0.1]:42405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnsy-0005AW-G4 for submit@debbugs.gnu.org; Sat, 25 May 2024 05:40:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnsw-0005AO-E2 for control@debbugs.gnu.org; Sat, 25 May 2024 05:40:18 -0400 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 ) id 1sAnsj-0005ex-E5 for control@debbugs.gnu.org; Sat, 25 May 2024 05:40:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=KQpIvwN13JlV48ZLwabevHTpE3yZhuhV7V5S6RYz24g=; b=B/tkfJ+dqzpldt DNPUK+wRN540nM6h0q0rVQbIFajg0vv+6eXOjWJItK1jtLZqxUf39v9veob8M9gPfmDkF5gDCBUBg q2P0VTEJvO7zfNaPxRKuXwqQzzlbFz98i0jIs9JmgZHnVICR4tMbrK2YIletfsbvlIfc12tZmz4Vy 7eAuF/gG8VTNYAzywxruVxEaM7FbS3+xCrcYAQs18iE0wt3KtUGWue2ytCJUXpRoj8FLaEzFXigiJ KzW3nlA00kM9/QUA22I3Pzuj3XV9So9Z3abE7uif969rmeD7jkrukZdPHs0tXppMsHO1Ni5fyrH8V 2K6KimGGz56407HHvw5g==; Date: Sat, 25 May 2024 11:40:03 +0200 Message-Id: <87le3y2psc.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #70826 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 70826 important quit From debbugs-submit-bounces@debbugs.gnu.org Sat May 25 05:47:22 2024 Received: (at 70826) by debbugs.gnu.org; 25 May 2024 09:47:22 +0000 Received: from localhost ([127.0.0.1]:42442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnzl-00082G-MY for submit@debbugs.gnu.org; Sat, 25 May 2024 05:47:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAnzk-00082A-2x for 70826@debbugs.gnu.org; Sat, 25 May 2024 05:47:20 -0400 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 ) id 1sAnzX-0006xe-9g; Sat, 25 May 2024 05:47:07 -0400 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=K/wqconLzqnZFTR0OCqJeFxpOKcmyQLxdz0obdPMikw=; b=YHMQnbD77YWahZWUd9Q5 X2Ak13H20U2/y4NEf2rw7br5HlLTD+BAg8vNgVD+K8G3ktBQ9G3UPQWjfOGqMaH7nohZ+oFRneD80 XhloAMEeMNPXrKHkk0gMzI3irEkncchB2jJ1SPgDRY70t/x14wr/TIXCYkeUYyp0nsGkefsB8I/Dr B71poQoSkvmqlVFodzB5rWcjVgiD/oqk2sCVEvulh10tVsuelDT4U2EtqYp4S5Mip+qNegL1eyQmx e0z4PD55R23DXI5RGDZtc2zrq9vI1Zzda8PZqof3k98pucI+ZFIR99AxwEWaX7lNZyPYHS2+yfdNC Uhk3ygpsUTlW6A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Tadhg McDonald-Jensen Subject: Re: bug#70826: luks-device-mapping-with-options breaks bootloader In-Reply-To: (Tadhg McDonald-Jensen's message of "Tue, 7 May 2024 14:54:12 -0400") References: Date: Sat, 25 May 2024 11:47:03 +0200 Message-ID: <87ikz22pgo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Hi, Tadhg McDonald-Jensen skribis: > using the `luks-device-mapping-with-options` mapped device type defined in > (gnu system mapped-devices) causes grub or other bootloaders to not > properly attempt to mount the encrypted drive. This is caused by the > commit 39a9404 which identifies luks mapped devices by checking if the type > is equal to `luks-device-mapping`, so by using a different routine that is > a proxy to that one it doesn't forward it to grub in the > store-crypto-devices list. Ouch, indeed. The immediate fix is: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/system.scm b/gnu/system.scm index c76f4d7c502..bb851b1b75f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -667,10 +667,13 @@ (define (operating-system-boot-mapped-devices os) (define operating-system-bootloader-crypto-devices (mlambdaq (os) ;to avoid duplicated output "Return the sources of the LUKS mapped devices specified by UUID." + (define (luks-device? m) + (memq (mapped-device-type m) + (list luks-device-mapping-with-options + luks-device-mapping))) + ;; XXX: Device ordering is important, we trust the returned one. - (let* ((luks-devices (filter (lambda (m) - (eq? luks-device-mapping - (mapped-device-type m))) + (let* ((luks-devices (filter luks-device? (operating-system-boot-mapped-devices os))) (uuid-crypto-devices non-uuid-crypto-devices (partition (compose uuid? mapped-device-source) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Not ideal, but it fixes the problem. I=E2=80=99ll go ahead with this patch if there are no objections. Thanks! Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 25 10:32:08 2024 Received: (at 70826) by debbugs.gnu.org; 25 May 2024 14:32:08 +0000 Received: from localhost ([127.0.0.1]:43769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAsRL-0001U3-Ie for submit@debbugs.gnu.org; Sat, 25 May 2024 10:32:07 -0400 Received: from mail-oa1-f45.google.com ([209.85.160.45]:51317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAsRJ-0001TS-Ou for 70826@debbugs.gnu.org; Sat, 25 May 2024 10:32:06 -0400 Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-24c10207d15so3373380fac.2 for <70826@debbugs.gnu.org>; Sat, 25 May 2024 07:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716647452; x=1717252252; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dv6c8I+OXdTRpembvDk/THVUkfNzrvEs1iYPafr5IOQ=; b=hs7A0pR9zP7ikgrKnBEcIKUP6JIRj9HoC/2S7gw5N/hBDGfsROktdhwi93UfCjTHHX MNFTti5RUm59ApAO6rZM1h5Tu5k4WE5Nbtt6jQ7VIjNY1aCMNJv7cpEB69aCw0JlhsPc bS/hOeyhkn9siQRmJR/1RlZ8x3b52jo6qcIDERPiZctPLHWoYsvxt20JsIm3tXxciaJR jlLk9WhBrgtqEgO0dgGy69l999WF0gDCJ/jxjRtnum14+n/yjrnfoNuOYJPcwPTyL2pT A8n9LkCqMaUo4ykh1nKYmZXEcuniAi3PENt91hqmHClo/ricIkr7OX5act3OZuhc3Sul BwLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716647452; x=1717252252; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dv6c8I+OXdTRpembvDk/THVUkfNzrvEs1iYPafr5IOQ=; b=wuK7fbPqGwyXs+gqhidLAAnXE5Jika1WjF7/bYVumnZLARbG/ov7o7xVRckY2lP1e4 EY19478B4/8NXLYPyLhELC157k0MBeQbKyCR5Lb5DRF3NvlkftOBMagxLl993gxV3epJ jS1yEkF6dIChEW11mT5aaQwKuSYHI8BcgTS+f6Clfevy00NatG7rahsABfon0ttuFILd IH7WUeUIsan4DpbVHU4ANdRdsKh2hT1vWico67qOYfDJRpMjX2dgNEpjlixvGGBDv/Vh 4Id6pQs0m7JpySjqyMs3aBaaPmIMTs2GsgchpyP5+tYnfAI+D4ajoplGBAtFJyWzdq1g KeUA== X-Gm-Message-State: AOJu0Yw45Tn36A3A6Li1Sf3CZ0c+gEN3c8VsMVRgmVG+R6q54qHBsGcA dQEVqFEXbymAVsiYJqexUut4BBQZX4m8bxbDWTCrgJwRTfnbcqXHxu/geQ== X-Google-Smtp-Source: AGHT+IFAks63m5lNeU8+6rQ+OTTzfDsCwcbpltXv0742QyWfnamccHA0E8On3fq320zYoA3BWvWBxA== X-Received: by 2002:a05:6871:652:b0:240:eab9:1635 with SMTP id 586e51a60fabf-24ca129ab36mr4884428fac.21.1716647451014; Sat, 25 May 2024 07:30:51 -0700 (PDT) Received: from [192.168.2.11] ([142.188.57.235]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad71678996sm3344846d6.139.2024.05.25.07.30.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 May 2024 07:30:50 -0700 (PDT) Message-ID: Date: Sat, 25 May 2024 10:30:49 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: bug#70826: luks-device-mapping-with-options breaks bootloader To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <87ikz22pgo.fsf@gnu.org> Content-Language: en-US From: Tadhg McDonald-Jensen In-Reply-To: <87ikz22pgo.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 70826 Cc: 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) That unfortunately doesn't fix the problem, `luks-device-mapping-with-options` is a routine that returns the `mapped-device-kind` so it won't check by equality. A possible solution is to check whether the `mapped-device-kind-close` routines are the same as these are shared. diff --git a/gnu/system.scm b/gnu/system.scm index cb6e719ca6..b564bf3788 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -661,10 +661,12 @@ (define (operating-system-boot-mapped-devices os) (define operating-system-bootloader-crypto-devices (mlambdaq (os) ;to avoid duplicated output "Return the sources of the LUKS mapped devices specified by UUID." + (define (luks-device? m) + (eq? (mapped-device-kind-close (mapped-device-type m)) + (mapped-device-kind-close luks-device-mapping))) + ;; XXX: Device ordering is important, we trust the returned one. - (let* ((luks-devices (filter (lambda (m) - (eq? luks-device-mapping - (mapped-device-type m))) + (let* ((luks-devices (filter luks-device? (operating-system-boot-mapped-devices os))) (uuid-crypto-devices non-uuid-crypto-devices (partition (compose uuid? mapped-device-source) (I apologize if my email client is adding line wraps to the diffs, I will look into it after sending this) I tried to implement this initially but it didn't work on my previous attempt so I abandoned trying to submit a patch, but this version does do the trick even if it seems inelegant. On 2024-05-25 5:47 a.m., Ludovic Courtès wrote: > Hi, > > Tadhg McDonald-Jensen skribis: > >> using the `luks-device-mapping-with-options` mapped device type defined in >> (gnu system mapped-devices) causes grub or other bootloaders to not >> properly attempt to mount the encrypted drive. This is caused by the >> commit 39a9404 which identifies luks mapped devices by checking if the type >> is equal to `luks-device-mapping`, so by using a different routine that is >> a proxy to that one it doesn't forward it to grub in the >> store-crypto-devices list. > > Ouch, indeed. The immediate fix is: > > > diff --git a/gnu/system.scm b/gnu/system.scm > index c76f4d7c502..bb851b1b75f 100644 > --- a/gnu/system.scm > +++ b/gnu/system.scm > @@ -667,10 +667,13 @@ (define (operating-system-boot-mapped-devices os) > (define operating-system-bootloader-crypto-devices > (mlambdaq (os) ;to avoid duplicated output > "Return the sources of the LUKS mapped devices specified by UUID." > + (define (luks-device? m) > + (memq (mapped-device-type m) > + (list luks-device-mapping-with-options > + luks-device-mapping))) > + > ;; XXX: Device ordering is important, we trust the returned one. > - (let* ((luks-devices (filter (lambda (m) > - (eq? luks-device-mapping > - (mapped-device-type m))) > + (let* ((luks-devices (filter luks-device? > (operating-system-boot-mapped-devices os))) > (uuid-crypto-devices non-uuid-crypto-devices > (partition (compose uuid? mapped-device-source) > > > > Not ideal, but it fixes the problem. > > I’ll go ahead with this patch if there are no objections. > > Thanks! > > Ludo’. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 23 14:20:00 2024 Received: (at 70826) by debbugs.gnu.org; 23 Jul 2024 18:20:00 +0000 Received: from localhost ([127.0.0.1]:60729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWK7D-0003TK-P6 for submit@debbugs.gnu.org; Tue, 23 Jul 2024 14:20:00 -0400 Received: from wolfsden.cz ([37.205.8.62]:51962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1sWK7B-0003T6-D3 for 70826@debbugs.gnu.org; Tue, 23 Jul 2024 14:19:58 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id E937628AE4E; Tue, 23 Jul 2024 18:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1721758790; bh=VT81BjFeuij3ClpnWVpexB6gUcVO+JAUsVpOoTnzY0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=G8n7FJkRjaerg7L30YVRdKdVpMJMQhyBZqokeNV75pyGhoFoiYZrVuKLkfGpl68ON 1RZWMsu5MbDai44LsRQjpPkLLTloOD4Dami6HSBEC3sk7C/2F7aWPi86xn7z+h/zyt u5eFwBAx8ZvES+AhRBtG9pPpZn2795D4hnRmUqfoGrPs9jwGcJ3I+upUSCFSv7tLrH 16OLcNqUIkezRe7uMSTnyI/XBRjLsdjYyHSeKjvMP8lVBvXEZCCzQQxQj0MVqALBYJ s6e4q5ELn51LNRCfOsmCXraGEq4RygDFkjuPJ6icN/h6DZSasRLqNqcMMPbPwe+pMN BZiZRjKfVcJctI5AZZUkT2vpsM5MuL2XtnEYhuMeVkrLJL5biXlzzAQaBOr/LzhRa4 6H+H3BSChVy1lx8MZXi4n33t3Qr+QpKnP/MEjZlQgiqhps1Jo+drTzchHbieGccHJl Qj7kodC/AKRqWvoeuuRy5CNXAc0kvyyNtl8t8Lufn/QcxYBcC+p6nKYQ9QIutZRxq9 +T1Gg3twp+ylL9DAYlKsfaUTFoEW1g9H/chsvwYa3TxDxj6N7zBSZJJeICe6ptz1l/ QlPhI7eWHMu/sjbG2hRDyC4PYMcA2fsIG6KTuCl1VxkOD/5CcZM4lZ1EDswTNML6E2 911QrPpVRerqpd9ZWMhJYVOg= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from localhost (unknown [193.32.127.136]) by wolfsden.cz (Postfix) with ESMTPSA id 0BEE628C98C; Tue, 23 Jul 2024 18:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1721758790; bh=VT81BjFeuij3ClpnWVpexB6gUcVO+JAUsVpOoTnzY0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=G8n7FJkRjaerg7L30YVRdKdVpMJMQhyBZqokeNV75pyGhoFoiYZrVuKLkfGpl68ON 1RZWMsu5MbDai44LsRQjpPkLLTloOD4Dami6HSBEC3sk7C/2F7aWPi86xn7z+h/zyt u5eFwBAx8ZvES+AhRBtG9pPpZn2795D4hnRmUqfoGrPs9jwGcJ3I+upUSCFSv7tLrH 16OLcNqUIkezRe7uMSTnyI/XBRjLsdjYyHSeKjvMP8lVBvXEZCCzQQxQj0MVqALBYJ s6e4q5ELn51LNRCfOsmCXraGEq4RygDFkjuPJ6icN/h6DZSasRLqNqcMMPbPwe+pMN BZiZRjKfVcJctI5AZZUkT2vpsM5MuL2XtnEYhuMeVkrLJL5biXlzzAQaBOr/LzhRa4 6H+H3BSChVy1lx8MZXi4n33t3Qr+QpKnP/MEjZlQgiqhps1Jo+drTzchHbieGccHJl Qj7kodC/AKRqWvoeuuRy5CNXAc0kvyyNtl8t8Lufn/QcxYBcC+p6nKYQ9QIutZRxq9 +T1Gg3twp+ylL9DAYlKsfaUTFoEW1g9H/chsvwYa3TxDxj6N7zBSZJJeICe6ptz1l/ QlPhI7eWHMu/sjbG2hRDyC4PYMcA2fsIG6KTuCl1VxkOD/5CcZM4lZ1EDswTNML6E2 911QrPpVRerqpd9ZWMhJYVOg= Date: Tue, 23 Jul 2024 20:19:49 +0200 From: Tomas Volf <~@wolfsden.cz> To: Tadhg McDonald-Jensen Subject: Re: bug#70826: luks-device-mapping-with-options breaks bootloader Message-ID: References: <87ikz22pgo.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3Li9OWrqVKdhC8qG" Content-Disposition: inline In-Reply-To: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: Ludovic =?iso-8859-1?Q?Court=E8s?= , 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --3Li9OWrqVKdhC8qG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2024-05-25 10:30:49 -0400, Tadhg McDonald-Jensen wrote: > That unfortunately doesn't fix the problem, > `luks-device-mapping-with-options` is a routine that returns the > `mapped-device-kind` so it won't check by equality. > > A possible solution is to check whether the `mapped-device-kind-close` > routines are the same as these are shared. What I find interesting is that I too am using luks-device-mapping-with-options and my system boots just fine. So I wonder what the difference is. Could you share your system configuration please? Or at least the relevant parts (I assume at least bootloader, file-systems and mapped-devices fields)? I would like to properly understand the problem here and why it works for me. Thanks, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --3Li9OWrqVKdhC8qG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmaf9EUACgkQL7/ufbZ/ wan9vBAAnqC/KJO7HlcrJDLYAKJR8aVh9U2DywISrzC9cdqmmzDg6xwkTDFPDnKG cYf+DF4T4dAn+TdlrF4KDWIoGqMLmMP/0l5fSaxPf4FdnDjY3BBr8As/qz1pxyKw QUU4AcbedZCzXYT2V/pzy8LN6RpfNO6w9ojbvNFDmy03V83RxcCVDWQ5qLaV4ws1 EZ2irVcHkULJSfIslXGjPVmLIcihXHpIwv+zDCTE5IuM763RR02aJhqMWRONigEc ysLfM8sVozp494MBpsSHxc3aIh1ZtjfxzQRTgYRBnmAIqbFZVwzkwP04iOsxv7CX 8/mi9yczq7RqsVFRK6QIgfepYfndJeA8ycCJEU7kjwZGgw3GdONa5uE1FeJmd6MV OPqMb/Ttx7V5KgIo7k/1oGBR8afwaaDgW7ga/Oemdqim0lzKf6hpmrFlrfoAcsBw MviLlDHA0vCVCybHehE2tGYs7QMMW/PNdWgUURXUrWGdxkMlJua2yJlLHBlvLMx2 G2ROY4mP8geARRD8yLOXskCh5aHSuC5T7yxP0Honno5P3aRDdW4iMTbwtSp1t+lM BFaOesFcOF8VzyAUBKSsnlhiEdfcbjW/DIWeKRsuPevJ5iZyl/PiIlIxQQHsexHU nbnwL3bix7M3q1ztt+OfrkbQThPz5cf69XrYi5fSwD9gKS4P35g= =5ISi -----END PGP SIGNATURE----- --3Li9OWrqVKdhC8qG-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 11 18:35:05 2024 Received: (at 70826) by debbugs.gnu.org; 11 Aug 2024 22:35:05 +0000 Received: from localhost ([127.0.0.1]:42009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdH9V-00020r-6o for submit@debbugs.gnu.org; Sun, 11 Aug 2024 18:35:05 -0400 Received: from mail-qv1-f44.google.com ([209.85.219.44]:61814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdH9T-00020L-Au for 70826@debbugs.gnu.org; Sun, 11 Aug 2024 18:35:04 -0400 Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6b7b28442f9so45591546d6.3 for <70826@debbugs.gnu.org>; Sun, 11 Aug 2024 15:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723415606; x=1724020406; darn=debbugs.gnu.org; h=in-reply-to:references:cc:to:content-language:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=t2o8lNPecWqvDjTWSC99Z8+a9DDMG3FuBHvwq8GID3U=; b=L55ZLdHzdHvI31dyxUrjFYvB5sVRVUroXJJNzuD9z4pXLVHJF4plozKZu5dQJbFmWX tOBcr3RtrsHVhlLjrJodN6qLNl+Op82ngUok8tkHf8Et+By/k4iHygBAI2WN3oiuYHcs TpSKwjfTROWJ5dulQIKQbbGGD6UZWsP9STiEDK7wjhssUf3QLnQDeSdfRdFltRDo9QNa bc4yGOh4ElXqnoZj8TElJmzBYCQfWDEVVaIJNzf75MsL7dLnk9HUV0/VKLSGgNXGsgSq IhqCiZjVgXAZN+TjbPf9yNWbztJDm4xkhN6+kP9PF/5wQMLxZkxw0UHCmuA3Qag7jxTu /DFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723415606; x=1724020406; h=in-reply-to:references:cc:to:content-language:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=t2o8lNPecWqvDjTWSC99Z8+a9DDMG3FuBHvwq8GID3U=; b=cAuaklhMjVM2+PxqM0OmCMhCGLJVUG7870S/yMJP3g3oK4Z5NllQpaJyAZtbk16xg/ zQFQh6btIBINcptC+RdejVmbEUFc4HTuHLlI4riZ/kOfi4wm2csvjDcRXRLP+jQoGbNR 4l5p2S6/v9aR2Ei68pOACAdmfZGPWZ4uw91CjN7+b6yOYTtsY2wVhu6NlSHXr8NfjJrn RFIK0/L/utNA291/aSBnVzP5w3WyjLgdbQuLy6CWGeFKnn8xRmS/68+pi3N98jh57JEK Ny7BWIDgjrhJU+FzjnB/xWhILR4Ozpi//g4XKDWfZMypCBVx1DtcEFJu7PsrCrU1oHLI A7OA== X-Forwarded-Encrypted: i=1; AJvYcCWNlYlwk6riObagKfk8/wVvOzk+IND74nkCaNp7M2cIzhj+RQ9fmYq6GhnZYaKVLql+Tr09SuL7EUkVaMOGjLsy1qGUnF4= X-Gm-Message-State: AOJu0YzoKMHZoFfUYPx5banvif7vCkBZaXShVQ9zKaAtjUWQeHxo1VWQ bBvvzS2NswcdLzdIUUeBqoeavzBxDHS9QadRsS6r1IcFpASqTmBK X-Google-Smtp-Source: AGHT+IHIE2YdGVyKWFeM7JRHCtDvzylb4YbZpCkrX3/mrUPRTEDMvuPZLyvKFOSkpxb0HDYM8uzA7Q== X-Received: by 2002:a05:620a:3182:b0:7a1:c40d:7573 with SMTP id af79cd13be357-7a4c182f778mr1199595785a.49.1723415606231; Sun, 11 Aug 2024 15:33:26 -0700 (PDT) Received: from [192.168.2.11] ([174.89.30.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4531c291a06sm17450081cf.85.2024.08.11.15.33.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Aug 2024 15:33:25 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------o7HI3IGBxJKlv02dEirym628" Message-ID: <44aec6b7-dcba-4598-c984-068333cc696b@gmail.com> Date: Sun, 11 Aug 2024 18:33:14 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 From: Tadhg McDonald-Jensen Subject: Re: bug#70826: luks-device-mapping-with-options breaks bootloader Content-Language: en-US To: Tomas Volf <~@wolfsden.cz> References: <87ikz22pgo.fsf@gnu.org> In-Reply-To: X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 70826 Cc: =?UTF-8?Q?Ludovic_Court=c3=a8s?= , 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.2 (--) This is a multi-part message in MIME format. --------------o7HI3IGBxJKlv02dEirym628 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I have attached a config I just did `sudo guix system reconfigure` and confirmed it was missing the `insmod luks` in /boot/grub/grub.cfg Sorry for the delay, Tadhg McD-J On 2024-07-23 2:19 p.m., Tomas Volf wrote: > On 2024-05-25 10:30:49 -0400, Tadhg McDonald-Jensen wrote: >> That unfortunately doesn't fix the problem, >> `luks-device-mapping-with-options` is a routine that returns the >> `mapped-device-kind` so it won't check by equality. >> >> A possible solution is to check whether the `mapped-device-kind-close` >> routines are the same as these are shared. > > What I find interesting is that I too am using luks-device-mapping-with-options > and my system boots just fine. So I wonder what the difference is. Could you > share your system configuration please? Or at least the relevant parts (I > assume at least bootloader, file-systems and mapped-devices fields)? > > I would like to properly understand the problem here and why it works for me. > > Thanks, > Tomas Volf > > -- > There are only two hard things in Computer Science: > cache invalidation, naming things and off-by-one errors. --------------o7HI3IGBxJKlv02dEirym628 Content-Type: text/x-scheme; charset=UTF-8; name="os.tmp.scm" Content-Disposition: attachment; filename="os.tmp.scm" Content-Transfer-Encoding: base64 Cih1c2UtbW9kdWxlcwogKGdudSkKICgoZ3VpeCBwYWNrYWdlcykgIzpzZWxlY3QgKG9yaWdp biBiYXNlMzIgbW9kaWZ5LWlucHV0cyBwYWNrYWdlLXNvdXJjZSBwYWNrYWdlLWlucHV0cyBw YWNrYWdlKSkKICgoZ3VpeCBkb3dubG9hZCkgIzpzZWxlY3QgKHVybC1mZXRjaCkpCiAoKGd1 aXggZ2V4cCkgIzpzZWxlY3QoZmlsZS1hcHBlbmQpKQogKChnbnUgcGFja2FnZXMgZnJlZWRl c2t0b3ApICM6c2VsZWN0KGZwcmludGQpKQogKChnbnUgcGFja2FnZXMgc3Vja2xlc3MpICM6 c2VsZWN0KHNsb2NrKSkKICgoZ251IHBhY2thZ2VzIGdhbWVzKSAjOnNlbGVjdCAoc3RlYW0t ZGV2aWNlcy11ZGV2LXJ1bGVzKSkKICgoZ251IHBhY2thZ2VzIGxpbnV4KSAjOnNlbGVjdCAo YnJpZ2h0bmVzc2N0bCkpCiAoKGdudSBwYWNrYWdlcyB3bSkgIzpzZWxlY3QgKHN3YXlsb2Nr KSkKICgoZ251IHBhY2thZ2VzIGN1cHMpICM6c2VsZWN0IChjdXBzIGN1cHMtZmlsdGVycyBl cHNvbi1pbmtqZXQtcHJpbnRlci1lc2NwciBocGxpcC1taW5pbWFsKSkKICgoZ251IHNlcnZp Y2VzIGN1cHMpICM6c2VsZWN0IChjdXBzLXNlcnZpY2UtdHlwZSBjdXBzLWNvbmZpZ3VyYXRp b24pKQogKChnbnUgc2VydmljZXMgbmZzKSAjOnNlbGVjdCAobmZzLXNlcnZpY2UtdHlwZSBu ZnMtY29uZmlndXJhdGlvbikpCiAoKGdudSBzZXJ2aWNlcyBkZXNrdG9wKSAjOnNlbGVjdCAo c2FuZS1zZXJ2aWNlLXR5cGUgYmx1ZXRvb3RoLXNlcnZpY2UtdHlwZSAlZGVza3RvcC1zZXJ2 aWNlcyBlbG9naW5kLXNlcnZpY2UtdHlwZSBlbG9naW5kLWNvbmZpZ3VyYXRpb24pKQogOzso KGdudSBzZXJ2aWNlcyBkb2NrZXIpICM6c2VsZWN0KGRvY2tlci1zZXJ2aWNlLXR5cGUpKQog KChnbnUgc2VydmljZXMgdmlydHVhbGl6YXRpb24pICM6c2VsZWN0KHFlbXUtYmluZm10LXNl cnZpY2UtdHlwZSBxZW11LWJpbmZtdC1jb25maWd1cmF0aW9uIGxvb2t1cC1xZW11LXBsYXRm b3JtcyBsaWJ2aXJ0LXNlcnZpY2UtdHlwZSkpCiAoKGdudSBzZXJ2aWNlcyBuaXgpICM6c2Vs ZWN0IChuaXgtc2VydmljZS10eXBlKSkKICgoZ251IHNlcnZpY2VzIG5ldHdvcmtpbmcpICM6 c2VsZWN0IChpcGZzLXNlcnZpY2UtdHlwZSBpcGZzLWNvbmZpZ3VyYXRpb24pKQogKChnbnUg c2VydmljZXMgc3luY3RoaW5nKSAjOnNlbGVjdCAoc3luY3RoaW5nLXNlcnZpY2UtdHlwZSBz eW5jdGhpbmctY29uZmlndXJhdGlvbikpCiAoKGdudSBzZXJ2aWNlcyBzb3VuZCkgIzpzZWxl Y3QgKHB1bHNlYXVkaW8tc2VydmljZS10eXBlIHB1bHNlYXVkaW8tY29uZmlndXJhdGlvbikp CiAoKGdudSBzZXJ2aWNlcyBhdWRpbykgIzpzZWxlY3QgKG1wZC1zZXJ2aWNlLXR5cGUgbXBk LWNvbmZpZ3VyYXRpb24pKQogKChnbnUgc2VydmljZXMgeG9yZykgIzpzZWxlY3QgKHhvcmct c2VydmVyLXNlcnZpY2UtdHlwZSBnZG0tc2VydmljZS10eXBlIHNjcmVlbi1sb2NrZXItc2Vy dmljZSBzY3JlZW4tbG9ja2VyLXNlcnZpY2UtdHlwZSB4b3JnLWNvbmZpZ3VyYXRpb24gc2V0 LXhvcmctY29uZmlndXJhdGlvbikpCiA7OygoZ251IHNlcnZpY2VzIGF1dGhlbnRpY2F0aW9u KSAjOnNlbGVjdCAoZnByaW50ZC1zZXJ2aWNlLXR5cGUpKQogKChnbnUgc2VydmljZXMgZmls ZS1zaGFyaW5nKSAjOnNlbGVjdCAodHJhbnNtaXNzaW9uLWRhZW1vbi1zZXJ2aWNlLXR5cGUg dHJhbnNtaXNzaW9uLWRhZW1vbi1jb25maWd1cmF0aW9uKSkKICgoZ251IHNlcnZpY2VzIHBt KSAjOnNlbGVjdCAodGxwLXNlcnZpY2UtdHlwZSB0bHAtY29uZmlndXJhdGlvbiB0aGVybWFs ZC1zZXJ2aWNlLXR5cGUpKQogKQoKKGRlZmluZSB1c2VybmFtZSAidGFkaGciKQo7OyBjb21t aXQgMzlhOTQwNCBpbiBndWl4IGJyb2tlIHRoaXMsIGEgZnVuY3Rpb24gaW4gdGhlIG9zIGNo ZWNrcyBmb3IgZXF1YWxpdHkgd2l0aCBsdWtzLWRldmljZS1tYXBwaW5nIGFzIHRoZSB0eXBl IGFuZCBvbmx5IHB1dHMgdGhlCjs7IG5lZWRlZCBjb21tYW5kcyBpbnRvIGdydWIuY2ZnIGlm IGl0IGlkZW50aWZpZXMgaXQgdGhhdCB3YXksIHNvIHRoaXMgbWFrZXMgZ3J1YiBqdXN0IG5v dCB0cnkgdG8gbW91bnQgdGhlIGVuY3J5cHRlZCBkZXZpY2Ugd2hpY2gKOzsgb2J2aW91c2x5 IGNhdXNlcyBpdCB0byBmYWlsLiBJIHdpbGwgbmVlZCB0byBzdWJtaXQgYSBidWcgcmVwb3J0 IGFuZCBnZXQgaXQgcHJvcGVybHkgZml4ZWQgYnV0IGZvciBub3cgSSB3aWxsIGp1c3QgbmVl ZCB0bwo7OyBjb250aW51ZSB0byB0eXBlIG15IGRlY3J5cHRpb24gcGFzc3dvcmQgdHdpY2Uu CihkZWZpbmUgY3J5cHRyb290LXR5cGUgKGx1a3MtZGV2aWNlLW1hcHBpbmctd2l0aC1vcHRp b25zCgkJCQkgOzsgTk9URTogd2hlbiBzcGVjaWZpZWQgYXMgYSBzdHJpbmcgdGhpcyBpcyBh IHBhdGggcmVsYXRpdmUgdG8gdGhlIGluaXRyZCBpbnRlcm5hbCBmaWxlc3lzdGVtCgkJCQkg Ozsgd2hpY2ggaXMgcG9wdWxhdGVkIGJ5IHRoZSBjcGlvIGZpbGUgcGFzc2VkIGFzICdleHRy YS1pbml0cmQnIHRvIGdydWIuCgkJCQkgOzsgaWYgaXQgd2FzIChsb2NhbC1maWxlICIvY3J5 cHRvX2tleWZpbGUuYmluIikgaXQgd291bGQgY29weSB0aGUgZmlsZSBvbiB0aGUgbG9jYWwg ZmlsZXN5c3RlbQoJCQkJIDs7IHRvIHRoZSBpbml0cmQsIGJ1dCBpdCB3b3VsZCBhbHNvIHB1 dCBhIGNvcHkgb2YgaXQgaW4gdGhlIGd1aXggc3RvcmUgd2hpY2ggaXMgZ2xvYmFsbHkgcmVh ZGFibGUKCQkJCSA7OyAoaXQnZCBhbHNvIGJlIHJlYWRhYmxlIGZyb20gdGhlIGluaXRyZCB3 aGljaCBpcyBhbHNvIGluIHRoZSBndWl4IHN0b3JlIHNvIGV2ZW4gaWYgaXQKCQkJCSA7OyAg IHdhc24ndCBjb3BpZWQgaW4gdGhlcmUnZCBiZSBhIHByb2JsZW0pCgkJCQkgOzsgaWYgdGhp cyBmaWxlIGV2ZXIgbmVlZHMgdG8gYmUgcmVjYXB0dXJlZCB1c2UgdGhlIGNvbW1hbmQgYGNw aW8gLWkgL2NyeXB0b19rZXlmaWxlLmJpbiA8IC9jcnlwdG9fa2V5ZmlsZS5jcGlvYCBydW4g YXMgcm9vdCBhbmQgaXQgd2lsbCByZXN0b3JlIHRoaXMgZmlsZSB0byB0aGUgcm9vdCBkaXJl Y3RvcnkuCgkJCQkgIzprZXktZmlsZSAiL2NyeXB0b19rZXlmaWxlLmJpbiIpKQoob3BlcmF0 aW5nLXN5c3RlbQogIChsb2NhbGUgImVuX0NBLnV0ZjgiKQogICh0aW1lem9uZSAiQW1lcmlj YS9Ub3JvbnRvIikKICAoa2V5Ym9hcmQtbGF5b3V0IChrZXlib2FyZC1sYXlvdXQgInVzIikp CiAgKGhvc3QtbmFtZSAiZnJhbWV3b3JrIikKCiAgOzsgVGhlIGxpc3Qgb2YgdXNlciBhY2Nv dW50cyAoJ3Jvb3QnIGlzIGltcGxpY2l0KS4KICAodXNlcnMgKGNvbnMqCgkgICh1c2VyLWFj Y291bnQKICAgICAgICAgICAgICAgICAgKG5hbWUgdXNlcm5hbWUpCiAgICAgICAgICAgICAg ICAgIChjb21tZW50ICJUYWRoZyBNY0RvbmFsZC1KZW5zZW4iKQogICAgICAgICAgICAgICAg ICAoZ3JvdXAgInVzZXJzIikKICAgICAgICAgICAgICAgICAgKGhvbWUtZGlyZWN0b3J5ICIv aG9tZS90YWRoZyIpCiAgICAgICAgICAgICAgICAgIChzdXBwbGVtZW50YXJ5LWdyb3VwcyAn KCJ3aGVlbCIgOzsgZm9yIHN1ZG8gYWNjZXNzCgkJCQkJICAibmV0ZGV2IiA7OyBUT0RPOiB3 aGF0IGlzIHRoaXMgZm9yPwoJCQkJCSAgImF1ZGlvIiA7OyB0byBiZSBhYmxlIHRvIHVzZSBh bHNhbWl4ZXIgZXRjCgkJCQkJICAidmlkZW8iICA7OyB0aGluayB0aGlzIGlzIHRvIGNvbnRy b2wgYnJpZ2h0bmVzcwoJCQkJCSAgInNjYW5uZXIiIDs7IGZvciBzY2FubmluZwoJCQkJCSAg ImlucHV0IiA7OyB0byBjb250cm9sIGNhcHMgbG9jayBsaWdodAoJCQkJCSAgKSkpCiAgICAg ICAgICAgICAgICAlYmFzZS11c2VyLWFjY291bnRzKSkKICAoYm9vdGxvYWRlciAoYm9vdGxv YWRlci1jb25maWd1cmF0aW9uCiAgICAgICAgICAgICAgICAoYm9vdGxvYWRlciBncnViLWVm aS1ib290bG9hZGVyKQogICAgICAgICAgICAgICAgKHRhcmdldHMgKGxpc3QgIi9ib290Iikp CiAgICAgICAgICAgICAgICAoa2V5Ym9hcmQtbGF5b3V0IGtleWJvYXJkLWxheW91dCkKCQko ZXh0cmEtaW5pdHJkICIvY3J5cHRvX2tleWZpbGUuY3BpbyIpCgkJKSkKICAobWFwcGVkLWRl dmljZXMgKGxpc3QgKG1hcHBlZC1kZXZpY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAo c291cmNlICh1dWlkCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImMwMDEw ZDA2LTBiZDEtNGFlMi05M2U2LWYyZjg5YTNhNjcwYiIpKQogICAgICAgICAgICAgICAgICAg ICAgICAgICh0YXJnZXQgImNyeXB0cm9vdCIpCgkJCSAgKHR5cGUgY3J5cHRyb290LXR5cGUp KSkpCgkJCSAgOzsodHlwZSBsdWtzLWRldmljZS1tYXBwaW5nKSkpKQogIAogIChzd2FwLWRl dmljZXMgKGxpc3QgKHN3YXAtc3BhY2UKICAgICAgICAgICAgICAgICAgICAgICAodGFyZ2V0 ICIvc3dhcGZpbGUiKQoJCSAgICAgICA7OyBUT0RPOiBzZWUgZXhhbXBsZSBhYm91dCBidHJm cyBtb3VudGluZyBpbiBkb2NzIGFib3V0IHN3YXAsIGp1c3QgZGVwZW5kaW5nIG9uIG1hcHBl ZC1kZXZpY2VzIGlzbid0IHN1ZmZpY2llbnQgdG8gZ3VhcmVudGVlIHRoZSByb290IHBhcnRp dGlvbiBpcyBtb3VudGVkLgoJCSAgICAgICAoZGVwZW5kZW5jaWVzIG1hcHBlZC1kZXZpY2Vz KSkpKQoKICA7OyBUaGUgbGlzdCBvZiBmaWxlIHN5c3RlbXMgdGhhdCBnZXQgIm1vdW50ZWQi LiAgVGhlIHVuaXF1ZQogIDs7IGZpbGUgc3lzdGVtIGlkZW50aWZpZXJzIHRoZXJlICgiVVVJ RHMiKSBjYW4gYmUgb2J0YWluZWQKICA7OyBieSBydW5uaW5nICdibGtpZCcgaW4gYSB0ZXJt aW5hbC4KICAoZmlsZS1zeXN0ZW1zIChjb25zKiAoZmlsZS1zeXN0ZW0KICAgICAgICAgICAg ICAgICAgICAgICAgIChtb3VudC1wb2ludCAiL2Jvb3QiKQogICAgICAgICAgICAgICAgICAg ICAgICAgKGRldmljZSAodXVpZCAiNTE5MC1FODQwIiAnZmF0MzIpKQogICAgICAgICAgICAg ICAgICAgICAgICAgKHR5cGUgInZmYXQiKSkKICAgICAgICAgICAgICAgICAgICAgICAoZmls ZS1zeXN0ZW0KICAgICAgICAgICAgICAgICAgICAgICAgIChtb3VudC1wb2ludCAiLyIpCiAg ICAgICAgICAgICAgICAgICAgICAgICAoZGV2aWNlICIvZGV2L21hcHBlci9jcnlwdHJvb3Qi KQogICAgICAgICAgICAgICAgICAgICAgICAgKHR5cGUgImJ0cmZzIikKICAgICAgICAgICAg ICAgICAgICAgICAgIChmbGFncyAnKGxhenktdGltZSkpCiAgICAgICAgICAgICAgICAgICAg ICAgICAob3B0aW9ucwogICAgICAgICAgICAgICAgICAgICAgICAgIChhbGlzdC0+ZmlsZS1z eXN0ZW0tb3B0aW9ucwogICAgICAgICAgICAgICAgICAgICAgICAgICAnKCgiY29tcHJlc3Mi IC4gImx6byIpKSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAoZGVwZW5kZW5jaWVzIG1h cHBlZC1kZXZpY2VzKSkgCiAgICAgICAgICAgICAgICAgICAgICAgICAlYmFzZS1maWxlLXN5 c3RlbXMpKQogIChwYWNrYWdlcyAoYXBwZW5kCgkgICAgIChsaXN0KSA7O29zLXBhY2thZ2Vz CiAgICAgICAgICAgICAlYmFzZS1wYWNrYWdlcykpCgogIDs7IEJlbG93IGlzIHRoZSBsaXN0 IG9mIHN5c3RlbSBzZXJ2aWNlcy4gIFRvIHNlYXJjaCBmb3IgYXZhaWxhYmxlCiAgOzsgc2Vy dmljZXMsIHJ1biAnZ3VpeCBzeXN0ZW0gc2VhcmNoIEtFWVdPUkQnIGluIGEgdGVybWluYWwu CiAgKHNlcnZpY2VzCiAgIChjb25zKgogICAgCiAgICAoc2VydmljZSB4b3JnLXNlcnZlci1z ZXJ2aWNlLXR5cGUpIDs7IG5lZWRlZCBmb3IgZGlzcGxheSAoa2luZCBvZiBpbXBvcnRhbnQp CiAgICAKICAgIChtb2RpZnktc2VydmljZXMKICAgICAgICAlZGVza3RvcC1zZXJ2aWNlcwoJ OzsoZ3VpeC1zZXJ2aWNlLXR5cGUgY29uZmlnID0+ICh0YWRoZzpzdWJzdGl0dXRlcyBjb25m aWcpKQoJCgkoZWxvZ2luZC1zZXJ2aWNlLXR5cGUKCSBjb25maWcgPT4KCSAoZWxvZ2luZC1j b25maWd1cmF0aW9uCiAgICAgICAgICAoaW5oZXJpdCBjb25maWcpCgkgIChoYW5kbGUtcG93 ZXIta2V5ICdoaWJlcm5hdGUpCgkgIDs7KGlkbGUtYWN0aW9uICdzdXNwZW5kKQogICAgICAg ICAgOzsoaGFuZGxlLWxpZC1zd2l0Y2ggJ2lnbm9yZSkKCSAgKSkKCShkZWxldGUgZ2RtLXNl cnZpY2UtdHlwZSkKCSkpKQogIDs7IGFsbG93IHVzaW5nIC5sb2NhbCB3aXRoIG1kbnMgcmVz b2x1dGlvbiwgdXNlZCBmb3IgcHJpbnRlciBpbiBwYXJ0aWN1bGFyCiAgKG5hbWUtc2Vydmlj ZS1zd2l0Y2ggJW1kbnMtaG9zdC1sb29rdXAtbnNzKQogICkK --------------o7HI3IGBxJKlv02dEirym628-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 11 19:20:59 2024 Received: (at 70826) by debbugs.gnu.org; 11 Aug 2024 23:20:59 +0000 Received: from localhost ([127.0.0.1]:42041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdHrv-00039H-2O for submit@debbugs.gnu.org; Sun, 11 Aug 2024 19:20:59 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:49632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdHrr-000393-SJ for 70826@debbugs.gnu.org; Sun, 11 Aug 2024 19:20:57 -0400 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a7a81bd549eso261980166b.3 for <70826@debbugs.gnu.org>; Sun, 11 Aug 2024 16:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723418358; x=1724023158; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bP+vptrwQc5dShQc1XG5TuQGNpgo6Sq8WtDhIlNawv8=; b=IKqlZywhFfU22Ga7Wo04fQ1SEja80SbxIqG2bPUAptcSXegO2iP2NvDY5VJcb6TNso xdFQuNDqMR+3RKeNIWqEwPZa2obwXsGdQN6XY+1daNaCVlFjyyiA/e3aJpkALrverwCT SwuIEOTh6lWOkP9FCqYVwyq2q2FYad3WjBX8G/UO0yyXom7obPuztjnAZTM4GCL0eGMl yBv79nXm3j/PVclqcY30eSdWr52WR8DlicjMeV7AowCO0BC7PY0MokpFQmKppsynGrX1 ryG1bCUxNHbX74thDQu6YVvhfOxoR9lqeKjUGmRQjis9IuOOwY6XjvcNf9StiJCg4liS Dc7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723418358; x=1724023158; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bP+vptrwQc5dShQc1XG5TuQGNpgo6Sq8WtDhIlNawv8=; b=Pa5CAMBKWgK0xkxfsiYcyj2y4CWdcwo7Lt5HaY5AziFt8u6TwKgcu6p/FB4LGoQNyZ MNJP7qGKJdQPIzLRAqwc7a9kCnwg+ybxnvgipsrdXTykfDTS+aZlEbVsIk+dM+rKUzcc 6bB4HKFerPm2D8XOlo7+faW7eNn+vficBGggL7RdVFkOJrnflgrn80SZpiHkiK6r4dtJ e5pA+OEEOyvxHGb/rGHp70Xz7OaRvQQw8wrJVZqKQa72jF4yCEKb/74weqRgx+mzAVFx lemeXNNrGXulS84NRkg29yWzKjiecl7/CARIhRw5CdUuTjL0mTmkV0OOS8smNpW2dPPW cuAw== X-Forwarded-Encrypted: i=1; AJvYcCVFQXcTibU23r2+/V84gdmpAALSEcwgTIxHUDoQ3eiNEqkwicTBrDfdrS1XPIqmBM34fgC86aF+tJ9RjhVdK+ZBSFH8rX8= X-Gm-Message-State: AOJu0YwY6kYMD1NdXUrgzfnIQG+CM63dgFTnD67mW2REMa199QiIK3Ph wnNQkTWZAtWp5UQn0LT7C0bUddfSVXO8TY6UQ/5VrLN9rqKmtDlZYIgv/OQxD+YgxB/jF3mxHYx 4b5OejNGcMEBdwS5s1eLRCFN8WERCo0Gc X-Google-Smtp-Source: AGHT+IFfhrUmqSw7hzSQV1rEYWKOp0cCS2ns16f6+p1GMDwBChAWeP123G4uRBMNy2ELzpQLTmg2tnoqbGI0R6xpVEA= X-Received: by 2002:a17:907:9484:b0:a7a:a801:12b3 with SMTP id a640c23a62f3a-a80aa5fb042mr616141666b.40.1723418358038; Sun, 11 Aug 2024 16:19:18 -0700 (PDT) MIME-Version: 1.0 References: <87ikz22pgo.fsf@gnu.org> <44aec6b7-dcba-4598-c984-068333cc696b@gmail.com> In-Reply-To: <44aec6b7-dcba-4598-c984-068333cc696b@gmail.com> From: Tadhg McDonald-Jensen Date: Sun, 11 Aug 2024 19:19:06 -0400 Message-ID: Subject: Re: bug#70826: luks-device-mapping-with-options breaks bootloader To: Tomas Volf <~@wolfsden.cz> Content-Type: multipart/alternative; boundary="00000000000007c729061f709b88" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000007c729061f709b88 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable In case it is relevant my disk is using GPT partition table with this layout: $ lsblk --output=3D"NAME,MAJ:MIN,TYPE,MOUNTPOINTS,UUID" NAME MAJ:MIN TYPE MOUNTPOINTS UUID nvme0n1 259:0 disk =E2=94=9C=E2=94=80nvme0n1p1 259:1 part /boot 5190-E840 =E2=94=94=E2=94=80nvme0n1p2 259:2 part c0010d06-0bd1-4ae2-93e6-f2f89a3a670b =E2=94=94=E2=94=80cryptroot 253:0 crypt /gnu/store / Only the main partition is encrypted with LUKS and grub is located on its own partition not in the in between space in an MBR drive. It is grub that is being responsible for decrypting the partition not my UEFI decrypting the whole drive. Tadhg On Sun, Aug 11, 2024 at 6:33=E2=80=AFPM Tadhg McDonald-Jensen wrote: > I have attached a config I just did `sudo guix system reconfigure` > and confirmed it was missing the `insmod luks` in /boot/grub/grub.cfg > > Sorry for the delay, > Tadhg McD-J > > On 2024-07-23 2:19 p.m., Tomas Volf wrote: > > On 2024-05-25 10:30:49 -0400, Tadhg McDonald-Jensen wrote: > >> That unfortunately doesn't fix the problem, > >> `luks-device-mapping-with-options` is a routine that returns the > >> `mapped-device-kind` so it won't check by equality. > >> > >> A possible solution is to check whether the `mapped-device-kind-close` > >> routines are the same as these are shared. > > > > What I find interesting is that I too am using > luks-device-mapping-with-options > > and my system boots just fine. So I wonder what the difference is. > Could you > > share your system configuration please? Or at least the relevant parts > (I > > assume at least bootloader, file-systems and mapped-devices fields)? > > > > I would like to properly understand the problem here and why it works > for me. > > > > Thanks, > > Tomas Volf > > > > -- > > There are only two hard things in Computer Science: > > cache invalidation, naming things and off-by-one errors. --00000000000007c729061f709b88 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In case it is relevant my disk is using GPT partition tabl= e with this layout:

$ lsblk --output=3D"NAME,MAJ:MIN,TYPE,MOUNT= POINTS,UUID"
NAME MAJ:MIN TYPE MOUNTPOINTS UUID
nvme0n= 1 259:0 disk
=E2=94=9C=E2=94=80nvme0n1p1 259:1 part /boot = 5190-E840
=E2=94=94=E2=94=80nvme0n1p2 259:2 part c= 0010d06-0bd1-4ae2-93e6-f2f89a3a670b
=E2=94=94=E2=94=80cryptroot 253:0 = crypt /gnu/store
/

Only the main pa= rtition is encrypted with LUKS and grub is located on
its own partition = not in the in between space in an MBR drive.

It is grub that is bein= g responsible for decrypting the partition
not my UEFI decrypting the wh= ole drive.

Tadhg

On Sun, Aug 11, 2024 at 6:33=E2=80=AFPM Tadhg Mc= Donald-Jensen <tadhgmister@gmai= l.com> wrote:
I have attached a config I just did `sudo guix system reconfigure`
and confirmed it was missing the `insmod luks` in /boot/grub/grub.cfg

Sorry for the delay,
Tadhg McD-J

On 2024-07-23 2:19 p.m., Tomas Volf wrote:
> On 2024-05-25 10:30:49 -0400, Tadhg McDonald-Jensen wrote:
>> That unfortunately doesn't fix the problem,
>> `luks-device-mapping-with-options` is a routine that returns the >> `mapped-device-kind` so it won't check by equality.
>>
>> A possible solution is to check whether the `mapped-device-kind-cl= ose`
>> routines are the same as these are shared.
>
> What I find interesting is that I too am using luks-device-mapping-wit= h-options
> and my system boots just fine.=C2=A0 So I wonder what the difference i= s.=C2=A0 Could you
> share your system configuration please?=C2=A0 Or at least the relevant= parts (I
> assume at least bootloader, file-systems and mapped-devices fields)? >
> I would like to properly understand the problem here and why it works = for me.
>
> Thanks,
> Tomas Volf
>
> --
> There are only two hard things in Computer Science:
> cache invalidation, naming things and off-by-one errors.
<= /div> --00000000000007c729061f709b88-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 04 15:50:29 2025 Received: (at 70826) by debbugs.gnu.org; 4 Apr 2025 19:50:29 +0000 Received: from localhost ([127.0.0.1]:40235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u0n3Y-0003m8-HE for submit@debbugs.gnu.org; Fri, 04 Apr 2025 15:50:28 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:46376) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <45mg.writes@gmail.com>) id 1u0n3V-0003kP-I5 for 70826@debbugs.gnu.org; Fri, 04 Apr 2025 15:50:23 -0400 Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-227b828de00so25366235ad.1 for <70826@debbugs.gnu.org>; Fri, 04 Apr 2025 12:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743796215; x=1744401015; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MZPz1DJOZbXueJn22XqnPFaS2PPVCHmmesXLf/P8w1U=; b=XuCgN/isuVXrQqv/zK63qUv+FKkQR9YJ0/NgplHRtKz2/17PiKEb6bKVB9nfB96NlM ZJ1Mt9bbu29gDEaMGrAMCkoNNGUWtbU/DJyE1kXhtnFTEaNHuP+LL7lBieG0Rlsh/AUC sIgj4fKFFv14hWmg2kqOCAuNgHwMault3ApRIR3TN/PGqZtA+pNLtjl4xDweyW7ozTT9 dgwt969hBehEENS9lX8cACNZFi5gugJYP7FGGvNRhepiBkHoRJ8+527tzG/LiVtZ/sCV IUH4y4Joa3F/1719JSwYScbz+XSnCrsZHG1/3rBaYq5up02zmR5Rk6EgUOdlEQTlfctx rUDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743796215; x=1744401015; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MZPz1DJOZbXueJn22XqnPFaS2PPVCHmmesXLf/P8w1U=; b=Z8PIkItswgCPlzTpbKw9GeDV4VNJ2dIW0gk8NBQrzqrZZUcXtWt2RpcoXb3eYZR/W1 0/JJZPKnOy5qSQBUFv7GOex/lVHgppLFLGLgpocF5VhMJvI82I6nln66PHWfIURWNQyk /ThjWYKxBQue5co4QYowpfDJiy5cKTAzdM4feoRQlAdD7kVjqKfmm5VWrKfImazK0fiY aWtJycCnJwANPjuPhBzJxMtwPbj5rgbF7RVpcJq5Y847iFup549JJaV3vXr5vGfRZppF qCOjFwLapEvOE+H7c7KbPwn90+M1/bL3ySdbNxLsZuCOx/qGmV9OQgWjGyXMqGcp8/Cc SRjQ== X-Gm-Message-State: AOJu0YyCiACOXLhp2iE2+sdTxNRw7iOZHv6e0Yv/0b1qlpwTRataU1mt Rf4bJmLMmqzCK3pozM15Q6bz1AcrJVnuiKA0waBl8LP2aODot6x3l+Yiz/z0 X-Gm-Gg: ASbGncteIu2Pg+vtLoqJPpMTTeQRWXuSuLgUTkaCHDE2zK4pVUOxreITUR3rM7+arWS YUcwchbrwN+gCchrm7WALImoTfn8FAdhogSjbjTRPU5/KV8IAhHGkEnFgBLwSeaySbd07yErPkw FmL1cWYMBTYveCfh5s3wUR/GNG10vq78oqgomggrWK8XDEdR+nCIhuGAf/werqdSmkR/FA1iQkd FDEf+EyZqORCTzax33qN4WP/cD5F7yAzb/YK9/J6a6m/3t2KCT8ipNzo1thdO013BpdG4xO65CB zHrY27anp/OryhlDtCMliKNlXXUcMzpUlXaHpE6qXtZt2yg037HAjsNUANIOnQ1nqI4= X-Google-Smtp-Source: AGHT+IFha5JLGQd/dQKHKXe+SCXfU+ocW1kN3gqoMeYdH4yFiRVGd5xt3YCFiwZuLznva1Xs0J/Weg== X-Received: by 2002:a17:902:cf0b:b0:220:ea90:191e with SMTP id d9443c01a7336-22a955141b4mr10943385ad.4.1743796214806; Fri, 04 Apr 2025 12:50:14 -0700 (PDT) Received: from localhost.localdomain (utm3.nitt.edu. [14.139.162.2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-229785c27b3sm36683595ad.97.2025.04.04.12.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 12:50:14 -0700 (PDT) From: 45mg <45mg.writes@gmail.com> To: 70826@debbugs.gnu.org Subject: [PATCH] system: Allow distinguishing s. Date: Sat, 5 Apr 2025 01:14:55 +0530 Message-ID: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , =?UTF-8?q?Ludovic=20Court=C3=A8s?= , 45mg <45mg.writes@gmail.com>, Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) We use records to represent the different types of mapped devices (LUKS, RAID, LVM). When variables are defined for these records, we can distinguish them with eq?; when they are created by procedures, like luks-device-mapping-with-options, this does not work. Therefore, add a 'name' field to to distinguish them. * gnu/system/mapped-devices.scm (): Add name field. (luks-device-mapping, raid-device-mapping, lvm-device-mapping): Initialize it with appropriate values for each of these types. * gnu/system.scm (operating-system-bootloader-crypto-devices): Use it to identify LUKS mapped devices. Change-Id: I4c85824f74316f07239374d9df6c007dd47a9d0c --- I've tested this on my system; in conjunction with [1], I can finally mount my LUKS volume with the no_read_workqueue and no_write_workqueue flags. [1] [bug#77499] [PATCH] mapped-devices/luks: Support extra options. https://issues.guix.gnu.org/77499 https://yhetil.org/guix/fb637872bd14abe305d810b9d32e0db290b26dd6.1743702237.git.45mg.writes@gmail.com/ gnu/system.scm | 6 ++++-- gnu/system/mapped-devices.scm | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 0d98e5a036..87247f06ee 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2024 Nicolas Graves +;;; Copyright © 2025 45mg <45mg.writes@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -676,8 +677,9 @@ (define operating-system-bootloader-crypto-devices "Return the sources of the LUKS mapped devices specified by UUID." ;; XXX: Device ordering is important, we trust the returned one. (let* ((luks-devices (filter (lambda (m) - (eq? luks-device-mapping - (mapped-device-type m))) + (eq? (mapped-device-kind-name + (mapped-device-type m)) + 'luks)) (operating-system-boot-mapped-devices os))) (uuid-crypto-devices non-uuid-crypto-devices (partition (compose uuid? mapped-device-source) diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index 667a495570..50626b8df9 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016 Andreas Enge ;;; Copyright © 2017, 2018 Mark H Weaver ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> +;;; Copyright © 2025 45mg <45mg.writes@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,6 +56,7 @@ (define-module (gnu system mapped-devices) mapped-device-kind mapped-device-kind? + mapped-device-kind-name mapped-device-kind-open mapped-device-kind-close mapped-device-kind-modules @@ -110,6 +112,7 @@ (define-deprecated (mapped-device-target md) (define-record-type* mapped-device-kind make-mapped-device-kind mapped-device-kind? + (name mapped-device-kind-name) (open mapped-device-kind-open) ;source target -> gexp (close mapped-device-kind-close ;source target -> gexp (default (const #~(const #f)))) @@ -283,6 +286,7 @@ (define* (check-luks-device md #:key (define luks-device-mapping ;; The type of LUKS mapped devices. (mapped-device-kind + (name 'luks) (open open-luks-device) (close close-luks-device) (check check-luks-device) @@ -338,6 +342,7 @@ (define (close-raid-device sources targets) (define raid-device-mapping ;; The type of RAID mapped devices. (mapped-device-kind + (name 'raid) (open open-raid-device) (close close-raid-device))) @@ -358,6 +363,7 @@ (define (close-lvm-device source targets) (define lvm-device-mapping (mapped-device-kind + (name 'lvm) (open open-lvm-device) (close close-lvm-device) (modules '((srfi srfi-1))))) base-commit: 0b754ceeded322e8079130e6793b0c68356967cf -- 2.49.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 10 16:34:29 2025 Received: (at 70826) by debbugs.gnu.org; 10 Apr 2025 20:34:29 +0000 Received: from localhost ([127.0.0.1]:47232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2ybU-0004MB-OC for submit@debbugs.gnu.org; Thu, 10 Apr 2025 16:34:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49008) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2ybQ-0004Ll-PG for 70826@debbugs.gnu.org; Thu, 10 Apr 2025 16:34:25 -0400 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 ) id 1u2ybK-0006h9-Lr; Thu, 10 Apr 2025 16:34:18 -0400 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=bDiBCLXNY7SyrIaH1/lwzanVk0T1vc48MPi5EZPktaY=; b=nq58pJTs8vW9kOBgIG9t vYUBuaxipwrTl0LhCG9P25Dg1Nd6aDZyj9K3LcU9y33Pt19rW+GYiTRmL0Bj2FLWCNojrZF59Z183 omHE97d9LspwFwcYtqxp6lhntNEKUN5yPwpVpE3ueUBfXC7xoSEFnQBJsINudR1hgVjBm0lfztFrY d8qkwdmVJVdWhyfDaQOwOUibjuHkuuZLhzxrebciXen8SwZeLVUetV8ffbLYaTj14QQ8UsmYEbLWv wZzjEmPpY4HSTrerJ4UdeVxho0kRpgIoWOliwn0khX2EmgvmxxpHVeR/yiIa/W69JoenWC/LPPMdx HCASmHo7oAw1yw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 45mg <45mg.writes@gmail.com> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> (45mg.writes@gmail.com's message of "Sat, 5 Apr 2025 01:14:55 +0530") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Primidi 21 Germinal an 233 de la =?utf-8?Q?R=C3=A9vo?= =?utf-8?Q?lution=2C?= jour du Gainier Date: Thu, 10 Apr 2025 21:18:30 +0200 Message-ID: <87jz7rsu49.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, 45mg <45mg.writes@gmail.com> skribis: > We use records to represent the different types of > mapped devices (LUKS, RAID, LVM). When variables are defined for these > records, we can distinguish them with eq?; when they are created by > procedures, like luks-device-mapping-with-options, this does not work. > Therefore, add a 'name' field to to distinguish > them. > > * gnu/system/mapped-devices.scm (): Add name field. > (luks-device-mapping, raid-device-mapping, lvm-device-mapping): > Initialize it with appropriate values for each of these types. > * gnu/system.scm (operating-system-bootloader-crypto-devices): Use it to > identify LUKS mapped devices. > > Change-Id: I4c85824f74316f07239374d9df6c007dd47a9d0c > --- > > I've tested this on my system; in conjunction with [1], I can finally mou= nt my > LUKS volume with the no_read_workqueue and no_write_workqueue flags. > > [1] [bug#77499] [PATCH] mapped-devices/luks: Support extra options. > https://issues.guix.gnu.org/77499 > https://yhetil.org/guix/fb637872bd14abe305d810b9d32e0db290b26dd6.17437022= 37.git.45mg.writes@gmail.com/ You can add a =E2=80=9CFixes=E2=80=9D line for the bug it fixes. > (let* ((luks-devices (filter (lambda (m) > - (eq? luks-device-mapping > - (mapped-device-type m))) > + (eq? (mapped-device-kind-name > + (mapped-device-type m)) > + 'luks)) [...] > (define-record-type* mapped-device-kind > make-mapped-device-kind > mapped-device-kind? > + (name mapped-device-kind-name) As a rule of thumb, I think comparing by identity (as was done before) is more robust and cleaner: that avoids the whole problem of this secondary name space where name clashes may occur involuntarily. But this problem the patch fixes was introduced by =E2=80=98luks-device-mapping-with-options=E2=80=99 I believe, which returns= a new device type. If we take a step back, I wonder if a better solution would not be to add an =E2=80=98arguments=E2=80=99 field to , following the = same pattern as . Here=E2=80=99s a preliminary patch to illustrate that: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 72da8e55d3..17c2e6f6bf 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -229,7 +229,8 @@ (define* (raw-initrd file-systems (targets (mapped-device-targets md)) (type (mapped-device-type md)) (open (mapped-device-kind-open type))) - (open source targets))) + (apply open source targets + (mapped-device-arguments md)))) mapped-devices)) (define file-system-scan-commands diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index 667a495570..29d0dc95cf 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -83,6 +83,8 @@ (define-record-type* %mapped-device (source mapped-device-source) ;string | list of strings (targets mapped-device-targets) ;list of strings (type mapped-device-type) ; + (arguments mapped-device-arguments ;list passed to open/close/check + (default '())) (location mapped-device-location (default (current-source-location)) (innate))) @@ -128,13 +130,16 @@ (define device-mapping-service-type 'device-mapping (match-lambda (($ source targets - ($ open close modules)) + ($ open close modules) + arguments) (shepherd-service (provision (list (symbol-append 'device-mapping- (string->symbol (string-join targets "-"))))) (requirement '(udev)) (documentation "Map a device node using Linux's device mapper.") - (start #~(lambda () #$(open source targets))) - (stop #~(lambda _ (not #$(close source targets)))) + (start #~(lambda () + #$(apply open source targets arguments))) + (stop #~(lambda _ + (not #$(apply close source targets arguments)))) (modules (append %default-modules modules)) (respawn? #f)))) (description "Map a device node using Linux's device mapper."))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 23eb215561..8a56f1cc63 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -680,9 +680,10 @@ (define (check-mapped-devices os) (mapped-device-type md)))) ;; We expect CHECK to raise an exception with a detailed ;; '&message' if something goes wrong. - (check md + (apply check md #:needed-for-boot? (needed-for-boot? md) - #:initrd-modules initrd-modules))) + #:initrd-modules initrd-modules + (mapped-device-arguments md)))) (operating-system-mapped-devices os))) (define (check-initrd-modules os) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpXRFlUPw0KDQpMdWRv4oCZLg0K --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 10 17:55:20 2025 Received: (at 70826) by debbugs.gnu.org; 10 Apr 2025 21:55:20 +0000 Received: from localhost ([127.0.0.1]:47387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2zrk-0008TO-8L for submit@debbugs.gnu.org; Thu, 10 Apr 2025 17:55:20 -0400 Received: from wolfsden.cz ([37.205.8.62]:36048) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1u2zrg-0008T9-Kj for 70826@debbugs.gnu.org; Thu, 10 Apr 2025 17:55:18 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id C7AFD29DC24; Thu, 10 Apr 2025 21:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1744322114; bh=YCDnCwwOxPJKchSDbqe3bTTqoWkg0qLAipOMM+jpSAk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MPvDsbo1WYYocy3tAJabZeK2UJbiNdQDfBNCHxBKDkXi/A7hfqa5jATWoXwKPZKWf Gbusx5GZkN6qMOzj7VjYAxaYcZRUgkq0OFpnnbl6yRbZGMKeOoGwc8PsDpCpe9F45N uOtvF0J6tgnjpPvVCSyE4XWUC+z7TzjzdYf6RUm9DnkIInXAfdM2A3KcHETEZ8dWQ3 ZEqsBzxPQ3w9Aj56mFLUyWCLpBfMOSbS8ZvMgG3S+S1FYMmZ+1sllT46mwQUbc6M/w Yz75T1uV1K2Wim+a+pddin5OO5+USPr4UHph2wAB5COtVuMq9kEl9REk+s/Qrindmm 2rPV0bT84HORD4P5TtIca1JiIxx+25OKO80dKsbJEqDc8tmMZaYeecuu8763JctkVN Q5ixDsFLTlGCiyriB8h8tYqTP7lTY96IUQRbtrSLnaWnbq2a3AA7oVt3DASn3z5IKo UxPwdwI7gLWEbQAnjbeBPoHSLRyhCU2vDRpY0qI95SmDI2TF/cQO9KaNgahNGH9Wt6 22ta01WRl+ixp4lPAEKDREZINdot7nG8GvLDVmCy92JYQXTN+P6GcgxQ+pjBpEyfkt 8++XJPwEdxqD+vq1vtEleRxLyve2AMipVhfL+VzGf/5Lvg3+tbDUNJgakma+LD1z8n Ae8kfIzdtuu/hKBLVT7M4bPo= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 3A69129DC23; Thu, 10 Apr 2025 21:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1744322114; bh=YCDnCwwOxPJKchSDbqe3bTTqoWkg0qLAipOMM+jpSAk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MPvDsbo1WYYocy3tAJabZeK2UJbiNdQDfBNCHxBKDkXi/A7hfqa5jATWoXwKPZKWf Gbusx5GZkN6qMOzj7VjYAxaYcZRUgkq0OFpnnbl6yRbZGMKeOoGwc8PsDpCpe9F45N uOtvF0J6tgnjpPvVCSyE4XWUC+z7TzjzdYf6RUm9DnkIInXAfdM2A3KcHETEZ8dWQ3 ZEqsBzxPQ3w9Aj56mFLUyWCLpBfMOSbS8ZvMgG3S+S1FYMmZ+1sllT46mwQUbc6M/w Yz75T1uV1K2Wim+a+pddin5OO5+USPr4UHph2wAB5COtVuMq9kEl9REk+s/Qrindmm 2rPV0bT84HORD4P5TtIca1JiIxx+25OKO80dKsbJEqDc8tmMZaYeecuu8763JctkVN Q5ixDsFLTlGCiyriB8h8tYqTP7lTY96IUQRbtrSLnaWnbq2a3AA7oVt3DASn3z5IKo UxPwdwI7gLWEbQAnjbeBPoHSLRyhCU2vDRpY0qI95SmDI2TF/cQO9KaNgahNGH9Wt6 22ta01WRl+ixp4lPAEKDREZINdot7nG8GvLDVmCy92JYQXTN+P6GcgxQ+pjBpEyfkt 8++XJPwEdxqD+vq1vtEleRxLyve2AMipVhfL+VzGf/5Lvg3+tbDUNJgakma+LD1z8n Ae8kfIzdtuu/hKBLVT7M4bPo= From: Tomas Volf <~@wolfsden.cz> To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <87jz7rsu49.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 10 Apr 2025 21:18:30 +0200") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> Date: Thu, 10 Apr 2025 23:55:13 +0200 Message-ID: <87ecxz65ry.fsf@wolfsden.cz> 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.0 (/) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , 45mg <45mg.writes@gmail.com>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ludovic Court=C3=A8s writes: > [..] >> (define-record-type* mapped-device-kind >> make-mapped-device-kind >> mapped-device-kind? >> + (name mapped-device-kind-name) > > As a rule of thumb, I think comparing by identity (as was done before) > is more robust and cleaner: that avoids the whole problem of this > secondary name space where name clashes may occur involuntarily. > > But this problem the patch fixes was introduced by > =E2=80=98luks-device-mapping-with-options=E2=80=99 I believe, which retur= ns a new device > type. > > If we take a step back, I wonder if a better solution would not be to > add an =E2=80=98arguments=E2=80=99 field to , following th= e same pattern > as . > > Here=E2=80=99s a preliminary patch to illustrate that: > > diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm > index 72da8e55d3..17c2e6f6bf 100644 > --- a/gnu/system/linux-initrd.scm > +++ b/gnu/system/linux-initrd.scm > @@ -229,7 +229,8 @@ (define* (raw-initrd file-systems > (targets (mapped-device-targets md)) > (type (mapped-device-type md)) > (open (mapped-device-kind-open type))) > - (open source targets))) > + (apply open source targets > + (mapped-device-arguments md)))) > mapped-devices)) >=20=20 > (define file-system-scan-commands > diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm > index 667a495570..29d0dc95cf 100644 > --- a/gnu/system/mapped-devices.scm > +++ b/gnu/system/mapped-devices.scm > @@ -83,6 +83,8 @@ (define-record-type* %mapped-device > (source mapped-device-source) ;string | list of stri= ngs > (targets mapped-device-targets) ;list of strings > (type mapped-device-type) ; > + (arguments mapped-device-arguments ;list passed to open/c= lose/check > + (default '())) I do not think it is a good idea to expect the same identical list for all of the operations, so we would need arguments-open, arguments-close and arguments-check fields. Other that that, this would work, sure. > (location mapped-device-location > (default (current-source-location)) (innate))) >=20=20 > @@ -128,13 +130,16 @@ (define device-mapping-service-type > 'device-mapping > (match-lambda > (($ source targets > - ($ open close modules)) > + ($ open close modules) > + arguments) > (shepherd-service > (provision (list (symbol-append 'device-mapping- (string->symbol = (string-join targets "-"))))) > (requirement '(udev)) > (documentation "Map a device node using Linux's device mapper.") > - (start #~(lambda () #$(open source targets))) > - (stop #~(lambda _ (not #$(close source targets)))) > + (start #~(lambda () > + #$(apply open source targets arguments))) > + (stop #~(lambda _ > + (not #$(apply close source targets arguments)))) > (modules (append %default-modules modules)) > (respawn? #f)))) > (description "Map a device node using Linux's device mapper."))) > diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm > index 23eb215561..8a56f1cc63 100644 > --- a/guix/scripts/system.scm > +++ b/guix/scripts/system.scm > @@ -680,9 +680,10 @@ (define (check-mapped-devices os) > (mapped-device-type md)))) > ;; We expect CHECK to raise an exception with a detailed > ;; '&message' if something goes wrong. > - (check md > + (apply check md > #:needed-for-boot? (needed-for-boot? md) > - #:initrd-modules initrd-modules))) > + #:initrd-modules initrd-modules > + (mapped-device-arguments md)))) > (operating-system-mapped-devices os))) >=20=20 > (define (check-initrd-modules os) > > > WDYT? Only thing I wonder about whether we should be apply-ing the list, or just passing it as a final arguments. That would be a change in the calling convention, but all procedures could just be adjusted to take the extra argument. One question would be how to handle if user passes the extra arguments to a procedure that is not prepared to handle them. In your approach (apply) it would be a error due to wrong number of arguments, I am not sure whether that is ideal. Maybe a warning would be better? Not sure. Opinions? Tomas --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 04:28:03 2025 Received: (at 70826) by debbugs.gnu.org; 11 Apr 2025 08:28:03 +0000 Received: from localhost ([127.0.0.1]:48589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u39k2-00029s-VF for submit@debbugs.gnu.org; Fri, 11 Apr 2025 04:28:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57030) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u39k0-00029E-78 for 70826@debbugs.gnu.org; Fri, 11 Apr 2025 04:28:00 -0400 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 ) id 1u39jt-0007iP-SQ; Fri, 11 Apr 2025 04:27:53 -0400 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=ihADwXU1zb22xephNY1u9hRlPo8D2HGNK+A1h4s66q8=; b=V1CEgY+JMLwosVpmAJrk jyrEVFE5BZA2gF7X3MuWCPKnGrxm3lkBGzWds79RQ904JHZRyWYUxuhnmyWO5TnH2k8YgSdAjz89y hyvBIibhaW4w6bLsZ1rjKm2kz0G6Z8KBdI6ii6n6cR/SsBOpOjGfHVqo71JkmLU0+0s4Qv859IP2V vI/aryAUQZEhZ2Dd+N+2V8pPs6klU56Di/MCbFbzg5otKzvSDV9mHibjBRO1oAjF6L78rzomeuxDT E06AWYLlXBZ66nn9Ib+y8rjA4NCMKclDuaSzijiFAwQvoL6lJqKzeMLSmO/eZyRQXMdW99+fP7RHP 1uqqtd/hKJkpFw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Tomas Volf <~@wolfsden.cz> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <87ecxz65ry.fsf@wolfsden.cz> (Tomas Volf's message of "Thu, 10 Apr 2025 23:55:13 +0200") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <87ecxz65ry.fsf@wolfsden.cz> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Duodi 22 Germinal an 233 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de la Romaine Date: Fri, 11 Apr 2025 10:27:50 +0200 Message-ID: <87jz7rp0ft.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , 45mg <45mg.writes@gmail.com>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Tomas Volf <~@wolfsden.cz> skribis: > Ludovic Court=C3=A8s writes: [...] >> +++ b/gnu/system/mapped-devices.scm >> @@ -83,6 +83,8 @@ (define-record-type* %mapped-device >> (source mapped-device-source) ;string | list of str= ings >> (targets mapped-device-targets) ;list of strings >> (type mapped-device-type) ; >> + (arguments mapped-device-arguments ;list passed to open/= close/check >> + (default '())) > > I do not think it is a good idea to expect the same identical list for > all of the operations, so we would need arguments-open, arguments-close > and arguments-check fields. Other that that, this would work, sure. Yeah I wondered about that but I thought that in the worst case the operations could just ignore those arguments; from the user=E2=80=99s viewp= oint, that would keep the interface simple. > Only thing I wonder about whether we should be apply-ing the list, or > just passing it as a final arguments. That would be a change in the > calling convention, but all procedures could just be adjusted to take > the extra argument. It=E2=80=99s a backward-compatible change in the calling convention (nothing changes for existing open/close/check methods that accept no keyword arguments). > One question would be how to handle if user passes the extra arguments > to a procedure that is not prepared to handle them. In your approach > (apply) it would be a error due to wrong number of arguments, I am not > sure whether that is ideal. Maybe a warning would be better? Not sure. > Opinions? Yes, you=E2=80=99d get a wrong-type-arg error, similar to what you have if = you pass #:random-number 42 in the =E2=80=98arguments=E2=80=99 field of a packa= ge. It=E2=80=99s not ideal in terms of error reporting, but maybe good enough. Another option would be for instance to always pass a key/value pair; open/close/check methods would have to look up in that list for relevant keys and could provide better error reporting, but the downside is extra boilerplate in those methods. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon May 05 10:47:38 2025 Received: (at 70826) by debbugs.gnu.org; 5 May 2025 14:47:38 +0000 Received: from localhost ([127.0.0.1]:41455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBx6X-00038h-UT for submit@debbugs.gnu.org; Mon, 05 May 2025 10:47:38 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:60669) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uBx6T-00038O-Jw for 70826@debbugs.gnu.org; Mon, 05 May 2025 10:47:35 -0400 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7c5675dec99so529273185a.0 for <70826@debbugs.gnu.org>; Mon, 05 May 2025 07:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746456447; x=1747061247; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8SuhpzTKb/kMKuQAQsGYK4jB8vVAXASas1qtZl3fGVk=; b=W5ZXG89cDlRCrMBhFwW36Z4ro3S9PHG+uUW+OOtwQN46asWcWijRi9ZfgHcOtl5inB DAP+IET1NJ30VIxTgLCzJDmVr9O8o+8pZKEin56wSKdYLy5bvJHWrMg9SdEPPpnFqggq UfEbutFV83YAS+xeOvcWtMngoC8s0dNPLelklfn/Q0TDtSPLUJjhPSjHrdgpM4gRktIz MZ4Y+tdhxAN0PGy6DcJ/HLRKnGZJfHfESgcEz1B/Zplcu1VP3inr3WjijFPDKNvl0xkp Oieu2HyWnW2aZkplxtpbu/h5UjUwYNov3kviJB/Z750e30asbLdNssNfYoxvsJPJuML6 VGig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746456447; x=1747061247; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8SuhpzTKb/kMKuQAQsGYK4jB8vVAXASas1qtZl3fGVk=; b=P86/efeMupIWxjte/b98OTuZrt0Dz56LN6QnpjNfIbiszRKwYH5hdoZVdxPv5SGKPp CY2XoHmxXZwOZgEHtWjfUH70mEvDwMu7EAJYaZwGFSfZCRzjvazzixJFAIijmEyycGGz dBqybp24fyxTkXS/5mZ3TrZmZl6cegnjHjDK6MNt842WMvuLuNY20hZEvSF85zMVWg1f i7Ak2lSfLPIxNsZLr9aY1jW0HdHjkLU91YEEVLArAqJxnsgp7XcuKpkVlJ7cfaYshcYY NvsThpaWGQcK2fE/0BFTuYPo1jTGRzGP/TwgwkZF2FTJJvdb0rlFxNScjb8M5wwRmshX Q6tw== X-Forwarded-Encrypted: i=1; AJvYcCUT9VFAqOtWA309hyBlViZbquwVzhmO+ZYy3agI27L1ja/FlyrJYi1U4I2E6Ff2tUe9C3muUQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyFKdATHYmV9EymU7BbcPl86GBHv3XQ8526ew9o+SlvppA0gCw6 p0Bgnpv9I9EB3mRiscS1p4eDwWG/R/oM6sMHC2TWqZKAYX4/xBRg X-Gm-Gg: ASbGncvLmiw9s7LHBcvJp2hmwQ2/9QNfK9IddI2DQoCC4uNu2IkMcVz9Gfl5rsn1M8F 7MnmlZ8m0Lwa+ebAJtaNIIf3Acbo99Oo3uFwm4DD9FeJ3xZNTwN0vJTiZ6qFRqeLwe2fvwLqHiS upvIjsrVGAUjgyrjts0kQv/YhC7klr1ZdvmADnsx2NJTjqUbaqQF13/qtJ/XHm0E0iGwKTavdTT gR2mRypymEfzpleyeEoez1WZORDuNEkUpABK8ARe9evO9XdGMCjKvuQP+Q+sL4BovOiP2Wg8oGr w/FNq5JfE0rAGaqGMsVUGYswerVOKVbnxkqvJ0GPlDrC X-Google-Smtp-Source: AGHT+IFjaFGOMaSOGo4F/xiF7vHY6hCwT1arHZHvwly74IZPu0ElA4emPUr1BzV3a4gxGs0DuXb0zQ== X-Received: by 2002:a05:620a:6017:b0:7c5:43b4:fa97 with SMTP id af79cd13be357-7cae3b0d426mr1261276585a.53.1746456447432; Mon, 05 May 2025 07:47:27 -0700 (PDT) Received: from [192.168.2.11] ([70.50.103.66]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7cad24416b6sm569110085a.106.2025.05.05.07.47.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 May 2025 07:47:26 -0700 (PDT) Message-ID: Date: Mon, 5 May 2025 10:47:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] system: Allow distinguishing s. To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz> References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <87ecxz65ry.fsf@wolfsden.cz> <87jz7rp0ft.fsf@gnu.org> Content-Language: en-US From: Tadhg McDonald-Jensen In-Reply-To: <87jz7rp0ft.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: 45mg <45mg.writes@gmail.com>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I figured out what is going on, When the boot partition (the one with grub.cfg) is encrypted the command to decrypt it gets baked into the grub executable by `grub-install`. When the boot partition is not encrypted (such as when the unencrypted partitition is mounted to /boot) then grub determines it doesn't need a decryption command to load the grub.cfg and relies on the decrypt command being in the config to load the rest of the system. Thus the default install process that has /boot part of the encrypted drive and mounts the efi partition to /boot/efi will be able to use `luks-device-mapping-with-options` without issue where as my setup with the grub.cfg being in the unencrypted drive runs into the issue I initially described. I can write up a system test to reproduce my setup that causes this to be an issue if that'd be helpful. Tadhg On 2025-04-11 4:27 a.m., Ludovic Courtès wrote: > Hello, > > Tomas Volf <~@wolfsden.cz> skribis: > >> Ludovic Courtès writes: > [...] > >>> +++ b/gnu/system/mapped-devices.scm >>> @@ -83,6 +83,8 @@ (define-record-type* %mapped-device >>> (source mapped-device-source) ;string | list of strings >>> (targets mapped-device-targets) ;list of strings >>> (type mapped-device-type) ; >>> + (arguments mapped-device-arguments ;list passed to open/close/check >>> + (default '())) >> I do not think it is a good idea to expect the same identical list for >> all of the operations, so we would need arguments-open, arguments-close >> and arguments-check fields. Other that that, this would work, sure. > Yeah I wondered about that but I thought that in the worst case the > operations could just ignore those arguments; from the user’s viewpoint, > that would keep the interface simple. > >> Only thing I wonder about whether we should be apply-ing the list, or >> just passing it as a final arguments. That would be a change in the >> calling convention, but all procedures could just be adjusted to take >> the extra argument. > It’s a backward-compatible change in the calling convention (nothing > changes for existing open/close/check methods that accept no keyword > arguments). > >> One question would be how to handle if user passes the extra arguments >> to a procedure that is not prepared to handle them. In your approach >> (apply) it would be a error due to wrong number of arguments, I am not >> sure whether that is ideal. Maybe a warning would be better? Not sure. >> Opinions? > Yes, you’d get a wrong-type-arg error, similar to what you have if you > pass #:random-number 42 in the ‘arguments’ field of a package. > > It’s not ideal in terms of error reporting, but maybe good enough. > > Another option would be for instance to always pass a key/value pair; > open/close/check methods would have to look up in that list for relevant > keys and could provide better error reporting, but the downside is extra > boilerplate in those methods. > > Ludo’. From debbugs-submit-bounces@debbugs.gnu.org Tue May 06 05:27:22 2025 Received: (at 70826) by debbugs.gnu.org; 6 May 2025 09:27:22 +0000 Received: from localhost ([127.0.0.1]:51482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCEa9-0002uX-8g for submit@debbugs.gnu.org; Tue, 06 May 2025 05:27:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51120) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uCEa5-0002tr-IM for 70826@debbugs.gnu.org; Tue, 06 May 2025 05:27:18 -0400 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 ) id 1uCEZz-0003oV-Cs; Tue, 06 May 2025 05:27:11 -0400 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=gZXmXjaSrshdK1ZTNc7J7hvP5/5yNWN2HIGCRcZ0Qic=; b=kGaU2I/MHcwUmQL7Zt3j IidzxC8eYiSmEpa3UevP/6MlmOHff76GJPSRdy/3Vtl2UZ1ETMNShVPuj3Dhowlp2lvIHkLew5Up4 VLLmnXaWT+sVOfNAuI2t/67KrACkp9qsBJcDL15zLVlLWCg3HP1WKOwEbQ3104+6oZ4KmpF+/roOx zvt0e/66C/3tWmlYhXBw32uFLkxdEX2FfBXQdLZu8WG58Gn77RqlhP5NKurCokVriHphIFhyEX72n QEh43pkvoP8zC+ohyN4oqyIdMZB6gWye4IVLqNv141ihTSZ4Bqrc1BIVFIB5TZ6yMI4Grsw71zzYL 7bduedfIb3kvQQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 45mg <45mg.writes@gmail.com> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <87jz7rsu49.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 10 Apr 2025 21:18:30 +0200") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Septidi 17 =?utf-8?Q?Flor=C3=A9al?= an 233 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Pimprenelle Date: Tue, 06 May 2025 11:26:12 +0200 Message-ID: <874ixyxf7v.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi 45mg, Did you have a chance to look into the proposed change below? Thanks, Ludo=E2=80=99. Ludovic Court=C3=A8s writes: > Hi, > > 45mg <45mg.writes@gmail.com> skribis: > >> We use records to represent the different types of >> mapped devices (LUKS, RAID, LVM). When variables are defined for these >> records, we can distinguish them with eq?; when they are created by >> procedures, like luks-device-mapping-with-options, this does not work. >> Therefore, add a 'name' field to to distinguish >> them. >> >> * gnu/system/mapped-devices.scm (): Add name field. >> (luks-device-mapping, raid-device-mapping, lvm-device-mapping): >> Initialize it with appropriate values for each of these types. >> * gnu/system.scm (operating-system-bootloader-crypto-devices): Use it to >> identify LUKS mapped devices. >> >> Change-Id: I4c85824f74316f07239374d9df6c007dd47a9d0c >> --- >> >> I've tested this on my system; in conjunction with [1], I can finally mo= unt my >> LUKS volume with the no_read_workqueue and no_write_workqueue flags. >> >> [1] [bug#77499] [PATCH] mapped-devices/luks: Support extra options. >> https://issues.guix.gnu.org/77499 >> https://yhetil.org/guix/fb637872bd14abe305d810b9d32e0db290b26dd6.1743702= 237.git.45mg.writes@gmail.com/ > > You can add a =E2=80=9CFixes=E2=80=9D line for the bug it fixes. > >> (let* ((luks-devices (filter (lambda (m) >> - (eq? luks-device-mapping >> - (mapped-device-type m))) >> + (eq? (mapped-device-kind-name >> + (mapped-device-type m)) >> + 'luks)) > > [...] > >> (define-record-type* mapped-device-kind >> make-mapped-device-kind >> mapped-device-kind? >> + (name mapped-device-kind-name) > > As a rule of thumb, I think comparing by identity (as was done before) > is more robust and cleaner: that avoids the whole problem of this > secondary name space where name clashes may occur involuntarily. > > But this problem the patch fixes was introduced by > =E2=80=98luks-device-mapping-with-options=E2=80=99 I believe, which retur= ns a new device > type. > > If we take a step back, I wonder if a better solution would not be to > add an =E2=80=98arguments=E2=80=99 field to , following th= e same pattern > as . > > Here=E2=80=99s a preliminary patch to illustrate that: > > diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm > index 72da8e55d3..17c2e6f6bf 100644 > --- a/gnu/system/linux-initrd.scm > +++ b/gnu/system/linux-initrd.scm > @@ -229,7 +229,8 @@ (define* (raw-initrd file-systems > (targets (mapped-device-targets md)) > (type (mapped-device-type md)) > (open (mapped-device-kind-open type))) > - (open source targets))) > + (apply open source targets > + (mapped-device-arguments md)))) > mapped-devices)) >=20=20 > (define file-system-scan-commands > diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm > index 667a495570..29d0dc95cf 100644 > --- a/gnu/system/mapped-devices.scm > +++ b/gnu/system/mapped-devices.scm > @@ -83,6 +83,8 @@ (define-record-type* %mapped-device > (source mapped-device-source) ;string | list of stri= ngs > (targets mapped-device-targets) ;list of strings > (type mapped-device-type) ; > + (arguments mapped-device-arguments ;list passed to open/c= lose/check > + (default '())) > (location mapped-device-location > (default (current-source-location)) (innate))) >=20=20 > @@ -128,13 +130,16 @@ (define device-mapping-service-type > 'device-mapping > (match-lambda > (($ source targets > - ($ open close modules)) > + ($ open close modules) > + arguments) > (shepherd-service > (provision (list (symbol-append 'device-mapping- (string->symbol = (string-join targets "-"))))) > (requirement '(udev)) > (documentation "Map a device node using Linux's device mapper.") > - (start #~(lambda () #$(open source targets))) > - (stop #~(lambda _ (not #$(close source targets)))) > + (start #~(lambda () > + #$(apply open source targets arguments))) > + (stop #~(lambda _ > + (not #$(apply close source targets arguments)))) > (modules (append %default-modules modules)) > (respawn? #f)))) > (description "Map a device node using Linux's device mapper."))) > diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm > index 23eb215561..8a56f1cc63 100644 > --- a/guix/scripts/system.scm > +++ b/guix/scripts/system.scm > @@ -680,9 +680,10 @@ (define (check-mapped-devices os) > (mapped-device-type md)))) > ;; We expect CHECK to raise an exception with a detailed > ;; '&message' if something goes wrong. > - (check md > + (apply check md > #:needed-for-boot? (needed-for-boot? md) > - #:initrd-modules initrd-modules))) > + #:initrd-modules initrd-modules > + (mapped-device-arguments md)))) > (operating-system-mapped-devices os))) >=20=20 > (define (check-initrd-modules os) > > > WDYT? > > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri May 09 03:56:24 2025 Received: (at 70826) by debbugs.gnu.org; 9 May 2025 07:56:24 +0000 Received: from localhost ([127.0.0.1]:35111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDIal-0003FW-Lk for submit@debbugs.gnu.org; Fri, 09 May 2025 03:56:23 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:52275) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <45mg.writes@gmail.com>) id 1uDIaj-0003FC-1i for 70826@debbugs.gnu.org; Fri, 09 May 2025 03:56:21 -0400 Received: by mail-pf1-x442.google.com with SMTP id d2e1a72fcca58-74068f95d9fso1863370b3a.0 for <70826@debbugs.gnu.org>; Fri, 09 May 2025 00:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746777374; x=1747382174; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PUudm9g6Lz525nX3KpAKbqoqsxYfG1rohSodzoDWAY4=; b=nhYm65B6f/v6Y5mNGn8bWm3e+AGEeTicqU/P2aFZ5adfp2P14IUAtWGNJ2jnC3nMHK s4d8f6sppGeFJ6gs6rLLCZ/1iJxbpUWsZcqhi8lbhsK925CEtTSmQ8tq9xiYOyiGF5mY P1B4cSUJEIri6zjoMTvydJTq5FCLnhhN3Xqux9oF4q5hAENLFBg9cNFSd18DNwjFtQUo kN+Gpub2AcWK5IgwrWQaTy6mx+Lmz/t10BJMtSCu3CuXIdn0DvOjTUOFjWvT3g/IJohv zrC4NtKB2SY+lPOmLCxkrclbCrEWEI8pOdISJPawpf9UyYXuL494sVorYrCaRbWghx9/ bZ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746777374; x=1747382174; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PUudm9g6Lz525nX3KpAKbqoqsxYfG1rohSodzoDWAY4=; b=EItCN6x+DxmO0jNvvG907TcGpemRdN7Z6kVbhR1DaE27GjUvxC/9BdGfh/aa4dOFYW T15SamNZULF13SqULWCiwKGj/xZ7/TlJP3Hv2FT1h9iLsi0yr0M7YqyKFG6siIQCzoi6 czf0gVXH1e0uYM+VEJoQaHhg2sW1THeGZ0yfJ0ADgPLOZMJj1UN2gaYP5+iLyn89Ojxy Ciq2iY9k1j1caQKDh6sfPaGvoDHG8jg5nnCiwkl+sE+j9mg0NO9zhjC2VEvg8fRs+SDL 1Ov1O8dDRYHL1ddDpTeWUmNKUZHZf0FQQz4UGsP+XYYvUv6bEiGt9QgElilAOBYLQjbM 4Yow== X-Gm-Message-State: AOJu0Yx9RFbcm4LwMqZvFbz6K8QWZTbAjM6WrGTccmNnj71qU86saVd3 IeClE+DGE0N2ffiSgbt0+1RUHtTg2JNFnCM94ZADn1gxPYtgfjA8 X-Gm-Gg: ASbGncuBZsKrKegkBOOKnO0a0uTBxe8FcoYHI6jGrdWDx6xVybCS7m52dLfkvqoP3cB aP78nZjpWEF7E0mOt1N7fmZJoW2rs6DY7z93DYzesBPRnybRFjuLNAk8Nigq4aPBXV4YiHZbE6l 3nutkeXDI5fu/YbE4HMWso51q+FRT/hVosivPdNSkDpqHk7D7fHISX0KDI7WB2lMKS3StSY0w8a diu5FOMeNUw32J99fnh5uVdh7lP4R6kkG+3qo0jsaraGpHWR57TJtWcmCZ+lVeT6X+hpocSfX/S 3RfP733iHsZnFH29Ox+PmEKTEnDq8B70PM8Isvk= X-Google-Smtp-Source: AGHT+IGt64zc/TNsMZip+DshEyRxB0EhS9B327ZBydJ6fsB/4l1HTs1vhtbVf6z1RBz+xcYdCF/Q8Q== X-Received: by 2002:a05:6a00:1ad2:b0:72d:3b2e:fef9 with SMTP id d2e1a72fcca58-7423c0600ddmr3556169b3a.20.1746777374339; Fri, 09 May 2025 00:56:14 -0700 (PDT) Received: from guix1 ([2401:4900:1f25:32ab:dd3d:6851:78d5:3e9f]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74237736e38sm1223728b3a.60.2025.05.09.00.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 May 2025 00:56:13 -0700 (PDT) From: 45mg <45mg.writes@gmail.com> To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 45mg <45mg.writes@gmail.com> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <874ixyxf7v.fsf@gnu.org> References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <874ixyxf7v.fsf@gnu.org> Date: Fri, 09 May 2025 07:56:04 +0000 Message-ID: <87msbm2p63.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s writes: > Hi 45mg, > > Did you have a chance to look into the proposed change below? > > Thanks, > Ludo=E2=80=99. Sorry for the delay, I've been quite busy lately. If I understand correctly, your proposal would make luks-device-mapping-with-options obsolete, so users would have to change from this: --8<---------------cut here---------------start------------->8--- (mapped-device (source "/dev/sdb1") (target "data") (type (luks-device-mapping-with-options #:allow-discards? #t))) --8<---------------cut here---------------end--------------->8--- to this: --8<---------------cut here---------------start------------->8--- (mapped-device (source "/dev/sdb1") (target "data") (type luks-device-mapping) (arguments (list #:allow-discards? #t))) --8<---------------cut here---------------end--------------->8--- Is that correct? Just trying to make sure I understand your idea. Regarding different arguments for open, close and check methods - I think it's fine to have a single keyword argument list like above, and then, like you suggested, have the methods only respect the keywords that are relevant to them (use `#:allow-other-keys #:rest keys` in the define* form). Like you said, this would lead to extra boilerplate (though we could reduce this by writing a procedure to inspect `keys` for a given keyword), but I think it would be more robust. At any rate, I should be able to work on this within two weeks at most; feel free to ping me if I don't send a v2 by then. From debbugs-submit-bounces@debbugs.gnu.org Fri May 09 04:52:18 2025 Received: (at 70826) by debbugs.gnu.org; 9 May 2025 08:52:18 +0000 Received: from localhost ([127.0.0.1]:35380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDJSr-0006HX-QG for submit@debbugs.gnu.org; Fri, 09 May 2025 04:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49838) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDJSp-0006H7-60 for 70826@debbugs.gnu.org; Fri, 09 May 2025 04:52:15 -0400 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 ) id 1uDJSi-0006wQ-RE; Fri, 09 May 2025 04:52:08 -0400 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=RnXLR7zWD1AIUbefE8GYXqv6T5gvEXpRHK7NM9dF9OQ=; b=qhKCZ5vCorepEPT9b96q /f4Xh5zTIhKtfrrdDAt/DjhSawF5Jt0MxpFG8viKPmJ8ferCj69WCb3+8Qq78zr9By7Qw31bUHxns Sk/OdjPp9/0n4JYENmNAYBr5TbFDgG4avelMhlWRsEoqstcYTZPiD8PYuaCDFEww9FLkUuOsO3Mio qUWi8AkdCZRFNgVFFvGnEH5FJEVOi+vNQq1XOKnaU+WEeSaWnnk0l3XrSq3XodSZAY+9CCwONh5ki WFFumJwQvNNSXYgIuHf7VjOC7Iqq+QoVknVpPjeT/8gjUNnjpdIFys0rQaZrP2vhCnYTxqGV3uvzL 0JeB+9kIyW2/9w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 45mg <45mg.writes@gmail.com> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <87msbm2p63.fsf@gmail.com> (45mg.writes@gmail.com's message of "Fri, 09 May 2025 07:56:04 +0000") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <874ixyxf7v.fsf@gnu.org> <87msbm2p63.fsf@gmail.com> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 20 =?utf-8?Q?Flor=C3=A9al?= an 233 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Sarcloir Date: Fri, 09 May 2025 10:38:51 +0200 Message-ID: <878qn6nppg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, 45mg <45mg.writes@gmail.com> writes: > Sorry for the delay, I've been quite busy lately. No worries. > If I understand correctly, your proposal would make > luks-device-mapping-with-options obsolete, so users would have to change > from this: > > --8<---------------cut here---------------start------------->8--- > (mapped-device > (source "/dev/sdb1") > (target "data") > (type (luks-device-mapping-with-options > #:allow-discards? #t))) > --8<---------------cut here---------------end--------------->8--- > > to this: > > --8<---------------cut here---------------start------------->8--- > (mapped-device > (source "/dev/sdb1") > (target "data") > (type luks-device-mapping) > (arguments (list #:allow-discards? #t))) > --8<---------------cut here---------------end--------------->8--- > > Is that correct? Just trying to make sure I understand your idea. Yes. But we can keep =E2=80=98luks-device-mapping-with-options=E2=80=99 fo= r a while and mark it as deprecated. > At any rate, I should be able to work on this within two weeks at most; > feel free to ping me if I don't send a v2 by then. Excellent. Feel free to start from the patch I sent. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 15 02:58:22 2025 Received: (at 70826) by debbugs.gnu.org; 15 Jun 2025 06:58:23 +0000 Received: from localhost ([127.0.0.1]:52945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uQhJu-0005Ql-4k for submit@debbugs.gnu.org; Sun, 15 Jun 2025 02:58:22 -0400 Received: from layka.disroot.org ([178.21.23.139]:36328) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uQfJl-0007Zx-J9 for 70826@debbugs.gnu.org; Sun, 15 Jun 2025 00:50:07 -0400 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2774A26025 for <70826@debbugs.gnu.org>; Sun, 15 Jun 2025 06:50:04 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hJNC1TyDelZ3 for <70826@debbugs.gnu.org>; Sun, 15 Jun 2025 06:50:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1749963003; bh=pN4i1rN6PQl3JVdtCzMBH4QU4IliQ2SWodUJwqlcqQA=; h=From:To:Subject:Date; b=A9ACow1XiC8B4wSA8MVMuj8TWqeXYvu96PmnqnotmEsA/l8p1/EUvEaF1oFa+1chW cicNSG5k8T3fkd/G6lQy7lwndto8SnqpzOsAiQV4dAdWxfCchfE3w25akjA8roLPa1 +5lDTwTNOIwDn8+jymQEjEh2iMxbaxLSwTYO9rY6/yWiliQm2PVe9bagWlmfU5yW7v uMLZ2wF3N5xjhjC4YWD+9PFRzJ7EcAkPpyj5gQk9obKT7ryP9H0WCDSqsznFnY0CIU 7f7EQvdNDfKNAGBAuWmJfzOSc1fz8adEJrTWnJGUasygpKxpI7jq9BgrCekkHn57p/ Um/d00WwvGSnw== From: Quentin Vincent To: 70826@debbugs.gnu.org Subject: luks-device-mapping-with-options breaks bootloader Date: Sun, 15 Jun 2025 06:50:02 +0200 Message-ID: <87jz5dtxqd.fsf@myguixvm.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 X-Mailman-Approved-At: Sun, 15 Jun 2025 02:58:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi, I independently ran into and fixed this issue myself, but seeing Ludo's patch, I'll probably run with that. @Ludo: I tested your patch on my setup (inside a VM); it needed a few small fixups (an export was missing and the (apply ...) wasn't working for some reason), but other than that it worked for me. I was able to add a #:key-file parameter to my LUKS device with your patch. You just need to apply my fixup on top of your patch. Cheers, Quentin --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-system-Make-arguments-for-mapped-device-type-s-work.patch >From 4d507479467c6721f911e5776b4bf6b5709b9846 Mon Sep 17 00:00:00 2001 From: Quentin Vincent Date: Sat, 14 Jun 2025 13:20:22 +0200 Subject: [PATCH] system: Make arguments for s work Change-Id: Ia5e14d0eb516cb20bee00a270cb3446bfdfabf90 --- gnu/system/linux-initrd.scm | 12 ++++++------ gnu/system/mapped-devices.scm | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 17c2e6f6bf..0484c899fa 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -225,12 +225,12 @@ (define* (raw-initrd file-systems (define device-mapping-commands ;; List of gexps to open the mapped devices. (map (lambda (md) - (let* ((source (mapped-device-source md)) - (targets (mapped-device-targets md)) - (type (mapped-device-type md)) - (open (mapped-device-kind-open type))) - (apply open source targets - (mapped-device-arguments md)))) + (let* ((source (mapped-device-source md)) + (targets (mapped-device-targets md)) + (type (mapped-device-type md)) + (open (mapped-device-kind-open type)) + (arguments (mapped-device-arguments md))) + (apply open source targets arguments))) mapped-devices)) (define file-system-scan-commands diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index 29d0dc95cf..f8ec178ba8 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -51,6 +51,7 @@ (define-module (gnu system mapped-devices) mapped-device-target mapped-device-targets mapped-device-type + mapped-device-arguments mapped-device-location mapped-device-kind -- 2.49.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 06 11:04:53 2025 Received: (at 70826) by debbugs.gnu.org; 6 Jul 2025 15:04:53 +0000 Received: from localhost ([127.0.0.1]:56031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uYQvB-0002Bh-BZ for submit@debbugs.gnu.org; Sun, 06 Jul 2025 11:04:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38110) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uYQv6-0002AK-Pn for 70826@debbugs.gnu.org; Sun, 06 Jul 2025 11:04:45 -0400 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 ) id 1uYQv0-0004w0-DE; Sun, 06 Jul 2025 11:04:38 -0400 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=B20lhlZvDdRoxuosx+tDKm54w/oQr+K3uWI7I2GMmng=; b=rh8aESztSU/v0uqWjJjz 2TdeuyNqQ2RQHhYkxCEJ4BuoWvmhshO31v9zNtL0ZrTbKbgi9kRTdg6MdhAPvqHaNWRtNZuasMMNt 6Y3wtoTIFcjTsZMi6ZYQ3FylmAhD8ZpYEJWLUdjCobBpTWMj99h5OS5ZfmX/6AxHunQIrcCXVPVzG vLzxLEth+0KG88QAqEU4xU5EQbA4fj/SRm2Qca3RVIq74LQ+Rbs2pfukWw5cJh9cTiTvkP8C3Kug6 mhbWGgO/2tJR+HZ4bG/CZ91q6WsVVogjTFAzSIvvEzV86NC/ljbxZb2bGb/EOCr3km/3aF/8uvWRx zzh0OfMggDZOBA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 45mg <45mg.writes@gmail.com> Subject: Re: [PATCH] system: Allow distinguishing s. In-Reply-To: <878qn6nppg.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 09 May 2025 10:38:51 +0200") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <874ixyxf7v.fsf@gnu.org> <87msbm2p63.fsf@gmail.com> <878qn6nppg.fsf@gnu.org> User-Agent: mu4e 1.12.11; emacs 30.1 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Octidi 18 Messidor an 233 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la Gesse Date: Sun, 06 Jul 2025 17:04:29 +0200 Message-ID: <87ms9hnywy.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70826 Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello 45mg and all, I polished the patch I had sent in this thread: https://codeberg.org/guix/guix/pulls/1048 As usual, feedback welcome! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 19:23:15 2025 Received: (at 70826-done) by debbugs.gnu.org; 17 Jul 2025 23:23:15 +0000 Received: from localhost ([127.0.0.1]:57922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucXwZ-0007b1-0j for submit@debbugs.gnu.org; Thu, 17 Jul 2025 19:23:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45450) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucXwW-0007ad-5o for 70826-done@debbugs.gnu.org; Thu, 17 Jul 2025 19:23:12 -0400 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 ) id 1ucXwP-0004OX-M3; Thu, 17 Jul 2025 19:23:05 -0400 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=KscwKxAhGL+zltvoPRsoOZL1bJ8/wNe1/5fccP1l+xw=; b=enBkGAmXZ4NvsdKUC6cy wZaJ64b1b7HKGEM7Hf0CYTjUZGVdt9YhVW+ND7DR4wI9wldtb6alCk3G9Psgbi39a0IIrt2ThRwKx l2xiFbHMGKlrrWhWqJWEji4okR5sg7Ycj1cx6R7w9sAttdlsLLsT5iUdYsuBO2DMP0gCk5oXyjP1n kAVfRQJLi/l5AwAYfMEFlS2EgQF+gpxGEDKBbByaUoxfcxnrTQskPoCK4QWgEMqN8guQcyMGVpsVv cwAvFFUEJs3ZTjk1IRx0wupPxU7NmX45tqI2rxzxYriNIJV7JCyI28IHE3EPKqCqcX1miZDjBqV+Y Db5d+9+XZJ7awQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 45mg <45mg.writes@gmail.com> Subject: Re: bug#70826: [PATCH] system: Allow distinguishing s. In-Reply-To: <87ms9hnywy.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 06 Jul 2025 17:04:29 +0200") References: <4e7d4ef33cc34ac5cb73a525d294d4b7f44f6989.1743795895.git.45mg.writes@gmail.com> <87jz7rsu49.fsf@gnu.org> <874ixyxf7v.fsf@gnu.org> <87msbm2p63.fsf@gmail.com> <878qn6nppg.fsf@gnu.org> <87ms9hnywy.fsf@gnu.org> Date: Fri, 18 Jul 2025 01:22:43 +0200 Message-ID: <87qzye9zcs.fsf@gnu.org> 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: -2.3 (--) X-Debbugs-Envelope-To: 70826-done Cc: Tadhg McDonald-Jensen , Tomas Volf <~@wolfsden.cz>, 70826-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ludovic Court=C3=A8s writes: > Hello 45mg and all, > > I polished the patch I had sent in this thread: > > https://codeberg.org/guix/guix/pulls/1048 Pushed as 14c8728f0d812ea2c396b3c0564fa8da1202f430. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:17:39 2025 Received: (at 70826) by debbugs.gnu.org; 9 Aug 2025 12:17:40 +0000 Received: from localhost ([127.0.0.1]:40580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukiW3-0001xo-4t for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:17:39 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:47150) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <45mg.writes@gmail.com>) id 1ukiVz-0001xT-D9; Sat, 09 Aug 2025 08:17:36 -0400 Received: by mail-pf1-x444.google.com with SMTP id d2e1a72fcca58-76bc61152d8so2721712b3a.2; Sat, 09 Aug 2025 05:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754741849; x=1755346649; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3H+f+9FA5DumENvLOte3rIStTpBwz6ht7xSrD1KThcg=; b=BQzET2gUm9Vt7CPkKcLwFoacjSZTJ0Ix+hNKdQ0VH/ObjzbM0ZUVwsccXWFr9D0BJi /G3JnkhHy8FrdG2bM9a5fFvor2oWyQQsltHR9+mrbG9j/lHmX8q+Zom/b/4F0WE732wD UehWAFdVtVd2t7ATyiQYTLM5eNWy5fqd5Ej3fH7NX65+asVYdA9s9u/5jGOEUuRSFaVV uxhCjMbPmANyHNqK9WPF8rKdJiqUOB72Mt/9QnCjz6mk61dS3BDE+8FHDaD+4RSltJQz GOjoh9NCGisgm1I1T55xnKIP/6IFT6bJjoqEezpP/KrkzaqdxxrbGZmgRIB0et08OILG pVCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754741849; x=1755346649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3H+f+9FA5DumENvLOte3rIStTpBwz6ht7xSrD1KThcg=; b=Hc0KihAwNfW7g8BuBWBogSwznaW0u4m88suGHP76FNmd7CbiVoXsphsOWzRCN19VRH TcSmpRx2WMa3vNKFddXYkHGnxrmWRYojI17LrhsQY2B4sG59WGO1JPmdJet18WfvOI4w hGMHAlP/gsh8wHRX8keYFAD7xCxMw9lQ38UJbTtjd3+nDaB9P9rJuGtUQHTiAjwOKIBE irCH4sf1Kx6VIGk2r0wh98KkjYx3/ETLcwJl2WosdWWwCV2y8y66swh2mojTgHotIL82 LOAoAFBWrksCtXtAJoEZtuOohizH5r3h2SOjYqZe9g/WJmWuIPUCebGCI9YgnGonf2lY 3EJw== X-Forwarded-Encrypted: i=1; AJvYcCXFNNPuTK/jNIi78OiSGOFKuxpyC3OF72wA+Nc5JjwUATyZ53Iu8XlFGLaCIx2/7uqkDr5m6Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwTnDVmmZkIk1wvWg7IiTbpg3/3g4B47FXw3vvAarFakdT4D5RU seUPwIHVE6BNjZ2Q/p1t/GhPmZnbNtnZ17+UaPgPBPgIFB25SZuott6v/9SXGbg2 X-Gm-Gg: ASbGncukdkEEzdxhpcoza/Feordc6MqpNAc9j/tXDnI+09npCzItOSKV2GDpdtisl8K x8WSBUSFK3LGvmQRqT8mD40LFNx0qTGlfK07h2DhFV/Q7PeDD05ljj8+70IqFn77CEBaGQ/IHS1 FqRkXuebvK9/FO8vzdZFNHc7nweGgkD/ckRe7PLSXW5sYMmBjDQg+T3aHNjGAoo2MCwPjg1gK8Q HEwrUGwu8N+6GnNv5xvhslHehU1Apwnp+7ijCoH5PXyZkxLLa2nXraISXwngs+sQ07OsvADesr/ iGCnDfxMjiNORPw25BFSH9ocSlGOy7xz4R116qfaFHhf8Q1HRAAHOcy0lDoDx8sgSMwAFx6IVNz E6/71XsePh9x3ig== X-Google-Smtp-Source: AGHT+IEpcc+6H5DWF3pZLTF/4dxCsgoAlgznQsp8DpevWPuoAYY18XmwCm9T4Qxh75RX5NJ6Zzqrtg== X-Received: by 2002:a05:6a00:4fca:b0:76b:d93a:69e2 with SMTP id d2e1a72fcca58-76c46193b5amr9934868b3a.19.1754741848893; Sat, 09 Aug 2025 05:17:28 -0700 (PDT) Received: from guix1 ([103.28.247.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bf148333dsm17114294b3a.100.2025.08.09.05.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 05:17:28 -0700 (PDT) From: 45mg <45mg.writes@gmail.com> To: 70826@debbugs.gnu.org, 45mg <45mg.writes@gmail.com> Subject: [PATCH] mapped-devices/luks: Support extra options. Date: Sat, 9 Aug 2025 17:40:33 +0530 Message-ID: <85a028e86a47aec2ce943b1a81904d2916627893.1754741432.git.45mg.writes@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <87selvcbb8.fsf@gmail.com> References: <87selvcbb8.fsf@gmail.com> MIME-Version: 1.0 X-Debbugs-Cc: Gabriel Wicki , Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70826 Cc: , soeren@soeren-tempel.net, Tadhg McDonald-Jensen , =?UTF-8?q?Ludovic=20Court=C3=A8s?= , 77499@debbugs.gnu.org, Sisiutl , Hilton Chain , gmail.com, Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Allow passing extra options to the 'cryptsetup open' command. * gnu/system/mapped-devices.scm (open-luks-device) [#:extra-options]: New argument. * doc/guix.texi (Mapped Devices): Document it. * gnu/tests/install.scm (%test-encrypted-root-extra-options-os): New test for it, as well as the previously untested #:allow-discards? option. (%encrypted-root-extra-options-os): New os declaration for the test. Change-Id: Ia9fd129d1c66cbf27abdd3064d59188083465247 --- Took into account Maxim's review. Also, luks-device-mapping-with-options is now deprecated [1], so instead use the 'arguments' field of luks-device-mapping. [1] https://codeberg.org/guix/guix/pulls/1048 doc/guix.texi | 21 +++++++++++ gnu/system/mapped-devices.scm | 19 ++++++---- gnu/tests/install.scm | 68 +++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index bffaeb5bbc..4bb4f50200 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18731,6 +18731,27 @@ Mapped Devices file system level operations visible on the physical device. For more information, refer to the description of the @code{--allow-discards} option in the @code{cryptsetup-open(8)} man page. + +@item #:extra-options +@code{extra-options} may be used to specify a list of additional +command-line options for the @code{cryptsetup open} command. See the +@code{cryptsetup-open(8)} man page for a list of supported options. + +For example, here is how you could specify the +@option{--perf-no_read_workqueue} and @option{--perf-no_write_workqueue} +options, along with @option{--allow-discards}: + +@lisp +(mapped-device +(source "/dev/sdb1") +(target "data") +(type (type luks-device-mapping) + (arguments '(#:allow-discards? #t + #:extra-options + ("--perf-no_read_workqueue" + "--perf-no_write_workqueue"))))) +@end lisp + @end table @end defvar diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index b0a6beef28..034956c616 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -200,10 +200,12 @@ (define (check-device-initrd-modules device linux-modules location) ;;; Common device mappings. ;;; -(define* (open-luks-device source targets #:key key-file allow-discards?) +(define* (open-luks-device source targets + #:key key-file allow-discards? extra-options) "Return a gexp that maps SOURCE to TARGET as a LUKS device, using 'cryptsetup'. When ALLOW-DISCARDS? is true, the use of discard (TRIM) -requests is allowed for the underlying device." +requests is allowed for the underlying device. EXTRA-OPTIONS is a list of +additional options to be passed to the 'cryptsetup open' command." (with-imported-modules (source-module-closure '((gnu build file-systems) (guix build utils))) ;; For mkdir-p @@ -244,10 +246,15 @@ (define* (open-luks-device source targets #:key key-file allow-discards?) (let ((cryptsetup #$(file-append cryptsetup-static "/sbin/cryptsetup")) (cryptsetup-flags (cons* - "open" "--type" "luks" partition #$target - (if #$allow-discards? - '("--allow-discards") - '())))) + "open" "--type" "luks" + (append + (if #$allow-discards? + '("--allow-discards") + '()) + (if (pair? '#$extra-options) + '#$extra-options + '()) + (list partition #$target))))) ;; We want to fallback to the password unlock if the keyfile ;; fails. (or (and keyfile diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index ec31cf2bdf..c6715484cf 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -68,6 +68,7 @@ (define-module (gnu tests install) %test-separate-home-os %test-raid-root-os %test-encrypted-root-os + %test-encrypted-root-extra-options-os %test-encrypted-home-os %test-encrypted-home-os-key-file %test-encrypted-root-not-boot-os @@ -843,6 +844,73 @@ (define %test-encrypted-root-os (run-basic-test %encrypted-root-os command "encrypted-root-os" #:initialization enter-luks-passphrase))))) + +;;; +;;; LUKS-encrypted root with extra options: --allow-discards, +;;; --perf-no_read_workqueue and --perf-no_write_workqueue +;;; + +;; Except for the 'mapped-devices' field, this is exactly the same as +;; %encrypted-root-os. +(define-os-with-source (%encrypted-root-extra-options-os + %encrypted-root-extra-options-os-source) + ;; The OS we want to install. + (use-modules (gnu) (gnu tests) (srfi srfi-1)) + + (operating-system + (host-name "liberigilo") + (timezone "Europe/Paris") + (locale "en_US.UTF-8") + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets '("/dev/vdb")))) + + ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt + ;; detection logic in 'enter-luks-passphrase'. + + (mapped-devices (list (mapped-device + (source (uuid "12345678-1234-1234-1234-123456789abc")) + (target "the-root-device") + (type luks-device-mapping) + (arguments '(#:allow-discards? #t + #:extra-options + ("--perf-no_read_workqueue" + "--perf-no_write_workqueue")))))) + (file-systems (cons (file-system + (device "/dev/mapper/the-root-device") + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (users (cons (user-account + (name "charlie") + (group "users") + (supplementary-groups '("wheel" "audio" "video"))) + %base-user-accounts)) + (services (cons (service marionette-service-type + (marionette-configuration + (imported-modules '((gnu services herd) + (guix combinators))))) + %base-services)))) + +(define %test-encrypted-root-extra-options-os + (system-test + (name "encrypted-root-extra-options-os") + (description + "Test basic functionality of an OS installed like one would do by hand, +with an LUKS-encrypted root partition opened with extra options +(--allow-discards, --perf-no_read_workqueue and --perf-no_write_workqueue). +This test is expensive in terms of CPU and storage usage since we need to +build (current-guix) and then store a couple of full system images.") + (value + (mlet* %store-monad ((images (run-install %encrypted-root-extra-options-os + %encrypted-root-extra-options-os-source + #:script + %encrypted-root-installation-script)) + (command (qemu-command* images))) + (run-basic-test %encrypted-root-os command "encrypted-root-extra-options-os" + #:initialization enter-luks-passphrase))))) + ;;; ;;; Separate /home on LVM base-commit: 0697809d64d525b5b9146a57f824641f6f9f81ca -- 2.50.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 21:26:59 2025 Received: (at 70826) by debbugs.gnu.org; 14 Aug 2025 01:26:59 +0000 Received: from localhost ([127.0.0.1]:59390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umMk6-000337-V0 for submit@debbugs.gnu.org; Wed, 13 Aug 2025 21:26:59 -0400 Received: from mailtransmit04.runbox.com ([2a0c:5a00:149::25]:48514) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umMjs-00032G-GR; Wed, 13 Aug 2025 21:26:46 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1umMjg-002C7s-RE; Thu, 14 Aug 2025 03:26:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=guixotic.coop; s=selector1; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From; bh=YRSRnCKfV6/xpqYSPktmnL1t6/yZkfzIMrmwE4ILEj4=; b=KoQR4dVyw5t4DagFPN8CvNYr/w Vp2tNNP5Xy9DhZAt6bTnK+epkQZJBDgMOu2hhx03mkA1KsvmsgRtSDN5N5ZIKMPO1W1HKOTi8s2Vh 5rsDCwiVZYiwvciXKCbSAAfkVFJvVZm0vRRcJMWecJ3JSuXEOgBeF0pFD3+ztudhKTWm+Q3pax6Wx PX6PIl7p10PcCla+Z2xtWKVc9C+TzwBQEnN3gUisS3k4MbHS8vALyRnzpQxFa3DICbtuxAtuhFH+4 SE3V8Xc1+rFFU7kCW0hSkgg/zq/ppELfBZTdNbfsNB/KC8gF0pT42NNe6x6Cn2D1vl2cSToZhWWyq UVzw06vg==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1umMjf-0007nm-Ub; Thu, 14 Aug 2025 03:26:32 +0200 Received: by submission01.runbox with esmtpsa [Authenticated ID (1476852)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1umMjX-00ElzD-2B; Thu, 14 Aug 2025 03:26:23 +0200 From: Maxim Cournoyer To: 45mg <45mg.writes@gmail.com> Subject: Re: [bug#77499] [PATCH] mapped-devices/luks: Support extra options. In-Reply-To: <85a028e86a47aec2ce943b1a81904d2916627893.1754741432.git.45mg.writes@gmail.com> Organization: Guixotic References: <87selvcbb8.fsf@gmail.com> <85a028e86a47aec2ce943b1a81904d2916627893.1754741432.git.45mg.writes@gmail.com> Date: Thu, 14 Aug 2025 10:26:15 +0900 Message-ID: <87cy8ypubs.fsf@guixotic.coop> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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: Hi, 45mg <45mg.writes@gmail.com> writes: > Allow passing extra options to the 'cryptsetup open' command. > > * gnu/system/mapped-devices.scm (open-luks-device) > [#:extra-options]: New argument. > * doc/guix.texi (Mapped Devices): Document i [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a0c:5a00:149:0:0:0:0:25 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: 70826 Cc: Gabriel Wicki , soeren@soeren-tempel.net, Tadhg McDonald-Jensen , Ludovic =?utf-8?Q?Court=C3=A8s?= , 77499@debbugs.gnu.org, gmail.com@debbugs.gnu.org, Sisiutl , 70826@debbugs.gnu.org, Hilton Chain , Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.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: Hi, 45mg <45mg.writes@gmail.com> writes: > Allow passing extra options to the 'cryptsetup open' command. > > * gnu/system/mapped-devices.scm (open-luks-device) > [#:extra-options]: New argument. > * doc/guix.texi (Mapped Devices): Document i [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a0c:5a00:149:0:0:0:0:25 listed in] [list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi, 45mg <45mg.writes@gmail.com> writes: > Allow passing extra options to the 'cryptsetup open' command. > > * gnu/system/mapped-devices.scm (open-luks-device) > [#:extra-options]: New argument. > * doc/guix.texi (Mapped Devices): Document it. > * gnu/tests/install.scm (%test-encrypted-root-extra-options-os): New > test for it, as well as the previously untested #:allow-discards? > option. > (%encrypted-root-extra-options-os): New os declaration for the test. > > Change-Id: Ia9fd129d1c66cbf27abdd3064d59188083465247 > --- > > Took into account Maxim's review. Also, luks-device-mapping-with-options is > now deprecated [1], so instead use the 'arguments' field of > luks-device-mapping. > > [1] https://codeberg.org/guix/guix/pulls/1048 > > doc/guix.texi | 21 +++++++++++ > gnu/system/mapped-devices.scm | 19 ++++++---- > gnu/tests/install.scm | 68 +++++++++++++++++++++++++++++++++++ > 3 files changed, 102 insertions(+), 6 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index bffaeb5bbc..4bb4f50200 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -18731,6 +18731,27 @@ Mapped Devices > file system level operations visible on the physical device. For more > information, refer to the description of the @code{--allow-discards} > option in the @code{cryptsetup-open(8)} man page. > + > +@item #:extra-options > +@code{extra-options} may be used to specify a list of additional > +command-line options for the @code{cryptsetup open} command. See the > +@code{cryptsetup-open(8)} man page for a list of supported options. > + > +For example, here is how you could specify the > +@option{--perf-no_read_workqueue} and @option{--perf-no_write_workqueue} > +options, along with @option{--allow-discards}: > + > +@lisp > +(mapped-device > +(source "/dev/sdb1") > +(target "data") > +(type (type luks-device-mapping) > + (arguments '(#:allow-discards? #t > + #:extra-options > + ("--perf-no_read_workqueue" > + "--perf-no_write_workqueue"))))) > +@end lisp > + > @end table > @end defvar > > diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm > index b0a6beef28..034956c616 100644 > --- a/gnu/system/mapped-devices.scm > +++ b/gnu/system/mapped-devices.scm > @@ -200,10 +200,12 @@ (define (check-device-initrd-modules device linux-modules location) > ;;; Common device mappings. > ;;; > > -(define* (open-luks-device source targets #:key key-file allow-discards?) > +(define* (open-luks-device source targets > + #:key key-file allow-discards? extra-options) I guess it'd be nicer if the default was '() for extra-options, then you don't need to check its value later (unless if you want to validate the inputs). > "Return a gexp that maps SOURCE to TARGET as a LUKS device, using > 'cryptsetup'. When ALLOW-DISCARDS? is true, the use of discard (TRIM) > -requests is allowed for the underlying device." > +requests is allowed for the underlying device. EXTRA-OPTIONS is a list of > +additional options to be passed to the 'cryptsetup open' command." > (with-imported-modules (source-module-closure > '((gnu build file-systems) > (guix build utils))) ;; For mkdir-p > @@ -244,10 +246,15 @@ (define* (open-luks-device source targets #:key key-file allow-discards?) > (let ((cryptsetup #$(file-append cryptsetup-static > "/sbin/cryptsetup")) > (cryptsetup-flags (cons* > - "open" "--type" "luks" partition #$target > - (if #$allow-discards? > - '("--allow-discards") > - '())))) > + "open" "--type" "luks" > + (append > + (if #$allow-discards? > + '("--allow-discards") > + '()) > + (if (pair? '#$extra-options) > + '#$extra-options > + '()) Then the if can be removed, else turned into some input validation like: --8<---------------cut here---------------start------------->8--- (unless (pair? '#$extra-options) (error "invalid value for #:extra-options argument of `open-luks-device'")) --8<---------------cut here---------------end--------------->8--- I haven't reviewed where this gets used (I assume in the early boot); perhaps it could be possible to use (guix diagnostics) as well if it's already imported there to produce a nicer error message. Could you send a revised version doing the above? -- Thanks, Maxim