test.uefi

This commit is contained in:
eichehome 2023-07-26 13:00:02 +02:00
parent 61abdf237f
commit e829f3c7a9

View file

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