fix migrate2rocky script for aarch64 systems by using correct suffix for grub2-efi* and shim* packages (#138)

* fix migrate2rocky script for aarch64 systems by using correct suffix for grub2-efi* and shim* packages

* wrap value passed to -l option of efibootmgr command in quotes
This commit is contained in:
Kenneth Hoste 2021-12-20 21:06:55 +01:00 committed by GitHub
parent a208a1ce0b
commit 68c77adbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -160,6 +160,14 @@ stream_repos_pkgs=(
[epel-release]=epel-next-release
)
# Map for package name suffix for shim/grub2-efi
# on x86_64: grub2-efi-x64, shim-x64
# on aarch64: grub2-efi-aa64, shim-aa64
declare -A cpu_arch_suffix_map=(
[x86_64]=x64
[aarch64]=aa64
)
# Prefix to add to CentOS stream repo names when renaming them.
stream_prefix=stream-
@ -502,8 +510,8 @@ collect_system_info () {
# We need to make sure that these packages are always installed in an
# EFI system.
always_install+=(
shim-x64
grub2-efi-x64
"shim-${cpu_arch_suffix_map[$ARCH]}"
"grub2-efi-${cpu_arch_suffix_map[$ARCH]}"
)
fi
@ -1098,7 +1106,7 @@ fix_efi () (
exit_message "Error updating the grub config."
for i in "${!efi_disk[@]}"; do
efibootmgr -c -d "/dev/${efi_disk[$i]}" -p "${efi_partition[$i]}" \
-L "Rocky Linux" -l /EFI/rocky/shimx64.efi ||
-L "Rocky Linux" -l "/EFI/rocky/shim${cpu_arch_suffix_map[$ARCH]}.efi" ||
exit_message "Error updating uEFI firmware."
done
)