]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: fix buffer alignment when doing block I/O (#40465)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 00:10:01 +0000 (09:10 +0900)
committerGitHub <noreply@github.com>
Mon, 16 Feb 2026 00:10:01 +0000 (09:10 +0900)
UEFI Block I/O Protocol has `Media->IoAlign` field dictating the minimum
alignment for I/O buffer. It's quite surprising this has been lingering
here unnoticed for years, seems like most UEFI implementations have
small or no alignment requirements. U-Boot is not the case here, and
requires at least 512 byte alignment, hence attempt to read GPT
partition table fail and in effect systemd-boot can not find XBOOTLDR
partition.

These patches allow to boot from XBOOTLDR partition on U-Boot - tested
with latest systemd revision and U-Boot master
(`8de6e8f8a076d2c9b6d38d8563db135c167077ec`) on x64 and ARM32, of which
both are failing without the patch.

Also fixes Bitlocker probing logic, which is the only other place where
raw block I/O is used, however this is untested.

1  2 
src/boot/boot.c

diff --cc src/boot/boot.c
Simple merge