fix(base): Detect EFI partition on NVMe (#28)
This detects an EFI partition on '/dev/sda1' (same as before) as well as on '/dev/nvme0n1p1' (new) where there are not just letters in front of partition number '1'.
This commit is contained in:
2
setup.sh
2
setup.sh
@@ -1295,7 +1295,7 @@ function get_disks_with_one_efipart () {
|
|||||||
# Find disks that have exactly one EFI partition and where that EFI
|
# Find disks that have exactly one EFI partition and where that EFI
|
||||||
# partition is partition number 1. We expect exactly one disk to meet
|
# partition is partition number 1. We expect exactly one disk to meet
|
||||||
# these criteria. Anything else and we bail.
|
# these criteria. Anything else and we bail.
|
||||||
disks_with_one_efipart="$(lsblk --output PATH,PARTTYPE --json --tree | jq --raw-output '.[][] | select(.children | length > 0) | select( any (.children[]; (.path | test("^[^[:digit:]]+1")) and (.parttype=="'"${partition_types[gpt_efi]}"'")) and ([select(.children[].parttype=="'"${partition_types[gpt_efi]}"'")] | length == 1) ) | .path')"
|
disks_with_one_efipart="$(lsblk --output PATH,PARTTYPE --json --tree | jq --raw-output '.[][] | select(.children | length > 0) | select( any (.children[]; (.path | test("^[^[:digit:]]+(.*?[[:digit:]]+p)?1")) and (.parttype=="'"${partition_types[gpt_efi]}"'")) and ([select(.children[].parttype=="'"${partition_types[gpt_efi]}"'")] | length == 1) ) | .path')"
|
||||||
if [[ "$(wc -l <<<"${disks_with_one_efipart}")" -eq '1' ]] && [[ "$(wc -c <<<"${disks_with_one_efipart}")" -gt '1' ]]; then
|
if [[ "$(wc -l <<<"${disks_with_one_efipart}")" -eq '1' ]] && [[ "$(wc -c <<<"${disks_with_one_efipart}")" -gt '1' ]]; then
|
||||||
printf -- '%s' "${disks_with_one_efipart}"
|
printf -- '%s' "${disks_with_one_efipart}"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user