Name der Konstante der GUIDs korrigiert.

This commit is contained in:
eichehome 2023-07-26 02:24:35 +02:00
parent f3c9aaaefc
commit 3c9d88edb3

View file

@ -33,16 +33,16 @@ declare -A PARTITIONS_PRESENT=()
CHECK_PARTITIONS_OUTPUT=$(lsblk -plo NAME,PARTTYPE | grep -i "${DRIVE}[0-9]")
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUID[ESP]}")
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUIDS[ESP]}")
PARTITIONS_PRESENT+=([ESP]="${CHECK_ESP}")
CHECK_USR=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUID[USR]}")
CHECK_USR=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUIDS[USR]}")
PARTITIONS_PRESENT+=([USR]="${CHECK_USR}")
CHECK_USRHASH=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUID[USRHASH]}")
CHECK_USRHASH=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUIDS[USRHASH]}")
PARTITIONS_PRESENT+=([USRHASH]="${CHECK_USRHASH}")
CHECK_ROOT=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUID[ROOT]}")
CHECK_ROOT=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "${GUIDS[ROOT]}")
PARTITIONS_PRESENT+=([ROOT]="${CHECK_ROOT}")
echo "ESP: ${CHECK_ESP}, USR: ${CHECK_USR}, USRHASH: ${CHECK_USRHASH}, ROOT: ${CHECK_ROOT}"
@ -53,10 +53,10 @@ elif [[ ${PARTITIONS_PRESENT[ROOT]} -eq 0 && ${PARTITIONS_PRESENT[USR]} -eq 0 &&
echo "Keine Partition ist vorhanden."
echo "Partitionen werden erstellt."
echo sgdisk -og "${DRIVE}"
echo sgdisk -n 0:0:"+${ESP}" -t 0:"${GUID[ESP]}" -c 0:"EFI System Partition" "${DRIVE}"
echo sgdisk -n 0:0:"+${USR}" -t 0:"${GUID[USR]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:+512M -t 0:"${GUID[USRHASH]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:0 -t 0:"${GUID[ROOT]}" -c 0:"ArchOS Root" "${DRIVE}"
echo sgdisk -n 0:0:"+${ESP}" -t 0:"${GUIDS[ESP]}" -c 0:"EFI System Partition" "${DRIVE}"
echo sgdisk -n 0:0:"+${USR}" -t 0:"${GUIDS[USR]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:+512M -t 0:"${GUIDS[USRHASH]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:0 -t 0:"${GUIDS[ROOT]}" -c 0:"ArchOS Root" "${DRIVE}"
else
echo " ##################################################################################"
echo " ##################################################################################"
@ -103,10 +103,10 @@ else
echo
echo "Recreate Partitions"
echo sgdisk -og "${DRIVE}"
echo sgdisk -n 0:0:"+${ESP}" -t 0:"${GUID[ESP]}" -c 0:"EFI System Partition" "${DRIVE}"
echo sgdisk -n 0:0:"+${USR}" -t 0:"${GUID[USR]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:+512M -t 0:"${GUID[USRHASH]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:0 -t 0:"${GUID[ROOT]}" -c 0:"ArchOS Root" "${DRIVE}"
echo sgdisk -n 0:0:"+${ESP}" -t 0:"${GUIDS[ESP]}" -c 0:"EFI System Partition" "${DRIVE}"
echo sgdisk -n 0:0:"+${USR}" -t 0:"${GUIDS[USR]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:+512M -t 0:"${GUIDS[USRHASH]}" -c 0:"ArchOS_0.1" "${DRIVE}"
echo sgdisk -n 0:0:0 -t 0:"${GUIDS[ROOT]}" -c 0:"ArchOS Root" "${DRIVE}"
else
echo "Do nothing (Partitions)"
echo "Bitte die fehlenden Partitionen erstellen, um das Script zu benutzen"
@ -153,13 +153,13 @@ declare -A INFO_USR=""
declare -A INFO_USRHASH=""
declare -A INFO_ROOT=""
CHECK_FS_ESP=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUID[ESP]}" | grep -i "vfat" | grep -ic "fast32")
CHECK_FS_ESP=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUIDS[ESP]}" | grep -i "vfat" | grep -ic "fast32")
CHECK_FS_USR=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUID[USR]}" | grep -ic "ext4")
CHECK_FS_USR=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUIDS[USR]}" | grep -ic "ext4")
CHECK_FS_USRHASH=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUID[USRHASH]}" | grep -ic "dm_verity_hash")
CHECK_FS_USRHASH=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUIDS[USRHASH]}" | grep -ic "dm_verity_hash")
CHECK_FS_ROOT=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUID[ROOT]}" | grep -ic "ext4")
CHECK_FS_ROOT=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "${GUIDS[ROOT]}" | grep -ic "ext4")
if [[ ${CHECK_FS_ESP} -eq 0 ]]; then
echo "ESP-Dateisystem existiert nicht."