Compare commits

..

3 commits

View file

@ -52,7 +52,8 @@ DEV=(base-devel "${KERNEL}-headers")
# Netzwerk # Netzwerk
NET=(iptables-nft firewalld inetutils avahi networkmanager networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc modemmanager) #iwd bind(dig,host,nslookup) NET=(iptables-nft firewalld inetutils avahi networkmanager networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc modemmanager) #iwd bind(dig,host,nslookup)
# Sontiges # Sontiges
OTHER=(base linux-firmware plymouth mkinitcpio xdg-utils) #dracut BASE=(base)
OTHER=("${BASE[@]}" linux-firmware plymouth mkinitcpio xdg-utils) #dracut
# Grafik # Grafik
GRAPHIC_DRIVER=() GRAPHIC_DRIVER=()
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
@ -97,29 +98,46 @@ sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"System Root" "${
UUID_ESP="" UUID_ESP=""
UUID_ROOT="" UUID_ROOT=""
UUID_USR="" UUID_USR=""
UUID_USRHASH=""
# Anzahl der Partitionen ermitteln # Anzahl der Partitionen ermitteln
DRIVE_NAME=${DRIVE//\/dev\/} DRIVE_NAME=${DRIVE//\/dev\/}
declare -i NUMBER_OF_PARTITIONS; declare -i NUMBER_OF_PARTITIONS;
NUMBER_OF_PARTITIONS=$(lsblk | grep -c "${DRIVE_NAME}") NUMBER_OF_PARTITIONS=$(lsblk | grep -c "${DRIVE_NAME}[0-9]")
declare -i UNKNOWN_PARTITIONS
NOCASEMATCH_UNSET=$(shopt -u | grep -c nocasematch) NOCASEMATCH_UNSET=$(shopt -u | grep -c nocasematch)
if [[ $NOCASEMATCH_UNSET ]]; then if [[ $NOCASEMATCH_UNSET ]]; then
shopt -s nocasematch shopt -s nocasematch
fi fi
for (( i=${NUMBER_OF_PARTITIONS}; ${i} > 0 ; ${i}-- )) ; do for (( i=${NUMBER_OF_PARTITIONS}; ${i} > 0 ; i=${i}-1 )) ; do
OUTPUT=$(sgdisk -i "${i}" "${DRIVE}") OUTPUT=$(sgdisk -i "${i}" "${DRIVE}")
PARTITION_EXISTS=$(echo "${OUTPUT}" | grep -c "GUID") PARTITION_EXISTS=$(echo "${OUTPUT}" | grep -c "GUID")
if [[ "${PARTITION_EXISTS}" != "0" ]]; then if [[ "${PARTITION_EXISTS}" != "0" ]]; then
GUID_CODE=$(echo "${OUTPUT}" | grep "GUID code:" | cut -d ' ' -f 4) GUID_CODE=$(echo "${OUTPUT}" | grep "GUID code:" | cut -d ' ' -f 4)
UUID=$(echo "${OUTPUT}" | grep "unique GUID:" | cut -d ' ' -f 4) UUID=$(echo "${OUTPUT}" | grep "unique GUID:" | cut -d ' ' -f 4)
case $GUID_CODE in case $GUID_CODE in
"8484680c-9521-48c6-9c11-b0720656f69e" ) echo "USR-Partition, UUID: ${UUID} " ;; "8484680c-9521-48c6-9c11-b0720656f69e" )
'USR_HASH' ) echo "USRHASH-Partition" ;; echo "USR-Partition, UUID: ${UUID}"
"c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ) echo "ESP-Partition, UUID: ${UUID}" ;; UUID_USR=${UUID}
"4f68bce3-e8cd-4db1-96e7-fbcaf984b709" ) echo "Root-Partition, UUID: ${UUID}" ;; ;;
* ) echo "Unbekannte Partition";; "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" )
echo "ESP-Partition, UUID: ${UUID}"
UUID_ESP=${UUID}
;;
"4f68bce3-e8cd-4db1-96e7-fbcaf984b709" )
echo "Root-Partition, UUID: ${UUID}"
UUID_ROOT=${UUID}
;;
"77ff5f63-e7b6-4633-acf4-1565b864c0e6" )
echo "Usrhash-Partition, UUID: ${UUID}"
UUID_USRHASH=${UUID}
;;
* )
echo "Unbekannte Partition"
UNKNOWN_PARTITIONS="${UNKNOWN_PARTITIONS}+1"
;;
esac esac
else else
echo "no partition found" echo "no partition found"
@ -131,6 +149,16 @@ if [[ $NOCASEMATCH_UNSET ]]; then
shopt -u nocasematch shopt -u nocasematch
fi fi
if [[ "${UNKNOWN_PARTITIONS}" > "0" ]]; then
if [[ "${UNKNOWN_PARTITIONS}" > "1" ]]; then
read -r -p "Mehrere Partitionen unbekannt. Trotzdem fortfahren? (j/N): " confirm
[[ "${confirm}" == [jJ] ]] || echo "Abbrechen" && exit 0
else
read -r -p "Eine Partition unbekannt. Trotzdem fortfahren? (j/N): " confirm
[[ "${confirm}" == [jJ] ]] || echo "Abbrechen" && exit 0
fi
fi
mkfs.vfat -n EFI -F 32 /dev/vda1 mkfs.vfat -n EFI -F 32 /dev/vda1
mkfs.ext4 -L usr /dev/vda2 mkfs.ext4 -L usr /dev/vda2
mkfs.ext4 -L root /dev/vda4 mkfs.ext4 -L root /dev/vda4