Skip to content

Commit

Permalink
boot.mount: mount by UUID instead
Browse files Browse the repository at this point in the history
This makes the mount more resistant to other filesystems labeled `boot`
that may get plugged in at any point.

Part of: coreos/fedora-coreos-tracker#976
  • Loading branch information
jlebon committed Oct 1, 2021
1 parent 999be5b commit 22fcb47
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ if [ ! -f "/sysroot/${mntfile}" ]; then
mpath=$(karg rd.multipath)
if [ -n "${mpath}" ] && [ "${mpath}" != 0 ]; then
bootdev=/dev/disk/by-label/dm-mpath-boot
else
eval $(blkid -o export "${bootdev}")
if [ -z "${UUID}" ]; then
# This should never happen
echo "Boot filesystem ${bootdev} has no UUID" >&2
exit 1
fi
bootdev="/dev/disk/by-uuid/${UUID}"
fi

devservice=$(systemd-escape -p "${bootdev}" --suffix=service)
Expand Down

0 comments on commit 22fcb47

Please sign in to comment.