]> git.ipfire.org Git - thirdparty/systemd.git/commit
bootspec: try harder to suppress duplicate enumerated entries
authorLennart Poettering <lennart@poettering.net>
Wed, 23 Mar 2022 16:00:24 +0000 (17:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 28 Mar 2022 14:01:10 +0000 (16:01 +0200)
commitd486a0eaaa435e50597327fa2f90947545a0312b
tree02102cf8597138dc372405021ae9a17ceb1c6ea0
parent85f4ae2f50c516cf2dc2343013ff61cdc08762f7
bootspec: try harder to suppress duplicate enumerated entries

For testing purposes I run one of my system symlinking /boot/loader/ to
/efi/loader/. This triggers annoying behaviour in boot entry
enumeration: the code ends up iterating through the 'entries' subdir of
both, thinking one was actually in the ESP and the other in XBOOTLDR,
and thus distinct. This would result in duplicate entries.

Let's address that, and filter out duplicates via their inode numbers:
never process the same inode twice. This should protect us from any
confusion effectively, regardless which inodes are symlinked (or even
bind mounted).
src/shared/bootspec.c
src/shared/bootspec.h