Skip to content

Commit 7e8a45c

Browse files
authored
Fix boot_uuid_subvolume fallback (#415)
Fix regression affecting systems where boot directory is not a Btrfs subvolume.
1 parent 14fa71c commit 7e8a45c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

41_snapshots-btrfs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ fi
136136
[ -z "$boot_uuid" ] && print_error "Cannot determine UUID of ${boot_device}"
137137

138138
# If /boot is not a Btrfs subvolume, reuse root subvol UUID
139-
boot_uuid_subvolume="$(btrfs subvolume show "${boot_directory}" 2>/dev/null | \
140-
awk -F':' '/^\s*UUID/ {gsub(/^[ \t]+/, "", $2); print $2}')" \
141-
|| boot_uuid_subvolume="UUID: $root_uuid_subvolume"
139+
boot_uuid_subvolume="$(
140+
btrfs subvolume show "${boot_directory}" 2>/dev/null | \
141+
awk -F':' '/^\s*UUID/ {gsub(/^[ \t]+/, "", $2); print $2; exit}'
142+
)"
143+
[ -z "$boot_uuid_subvolume" ] && boot_uuid_subvolume="$root_uuid_subvolume"
142144

143145
# Extra data for GRUB commands
144146
boot_hs="$(${grub_probe} --device "${boot_device}" --target=hints_string 2>/dev/null)"

0 commit comments

Comments
 (0)