Fix boot_uuid_subvolume fallback (#415)

Fix regression affecting systems where boot directory is not a Btrfs subvolume.
This commit is contained in:
Jalopy
2026-02-19 00:21:08 -08:00
committed by GitHub
parent 14fa71c994
commit 7e8a45ca9c

View File

@@ -136,9 +136,11 @@ fi
[ -z "$boot_uuid" ] && print_error "Cannot determine UUID of ${boot_device}" [ -z "$boot_uuid" ] && print_error "Cannot determine UUID of ${boot_device}"
# If /boot is not a Btrfs subvolume, reuse root subvol UUID # If /boot is not a Btrfs subvolume, reuse root subvol UUID
boot_uuid_subvolume="$(btrfs subvolume show "${boot_directory}" 2>/dev/null | \ boot_uuid_subvolume="$(
awk -F':' '/^\s*UUID/ {gsub(/^[ \t]+/, "", $2); print $2}')" \ btrfs subvolume show "${boot_directory}" 2>/dev/null | \
|| boot_uuid_subvolume="UUID: $root_uuid_subvolume" awk -F':' '/^\s*UUID/ {gsub(/^[ \t]+/, "", $2); print $2; exit}'
)"
[ -z "$boot_uuid_subvolume" ] && boot_uuid_subvolume="$root_uuid_subvolume"
# Extra data for GRUB commands # Extra data for GRUB commands
boot_hs="$(${grub_probe} --device "${boot_device}" --target=hints_string 2>/dev/null)" boot_hs="$(${grub_probe} --device "${boot_device}" --target=hints_string 2>/dev/null)"