From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aDXxL/LIkmFtbgEAgWs5BA (envelope-from ) for ; Mon, 15 Nov 2021 21:54:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gG2CK/LIkmFNEQAAbx9fmQ (envelope-from ) for ; Mon, 15 Nov 2021 20:54:10 +0000 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 C27B91500B for ; Mon, 15 Nov 2021 21:54:09 +0100 (CET) Received: from localhost ([::1]:36138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmizO-0004td-Vv for larch@yhetil.org; Mon, 15 Nov 2021 15:54:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmizK-0004so-Je for guix-patches@gnu.org; Mon, 15 Nov 2021 15:54:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmizK-0006QM-Be for guix-patches@gnu.org; Mon, 15 Nov 2021 15:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmizK-0000pb-9d for guix-patches@gnu.org; Mon, 15 Nov 2021 15:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51514] [PATCH v2 1/3] gnu: system: Add LUKS2 support for the root file system. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 20:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51514 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , 51514@debbugs.gnu.org Received: via spool by 51514-submit@debbugs.gnu.org id=B51514.16370096363164 (code B ref 51514); Mon, 15 Nov 2021 20:54:02 +0000 Received: (at 51514) by debbugs.gnu.org; 15 Nov 2021 20:53:56 +0000 Received: from localhost ([127.0.0.1]:56311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmizA-0000ol-3o for submit@debbugs.gnu.org; Mon, 15 Nov 2021 15:53:56 -0500 Received: from jpoiret.xyz ([206.189.101.64]:36636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmiz7-0000oZ-Fp for 51514@debbugs.gnu.org; Mon, 15 Nov 2021 15:53:50 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 79BE5184F5F; Mon, 15 Nov 2021 20:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1637009628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgRXqcT8Ad8glOqczTOLb8TMfpdfYL55jruUiZdNPXk=; b=IqUbWupvBCKlC33SH71OQY0oQhP4DUgM4mgmh9ix2QkvILQqAVa7jNPAopF7Cr7gAy+Kcz gBNTWrDCfs2PBMzSfJ4iotXyqt9UUPl0vw3uJBhzcu7EDodW9+q9iKL/5A9zTTc+G5ACFy CvlJYBjgPiBjxVOg7J4gAWhDbCL09hc6fdoktipMLk3WqE6T1qkDDpZn39GzL08Ik84jm+ G2Wo1cQVVZqrmS1iV6Kq/ifYPHWycUxMnvRpuBLxMG5TBKIA7GxS+xf7KfdjLeS6lcwAce Gesq6bXEoN90o3pnn+vHWKQxlRbL+C/DIh564zMKypYS3QvrTTjkzzhtfQybPA== Date: Mon, 15 Nov 2021 20:53:39 +0000 Message-Id: <20211115205341.9724-2-dev@jpoiret.xyz> In-Reply-To: <20211115205341.9724-1-dev@jpoiret.xyz> References: <87h7chdmzh.fsf_-_@gnu.org> <20211115205341.9724-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637009650; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=DgRXqcT8Ad8glOqczTOLb8TMfpdfYL55jruUiZdNPXk=; b=IfXILWt6NUqIUGWD4MSLhfGlSM5CP0XjxeNHho8v/QvMNICWDuoY+4QFniqgvvEi+vj0I2 7cgPbTWcMxBUeQnwv3Q8C0tmRwRuN8fJ83XK/0CqKquZpcoz5gD7anh9MHIO56s0rphTLB F/rWn035rM+vZ0tQ6IuaBMqcxmWusVk9pGZVq+ZwTLiWLrCHl00zjvXr7EL9iR5KEXliRm 3Lsq33mHKY7uAeIgBRRX5X5HJXNP0y/CwYZfzIHv9Lud+b/Ok7JHPwwg4c/PxEtLMJzKEW ETlGWhNHU/5KcfNT5nvkCXc8b1OqK8cIThoQBR9KwTSKiKSasTut/afiFhSSyg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637009650; a=rsa-sha256; cv=none; b=ath1CQfq4KaU3tTwKmKF1JrYt3G6cfzFFfxArngwZI+hHyXcRplLGt06vmt9U8CcmkQLTc jlTqZcm0t1zShYpMRJ4qXh9EYwILVvR4NybjgdbB1k6Q/X07tVWrGLiQV/p6DXphcSyFCY x1nIFscSqTITizNClCzqlFs4J6nYGYzk+2Uv/5s8j3IT4vrnz5iZLlQwuqoHtGelgJQf6u QyCWxnI3sHm3OHiFdp3IV9r1UVH7Od9PjStl6/MsPK8hwvMISPNtQ1M7oJvR2uJhVeb4oA 9UWx0URy/MLRfXTSEcSNhj0iCJsuJmsI9hwbW0zPky6BbHmTQws8Tt1YFVXTiQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=IqUbWupv; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=IqUbWupv; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C27B91500B X-Spam-Score: 0.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: ue85zDRzaIN9 * gnu/bootloader/grub.scm (grub-configuration-file): Add 'insmod luks2'. * gnu/system/mapped-devices.scm (open-luks-device): Create '/run/cryptsetup/' directory. --- gnu/bootloader/grub.scm | 3 +-- gnu/system/mapped-devices.scm | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index d8e888ff40..42f71aa4db 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -415,8 +415,7 @@ (define (crypto-device->cryptomount dev) ;; Other type of devices aren't implemented. #~())) (let ((devices (map crypto-device->cryptomount store-crypto-devices)) - ;; XXX: Add luks2 when grub 2.06 is packaged. - (modules #~(format port "insmod luks~%"))) + (modules #~(format port "insmod luks~%insmod luks2~%"))) (if (null? devices) devices (cons modules devices)))) diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index 518dbc4fe8..96a381d5fe 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -192,7 +192,8 @@ (define (open-luks-device source targets) "Return a gexp that maps SOURCE to TARGET as a LUKS device, using 'cryptsetup'." (with-imported-modules (source-module-closure - '((gnu build file-systems))) + '((gnu build file-systems) + (guix build utils))) ;; For mkdir-p (match targets ((target) #~(let ((source #$(if (uuid? source) @@ -201,7 +202,12 @@ (define (open-luks-device source targets) ;; XXX: 'use-modules' should be at the top level. (use-modules (rnrs bytevectors) ;bytevector? ((gnu build file-systems) - #:select (find-partition-by-luks-uuid))) + #:select (find-partition-by-luks-uuid)) + ((guix build utils) #:select (mkdir-p))) + + ;; Create '/run/cryptsetup/' if it does not exist, as device locking + ;; is mandatory for LUKS2. + (mkdir-p "/run/cryptsetup/") ;; Use 'cryptsetup-static', not 'cryptsetup', to avoid pulling the ;; whole world inside the initrd (for when we're in an initrd). -- 2.33.1