BuildTools 2 years ago
parent
commit
a9a07b285e
1 changed files with 29 additions and 38 deletions
  1. 29 38
      build_cube.sh

+ 29 - 38
build_cube.sh

@@ -1,32 +1,32 @@
 #!/bin/bash
 set -e
-Version=5.4
+Version=5.5
 Cuda=NO
 ZFS=NO
 Drivers=AMD
 
 if (( $EUID != 0 )); then
-   echo -e "\nThis must be run as root. Try 'sudo bash $0'."
+   echo -e "\n$(tput setaf 5)This must be run as root. Try 'sudo bash $0'.$(tput setaf 7)\n"
    exit 1
 fi
 clear
 
-function kernel_check {
+function kernel_check_ {
 if [ $Driver="AMD" ]
 then
-unamestr=$(uname -r)
-if ! [[ "$unamestr" == '5.4.0-54-generic' ]];
-then
-echo "Linux Kernel version $unamestr:"
-echo "L'installation des Drivers AMD necissite le kernel 5.4.0-54-generic"
-echo ""
-echo "Pour l'installer:"
-echo "sudo apt install linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic"
-echo "puis rebootez, maintenez ESC pour activer le menu grub"
-echo "booter sur le kernel 5.4.0-54-generic"
-echo "et enfin supprimez les autres kernels."
-exit
-fi
+	unamestr=$(uname -r)
+	if ! [[ "$unamestr" == '5.4.0-54-generic' ]];
+	then
+	echo "Linux Kernel version $unamestr:"
+	echo "L'installation des Drivers AMD necessite le kernel 5.4.0-54-generic."
+	echo ""
+	echo "Pour l'installer:"
+	echo "sudo apt install linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic"
+	echo "puis rebootez, maintenez ESC pour activer le menu grub"
+	echo "booter sur le kernel 5.4.0-54-generic"
+	echo -e "et enfin supprimez les autres kernels et relancez l'installation.\n"
+	exit
+	fi
 fi
 }
 
@@ -111,35 +111,26 @@ sudo reboot
 }
 
 function nvidia_driver_ {
-if [ ! -f /home/wareck/.pass1 ] && [ ! -f /home/wareck/.pass2 ] && [ ! -f /home/wareck/.pass3 ] && [ ! -f /home/wareck/.pass4 ]
-then
-echo -e "$(tput setaf 10)\nInstall Drivers phase 1:$(tput sgr0)"
-echo -e ""
-sleep 5
-fi
-
 if ! [ -f /home/wareck/.pass1 ]
 then
-	if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
-	then
-		sudo apt-get install build-essential libglvnd-dev -y
-		sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
-		sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
-		sudo update-initramfs -u
-		touch /home/wareck/.pass1
 	if [ $Drivers = "NVIDIA" ]
 	then
-		decompte_
+		if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
+		then
+			sudo apt-get install build-essential libglvnd-dev -y
+			sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+			sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+			sudo update-initramfs -u
+			touch /home/wareck/.pass1
+			decompte_
+		fi
 	fi
+	if [ $Drivers = "AMD" ]
+	then
+	touch ~/.pass1
 	fi
 fi
 
-if [ $Drivers = "AMD" ]
-then
-touch ~/.pass1
-fi
-
-
 if ! [ -f /home/wareck/.pass2 ]
 then
 sleep 2
@@ -613,8 +604,8 @@ sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
 fi
 }
 
-kernel_check
 intro_
+kernel_check_
 autoroot_
 nvidia_driver_
 update_