Skip to content

Commit

Permalink
Fix bug with finding ESP in setup.sh
Browse files Browse the repository at this point in the history
Fixes jaltuna#3
  • Loading branch information
smac89 authored Mar 18, 2024
1 parent f5ae4d2 commit fe38f21
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@ __find_esp__() {

while read -r device; do
read -r parttype fstype ESP <<<"$(lsblk -o "PARTTYPE,FSTYPE,MOUNTPOINT" "$device" 2>/dev/null | awk 'NR==2')"

[[ "${parttype,,}" != "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ]] && continue
[[ "${fstype,,}" != "vfat" ]] && continue
[[ -z $(findmnt -sn "$ESP") ]] && continue
[[ "${fstype,,}" != "vfat" ]] && continue
[[ -z $(findmnt -sn "$ESP") ]] && continue

# before breaking check that $ESP does in fact exist to avoid false positive from findmnt (see #3)
if [ -n "$ESP" ]; then
break
fi

done <<< "$(fdisk -l 2>/dev/null | grep -i efi | cut -d " " -f 1)"

Expand Down

0 comments on commit fe38f21

Please sign in to comment.