From 240e181576f30d283c421952f19116d4c73b9c21 Mon Sep 17 00:00:00 2001 From: eichehome Date: Mon, 11 Sep 2023 15:31:47 +0200 Subject: [PATCH] =?UTF-8?q?Fehler=20bei=20der=20Erkennung=20von=20existier?= =?UTF-8?q?enden=20Partitionen=20behoben.=20Das=20Ger=C3=A4t=20wurde=20auc?= =?UTF-8?q?h=20als=20Partition=20gez=C3=A4hlt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.uefi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/script.uefi b/script.uefi index b06ced9..35a0d73 100755 --- a/script.uefi +++ b/script.uefi @@ -98,9 +98,13 @@ create () { # existing_partitions [] existing_partitions () { + local DEVICE="$1" + local TYPE="$2" + echo "1: $1,2: $2" >> temp.log if [[ $# -eq 1 ]] # Genereller test auf Partitionen then - ANZAHL_PARTITIONEN_VORHANDEN=$(lsblk -pl "${DEVICE}" | grep -ic "${1}") + echo "Path 1" >> temp.log + ANZAHL_PARTITIONEN_VORHANDEN=$(lsblk -pl "${DEVICE}" | grep -ic "${DEVICE}[0-9]") if [[ ${ANZAHL_PARTITIONEN_VORHANDEN} != 0 ]] then echo "yes" # Partitionen vorhanden @@ -109,7 +113,8 @@ existing_partitions () { fi elif [[ $# -eq 2 ]] # Test auf eine bestimmte Partition then - case $2 in + echo "Path 2" >> temp.log + case ${TYPE} in "ESP") PARTUUID="${GUIDS[ESP]}" ;; @@ -129,7 +134,8 @@ existing_partitions () { die 1 "Unbekannter Partitionstype" ;; esac - SPEZIFISCHE_PARTITION_VORHANDEN=$(lsblk -o PARTTYPE "${DEVICE}" | grep "${PARTUUID}") + echo "UUID: ${PARTUUID}" >> temp.log + SPEZIFISCHE_PARTITION_VORHANDEN=$(lsblk -o PARTTYPE "${DEVICE}" | grep -ic "${PARTUUID}") if [[ "${SPEZIFISCHE_PARTITION_VORHANDEN}" == 1 ]] then echo "yes" # bestimmte Partition vorhanden