]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/partition/repart.c
repart: Use 4096 as the fallback sector size for verity/luks/filesystems 28812/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 12 Aug 2023 11:30:46 +0000 (13:30 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Aug 2023 09:04:52 +0000 (11:04 +0200)
commit93f125a66f46cc4c6a4e44f1de8f61106d1439c8
tree2584ae7249a026a3ddfe857a474bbd043d942795
parent1d117b068fc33cfe85df29610b91df6067de0664
repart: Use 4096 as the fallback sector size for verity/luks/filesystems

When we don't know the sector size of the actual block device, because
we're building an image in a loopback file and no sector size was specified
explicitly, let's use 4096 as the sector size for filesystems, verity and
LUKS. This should be the most compatible option, since 4096 will also work
on devices with sector size 512 or 2048.

For the actual GPT partition table size, we stick with 512 as the default
value since UEFI firmware and the kernel will only try to read the GPT
partition table from the first LBA on the device and the sector size for
most devices is still 512. It can also be trivially modified when copying
the image to another device using --copy-from + --sector-size.
src/partition/repart.c