Skip to content

merged PR #378 regression - bad "boot_uuid_subvolume" calculation #414

@Tom-0

Description

@Tom-0

PR #378 , results in bad calculation of boot_uuid_subvolume which creates regression for 41_snapshot-btrfs in:

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:

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.

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.

|| boot_uuid_subvolume="UUID: $root_uuid_subvolume"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions