diff options
author | Andreas Loibl <andreas@andreas-loibl.de> | 2014-05-06 23:40:51 +0200 |
---|---|---|
committer | Andreas Loibl <andreas@andreas-loibl.de> | 2014-05-07 00:17:34 +0200 |
commit | 841662c37f1c12887a2be25abba25bffd390d759 (patch) | |
tree | 341546379d23dec8a42482a8c3408d5a75b970fe /backend/modules/hdmap | |
parent | 6da3f6fb65e588934db6eb2d097a66f42911c4b2 (diff) | |
download | acritoxinstaller-841662c37f1c12887a2be25abba25bffd390d759.zip acritoxinstaller-841662c37f1c12887a2be25abba25bffd390d759.tar.gz |
added /boot/efi detection for hdmap
Diffstat (limited to 'backend/modules/hdmap')
-rw-r--r-- | backend/modules/hdmap | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/backend/modules/hdmap b/backend/modules/hdmap index ec7af08..09e2b91 100644 --- a/backend/modules/hdmap +++ b/backend/modules/hdmap @@ -326,10 +326,42 @@ function fill_hdmap() hdmap_set "$( ( echo "$cfg_hdmap" - root_disk="$(get_disk "$(hdmap_get device of mountpoint /)")" + root_disk="$(get_disk "$(hdmap_get device of mountpoint /)")" + efi_part="$(hdmap_get device of mountpoint /boot/efi)" + for part in $(list_efi_partitions | grep "$root_disk"; list_efi_partitions | grep -v "$root_disk") + do + # prefer EFI partition on root disk + if [ -z "$efi_part" ]; then + # preselect the first of the EFI partitions found + echo "$part:/boot/efi::auto" + efi_part="$part" + else + # list other possible EFI partitions in hdmap but don't select them + echo "$part:::" + fi + done for part in $(list_partitions -usage filesystem) do - if is_removeable "$part" && [ "$(get_disk "$part")" != "$root_disk" ]; then + disk="$(get_disk "$part")" + if [ -z "$efi_part" ] && [ "$disk" = "$root_disk" ] && \ + [ "$(get_filesystem_type $part)" = "DOS" ]; then + case "$(blkid -p -s PTTYPE -o value "$disk")" in + gpt) + efi_part="$part" + ;; + dos) + # only primary MSDOS partitions can be EFI partitions + partnr="${part/$disk}" + partnr="${partnr//[^0-9]}" + [ -n "$partnr" -a "$partnr" -ge 1 -a "$partnr" -le 4 ] && efi_part="$part" + ;; + esac + if [ "$efi_part" ]; then + echo "$efi_part:/boot/efi::auto" + continue + fi + fi + if is_removeable "$part" && [ "$disk" != "$root_disk" ]; then echo "$part:::" else echo "$part:/media/$(basename "$part")::auto" |