]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: also trigger loop device for boot disk when partition scanning is unsupported
authorDaan De Meyer <daan@amutable.com>
Sat, 4 Apr 2026 22:24:47 +0000 (22:24 +0000)
committerDaan De Meyer <daan@amutable.com>
Sat, 4 Apr 2026 22:24:47 +0000 (22:24 +0000)
commit4e0eabd40118c2607e52009c39a936c2054e6153
tree8c7cd2ee3f2eadef7f09bb7e46a904aabc70b01c
parent51e04b7e9064e7d3c1571a380bcf27b08e8016d8
udev: also trigger loop device for boot disk when partition scanning is unsupported

Previously, probe_gpt_sector_size_mismatch() would bail out early when
the GPT sector size matched the device sector size. However, some
devices (e.g. certain CD-ROM drives) do not support kernel partition
scanning even when sector sizes match. In that case, the kernel still
cannot parse the partition table, and we need to set up a loop device to
expose the partitions — just as we do for the sector size mismatch case.

Check blockdev_partscan_enabled() when sector sizes match, and only skip
the boot partition check if partition scanning is actually supported.

Also rename the function, udev property, and log messages to reflect the
broader scope:

- probe_gpt_sector_size_mismatch() -> probe_gpt_boot_disk_needs_loop()
- ID_PART_GPT_AUTO_ROOT_DISK_SECTOR_SIZE_MISMATCH -> ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP
rules.d/99-systemd.rules.in
src/udev/udev-builtin-blkid.c