]> git.ipfire.org Git - thirdparty/systemd.git/commit
find-esp: do not fail when /boot on btrfs RAID on searching ESP or xbootldr
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Dec 2023 05:57:13 +0000 (14:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Dec 2023 05:19:28 +0000 (14:19 +0900)
commit5c831ddec801d653014b4eea820a1d6afbb91a63
tree45e78a78e4ccee3e46db54c5dcbb3778ca08283b
parent0977039bdc9e857cdb0dfe1d96d0de0d94d02155
find-esp: do not fail when /boot on btrfs RAID on searching ESP or xbootldr

When /boot or friends is on btrfs RAID, btrfs_get_block_device_at() will
succeed with 0 and provide zero devnum. Then,
- if we are previleged, devname_from_devnum() maps the devnum to
  /run/systemd/inaccessible/blk, and the subsequent verification by blkid
  will fail,
- if we are unprevileged, sd_device_new_from_devnum() will fail.

This makes
- when find_esp() or find_xbootldr() is called without any paths, that
  is, called with the searching mode, then returns -ENOKEY, which should
  be handled gracefully by the caller,
- when they are called with an input path, then they provide the proper
  error message and suggestion.

Fixes RHBZ#2251262 (https://bugzilla.redhat.com/show_bug.cgi?id=2251262).
src/shared/find-esp.c