From 22fcb471841555a09ed4d60c01bbea437244d310 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 1 Oct 2021 13:23:14 -0400 Subject: [PATCH] boot.mount: mount by UUID instead This makes the mount more resistant to other filesystems labeled `boot` that may get plugged in at any point. Part of: https://github.com/coreos/fedora-coreos-tracker/issues/976 --- .../modules.d/35coreos-ignition/coreos-boot-edit.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh index 86b4e51a17..223f1e703c 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-boot-edit.sh @@ -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)