Votre Nom 1 year ago
parent
commit
c063148a97
7 changed files with 108 additions and 92 deletions
  1. 6 5
      README.md
  2. 11 8
      build_cube.sh
  3. 3 66
      options/build_gerbera.sh
  4. 20 9
      options/chia.sh
  5. 4 4
      options/flexfarmer.sh
  6. 1 0
      options/tools/.gitignore
  7. 63 0
      options/tools/_cmake.sh

+ 6 - 5
README.md

@@ -1,11 +1,12 @@
 build Cube base
-
-Update to V13:
+Update to V14:
+- Amelioration générale
+- Nouvelle archi disques
 - travail sur le nouveau kernel
-- Nvidia Drivers (ubuntu internal and external download)
+- Nvidia Drivers 
 - Nvme Btrfs Raid
-- miners for AMD A8
-- webmin
+- miners for AMD FX
+- Webmin
 - Chia toolkit
 - Gerbera toolkit
 - Bitcoin-sv build

+ 11 - 8
build_cube.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 set -e
-Version=14.0
+Version=14.2
 Cuda=NO
 kernel_custom=YES
 Webmin="webmin-2.021"
@@ -91,9 +91,9 @@ echo -e ""
 if [ $Cuda = "YES" ]
 then
 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 cmake libuv1-dev nvidia-cuda-dev nvidia-cuda-toolkit libmicrohttpd-dev gcc-8 g++-8 -y
 fi
+echo -e "Done."
 fi
 }
 
@@ -404,14 +404,16 @@ cd ..
 cd ..
 echo "Done."
 
+fi [ $Cuda = "YES" ]
+then
 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
 cd xmrig-nvidia
 mkdir build
 cd build
 cmake .. -DCMAKE_C_COMPILER=$(which gcc-8) -DCMAKE_CXX_COMPILER=$(which g++-8)
 make -j$((`nproc`+1))
+fi
 
 echo "Done"
 touch /home/wareck/.pass3
@@ -497,6 +499,7 @@ if ! [ -r /farm ];then sudo mkdir /farm;fi
 if ! [ -r /farm/farm0 ];then sudo mkdir /farm/farm0;fi
 if ! [ -r /farm/farm1 ];then sudo mkdir /farm/farm1;fi
 if ! [ -r /farm/farm2 ];then sudo mkdir /farm/farm2;fi
+if ! [ -r /farm/farm3 ];then sudo mkdir /farm/farm3;fi
 if ! grep "UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4" /etc/fstab >/dev/null
 then
 cp /etc/fstab /tmp/fstab
@@ -505,13 +508,13 @@ cat <<"EOF">> /tmp/fstab
 UUID=6fc06d70-1a38-4706-ae83-0a329181b9f7 /media/Cloud ext4 auto,nofail,noatime,rw,user    0   0
 UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4 auto,nofail,noatime,rw,user    0   0
 UUID=a111c12b-d1b4-441a-9352-b6bbc558184e /media/Partage ext4 auto,nofail,noatime,rw,user    0   0
-UUID=77a593df-1bdb-4012-8c9e-ce50864b464d /media/Exos ext4 auto,nofail,noatime,rw,user    0   0
 #btrfs raid
 UUID=c47d2dd0-b654-4865-8b9e-67c47196c081 /nvme btrfs  ssd,nodatacow,discard=async,noatime
 #Chia drive
-UUID=0d145a5a-50b0-456c-8998-549def2f9fc9 /farm/farm0 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
-UUID=b99c7fa3-827c-4c09-a625-a72aec6c9395 /farm/farm1 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
-UUID=e583a1e4-f8c8-4c2b-a427-cee854e0b56d /farm/farm2 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
+UUID=77a593df-1bdb-4012-8c9e-ce50864b464d /farm/farm0 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
+UUID=0d145a5a-50b0-456c-8998-549def2f9fc9 /farm/farm1 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
+UUID=b99c7fa3-827c-4c09-a625-a72aec6c9395 /farm/farm2 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
+UUID=e583a1e4-f8c8-4c2b-a427-cee854e0b56d /farm/farm3 ext4 auto,nofail,noatime,nodiratime,rw,user  0   0
 EOF
 sudo cp /tmp/fstab /etc/fstab
 fi

+ 3 - 66
options/build_gerbera.sh

@@ -60,72 +60,9 @@ echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
 }
 
 function cmake_ {
-echo -e "$(tput setaf 10)\nInstall cmake:$(tput sgr0)"
-if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
-case $flag in
-0)
-	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/cmake_3.26.3-1_amd64.deb
-	sudo dpkg -i cmake_3.26.3-1_amd64.deb
-	rm cmake_3.26.3-1_amd64.deb
-	;;
-1)
-	cmake_v="$(cmake --version | grep "version" | awk '{print $3}')"
-	echo "cmake version : $cmake_v"
-	sleep 2
-	if ! [ $(version $cmake_v) -ge $(version "3.18") ]
-	then
-	echo -e "cmake need update=> cmake_3.26.3"
-	sudo apt-get -qq remove --purge cmake -y
-	wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/cmake_3.26.3-1_amd64.deb
-	sudo dpkg -i cmake_3.26.3-1_amd64.deb
-	rm cmake_3.26.3-1_amd64.deb
-	else
-	echo -e "cmake version ok."
-	sleep 2
-	fi
-	;;
-*)	echo "Error";;
-esac
-}
-
-function cmake_source {
-echo -e "$(tput setaf 10)\nInstall cmake:$(tput sgr0)"
-if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
-case $flag in
-0)
-	wget -c https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.26.3.tar.gz
-	tar xvfz cmake-3.26.3.tar.gz
-	cd cmake-3.26.3
-	./bootstrap
-	make
-	sudo make install
-	cd ..
-	rm -r -f cmake-3.26.3
-	rm cmake-3.26.3.tar.gz
-        ;;
-1)
-        cmake_v="$(cmake --version | grep "version" | awk '{print $3}')"
-        echo "cmake version : $cmake_v"
-        sleep 2
-        if ! [ $(version $cmake_v) -ge $(version "3.18") ]
-        then
-        echo -e "cmake need update =>:"
-	wget -c https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
-        tar xvfz cmake-3.26.3.tar.gz
-        cd cmake-3.26.3
-        ./bootstrap
-        make
-        sudo make install
-        cd ..
-        rm -r -f cmake-3.26.3
-        rm cmake-3.26.3.tar.gz
-        else
-        echo -e "cmake version ok."
-        sleep 2
-        fi
-        ;;
-*)      echo "Error";;
-esac
+pids=""
+./tools/_cmake.sh & pids="$pids $!"
+wait $pids
 }
 
 function build_ {

+ 20 - 9
options/chia.sh

@@ -108,7 +108,7 @@ if ! [ -d /home/wareck/chia ];then mkdir /home/wareck/chia;fi
 }
 
 function update_ {
-echo -e "$(tput setaf 2)\nUpdate and install packages:$(tput sgr0)"
+echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
 sleep 1
 if grep "Drivers=NVIDIA" /home/wareck/Build_Cube/build_cube.sh >/dev/null
 then
@@ -121,7 +121,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function chia_plotter {
-echo -e "$(tput setaf 2)\nBuild Chia-Plotter (MadMax4ever) :$(tput sgr0)"
+echo -e "$(tput setaf 10)\nBuild Chia-Plotter (MadMax4ever) :$(tput sgr0)"
 sleep 1
 cd /home/wareck/chia/
 if [ ! -d chia-plotter ]
@@ -155,7 +155,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function bladebit {
-echo -e "$(tput setaf 2)\nBuild Bladebit v2 :$(tput sgr0)"
+echo -e "$(tput setaf 10)\nBuild Bladebit v2 :$(tput sgr0)"
 sleep 1
 cd /home/wareck/chia
 if [ ! -d bladebit ]
@@ -171,7 +171,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function gigahorse {
-echo -e "$(tput setaf 2)\nMadMax4ever GigaHorse:$(tput sgr0)"
+echo -e "$(tput setaf 10)\nMadMax4ever GigaHorse:$(tput sgr0)"
 sleep 1
 if [ -d /home/wareck/chia/chia-gigahorse ]
 then
@@ -190,7 +190,7 @@ if [ -f /usr/local/bin/distrib_chia.sh ];then sudo rm /usr/local/bin/distrib_chi
 cat <<'EOF'>> distrib_chia.sh
 #!/bin/bash
 echo "IP : $(hostname -I)"
-chia_plot_sink -p 1447 /farm/farm0/Plots-nft/ /farm/farm1/Plots-nft/ /farm/farm2/Plots-nft/ /Partage/Plots-nft/ /Exos/Plots-nft/
+chia_plot_sink -p 1447 /farm/farm0/Plots-nft/ /farm/farm1/Plots-nft/ /farm/farm2/Plots-nft/ /farm/farm3/Plots-nft/ /Partage/Plots-nft/
 EOF
 chmod +x distrib_chia.sh
 sudo mv distrib_chia.sh /usr/local/bin/
@@ -208,7 +208,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function chiapos {
-echo -e "$(tput setaf 2)\nBuild Chia-Pos:$(tput sgr0)"
+echo -e "$(tput setaf 10)\nBuild Chia-Pos:$(tput sgr0)"
 sleep 1
 cd /home/wareck/chia
 if [ ! -d  /home/wareck/chia/chia-pos ]
@@ -227,7 +227,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function miner {
-echo -e "$(tput setaf 2)\nChia-Miner (hpool):$(tput sgr0)"
+echo -e "$(tput setaf 10)\nChia-Miner (hpool):$(tput sgr0)"
 sleep 1
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/chia-miner.tar.xz -O /home/wareck/Build_Cube/pack/chia-miner.tar.xz
 cp /home/wareck/Build_Cube/pack/chia-miner.tar.xz /home/wareck/miners
@@ -238,7 +238,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function chia_blockchain {
-echo -e "$(tput setaf 2)\nBuild Chia-blockchain & Gui :$(tput sgr0)"
+echo -e "$(tput setaf 10)\nBuild Chia-blockchain & Gui :$(tput sgr0)"
 sleep 1
 cd /home/wareck/chia
 if [ ! -d  /home/wareck/chia/chia-blockchain ]
@@ -256,7 +256,7 @@ echo -e "\e[97mDone.\e[0m"
 }
 
 function service_ {
-echo -e "$(tput setaf 2)\nInstall chia-miner service (hpool) :$(tput sgr0)"
+echo -e "$(tput setaf 10)\nInstall chia-miner service (hpool) :$(tput sgr0)"
 sleep 1
 echo "Generation du fichier /etc/init.d/chia-miner"
 cat <<'EOF'>> chia-miner.sh
@@ -291,9 +291,19 @@ sudo rm chia-miner.sh
 echo -e "\e[97mDone.\e[0m"
 }
 
+function cmake_ {
+if [ $BladeBit = "YES" ]
+then
+pids=""
+./tools/_cmake.sh & pids="$pids $!"
+wait $pids
+fi
+}
+
 simplify_config
 intro_
 update_
+cmake_
 case $Gui in
 NO|YES)
         if [ $GigaHorse = "YES" ];then gigahorse;fi
@@ -301,6 +311,7 @@ NO|YES)
 	if [ $BladeBit = "YES" ];then bladebit;fi
 	if [ $ChiaPos = "YES" ];then chiapos;fi
 	if [ $Service = "YES" ];then service_;fi
+	miner
 	;;
 esac
 case $Gui in

+ 4 - 4
options/flexfarmer.sh

@@ -113,9 +113,9 @@ echo
 install_
 build_service
 nft_builder
-sudo systemctl restart rsyslog
-sudo systemctl daemon-reload >/dev/null
-sudo systemctl enable flexfarmer >/dev/null
-sudo systemctl start flexfarmer >/dev/null
+sudo systemctl restart rsyslog >/dev/null 2>&1
+sudo systemctl daemon-reload >/dev/null 2>&1
+sudo systemctl enable flexfarmer >/dev/null 2>&1
+sudo systemctl start flexfarmer >/dev/null 2>&1
 #sudo systemctl status flexfarmer
 echo

+ 1 - 0
options/tools/.gitignore

@@ -1,3 +1,4 @@
 cndrvcups-capt_2.71-1_amd64.deb 
 cndrvcups-common_3.21-1_amd64.deb 
 kernel_patch
+cmake*

+ 63 - 0
options/tools/_cmake.sh

@@ -0,0 +1,63 @@
+#!/bin/bash
+Mode=prod
+error_flag=0
+
+function version {
+echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
+}
+
+function install_ {
+echo -e "$(tput setaf 10)\nInstall / Update cmake :$(tput sgr0)"
+if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
+case $flag in
+0)
+        wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/cmake_3.26.3-1_amd64.deb
+        sudo dpkg -i cmake_3.26.3-1_amd64.deb
+        rm cmake_3.26.3-1_amd64.deb
+        ;;
+1)
+        cmake_v="$(cmake --version | grep "version" | awk '{print $3}')"
+        echo "cmake version : $cmake_v"
+        sleep 2
+        if ! [ $(version $cmake_v) -ge $(version "3.18") ]
+        then
+        echo -e "cmake need update=> cmake_3.26.3"
+        sudo apt-get -qq remove --purge cmake -y
+        wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/cmake_3.26.3-1_amd64.deb
+        sudo dpkg -i cmake_3.26.3-1_amd64.deb
+        rm cmake_3.26.3-1_amd64.deb
+        else
+        echo -e "cmake version ok."
+        sleep 2
+        fi
+        ;;
+*)      echo "Error";;
+esac
+echo "Done"
+}
+
+function cmake_source {
+echo -e "$(tput setaf 12)Cmake kitware build:$(tput sgr0)"
+sleep 2
+sudo apt-get install checkinstall -y
+wget -c https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
+tar xvfz cmake-3.26.3.tar.gz
+cd cmake-3.26.3
+./bootstrap
+make -j6
+sudo checkinstall --pkgname=cmake --pkgversion="3.26.3" --default
+hash -r
+}
+
+Mode=${Mode^^}
+if [ $Mode = "PROD" ]
+then
+install_
+fi
+if [ $Mode = "BUILD" ]
+then
+cmake_source
+fi
+
+
+