Compare commits
No commits in common. "09876ec68034dc8d9874cc51f7671f8712601cc7" and "3b7544783e21d3bd4817b1168e86d18d1018352b" have entirely different histories.
09876ec680
...
3b7544783e
2 changed files with 60 additions and 63 deletions
16
prepare.uefi
16
prepare.uefi
|
@ -1,22 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if true ; then
|
if true ; then
|
||||||
sgdisk -og /dev/vda
|
sgdisk -og "${DRIVE}"
|
||||||
# EFI System Partition erstellen
|
# EFI System Partition erstellen
|
||||||
sgdisk -n 0:0:+512M -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" /dev/vda
|
sgdisk -n 0:0:+"${ESP}" -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" "${DRIVE}"
|
||||||
# usr-Partition erstellen
|
# usr-Partition erstellen
|
||||||
sgdisk -n 0:0:+10G -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"ArchOS_0.1" /dev/vda
|
sgdisk -n 0:0:+"${USR}" -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"ArchOS_0.1" "${DRIVE}"
|
||||||
# usrhash-Partition erstellen
|
# usrhash-Partition erstellen
|
||||||
sgdisk -n 0:0:+512M -t 0:77ff5f63-e7b6-4633-acf4-1565b864c0e6 -c 0:"ArchOS_0.1" /dev/vda
|
sgdisk -n 0:0:+512M -t 0:77ff5f63-e7b6-4633-acf4-1565b864c0e6 -c 0:"ArchOS_0.1" "${DRIVE}"
|
||||||
# Root-Partition erstellen
|
# Root-Partition erstellen
|
||||||
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"ArchOS Root" /dev/vda
|
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"ArchOS Root" "${DRIVE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if false ; then
|
if true ; 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,24 +10,22 @@ ESP_LABEL="EFI"
|
||||||
|
|
||||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||||
|
|
||||||
# Prüfen, ob Drive existiert
|
CHECK_EXISTENCE_OUTPUT=$(lsblk -o NAME | grep -c "^${DRIVE//\/dev\/}")
|
||||||
|
|
||||||
CHECK_PARTITION_EXISTENCE_OUTPUT=$(lsblk -pldo NAME | grep -ic "${DRIVE}")
|
if [[ ${CHECK_EXISTENCE_OUTPUT} -lt 1 ]]; then
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
#----------------------------#
|
#----------------------------#
|
||||||
|
|
||||||
# Prüfen, ob Partitionen existieren ung ggf. erstellen
|
RECREATE_PARTITIONS="1"
|
||||||
|
|
||||||
declare -A PARTITIONS_PRESENT=()
|
declare -A PARTITIONS_PRESENT=()
|
||||||
|
|
||||||
CHECK_PARTITIONS_OUTPUT=$(lsblk -pldo NAME,PARTTYPE "${DRIVE}[0-9]")
|
CHECK_PARTITIONS_OUTPUT=$(lsblk -po NAME,PARTTYPE | grep "${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}")
|
||||||
|
@ -108,6 +106,54 @@ 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
|
||||||
# _______ _ _ ___________ _ _ ___ _ ______
|
# _______ _ _ ___________ _ _ ___ _ ______
|
||||||
# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \
|
# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \
|
||||||
# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_|
|
# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_|
|
||||||
|
@ -115,48 +161,3 @@ 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