From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id mFqnBqb2UWYstAAAA41jLg (envelope-from ) for ; Sat, 25 May 2024 16:33:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 8PUkO6X2UWYOmgAA62LTzQ (envelope-from ) for ; Sat, 25 May 2024 16:33:10 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=hs7A0pR9; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716647589; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dv6c8I+OXdTRpembvDk/THVUkfNzrvEs1iYPafr5IOQ=; b=izZSRZ06mgtwFn909ZvNcNJK8RsePGrC251dmOpbsSdNZKL+Xa7VX7KZJaJYYl1CX6pj2a sNyGImjpTk2Z+SJMm38+xaEvvP79FNM+c3NgYY6A++k+RL8EwdBIPqFUNg2xYSoI3XyMEf S4P3xN6Qb63XPpktxn7Qf08INUKUm3RqLyd9FA8+bgCGdZxQHWqbM7WsNwL3XXxUvbwXTv k/db8P/kUhrTQtpbctmsifXXkFUVkivSss+o87c4jFySDG2YW8n7L5e2sJXtFQXxN0svGf kMldt84NsCXV0h5486AC2ork+PGwi7HYAVmB7alONT9ztFjuxdi3U/xKFTZ23Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=hs7A0pR9; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716647589; a=rsa-sha256; cv=none; b=bE0NAt6hR2HNn5JEcdwG2AJpLk/lznZL7d63pgaylpwip3X7wagWve+Gr7L33ieeyhoDWE 4mNdt07lAlThVW22KdPxu91S+WDmLO4stX/fGGLSN7ujbVYT6TYHULL55z5RfmsdwvEwGu JiKGaBZq2V9g4p7nXhPrO4yZPMa7EaooXJc2XpI7cGBi4x5OrJcC6OPIzwZSM+wxLCKw6Q S8jBA7cCOQRfsex4zpZujcI1Z+Tib8EfhlfYi+5S93Vt8FMTYxqezx3aXAB1GjGapHcepY Yg2pDrVHz9EKQHmOU5XgtOO7ON7cKa1FgWQrzb9m4B/5h5S5LJ8CIBkqQBpenA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 96F9778CE9 for ; Sat, 25 May 2024 16:33:09 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAsS8-0007Kq-I0; Sat, 25 May 2024 10:32:56 -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 1sAsS6-0007Ke-Vj for bug-guix@gnu.org; Sat, 25 May 2024 10:32:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAsS6-00075G-Ni for bug-guix@gnu.org; Sat, 25 May 2024 10:32:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAsSE-0001WJ-8T for bug-guix@gnu.org; Sat, 25 May 2024 10:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#70826: luks-device-mapping-with-options breaks bootloader Resent-From: Tadhg McDonald-Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 25 May 2024 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70826 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 70826@debbugs.gnu.org Received: via spool by 70826-submit@debbugs.gnu.org id=B70826.17166475285711 (code B ref 70826); Sat, 25 May 2024 14:33:02 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 2.65 X-Migadu-Queue-Id: 96F9778CE9 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 2.65 X-TUID: owosbXF86klz 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’.