]> git.ipfire.org Git - thirdparty/grub.git/commit
disk/cryptodisk: When cheatmounting, use the sector info of the cheat device
authorFabian Vogt <fvogt@suse.de>
Thu, 12 Jan 2023 23:05:07 +0000 (17:05 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 1 Feb 2023 15:16:54 +0000 (16:16 +0100)
commitefc9c363b2aab222586b420508eb46fc13242739
treeb2ceca790317c4d68d62853586b243fb15d06f1e
parent4de39a2af6521631d24978eb23035b7608949174
disk/cryptodisk: When cheatmounting, use the sector info of the cheat device

When using grub-probe with cryptodisk, the mapped block device from the host
is used directly instead of decrypting the source device in GRUB code.
In that case, the sector size and count of the host device needs to be used.
This is especially important when using LUKS2, which does not assign
total_sectors and log_sector_size when scanning, but only later when the
segments in the JSON area are evaluated. With an unset log_sector_size,
grub_device_open() complains.

This fixes grub-probe failing with
"error: sector sizes of 1 bytes aren't supported yet.".

Signed-off-by: Fabian Vogt <fvogt@suse.de>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Tested-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/cryptodisk.c