]> 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 08:01:49 +0000 (10:01 +0200)
commit2fad9fb769359d69e9e10d1e57a9cbb2a375f03d
tree748983c6de415440827461c894854007a19ce993
parent90941d458a2f6b03cb782ab55c16f605b44c4fd8
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