From 2c73632fad5c519e9c1bce0d4cb2a0a121b8ba8d Mon Sep 17 00:00:00 2001 From: eichehome Date: Sun, 16 Jul 2023 22:56:17 +0200 Subject: [PATCH] =?UTF-8?q?Ein=20Installscript=20hinzugef=C3=BCgt,=20welch?= =?UTF-8?q?es=20den=20Versuch=20einer=20TUI=20implementiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/archinstall.uefi | 327 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100755 script/archinstall.uefi diff --git a/script/archinstall.uefi b/script/archinstall.uefi new file mode 100755 index 0000000..389ae82 --- /dev/null +++ b/script/archinstall.uefi @@ -0,0 +1,327 @@ +#!/bin/bash + +# Archinstaller - UEFI +# Revision: 2023.07.03 -- by eichehome +# (GNU/General Public License version 3.0) + +# ---------------------------------------- +# Define Variables +# ---------------------------------------- + +MYTMZ="Europe/Berlin" + +LCLST="de_DE" +# Format is language_COUNTRY where language is lower case two letter code +# and country is upper case two letter code, seperated with an underscore + +KEYMP="de-latin1-nodeadkeys" + +# ---------------------------------------- +# Define Functions: +# ---------------------------------------- + +handlerr () { + clear + set -uo pipefail + trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR + clear +} + +invalid () { + echo -e "\n" + echo "Invalid answer, Please try again" + sleep 2 +} + +welcome () { + clear + echo "=====================================================" + echo "= =" + echo "= Welcome to the Archinstaller Script =" + echo "= =" + echo "= UEFI Edition =" + echo "= Revision: 2023.07.03 =" + echo "= =" + echo "= Brought to you by eichehome =" + echo "= https://git.sp-codes.de/eichehome/archinstall =" + echo "= =" + echo -e "===================================================== \n" + sleep 4 +} + +targetdrive () { + clear + echo -e "Check to see th available drives: \n" + /bin/lsblk + echo -e "\n" + read -p "Type your target device (e.g. sda), be exact and press Enter: " TARGETDDRIVE + [[ -z "$TARGETDDRIVE" ]] && targetdrive + clear + echo -e "\n" + echo "Target device set to "${TARGETDDRIVE}"..." + sleep 2 + clear +} + +makepartitions () { + clear + dd bs=512 if=/dev/zero of/dev/"${TARGETDDRIVE}" count=8192 + dd bs=512 if=/dev/zero of/dev/"${TARGETDDRIVE}" count=8192 seek$((`blockdev getsz /dev/"${TARGETDDRIVE}"` - 8192)) + sgdisk -og /dev/"${TARGETDDRIVE}" #Clear Patition Data and create GPT-Label + sgdisk -n 0:0:+650MiB -t 0:ef00 -c 0:efi /dev/"${TARGETDDRIVE}" # EFI System Partition + sgdisk -n 0:0:0 -t 0:8303 -c 0:root /dev/"${TARGETDDRIVE}" # Rest der +} + +liveconf () { + clear + timedatectl set-ntp true +} + +instStd () { + clear + echo "Installiere Standartpakete" + sleep 2 +} + +instLXC () { + clear + echo "Installiere LXC" + sleep 2 +} + +instVirt () { + clear + echo "Installiere Virtmanager" + sleep 2 +} + +instPodman () { + clear + echo "Installiere Podman" + sleep 2 +} + +instWeb () { + clear + echo "Installiere Webserver" + sleep 2 +} + +instKubern () { + clear + echo "Installiere Kubernetes" + sleep 2 +} + +server () { while true + do + clear + echo "---------------------------------" + echo " Server" + echo "---------------------------------" + echo "" + echo " 1) Standart (SSH-Server & Co)" + echo " 2) LXC" + echo " 3) Virtualisierung" + echo " 4) Podman" + echo " 5) Web" + echo " 6) Kubernetes" + echo "" + echo " X) Exit" + echo -e "\n" + read -p "Please enter your choise: " choise2 + case $choise2 in + 1 ) instStd;; + 2 ) instLXC;; + 3 ) instVirt;; + 4 ) instPodman;; + 5 ) instWeb;; + 6 ) instKubern;; + x|X ) exit;; + * ) invalid;; + esac + done +} + +instSound () { + clear + echo "Installiere Soundsystem" + sleep 2 +} + +instMultimedia () { + clear + echo "Installiere Mutimedia Software" + sleep 2 +} + +instDevel () { + clear + echo "Installiere Developmentumgebung" + sleep 2 +} + +instFonts () { + clear + echo "Installiere Fonts" + sleep 2 +} + +instMisc () { + clear + echo "Installiere Verschiedenes" + sleep 2 +} + +pakete () { while true + do + clear + echo "---------------------------------" + echo " Pakete" + echo "---------------------------------" + echo "" + echo " 1) Sound" + echo " 2) Multimedia" + echo " 3) Development" + echo " 4) Fonts" + echo " 5) Misc" + echo "" + echo " X) Back" + echo -e "\n" + read -p "Please enter your choise: " choise4 + case $choise4 in + 1 ) instSound;; + 2 ) instMultimedia;; + 3 ) instDevel;; + 4 ) instFonts;; + 5 ) instMisc;; + x|X ) client;; + * ) invalid;; + esac + done +} + +instGNOME () { + clear + echo "Installiere GNOME" + sleep 2 +} + +instKDE () { + clear + echo "Installiere KDE" + sleep 2 +} + +instSway () { + clear + echo "Installiere Sway" + sleep 2 +} + +instWayfire () { + clear + echo "Installiere Wayfire" + sleep 2 +} + +desktops () { while true + do + clear + echo "---------------------------------" + echo " Desktops" + echo "---------------------------------" + echo "" + echo " 1) GNOME" + echo " 2) KDE" + echo " 3) Sway" + echo " 4) Wayfire" + echo "" + echo " X) Back" + echo -e "\n" + read -p "Please enter your choise: " choise4 + case $choise4 in + 1 ) instGNOME;; + 2 ) instKDE;; + 3 ) instSway;; + 4 ) instWayfire;; + x|X ) client;; + * ) invalid;; + esac + done +} + +client () { while true + do + clear + echo "---------------------------------" + echo " Client" + echo "---------------------------------" + echo "" + echo " 1) Pakete" + echo " 2) Desktops" + echo "" + echo " X) Exit" + echo -e "\n" + read -p "Please enter your choise: " choise3 + case $choise3 in + 1 ) pakete;; + 2 ) desktops;; + x|X ) exit;; + * ) invalid;; + esac + done +} + +configClient () { + clear + echo "Installiere Grundkonfiguration Client" + sleep 2 + client +} + +configServer () { + clear + echo "Installiere Grundkonfiguration Server" + sleep 2 + server +} + +ROOTUSER () { + if [[ "$EUID" = 0 ]]; then + continue + else + echo "Please run as Root" + sleep 2 + exit + fi +} + +start () { while true + do + clear + echo "---------------------------------" + echo " Archinstaller - UEFI Systems" + echo "---------------------------------" + echo "" + echo " 1) Server" + echo " 2) Client" + echo "" + echo " X) Exit" + echo -e "\n" + read -p "Enter your choise: " choise1 + case $choise1 in + 1 ) configServer;; + 2 ) configClient;; + x|X ) exit;; + * ) invalid;; + esac + done +} + +ROOTUSER +handlerr +welcome + +#liveconf +start \ No newline at end of file