Votre Nom il y a 1 an
Parent
commit
91ae9b0467
1 fichiers modifiés avec 162 ajouts et 359 suppressions
  1. 162 359
      options/tools/r640.sh

+ 162 - 359
options/tools/build_cube.sh.bak → options/tools/r640.sh

@@ -1,21 +1,15 @@
 #!/bin/bash
 #!/bin/bash
 set -e
 set -e
-Version=12.5
-Headless=NO
+Version=15.1
 Cuda=NO
 Cuda=NO
-ZFS=NO
-Drivers=NVIDIA
-motherboard="GA990xa-ud3"
 kernel_custom=YES
 kernel_custom=YES
 Webmin="webmin-2.021"
 Webmin="webmin-2.021"
-kernel_dkms="5.15.0-69-generic"
-
+kernel_dkms="5.15.0-71-generic"
 if (( $EUID != 0 )); then
 if (( $EUID != 0 )); then
-   echo -e "$(tput setaf 9)This must be run as root. Try 'sudo $0'.$(tput sgr0)"
+   echo -e "$(tput setaf 11)This must be run as root. Try 'sudo $0'.$(tput sgr0)"
    exit 1
    exit 1
 fi
 fi
 clear
 clear
-
 function ubuntu_version_check {
 function ubuntu_version_check {
 if [[ $(lsb_release -rs) == "20.04" ]]
 if [[ $(lsb_release -rs) == "20.04" ]]
 then
 then
@@ -28,63 +22,6 @@ else
 fi
 fi
 }
 }
 
 
-function kernel_check_ {
-unamestr=$(uname -r)
-case $kernel_custom in
-NO)
-	if [[ "$unamestr" == '5.15.0-69-generic' ]]
-	then
-	echo -e "$(tput setaf 10)DKMS Kernel install :$(tput sgr0)"
-	sudo rm /boot/config-5.15*
-	sudo rm /boot/initrd.img-5.15*
-	sudo rm /boot/System.map-5.15*
-	sudo rm /boot/vmlinuz-5.15*
-	sudo apt-get install linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic htop -y
-	sudo update-grub2
-        sudo apt-mark hold linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic
-        autoroot_
-        decompte_
-	fi
-	if [[ "$unamestr" == '5.4.0-139-generic' ]]
-	then
-	sudo rm /boot/config-5.4.0-139-generic | true
-        sudo rm /boot/System.map-5.4.0-139-generic | true
-        sudo rm /boot/initrd.img-5.4.0-139-generic | true
-        sudo rm /boot/vmlinuz-5.4.0-139-generic | true
-        sudo update-grub2
-        sudo apt-mark hold linux-image-$kernel_dkms linux-headers-$kernel_dkms linux-modules-extra-$kernel_dkms
-        autoroot_
-        decompte_
-	fi
-	;;
-YES)
-	wget -c -q http://192.168.1.8:3000/wareck/custom_kernel/raw/master/ksource.txt -O /tmp/ksource.txt
-	source /tmp/ksource.txt
-
-	if ! [[ "$unamestr" == $KLversion ]]
-	then
-	echo -e "$(tput setaf 15)Custom kernel install $(tput setaf 9)$KLversion$(tput setaf 15) (fix DKMS/WOL) :$(tput sgr0)"
-	cd /tmp/
-	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KHeader
-	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KImage
-	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KLibc
-
-	sudo dpkg -i $KLibc
-	sudo dpkg -i $KHeader
-	sudo dpkg -i $KImage
-
-	if [ $Drivers="NVIDIA" ]
-	then
-	nvidia_driver_
-	else
-	autoroot_
-	decompte_
-	fi
-	fi
-	;;
-esac
-}
-
 function print_centered {
 function print_centered {
      [[ $# == 0 ]] && return 1
      [[ $# == 0 ]] && return 1
 
 
@@ -109,6 +46,17 @@ function print_centered {
      return 0
      return 0
 }
 }
 
 
+function decompte_ {
+echo -e "$(tput setaf 10)\nReboot in 10 seconds (CRTL+C to abord):$(tput sgr0)"
+for i in {9..0}
+do
+echo -e -n "$i "
+sleep 1
+done
+echo ""
+sudo reboot
+}
+
 function intro_ {
 function intro_ {
 print_centered "$(tput setaf 5)"
 print_centered "$(tput setaf 5)"
 print_centered " ██████╗██╗   ██╗██████╗ ███████╗"
 print_centered " ██████╗██╗   ██╗██████╗ ███████╗"
@@ -120,15 +68,8 @@ print_centered " ╚═════╝ ╚═════╝ ╚═════
 echo -n "$(tput sgr0)"
 echo -n "$(tput sgr0)"
 print_centered "Cube Server installation script v$Version"
 print_centered "Cube Server installation script v$Version"
 print_centered "Ubuntu version 20.04"
 print_centered "Ubuntu version 20.04"
-if [ $motherboard = "FMA86-extreme4" ]
-then
-print_centered "FMA86-extreme4 $Drivers"
-fi
-if [ $motherboard = "GA990xa-ud3" ]
-then
 print_centered "GA990xa-ud3 $Drivers"
 print_centered "GA990xa-ud3 $Drivers"
-fi
-sleep 1
+sleep 3
 }
 }
 
 
 function update_ {
 function update_ {
@@ -139,103 +80,128 @@ sudo apt-get update
 echo -e ""
 echo -e ""
 sudo apt-get install lxde lxde-icon-theme -y
 sudo apt-get install lxde lxde-icon-theme -y
 echo -e ""
 echo -e ""
-sudo apt-get install  checkinstall samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla \
+sudo apt-get install  samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla \
 tasksel lzma-dev lzma cmake libuv1-dev libssl-dev msr-tools tightvncserver lm-sensors openssh-server xfsprogs -y
 tasksel lzma-dev lzma cmake libuv1-dev libssl-dev msr-tools tightvncserver lm-sensors openssh-server xfsprogs -y
 echo -e ""
 echo -e ""
 sudo apt-get install pixz pbzip2 pigz btrfs-progs gparted gpart gnome-remote-desktop libcanberra-gtk-module \
 sudo apt-get install pixz pbzip2 pigz btrfs-progs gparted gpart gnome-remote-desktop libcanberra-gtk-module \
-ctorrent libcurl4-openssl-dev bison byacc screen libudev-dev libjansson-dev libncurses5-dev libmicrohttpd-dev curl -y
+ctorrent libcurl4-openssl-dev bison byacc screen libudev-dev libjansson-dev libncurses5-dev libmicrohttpd-dev curl nvme-cli -y
 echo -e ""
 echo -e ""
 sudo apt-get install libglib2.0-dev libgtk2.0-dev libsensors4-dev htop vlc locate -y
 sudo apt-get install libglib2.0-dev libgtk2.0-dev libsensors4-dev htop vlc locate -y
 echo -e ""
 echo -e ""
-if [ $ZFS = "YES" ]
-then
-sudo apt-get install zfsutils-linux -y
-fi
 if [ $Cuda = "YES" ]
 if [ $Cuda = "YES" ]
 then
 then
 echo -e "$(tput setaf 10)\nInstall Cuda packages:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nInstall Cuda packages:$(tput sgr0)"
-sudo apt-get install nvidia-cuda-toolkit -y
-echo -e "Done."
+sudo apt-get install libgmp-dev libnuma-dev cmake libuv1-dev nvidia-cuda-dev nvidia-cuda-toolkit libmicrohttpd-dev gcc-8 g++-8 -y
 fi
 fi
+echo -e "Done."
 fi
 fi
 }
 }
 
 
-function decompte_ {
-echo -e "$(tput setaf 10)\nReboot in 10 seconds (CRTL+C to abord):$(tput sgr0)"
-for i in {10..0}
-do
-echo -e -n "$i "
-sleep 1
-done
-echo ""
-sudo reboot
+function kernel_check_ {
+unamestr=$(uname -r)
+case $kernel_custom in
+NO)
+        if [[ "$unamestr" == '5.15.0-69-generic' ]]
+        then
+        echo -e "$(tput setaf 10)DKMS Kernel install :$(tput sgr0)"
+        sudo rm /boot/config-5.15*
+        sudo rm /boot/initrd.img-5.15*
+        sudo rm /boot/System.map-5.15*
+        sudo rm /boot/vmlinuz-5.15*
+        sudo apt-get install linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic htop -y
+        sudo update-grub2
+        sudo apt-mark hold linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic
+        autoroot_
+        decompte_
+        fi
+        if [[ "$unamestr" == '5.4.0-139-generic' ]]
+        then
+        sudo rm /boot/config-5.4.0-139-generic | true
+        sudo rm /boot/System.map-5.4.0-139-generic | true
+        sudo rm /boot/initrd.img-5.4.0-139-generic | true
+        sudo rm /boot/vmlinuz-5.4.0-139-generic | true
+        sudo update-grub2
+        sudo apt-mark hold linux-image-$kernel_dkms linux-headers-$kernel_dkms linux-modules-extra-$kernel_dkms
+        autoroot_
+        decompte_
+        fi
+        ;;
+YES)
+	if [ -f /tmp/ksource.txt ]; then rm /tmp/ksource.txt;fi
+        wget -c -q http://192.168.1.8:3000/wareck/custom_kernel/raw/master/ksource.txt -O /tmp/ksource.txt
+        source /tmp/ksource.txt
+        if ! [[ "$unamestr" == $KLversion ]]
+        then
+        echo -e "$(tput setaf 10)Custom kernel install $(tput setaf 9)$KLversion$(tput setaf 10) (fix DKMS/WOL) :$(tput sgr0)"
+        cd /tmp/
+	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$kernel_version
+        #wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KHeader
+        #wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KImage
+        #wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/$KLibc
+        #sudo dpkg -i $KLibc
+        #sudo dpkg -i $KHeader
+        #sudo dpkg -i $KImage
+	chmod +x $kernel_version
+	sudo ./$kernel_version
+        nvidia_driver_
+        autoroot_
+        decompte_
+        fi
+        ;;
+esac
 }
 }
 
 
 function nvidia_driver_ {
 function nvidia_driver_ {
 if ! [ -f /home/wareck/.pass1 ]
 if ! [ -f /home/wareck/.pass1 ]
 then
 then
-	if [ $Drivers = "NVIDIA" ]
+	if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
 	then
 	then
-		if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
-		then
+        echo "Blacklist nvidia-nouveau driver..."
+        echo "System will reboot"
+        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"
+        fi
+case $Cuda in
+NO)
 			sudo apt-get install build-essential libglvnd-dev -y
 			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
+			;;
+YES)
+			sudo apt-get install build-essential libglvnd-dev cmake libhugetlbfs-dev libc-dev libc6-dev g++ -y
+	                ;;
+*)
+   		        ;;
+esac
+
+#sudo update-initramfs -u
+touch /home/wareck/.pass1
+decompte_
 fi
 fi
 
 
 if ! [ -f /home/wareck/.pass2 ]
 if ! [ -f /home/wareck/.pass2 ]
 then
 then
-sleep 2
-
-case $Drivers in
-NVIDIA)
-		#echo -e "$(tput setaf 10)\nInstall NVIDIA GTX1070 Drivers :$(tput sgr0)"
-                echo -e "$(tput setaf 10)\nInstall NVIDIA GT 710 Drivers :$(tput sgr0)"
-		cd /home/wareck/
-                echo -e "Download MegaDownload:"
-                git clone https://github.com/wareck/megadown.git
-                sudo cp /home/wareck/megadown/megadown /usr/local/bin/megadown
-                sudo rm -r /home/wareck/megadown
-                cd /home/wareck
-                echo -e ""
-                echo -e "Install drivers:"
-                #sudo apt-get install nvidia-driver-470 -y
-		sudo apt-get install nvidia-driver-525 -y
-		touch /home/wareck/.pass2
-		decompte_
-;;
-AMD)
-		echo -e "$(tput setaf 10)\nInstall AMD Drivers :$(tput sgr0)"
-                cd /home/wareck
-                echo -e ""
-                echo -e "Install drivers:"
-		wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/amdgpu-install_5.4.50403-1_all.deb -O /home/wareck/Build_Cube/pack/amdgpu-install_5.4.50403-1_all.deb
-		wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/linux-firmware.tar.xz
-		tar xfJ linux-firmware.tar.xz
-		sudo cp /home/wareck/linux-firmware/amdgpu/* /lib/firmware/amdgpu/
-		sudo rm -r -f /home/wareck/linux-firmware /home/wareck/linux-firmware.tar.xz
-		sudo apt-get install /home/wareck/Build_Cube/pack/amdgpu-install_5.4.50403-1_all.deb -y
-		sudo apt-get update
-		sudo amdgpu-install --opencl=legacy --accept-eula -y
-		sudo apt-get install ocl-icd-opencl-dev -y
-		sudo usermod -a -G video $LOGNAME
-		touch /home/wareck/.pass2
-		sudo apt-get autoremove -y
-		decompte_
-;;
-*)
-echo -e "$(tput setaf 9)Error driver number ! $(tput sgr0)\n"
-exit 0
-;;
+sleep 1
+case $Cuda in
+NO)
+	echo -e "$(tput setaf 10)\nInstall NVIDIA GTX1080 Drivers :$(tput sgr0)"
+	sleep 3
+	sudo apt-get install nvidia-driver-525 -y
+	touch /home/wareck/.pass2
+	decompte_
+	;;
+YES)
+	echo -e "$(tput setaf 10)\nInstall CUDA Drivers :$(tput sgr0)"
+	cd /home/wareck/
+	echo -e "Download MegaDownload:"
+	git clone https://github.com/wareck/megadown.git
+	sudo cp /home/wareck/megadown/megadown /usr/local/bin/megadown
+	sudo rm -r /home/wareck/megadown
+	megadown https://mega.nz/file/r0wwnZCJ#27WWRMwSsGYXiMUHf2OgcGYp2O2itChsBxcK9znmr5E
+	chmod +x cuda_11.8.0_520.61.05_linux.run
+	sudo ./cuda_11.8.0_520.61.05_linux.run
+	sudo rm cuda_11.8.0_520.61.05_linux.run
+	touch /home/wareck/.pass2
+	decompte_
+	;;
 esac
 esac
 fi
 fi
 }
 }
@@ -252,12 +218,11 @@ wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/$Webmin.tar.x
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/xmrig.tar.xz -O /home/wareck/Build_Cube/pack/xmrig.tar.xz
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/xmrig.tar.xz -O /home/wareck/Build_Cube/pack/xmrig.tar.xz
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/zfsmanager-0.0.4.wbm.gz -O /home/wareck/Build_Cube/pack/zfsmanager-0.0.4.wbm.gz
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/zfsmanager-0.0.4.wbm.gz -O /home/wareck/Build_Cube/pack/zfsmanager-0.0.4.wbm.gz
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/gpu-miners.tar.xz -O /home/wareck/Build_Cube/pack/gpu-miners.tar.xz
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/gpu-miners.tar.xz -O /home/wareck/Build_Cube/pack/gpu-miners.tar.xz
-if [ $Drivers = "AMD" ] || [ $Drivers = "NVIDIA" ]
-then
+
 cp /home/wareck/Build_Cube/pack/gpu-miners.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/gpu-miners.tar.xz /home/wareck
-fi
 cp /home/wareck/Build_Cube/pack/pack1.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/pack1.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/pack2.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/pack2.tar.xz /home/wareck
+cp /home/wareck/Build_Cube/pack/pack3.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/xmrig.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/xmrig.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/start_cgminer.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/start_cgminer.tar.xz /home/wareck
 echo "Done."
 echo "Done."
@@ -273,7 +238,7 @@ fi
 
 
 echo -e "$(tput setaf 10)\nDownloading miners:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nDownloading miners:$(tput sgr0)"
 cd /home/wareck
 cd /home/wareck
-if ! [ -d miners ]; then mkdir miners;fi
+if ! [ -d miners ]; then mkdir -p miners;fi
 
 
 cd /home/wareck/miners
 cd /home/wareck/miners
 if ! [ -d xmrig ]
 if ! [ -d xmrig ]
@@ -308,16 +273,11 @@ echo "Done."
 function build_miners_ {
 function build_miners_ {
 if [ ! -f /home/wareck/.pass3 ]
 if [ ! -f /home/wareck/.pass3 ]
 then
 then
-if [ $Drivers = "AMD" ]
-then
+cmake_ #check cmake version
 cd /home/wareck
 cd /home/wareck
 tar xfJ gpu-miners.tar.xz
 tar xfJ gpu-miners.tar.xz
-else
-cd /home/wareck
-tar xfJ gpu-miners.tar.xz
-fi
-
 cd /home/wareck/miners
 cd /home/wareck/miners
+
 echo -e "$(tput setaf 10)\nBuild Cgminer-gekko:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nBuild Cgminer-gekko:$(tput sgr0)"
 cd cgminer-gekko
 cd cgminer-gekko
 sudo usermod -a -G dialout,plugdev wareck
 sudo usermod -a -G dialout,plugdev wareck
@@ -407,19 +367,6 @@ make -j$((`nproc`+1))
 cd ..
 cd ..
 echo "Done."
 echo "Done."
 
 
-
-#if ! grep -q "modded" /usr/include/CL/cl_version.h
-#then
-#sudo cp /usr/include/CL/cl_version.h /home/wareck/
-#echo "/*modded*/" > /home/wareck/cl_version_m.h
-#echo "#define CL_TARGET_OPENCL_VERSION 220" >> /home/wareck/cl_version_m.h
-#cat /home/wareck/cl_version.h >> /home/wareck/cl_version_m.h
-#rm /home/wareck/cl_version.h
-#mv /home/wareck/cl_version_m.h /home/wareck/cl_version.h
-#sudo cp /home/wareck/cl_version.h /usr/include/CL/cl_version.h
-#sudo rm /home/wareck/cl_version.h
-#fi
-
 echo -e "$(tput setaf 10)\nUncompress xmr files:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nUncompress xmr files:$(tput sgr0)"
 tar xfJ /home/wareck/xmrig.tar.xz --checkpoint=.100
 tar xfJ /home/wareck/xmrig.tar.xz --checkpoint=.100
 echo "Done."
 echo "Done."
@@ -475,12 +422,7 @@ if ! [ -d build ];then mkdir build ;fi
 git config --global --add safe.directory /home/wareck/miners/xmr-stak
 git config --global --add safe.directory /home/wareck/miners/xmr-stak
 git pull
 git pull
 cd build
 cd build
-if [ $Drivers = "AMD" ]
-then
-cmake .. -DCUDA_ENABLE=OFF
-else
 cmake .. -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=OFF
 cmake .. -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=OFF
-fi
 make -j$((`nproc`+1))
 make -j$((`nproc`+1))
 cd ..
 cd ..
 cd ..
 cd ..
@@ -489,7 +431,6 @@ echo "Done."
 if [ $Cuda = "YES" ]
 if [ $Cuda = "YES" ]
 then
 then
 echo -e "$(tput setaf 10)\nBuild xmrig-cuda:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nBuild xmrig-cuda:$(tput sgr0)"
-sudo apt-get install git build-essential cmake libuv1-dev nvidia-cuda-dev nvidia-cuda-toolkit libmicrohttpd-dev gcc-8 g++-8
 git clone https://github.com/xmrig/xmrig-nvidia.git
 git clone https://github.com/xmrig/xmrig-nvidia.git
 cd xmrig-nvidia
 cd xmrig-nvidia
 mkdir build
 mkdir build
@@ -553,8 +494,10 @@ sudo rm -r -f /etc/update-motd.d/*
 tar xfJ pack1.tar.xz --checkpoint=.10
 tar xfJ pack1.tar.xz --checkpoint=.10
 echo -n -e "\n"
 echo -n -e "\n"
 sudo cp /home/wareck/pack2.tar.xz /
 sudo cp /home/wareck/pack2.tar.xz /
+sudo cp /home/wareck/pack3.tar.xz /
 cd /
 cd /
 sudo tar xfJ pack2.tar.xz --checkpoint=.10
 sudo tar xfJ pack2.tar.xz --checkpoint=.10
+sudo tar xfJ pack3.tar.xz --checkpoint=.10
 echo -n -e "\n"
 echo -n -e "\n"
 cd /home/wareck
 cd /home/wareck
 
 
@@ -569,44 +512,15 @@ sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
 fi
 fi
 
 
 echo -e "$(tput setaf 10)\nBuild folder and mount drives:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nBuild folder and mount drives:$(tput sgr0)"
-if ! [ -r /media/Exos ];then sudo mkdir /media/Exos && cd / & sudo ln -s /media/Exos /Exos ;fi
-if ! [ -r /media/Cloud ];then sudo mkdir /media/Cloud && cd / & sudo ln -s /media/Cloud /Cloud ;fi
-if ! [ -r /media/Store ];then sudo mkdir /media/Store && cd / & sudo ln -s /media/Store /Store;fi
-if ! [ -r /media/Partage ];then sudo mkdir /media/Partage && cd / & sudo ln -s /media/Partage /Partage;fi
-if ! [ -r /media/Nas ];then sudo mkdir /media/Nas && cd / & sudo ln -s /media/Nas /Nas;fi
-if ! [ -r /media/Nvme0 ];then sudo mkdir /media/Nvme0 && cd / & sudo ln -s /media/Nvme0 /Nvme0 ;fi
-if ! [ -r /media/Nvme1 ];then sudo mkdir /media/Nvme1 && cd / & sudo ln -s /media/Nvme1 /Nvme1 ;fi
-if ! [ -r /Chia ];then sudo mkdir /Chia;fi
-if ! [ -r /Chia/Chia1 ];then sudo mkdir /Chia/Chia1;fi
-if ! [ -r /Chia/Chia2 ];then sudo mkdir /Chia/Chia2;fi
-if ! [ -r /Chia/Chia3 ];then sudo mkdir /Chia/Chia3;fi
-if ! grep "UUID=UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4" /etc/fstab >/dev/null
-then
-cp /etc/fstab /tmp/fstab
-cat <<"EOF">> /tmp/fstab
-#ext4
-UUID=6fc06d70-1a38-4706-ae83-0a329181b9f7 /media/Cloud ext4
-UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4
-UUID=9a837a47-aa05-4ca5-a2e1-2838e53bb9b7 /media/Partage ext4
-UUID=203b0f7e-2cdd-432e-b7a1-a9a454e752c9 /media/Exos ext4
-#btrfs
-UUID=a2f5d82d-8cf9-4c30-9101-d527c09df304 /Nvme0 btrfs ssd,nodatacow,noatime
-UUID=731779b2-6cb6-4951-a4f2-27606c6e0d95 /Nvme1 btrfs ssd,nodatacow,noatime
-#Chia drive
-UUID=15edb9ad-b099-476f-97b0-5855fc5b6fb7 /Chia/Chia1 ext4 auto,nofail,noatime,rw,user    0   0
-UUID=3ef9a608-5d67-4dc9-bae8-ce608cd821d6 /Chia/Chia2 ext4 auto,nofail,noatime,rw,user    0   0
-UUID=66be44f6-f8e9-473c-9b71-db849f870099 /Chia/Chia3 ext4 auto,nofail,noatime,rw,user    0   0
-EOF
-sudo cp /tmp/fstab /etc/fstab
-fi
 
 
 sudo rm /etc/hosts
 sudo rm /etc/hosts
 sudo cat <<'EOF'>> /etc/hosts
 sudo cat <<'EOF'>> /etc/hosts
 127.0.0.1       localhost
 127.0.0.1       localhost
-127.0.1.1       cube
+127.0.1.1       r640
 192.168.1.8     miniserver miniserver gogserver.dnsalias.com
 192.168.1.8     miniserver miniserver gogserver.dnsalias.com
 192.168.1.10    nzxt
 192.168.1.10    nzxt
 192.168.1.11    garage
 192.168.1.11    garage
+192.168.1.100	cube
 192.168.1.254   mafreebox.freebox.fr
 192.168.1.254   mafreebox.freebox.fr
 192.168.1.200   node
 192.168.1.200   node
 
 
@@ -619,138 +533,6 @@ ff02::2 ip6-allrouters
 EOF
 EOF
 echo "Done."
 echo "Done."
 
 
-echo -e "$(tput setaf 10)\nSensors drivers:$(tput sgr0)"
-if [ $motherboard = "FMA86-extreme4" ]
-then
-
-if ! grep "nct6775" /etc/modules >/dev/null
-then
-cp /etc/modules /tmp/modules
-cat <<"EOF">> /tmp/modules
-
-# Chip drivers
-nct6775
-EOF
-sudo cp /tmp/modules /etc/modules
-fi
-
-if [ -f /tmp/sensors3.conf ]
-then
-chmod 777 /tmp/sensors3.conf
-rm /tmp/sensors3.conf
-fi
-cat <<'EOF'>> /tmp/sensors3.conf
-chip "fam15h_power-pci-00c4"
-ignore power1
-
-chip "amdgpu-pci-0200"
-label fan1 "GPU Fan"
-
-chip "k10temp-pci-00c3"
-ignore temp1
-
-chip "nct6776-isa-0290"
-label in0 "Vcore"
-label in2 "AVCC"
-label in3 "+3.3V"
-label in7 "3VSB"
-label in8 "Vbat"
-set in2_min  3.3 * 0.90
-set in2_max  3.3 * 1.10
-set in3_min  3.3 * 0.90
-set in3_max  3.3 * 1.10
-set in7_min  3.3 * 0.90
-set in7_max  3.3 * 1.10
-set in8_min  3.0 * 0.90
-set in8_max  3.3 * 1.10
-set temp1_max 65.000
-set temp1_max_hyst 60.000
-ignore fan1
-ignore fan2
-ignore fan5
-ignore fan4
-ignore intrusion0
-ignore intrusion1
-ignore beep_enable
-ignore temp10
-ignore temp9
-ignore temp8
-ignore temp7
-ignore temp3
-set fan3_min 100.000
-set fan3_max 3000.000
-ignore in1
-ignore in4
-ignore in5
-ignore in6
-label fan3  "CPU Fan"
-label temp1 "M/B Temp"
-label temp2 "CPU Temp"
-label temp2_crit  "CPU Crit"
-EOF
-chmod 644 /tmp/sensors3.conf
-sudo cp /tmp/sensors3.conf /etc/
-echo "Done."
-fi
-
-if [ $motherboard = "GA990xa-ud3" ]
-then
-if ! grep "it87" /etc/modules >/dev/null
-then
-cp /etc/modules /tmp/modules
-cat <<"EOF">> /tmp/modules
-
-# Chip drivers
-it87
-EOF
-sudo cp /tmp/modules /etc/modules
-fi
-if [ -f /tmp/sensors3.conf ]
-then
-chmod 777 /tmp/sensors3.conf
-rm /tmp/sensors3.conf
-fi
-cat <<'EOF'>> /tmp/sensors3.conf
-chip "it8728-isa-0228"
-ignore fan2
-ignore fan3
-ignore fan5
-label fan1 "fan1"
-label fan4 "fan2"
-label temp1 "MB"
-label temp2 "CPU"
-EOF
-chmod 644 /tmp/sensors3.conf
-sudo cp /tmp/sensors3.conf /etc/
-sudo apt install ethtool -y
-iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{print $2a;getline}')
-sudo ethtool --change $iface wol g
-
-cat <<'EOF'>> /tmp/wakemeup.sh
-#!/bin/bash
-set -e
-if ! [ -x "$(command -v etherwake)" ];then sudo apt-get install etherwake -y;fi
-clear
-echo -e "$(tput setaf 10)Wake On Lan v1.0:$(tput sgr0)"
-PS3="Select : "
-items=("Nzxt" "Garage")
-
-select item in "${items[@]}" Quit
-    do
-        case $REPLY in
-            1) sudo etherwake -i enp6s0 58:11:22:CD:FC:7A ; break;;
-            2) sudo etherwake -i enp6s0 E0:D5:5E:2D:9E:CB ; break;;
-            $((${#items[@]}+1))) echo "We're done!"; break 2;;
-            *) echo "Ooops - unknown choice $REPLY"; break;
-        esac
-    done
-echo -e ""
-EOF
-sudo chmod +x /tmp/wakemeup.sh
-sudo cp /tmp/wakemeup.sh /usr/local/bin
-echo "Done."
-fi
-
 echo -e "$(tput setaf 10)\nVnc init:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nVnc init:$(tput sgr0)"
 sudo update-rc.d vncserver defaults
 sudo update-rc.d vncserver defaults
 echo "Done."
 echo "Done."
@@ -813,7 +595,7 @@ then
 if [ ! -d /tmp/foomatic-db/ ]
 if [ ! -d /tmp/foomatic-db/ ]
 then
 then
 cd /tmp/
 cd /tmp/
-echo -e "$(tput setaf 10)\nPrinter Drivers$(tput sgr0)"
+echo -e "$(tput setaf 10)\nInstall printers generic drivers:$(tput sgr0)"
 git clone https://github.com/OpenPrinting/foomatic-db.git
 git clone https://github.com/OpenPrinting/foomatic-db.git
 fi
 fi
 cd /tmp/foomatic-db
 cd /tmp/foomatic-db
@@ -832,21 +614,6 @@ function mounting_drives_ {
 if [ ! -f /home/wareck/.pass4 ]
 if [ ! -f /home/wareck/.pass4 ]
 then
 then
 echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
 echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
-if [ $ZFS = "YES" ]
-then
-if findmnt /media/Cloud/ >/dev/null 2>&1
-then
-sudo zpool export Cloud
-else
-sudo zpool import Cloud
-fi
-fi
-if ! findmnt /media/Partage >/dev/null ; then sudo mount /media/Partage ;fi
-if ! findmnt /media/Store >/dev/null ; then sudo mount /media/Store ;fi
-sudo chmod 777 /media/Store
-sudo chmod 777 /media/Partage
-sudo chmod 777 /media/nvme
-sudo chmod 777 /media/Nas
 echo "Done."
 echo "Done."
 fi
 fi
 }
 }
@@ -856,8 +623,10 @@ if [ -f /home/wareck/.pass4 ]
 then
 then
 echo -e "$(tput setaf 10)\nCleaning install files:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nCleaning install files:$(tput sgr0)"
 if [ -f /pack2.tar.xz ]; then sudo rm /pack2.tar.xz ;fi
 if [ -f /pack2.tar.xz ]; then sudo rm /pack2.tar.xz ;fi
+if [ -f /pack3.tar.xz ]; then sudo rm /pack3.tar.xz ;fi
 if [ -f /home/wareck/pack1.tar.xz ]; then rm /home/wareck/pack1.tar.xz ;fi
 if [ -f /home/wareck/pack1.tar.xz ]; then rm /home/wareck/pack1.tar.xz ;fi
 if [ -f /home/wareck/pack2.tar.xz ]; then rm /home/wareck/pack2.tar.xz ;fi
 if [ -f /home/wareck/pack2.tar.xz ]; then rm /home/wareck/pack2.tar.xz ;fi
+if [ -f /home/wareck/pack3.tar.xz ]; then rm /home/wareck/pack3.tar.xz ;fi
 if [ -f /home/wareck/xmrig.tar.xz ]; then rm /home/wareck/xmrig.tar.xz ;fi
 if [ -f /home/wareck/xmrig.tar.xz ]; then rm /home/wareck/xmrig.tar.xz ;fi
 if [ -f /home/wareck/gpu-miners.tar.xz ]; then rm /home/wareck/gpu-miners.tar.xz;fi
 if [ -f /home/wareck/gpu-miners.tar.xz ]; then rm /home/wareck/gpu-miners.tar.xz;fi
 if [ -r /home/wareck/Music ]; then sudo rm -r -f /home/wareck/Music ;fi
 if [ -r /home/wareck/Music ]; then sudo rm -r -f /home/wareck/Music ;fi
@@ -894,6 +663,7 @@ then
 echo -e "$(tput setaf 10)\nInit install & autostart:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nInit install & autostart:$(tput sgr0)"
 mkdir /home/wareck/.config/autostart
 mkdir /home/wareck/.config/autostart
 echo -e "Done."
 echo -e "Done."
+sleep 1
 fi
 fi
 
 
 if [ ! -f /home/wareck/.config/autostart/install_os.desktop ]
 if [ ! -f /home/wareck/.config/autostart/install_os.desktop ]
@@ -959,6 +729,10 @@ if ! grep "wareck" /etc/sudoers >/dev/null
 then
 then
 sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
 sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
 fi
 fi
+echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
+sudo apt-get update
+sudo apt-get install lxde lxde-icon-theme -y
+sleep 1
 }
 }
 
 
 function remove_screensaver {
 function remove_screensaver {
@@ -971,6 +745,37 @@ sudo chmod 744 autostart
 sudo cp autostart /etc/xdg/lxsession/LXDE/
 sudo cp autostart /etc/xdg/lxsession/LXDE/
 sudo cp autostart /home/wareck/.config/lxsession/LXDE/
 sudo cp autostart /home/wareck/.config/lxsession/LXDE/
 sudo rm autostart
 sudo rm autostart
+sudo apt-get remove xscreensaver xscreensaver-data -y
+}
+
+function cmake_ {
+pids=""
+/home/wareck/Build_Cube/options/tools/_cmake.sh rollback & pids="$pids $!"
+wait $pids
+}
+
+function watchdog_ {
+pids=""
+/home/wareck/Build_Cube/options/watchdog.sh ext & pids="$pids $!"
+wait $pids
+}
+
+function wol_ {
+iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{print $2a;getline}')
+ether=$(which ethtool)
+echo "[Unit]" >>/tmp/wol.service
+echo "Description=Enable Wake On Lan" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Service]" >>/tmp/wol.service
+echo "Type=oneshot" >>/tmp/wol.service
+echo "ExecStart = $ether --change$iface wol g" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Install]" >>/tmp/wol.service
+echo "WantedBy=basic.target" >>/tmp/wol.service
+sudo cp /tmp/wol.service /etc/systemd/system/wol.service
+sudo systemctl daemon-reload
+sudo systemctl enable wol.service
+sudo systemctl start wol.service
 }
 }
 
 
 intro_
 intro_
@@ -979,7 +784,6 @@ ubuntu_version_check
 update_
 update_
 kernel_check_
 kernel_check_
 autoroot_
 autoroot_
-nvidia_driver_
 update_
 update_
 download_packs_
 download_packs_
 printer_
 printer_
@@ -987,10 +791,9 @@ build_miners_
 configure_
 configure_
 mounting_drives_
 mounting_drives_
 cleaning_
 cleaning_
+remove_screensaver
 clear
 clear
 dynmotd
 dynmotd
-remove_screensaver
-
 
 
 echo -e "$(tput setaf 10)\nEnd of script:$(tput sgr0) \n"
 echo -e "$(tput setaf 10)\nEnd of script:$(tput sgr0) \n"
 echo -e "$(tput setaf 7)Need to install webmin manually (reboot required)$(tput sgr0)"
 echo -e "$(tput setaf 7)Need to install webmin manually (reboot required)$(tput sgr0)"