From f36f3cd9e910b252de73bee7cdac5de0ae6e0a01 Mon Sep 17 00:00:00 2001 From: eichehome Date: Tue, 25 Jul 2023 23:25:54 +0200 Subject: [PATCH] Workflow zur Partitionserstellung umgearbeitet. --- test.uefi | 122 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 104 insertions(+), 18 deletions(-) diff --git a/test.uefi b/test.uefi index 37241e6..49c4c71 100644 --- a/test.uefi +++ b/test.uefi @@ -41,26 +41,112 @@ PARTITIONS_PRESENT+=([ROOT]="${CHECK_ROOT}") echo "ESP: ${CHECK_ESP}, USR: ${CHECK_USR}, USRHASH: ${CHECK_USRHASH}, ROOT: ${CHECK_ROOT}" -if [[ ${PARTITIONS_PRESENT[ROOT]} -eq 1 ]]; then - echo "Root-Partition vorhanden." +if [[ ${PARTITIONS_PRESENT[ROOT]} -eq 1 && ${PARTITIONS_PRESENT[USR]} -eq 1 && ${PARTITIONS_PRESENT[USRHASH]} -eq 1 && ${PARTITIONS_PRESENT[ESP]} -eq 1 ]]; then + echo "Alle Partitionen vorhanden." +elif [[ ${PARTITIONS_PRESENT[ROOT]} -eq 0 && ${PARTITIONS_PRESENT[USR]} -eq 0 && ${PARTITIONS_PRESENT[USRHASH]} -eq 0 && ${PARTITIONS_PRESENT[ESP]} -eq 0 ]]; then + echo "Keine Partition ist vorhanden." + echo "Partitionen werden erstellt." else - echo "Root-Partition nicht vorhanden." + echo " ##################################################################################" + echo " ##################################################################################" + echo " ## _______ _ _ ___________ _ _ ___ _ ______ ##" + echo " ## /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \ ##" + echo " ## / \ | | \/| |_____| | | | | | | | |\ \ | | / \_| ##" + echo " ## / /\ \ | | | | | | | | | | | \ \ | | | ___ ##" + echo " ## / /__\ \ | | | _____ | | | | | | | | \ \ | | | |_ | ##" + echo " ## / ______ \| |_____/\| | | | | | \ \____/ | | \ \| | \___| | ##" + echo " ## /_/ \_\________/|_| |_| |_| \________/|_| \___|\_______| ##" + echo " ## ##" + echo " ##################################################################################" + echo " ##################################################################################" + echo "" + echo " Partitionen teilweise vorhanden." + echo " Fehlende Partitionen:" + for part in "${!PARTITIONS_PRESENT[@]}"; do + echo "- $part" + case $part in + "ROOT" ) + echo " - Root-Partition" + ;; + "USR" ) + echo " - /usr-Partition" + ;; + "USRHASH" ) + echo " - /usr-Verity-Partition" + ;; + "ESP" ) + echo " - ESP-Partition" + ;; + esac + done + echo "" + echo " ==================================================================================" + echo "" + echo " Alle Partitionen werden neu erstellt!" + echo " Die gesammte Platte ${DRIVE//\/dev\/} wird verwendet!" + echo " ==================================================================================" + echo "" + read -r -p " Partitionen trotz der Warnung neu erstellen? (j/N): " confirm_recreate_partitions + if [[ ${confirm_recreate_partitions} == [jJ] ]]; then + echo + echo "Recreate Partitions" + else + echo "Do nothing (Partitions)" + fi fi -if [[ ${PARTITIONS_PRESENT[USR]} -eq 1 ]]; then - echo "/usr-Partition vorhanden." -else - echo "/usr-Partition nicht vorhanden." -fi +# if [[ ${PARTITIONS_PRESENT[ROOT]} -eq 1 ]]; then +# echo "Root-Partition vorhanden." +# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_root +# if [[ ${confirm_root} == [jJ] ]]; then +# echo "Root-Partition wird neu erstellt" +# echo sgdisk -n 0: +# else +# echo "Root-Partition wird nicht neu erstellt" +# fi +# else +# echo "Root-Partition nicht vorhanden." +# fi -if [[ ${PARTITIONS_PRESENT[USRHASH]} -eq 1 ]]; then - echo "/usr-Verity-Partition vorhanden." -else - echo "/usr-Verity-Partition nicht vorhanden." -fi +# if [[ ${PARTITIONS_PRESENT[USR]} -eq 1 ]]; then +# echo "/usr-Partition vorhanden." +# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_usr +# if [[ ${confirm_usr} == [jJ] ]]; then +# echo "/usr-Partition wird neu erstellt" +# else +# echo "/usr-Partition wird nicht neu erstellt" +# fi +# else +# echo "/usr-Partition nicht vorhanden." +# fi -if [[ ${PARTITIONS_PRESENT[ESP]} -eq 1 ]]; then - echo "ESP-Partition vorhanden." -else - echo "ESP-Partition nicht vorhanden." -fi \ No newline at end of file +# if [[ ${PARTITIONS_PRESENT[USRHASH]} -eq 1 ]]; then +# echo "/usr-Verity-Partition vorhanden." +# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_usrhash +# if [[ ${confirm_usrhash} == [jJ] ]]; then +# echo "/usr-Verity-Partition wird neu erstellt" +# else +# echo "/usr-Verity-Partition wird nicht neu erstellt" +# fi +# else +# echo "/usr-Verity-Partition nicht vorhanden." +# fi + +# if [[ ${PARTITIONS_PRESENT[ESP]} -eq 1 ]]; then +# echo "ESP-Partition vorhanden." +# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_esp +# if [[ ${confirm_esp} == [jJ] ]]; then +# echo "ESP-Partition wird neu erstellt" +# else +# echo "ESP-Partition wird nicht neu erstellt" +# fi +# else +# echo "ESP-Partition nicht vorhanden." +# fi +# _______ _ _ ___________ _ _ ___ _ ______ +# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \ +# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_| +# / /\ \ | | | | | | | | | | | \ \ | | | ___ +# / /__\ \ | | | _____ | | | | | | | | \ \ | | | |_ | +# / ______ \| |_____/\| | | | | | \ \____/ | | \ \| | \___| | +#/_/ \_\________/|_| |_| |_| \________/|_| \___|\_______| \ No newline at end of file