]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /
authorLennart Poettering <lennart@poettering.net>
Thu, 13 Mar 2025 21:03:04 +0000 (22:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Apr 2025 09:08:57 +0000 (11:08 +0200)
commit5d3243bd468cee0dc9ec9e46c5c57f6cc7b1dba2
tree912b9f3df7583cae999afbcbb0a31945ed99ac0f
parente04c7a92cc34fc911a67ae8a77093338265b5b3d
udev-builtin-blkid: look for ESP/XBOOTLDR only in initrd; afterwards just look at /

So far the gpt-auto symlinks would point to:

   1. the disk the ESP/XBOOTLDR is located on
   2. or to a loopback device whose filename field is set to "rootdisk"
      or "rootdisk.raw"

This makes sense in the initrd. But once we transition to the host this
is quite confusing, since the symlinks might point to a different place
than what we actually ended up transitioning too: the actual backing
device of the root file system might be different from what gpt-auto
found.

Let's clean this up: let's avoid any ambiguities here: let's extend the
rules above with one more rule:

   3. if we left the initrd, we'll make gpt-auto point to the selected
      root file system, if it otherwise would have been a candidate.

Or in other words, the ID_PART_GPT_AUTO_ROOT_DISK=1 udev property now
always makes sense: in the initrd it points to the future root disk, and
on the host to the actual root disk.

Fixes: #34319
src/udev/udev-builtin-blkid.c