fix: missing /sys prefix when determining partition numbers

This commit is contained in:
oddlama 2022-12-21 14:10:47 +01:00
parent 2a2ef9abd7
commit dbb8b81c26
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
1 changed files with 5 additions and 2 deletions

View File

@ -209,11 +209,14 @@ function install_kernel_efi() {
|| die "Could not resolve device with id=$DISK_ID_EFI" || die "Could not resolve device with id=$DISK_ID_EFI"
efipartdev="$(realpath "$efipartdev")" \ efipartdev="$(realpath "$efipartdev")" \
|| die "Error in realpath '$efipartdev'" || die "Error in realpath '$efipartdev'"
local sys_efipart
sys_efipart="/sys/class/block/$(basename "$efipartdev")" \
|| die "Could not construct /sys path to efi partition"
local efipartnum local efipartnum
efipartnum="$(cat "$efipartdev/partition")" \ efipartnum="$(cat "$sys_efipart/partition")" \
|| die "Failed to find partition number for EFI partition $efipartdev" || die "Failed to find partition number for EFI partition $efipartdev"
local gptdev local gptdev
gptdev="/dev/$(basename "$(readlink -f "$efipartdev/..")")" \ gptdev="/dev/$(basename "$(readlink -f "$sys_efipart/..")")" \
|| die "Failed to find parent device for EFI partition $efipartdev" || die "Failed to find parent device for EFI partition $efipartdev"
if [[ ! -e "$gptdev" ]] || [[ -z "$gptdev" ]]; then if [[ ! -e "$gptdev" ]] || [[ -z "$gptdev" ]]; then
gptdev="$(resolve_device_by_id "${DISK_ID_PART_TO_GPT_ID[$DISK_ID_EFI]}")" \ gptdev="$(resolve_device_by_id "${DISK_ID_PART_TO_GPT_ID[$DISK_ID_EFI]}")" \