Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mw1W6-0005EB-Dq for mharc-grub-devel@gnu.org; Sat, 11 Dec 2021 07:30:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw1W2-0005Ch-De for grub-devel@gnu.org; Sat, 11 Dec 2021 07:30:14 -0500 Received: from jpoiret.xyz ([206.189.101.64]:32790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw1Vy-0006ok-W2 for grub-devel@gnu.org; Sat, 11 Dec 2021 07:30:13 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 35C8A183B2D; Sat, 11 Dec 2021 12:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1639225806; 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=TI19pcKfJG1b2iZ0hsclVYnXt/0Gnhlq0vMhfiawhdg=; b=bpl1bKqAuDmOimmAjAGhV4mM1n8Bokh9cqsTtDMcuLso1ji8kFsg6+ltldg9WH0JfDoBM4 Y0wR+mB6u/egCVm66fiMAL/I3D/r4wIcTwSKreLBy1jqeQtWVZUHih1Sv3TlBai6aWee9B puMzHjaSIz2oGwG0c5YjY5kfeKp1arppkcflr2vz5Ifj7CJuwYKxPkg09TeJt44j9AfYXV FzfopQ7Ns01h+nnUB0SZAJj1vob/5W07xv8gXcLiDDJ9s1WlANjpVoErKlloBHQ5pfeith J5fak8rc1FMMWZ2i70wdOzxhd+4+tmu7g2B+iYuNwwgE1tmP0edNAwuBKpnPvA== From: Josselin Poiret To: Glenn Washburn Cc: grub-devel@gnu.org, Josselin Poiret Subject: [PATCH v2 0/2] Have LUKS2 cryptomounts be useable with grub-probe Date: Sat, 11 Dec 2021 13:29:43 +0100 Message-Id: <20211211122945.6326-1-dev@jpoiret.xyz> In-Reply-To: <20211209141526.002e83a4@crass-HP-ZBook-15-G2> References: <20211209141526.002e83a4@crass-HP-ZBook-15-G2> 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, PDS_OTHER_BAD_TLD=1.856, 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: Sat, 11 Dec 2021 12:30:14 -0000 Glenn Washburn writes: > Its not clear to me, did you test a LUKS2 device with sector size 4096 > with this change? I believe DM does use 512-byte sectors internally, > but it can create block devices that report and use other sector sizes. > You can verfiy this by creating a 4096 sector size LUKS2 devices, open > it with cryptsetup, and then run "blockdev --getbsz /dev/mapper/". You're right, blockdev does indeed report 4096. Here is an updated patch that parses the optional sector_size argument from the DM parameters, I have checked that it does indeed set the right log_sector_size. I think it worked without it because you can technically just read with a lower sector size, but better be safe than sorry! 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 | 107 ++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 5 deletions(-) -- 2.34.0