Skip to content

Commit

Permalink
Fix ISO location logic in 99_migration
Browse files Browse the repository at this point in the history
There is code in the grub script which checks if the location of the installed live
migration ISO file is on the same root device than (/). After the move of the
installation target to "/migration-image", that location check is no longer needed.
This commit drops the extra checks for /usr/share and /usr

Co-authored-by: Marcus Schäfer <[email protected]>
  • Loading branch information
doccaz and schaefi authored Nov 8, 2024
1 parent 899fb8b commit ab58541
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions grub.d/99_migration
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,8 @@ root_device=$(
lsblk -p -n -r -o NAME,MOUNTPOINT | grep -E "/$" | uniq | cut -f1 -d" "
)

# check if location of migration_iso is not on the root_device
image_fs_device=${root_device}
index=4
for path in "/usr/share" "/usr";do
if mountpoint -q ${path};then
image_fs_device=$(
lsblk -p -n -r -o NAME,MOUNTPOINT |\
grep -E "${path}$" | uniq | cut -f1 -d" "
)
migration_iso=/$(echo "${migration_iso}" | cut -f"${index}"- -d/)
break
fi
index=$((index -1))
done

image_fs_uuid=$(blkid -s UUID -o value "${image_fs_device}")
image_fs_type=$(blkid -s TYPE -o value "${image_fs_device}")
image_fs_uuid=$(blkid -s UUID -o value "${root_device}")
image_fs_type=$(blkid -s TYPE -o value "${root_device}")

if [[ ${image_fs_type} =~ ^ext[[:digit:]] ]] ; then
image_fs_type="ext2"
Expand Down

0 comments on commit ab58541

Please sign in to comment.