test.uefi

This commit is contained in:
eichehome 2023-07-26 03:27:33 +02:00
parent 3c9d88edb3
commit 334a0e7c0f

View file

@ -142,8 +142,57 @@ fi
#----------------------------# #----------------------------#
declare -A INFO_ESP=""
declare -A INFO_USR=""
declare -A INFO_USRHASH=""
declare -A INFO_ROOT=""
INFO_ESP+=([PRESENT]="0")
INFO_USR+=([PRESENT]="0")
INFO_USRHASH+=([PRESENT]="0")
INFO_ROOT+=([PRESENT]="0")
# Check if GUIDS existieren
GUIDS_OUTPUT=$(lsblk -plo PARTUUID,PARTTYPE,PARTN,NAME | grep -i "${DRIVE}" | sed 's/[[:blank:]]\+/ /g')
for guid in "${!GUIDS[@]}"; do
CHECK=$(echo "${GUIDS_OUTPUT}" | grep -ic "${GUIDS[$guid]}")
if [[ ${CHECK} -eq 1 ]]; then
echo "1 Partition existiert."
case $guid in
"ROOT" )
INFO_ROOT+=([PRESENT]="1")
INFO_ROOT+=([PARTUUID]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 1))
INFO_ROOT+=([PARTNUM]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 3))
echo "ROOT: " "${INFO_ROOT[@]}"
;;
"USR" )
INFO_USR+=([PRESENT]="1")
INFO_USR+=([PARTUUID]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 1))
INFO_USR+=([PARTNUM]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 3))
echo "USR: " "${INFO_USR[@]}"
;;
"USRHASH" )
INFO_USRHASH+=([PRESENT]="1")
INFO_USRHASH+=([PARTUUID]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 1))
INFO_USRHASH+=([PARTNUM]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 3))
echo "USRHASH: " "${INFO_USRHASH[@]}"
;;
"ESP" )
INFO_ESP+=([PRESENT]="1")
INFO_ESP+=([PARTUUID]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 1))
INFO_ESP+=([PARTNUM]=$(echo "${GUIDS_OUTPUT}" | grep -i "${GUIDS[$guid]}" | cut -d ' ' -f 3))
echo "ESP: " "${INFO_ESP[@]}"
;;
esac
elif [[ ${CHECK} -gt 1 ]]; then
echo "Mehrere Partitionen existieren."
echo "Partition auswählen:"
else
echo "${guid}" "GUID nicht gefunden."
echo "Abbrechen"
exit 1
fi
done
#----------------------------# #----------------------------#