-
Notifications
You must be signed in to change notification settings - Fork 97
Description
PR #378 , results in bad calculation of boot_uuid_subvolume which creates regression for 41_snapshot-btrfs in:
Lines 139 to 141 in 14fa71c
| boot_uuid_subvolume="$(btrfs subvolume show "${boot_directory}" 2>/dev/null | \ | |
| awk -F':' '/^\s*UUID/ {gsub(/^[ \t]+/, "", $2); print $2}')" \ | |
| || boot_uuid_subvolume="UUID: $root_uuid_subvolume" |
If there is no subvolume present for "${boot_directory} (which is usually /boot) , btrfs subvolume show "${boot_directory} will return 1, but pipe to awk will result in whole $(...) subshell always returning 0. So it will never fall back to UUID: $root_uuid_subvolume and this has further implications.
Due to the above bad calculation, the below condition will always run boot_separate:
Line 667 in 14fa71c
| if [ "$root_uuid" != "$boot_uuid" ] || [ "$root_uuid_subvolume" != "$boot_uuid_subvolume" ]; then boot_separate ; else boot_bounded ; fi |
Later it has impact on boot_dir and boot_dir_root_grub calculations and all of that In practice results for me in Fedora 43 with bad paths for kernel and initramfs which always point to /boot instead of absolute snapshot paths.
To fix this, whole script could have set -eo pipefail instead of set -e, but amending recent changes may be less radical approach.
Line 39 in 14fa71c
| set -e |
Also whole fall back, shouldn't happen to UUID: $root_uuid_subvolume but just to $root_uuid_subvolume otherwise it will still break boot_separate/boot_bounded condition mentioned above due to mismatched strings.
Line 141 in 14fa71c
| || boot_uuid_subvolume="UUID: $root_uuid_subvolume" |