From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mvNOB-0003O7-BY for mharc-grub-devel@gnu.org; Thu, 09 Dec 2021 12:39:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvNO9-0003Lk-Fu for grub-devel@gnu.org; Thu, 09 Dec 2021 12:39:25 -0500 Received: from jpoiret.xyz ([206.189.101.64]:51834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvNO6-0005Ib-4X for grub-devel@gnu.org; Thu, 09 Dec 2021 12:39:25 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 7202C184F2D; Thu, 9 Dec 2021 17:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1639071558; 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; bh=DVff8EHSQxrtm2vycnzwKW3kzYvx9dHPpD19pxR9ymM=; b=iUmchH7RwylKKUuJ0ARXKlXaz9ZGpnTvmXgpWDjreM57CzB14508b6IMzbaXWDY+agmevX 41Jkjp4p9LHukNdxkZKwICORb90ZevfdqTP/cT3AmOX3+O+7hGH8UnQgD/UUwq9wTTJnGE JKhK7T7LOivizao1Wn7iqQLHbEj30cmO0owGmkPqfEoxr2FHi5Mg6NRqUi3iR/BqLw5nyQ YLtr1ksqGAChzP3+fxthAh+0/C0Muvzv7BO3wKr5AGJBqzbnZMqdug8CyhU4x4WuMQL5pX Z9Ph4WsXs8sVFOsUwxWU7ptEYtAbRu8qSjzoBSW6XFERB2TDbASSfLCscTuyTw== From: Josselin Poiret To: grub-devel@gnu.org Cc: Josselin Poiret Subject: [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe Date: Thu, 9 Dec 2021 18:38:51 +0100 Message-Id: <20211209173853.30489-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ++++ Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz Received-SPF: pass client-ip=206.189.101.64; envelope-from=dev@jpoiret.xyz; helo=jpoiret.xyz X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.498, FROM_SUSPICIOUS_NTLD_FP=0.001, PDS_OTHER_BAD_TLD=1.861, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2021 17:39:25 -0000 Hello, These two draft patches make devmapper set up LUKS2 cryptomount properties when pulling, as well as report LUKS2 cryptomounts as having GRUB_DEV_ABSTRACTION_LUKS. This makes grub-probe and grub-install behave properly wrt. LUKS2 drives: `grub-probe -t abstraction /` reports all the needed modules for the GRUB image, and grub-install leads to a working GRUB without manually adding modules. One small part that I am unsure about, although I have tested it and it does seem to work properly: if I understand correctly, all dm devices have a 512 sector size, however LUKS2 lets one choose up to 4096 for the encryption sector size. Which of these two should be used as cryptodisk->sector_size? I put 512 here since we're reading through a cheated mount, but I'm not so sure. Best, Josselin Poiret Josselin Poiret (2): devmapper/getroot: Have devmapper recognize LUKS2 devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters grub-core/osdep/devmapper/getroot.c | 59 ++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) -- 2.34.0