Compare commits
2 commits
3b7544783e
...
09876ec680
Author | SHA1 | Date | |
---|---|---|---|
09876ec680 | |||
782a54efff |
2 changed files with 63 additions and 60 deletions
16
prepare.uefi
16
prepare.uefi
|
@ -1,18 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if true ; then
|
if true ; then
|
||||||
sgdisk -og "${DRIVE}"
|
sgdisk -og /dev/vda
|
||||||
# EFI System Partition erstellen
|
# EFI System Partition erstellen
|
||||||
sgdisk -n 0:0:+"${ESP}" -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" "${DRIVE}"
|
sgdisk -n 0:0:+512M -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" /dev/vda
|
||||||
# usr-Partition erstellen
|
# usr-Partition erstellen
|
||||||
sgdisk -n 0:0:+"${USR}" -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"ArchOS_0.1" "${DRIVE}"
|
sgdisk -n 0:0:+10G -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"ArchOS_0.1" /dev/vda
|
||||||
# usrhash-Partition erstellen
|
# usrhash-Partition erstellen
|
||||||
sgdisk -n 0:0:+512M -t 0:77ff5f63-e7b6-4633-acf4-1565b864c0e6 -c 0:"ArchOS_0.1" "${DRIVE}"
|
sgdisk -n 0:0:+512M -t 0:77ff5f63-e7b6-4633-acf4-1565b864c0e6 -c 0:"ArchOS_0.1" /dev/vda
|
||||||
# Root-Partition erstellen
|
# Root-Partition erstellen
|
||||||
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"ArchOS Root" "${DRIVE}"
|
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"ArchOS Root" /dev/vda
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if true ; then
|
if false ; then
|
||||||
mkfs.vfat -F 32 -n EFI /dev/vda1
|
mkfs.vfat -F 32 -n EFI /dev/vda1
|
||||||
|
fi
|
||||||
|
if false ; then
|
||||||
mkfs.ext4 -L usr /dev/vda2
|
mkfs.ext4 -L usr /dev/vda2
|
||||||
|
fi
|
||||||
|
if false ; then
|
||||||
mkfs.ext4 -L root /dev/vda4
|
mkfs.ext4 -L root /dev/vda4
|
||||||
fi
|
fi
|
105
test.uefi
105
test.uefi
|
@ -10,22 +10,24 @@ ESP_LABEL="EFI"
|
||||||
|
|
||||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||||
|
|
||||||
CHECK_EXISTENCE_OUTPUT=$(lsblk -o NAME | grep -c "^${DRIVE//\/dev\/}")
|
# Prüfen, ob Drive existiert
|
||||||
|
|
||||||
if [[ ${CHECK_EXISTENCE_OUTPUT} -lt 1 ]]; then
|
CHECK_PARTITION_EXISTENCE_OUTPUT=$(lsblk -pldo NAME | grep -ic "${DRIVE}")
|
||||||
|
|
||||||
|
if [[ ${CHECK_PARTITION_EXISTENCE_OUTPUT} -eq 1 ]]; then
|
||||||
echo "Platte existiert nicht, Abbruch!"
|
echo "Platte existiert nicht, Abbruch!"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Platte existiert , Weitermachen."
|
echo "Platte existiert , Weitermachen."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
|
|
||||||
RECREATE_PARTITIONS="1"
|
# Prüfen, ob Partitionen existieren ung ggf. erstellen
|
||||||
|
|
||||||
declare -A PARTITIONS_PRESENT=()
|
declare -A PARTITIONS_PRESENT=()
|
||||||
|
|
||||||
CHECK_PARTITIONS_OUTPUT=$(lsblk -po NAME,PARTTYPE | grep "${DRIVE}[0-9]")
|
CHECK_PARTITIONS_OUTPUT=$(lsblk -pldo NAME,PARTTYPE "${DRIVE}[0-9]")
|
||||||
|
|
||||||
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
|
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
|
||||||
PARTITIONS_PRESENT+=([ESP]="${CHECK_ESP}")
|
PARTITIONS_PRESENT+=([ESP]="${CHECK_ESP}")
|
||||||
|
@ -106,54 +108,6 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
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[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[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
|
|
||||||
# _______ _ _ ___________ _ _ ___ _ ______
|
# _______ _ _ ___________ _ _ ___ _ ______
|
||||||
# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \
|
# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \
|
||||||
# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_|
|
# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_|
|
||||||
|
@ -161,3 +115,48 @@ fi
|
||||||
# / /__\ \ | | | _____ | | | | | | | | \ \ | | | |_ |
|
# / /__\ \ | | | _____ | | | | | | | | \ \ | | | |_ |
|
||||||
# / ______ \| |_____/\| | | | | | \ \____/ | | \ \| | \___| |
|
# / ______ \| |_____/\| | | | | | \ \____/ | | \ \| | \___| |
|
||||||
#/_/ \_\________/|_| |_| |_| \________/|_| \___|\_______|
|
#/_/ \_\________/|_| |_| |_| \________/|_| \___|\_______|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------#
|
||||||
|
|
||||||
|
CHECK_FS_EXISTENCE_OUTPUT=$(lsblk -pldo NAME,PARTUUID,PARTTYPE,FSTYPE,FSVER "${DRIVE}[0-9]")
|
||||||
|
declare -A INFO_ESP=""
|
||||||
|
declare -A INFO_USR=""
|
||||||
|
declare -A INFO_USRHASH=""
|
||||||
|
declare -A INFO_ROOT=""
|
||||||
|
|
||||||
|
CHECK_FS_ESP=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" | grep -i "vfat" | grep -ic "fast32")
|
||||||
|
|
||||||
|
CHECK_FS_USR=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "8484680c-9521-48c6-9c11-b0720656f69e" | grep -ic "ext4")
|
||||||
|
|
||||||
|
CHECK_FS_USRHASH=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "77ff5f63-e7b6-4633-acf4-1565b864c0e6" | grep -ic "dm_verity_hash")
|
||||||
|
|
||||||
|
CHECK_FS_ROOT=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" | grep -i "ext4")
|
||||||
|
|
||||||
|
if [[ ${CHECK_ESP} -eq 0 ]]; then
|
||||||
|
echo "ESP-Dateisystem existiert nicht."
|
||||||
|
else
|
||||||
|
echo "ESP-Dateisystem existiert."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${CHECK_FS_USR} -eq 0 ]]; then
|
||||||
|
echo "/usr-Dateisystem existiert nicht."
|
||||||
|
else
|
||||||
|
echo "/usr-Dateisystem existiert."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${CHECK_FS_USRHASH} -eq 0 ]]; then
|
||||||
|
echo "Dateisystem existiert nicht."
|
||||||
|
else
|
||||||
|
echo "Dateisystem existiert."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${CHECK_FS_ROOT} -eq 0 ]]; then
|
||||||
|
echo "Root-Dateisystem existiert nicht."
|
||||||
|
else
|
||||||
|
echo "Root-Dateisystem existiert."
|
||||||
|
fi
|
Loading…
Reference in a new issue