From a5af73b9eccf2ca274d7a68165eada10d8389c23 Mon Sep 17 00:00:00 2001 From: eichehome Date: Thu, 20 Jul 2023 14:40:14 +0200 Subject: [PATCH] =?UTF-8?q?Etwas=20Code=20hinzugef=C3=BCgt=20um=20m=C3=B6g?= =?UTF-8?q?licherweise=20die=20UUIDs=20der=20Partitionen=20zu=20bekommen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.uefi | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/install.uefi b/install.uefi index 26b84ae..30a9f22 100644 --- a/install.uefi +++ b/install.uefi @@ -93,6 +93,37 @@ sgdisk -n 0:0:+64M -t 0: -c 0:"usrhash-Partition" "${DRIVE}" # Create Root-Partition sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"System Root" "${DRIVE}" +# UUIDs finden +UUID_ESP="" +UUID_ROOT="" +UUID_USR="" + +NOCASEMATCH_UNSET=$(shopt -u | grep -c nocasematch) +if [[ $NOCASEMATCH_UNSET ]]; then + shopt -s nocasematch +fi + +for i in {1..9} ; do + OUTPUT=$(sgdisk -i "${i}" "${DRIVE}") + PARTITION_EXISTS=$(echo "${OUTPUT}" | grep -c 'Partition size') + if [[ $PARTITION_EXISTS ]]; then + GUID_CODE=$(echo "${OUTPUT}" | cut -d ' ' -f 4) + UUID=$(echo "${OUTPUT}" | sed 's/.*GUID: \s//' | cut -d ' ' -f 1) + case $GUID_CODE in + '8484680c-9521-48c6-9c11-b0720656f69e' ) echo "USR-Partition" ;; + 'USR_HASH' ) echo "USRHASH-Partition" ;; + 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b' ) echo "ESP-Partition" ;; + '4f68bce3-e8cd-4db1-96e7-fbcaf984b709' ) echo "Root-Partition" ;; + * ) echo "Unbekannte Partition";; + esac + else + break; + fi +done + +if [[ $NOCASEMATCH_UNSET ]]; then + shopt -u nocasematch +fi mkfs.vfat -n EFI -F 32 /dev/vda1 mkfs.ext4 -L usr /dev/vda2