From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4J8CANCXlGJZ/QAAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 12:09:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AMQJANCXlGIH3wAA9RJhRA (envelope-from ) for ; Mon, 30 May 2022 12:09:20 +0200 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 801EB47E0C for ; Mon, 30 May 2022 12:09:19 +0200 (CEST) Received: from localhost ([::1]:60170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvcKs-0001Da-LL for larch@yhetil.org; Mon, 30 May 2022 06:09:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvcKc-0001D4-KZ for bug-guix@gnu.org; Mon, 30 May 2022 06:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvcKb-00010N-Vn for bug-guix@gnu.org; Mon, 30 May 2022 06:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nvcKb-0007U2-Oa for bug-guix@gnu.org; Mon, 30 May 2022 06:09:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55723: Full disk encryption with grub-efi and LUKS2 Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 30 May 2022 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55723 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 55723@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165390528828678 (code B ref -1); Mon, 30 May 2022 10:09:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 May 2022 10:08:08 +0000 Received: from localhost ([127.0.0.1]:42814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvcJk-0007ST-9L for submit@debbugs.gnu.org; Mon, 30 May 2022 06:08:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:39402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvcJf-0007SJ-Ju for submit@debbugs.gnu.org; Mon, 30 May 2022 06:08:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvcJf-0001AX-Fa for bug-guix@gnu.org; Mon, 30 May 2022 06:08:03 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:49710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1nvcJc-0000uU-Hp for bug-guix@gnu.org; Mon, 30 May 2022 06:08:02 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4LBWLY1yHyz9sWx for ; Mon, 30 May 2022 12:07:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1653905269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJSMLbjsscUK1VGPn93bHTXRjDjVjy55YfzCSsG0EXo=; b=AcufqX8Eq9YqmY0WYAFshC49EXpKkIZQoEj8xziLt4PTuGxtSEp/3b/Hz+HX2EzBD60f8g inlLeKH6k7+5sI+GNhAwXoVMcvNPrF8iGnUai0qID6pHVX6GpdZZjWb019amLJrslPGFeu 5s/9piQwgiu9NG8JF/K//e1pnwlXp1lbvA3NWZXdChks4IcJmPXgIJ1XgxJZEuYHmnfyVX W6Ch3gqBaMGDHu9w45H4tvhKzUbB1PDD8TlMpjQIk0zBXJ0ZtK9Vvqr1fP+N5yfQzfO8U0 8x43/hk4C1BT5IsWiFXusDC7wZh24j29F+wh9MYvVD/WQIWDeJ36KueMEmxKAw== Date: Mon, 30 May 2022 12:07:47 +0200 From: Lars-Dominik Braun Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=80.241.56.171; envelope-from=lars@6xq.net; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653905359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=FJSMLbjsscUK1VGPn93bHTXRjDjVjy55YfzCSsG0EXo=; b=DB450jiUuQWEQu4RccqTENxvzA+AMI0FHWJpjcil2Jj14KeVcsOdPfC2CufOux3BYNrNil zX+OGPsJaCRlUbBuZlvuNwjC0ACopOoYgYVrFGUEpNnQBCpLYl1uxXOze6NNqSGYiRXHo+ snNhyAodBZiuwocDGhfNp1JfEz+OUs1jO24w6kLyZ2HxVvtnWcyC8B9FRcYy0XsOA6WsA7 Fl98Hz0lGaW3m6R+geYG4Y5A8i6IuBLnDFwMtI7vexJiNMzC2ZK5GOniJLr/X0DQeAyxiQ 08HfslIypHXwd4BtdbCf8A7Egdmmk4ziGE4KwW4m/XfEUmUyu0RJGCJ9Z/05mg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653905359; a=rsa-sha256; cv=none; b=d1JxDJwQXHV55JnxnHxvRWKiRoCdaSHyq08ZtfVZxPxOaRAmDNF+35RHtAZd93jXWDILyX nTBAj6SsKyUK3ruxzY6oaUtXvA3niHCd45FhgMExi0twOt3rtJSyPoHHWh2CDZocHiIbR1 hVPvr4RSTkCdGQ4mbSIFMg36APBgohbiPehzco2Yh/Z2bXWtjQKrYBU2N9iO/wIUJxyDiy Be64/ZP5LoOOikYhrk34vr91N62/dbSuV9peZTRqo+eWokORf/lH3tbSq764Ui97XwXFGM iTAqR5i3IGZT+pLKvFnNq90+eUanXrHlnNF2AD/PqYXPEpUCEulf+sxVR96LoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=AcufqX8E; dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none); 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" X-Migadu-Spam-Score: 5.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=AcufqX8E; dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none); 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" X-Migadu-Queue-Id: 801EB47E0C X-Spam-Score: 5.67 X-Migadu-Scanner: scn1.migadu.com X-TUID: ziIqUPjiOaIm Hi, I followed the manual to manually install Guix with full disk encryption using LUKS2 and PBKDF2. However this leaves me with an unbootable system, stuck at Grub’s rescue prompt, because `grub-install` apparently does not know how to detect a LUKS2 target and therefore does not include the modules required to open the encrypted volume in the EFI image. See [1]. I managed to manually create a core.img with the help of ArchLinux’ Wiki[2] (see also [3]), boot into the system and reconfigure with a modified bootloader: ---snip--- (define install-grub-efi-mkimage "Create an Grub EFI image with included cryptomount support for luks2, which grub-install does not handle yet." #~(lambda (bootloader efi-dir mount-point) (when efi-dir (let ((grub-mkimage (string-append bootloader "/bin/grub-mkimage")) ;; Required modules, YMMV. (modules (list "luks2" "part_gpt" "cryptodisk" "gcry_rijndael" "pbkdf2" "gcry_sha256" "ext2")) (prefix (string-append mount-point "/boot/grub")) ;; Different configuration required to set up a crypto ;; device. Change crypto_uuid to match your output of ;; `cryptsetup luksUUID /device`. ;; XXX: Maybe cryptomount -a could work? (config #$(plain-file "grub.cfg" "set crypto_uuid=755e547f78f44dc38dab58399e1780a6 cryptomount -u $crypto_uuid set root=crypto0 set prefix=($root)/boot/grub insmod normal normal")) (target-esp (if (file-exists? (string-append mount-point efi-dir)) (string-append mount-point efi-dir) efi-dir))) (apply invoke (append (list grub-mkimage "-p" prefix "-O" "x86_64-efi" "-c" config "-o" (string-append target-esp "/EFI/Guix/grubx64.efi")) modules)))))) (define grub-efi-bootloader-luks2 (bootloader (inherit grub-efi-bootloader) (name 'grub-efi-luks2) (installer install-grub-efi-mkimage))) ---snap--- Supposedly there are also patches for grub-mkimage, but maybe we can include a workaround like the above by default until then or remove the section about LUKS2 entirely? Cheers, Lars [1] https://logs.guix.gnu.org/guix/2022-05-27.log#111808 [2] https://wiki.archlinux.org/title/GRUB#LUKS2 [3] https://wiki.archlinux.org/title/GRUB/Tips_and_tricks#Manual_configuration_of_core_image_for_early_boot