-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathETHminerBuildScriptDmW.bash
More file actions
238 lines (210 loc) · 6.35 KB
/
ETHminerBuildScriptDmW.bash
File metadata and controls
238 lines (210 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/bash
#========== PreStart ==========
#Set version info
V=3.5.3
#========== Start ==========
clear
echo '###############################################################################'
echo #
echo " ETHminerBuildScriptDmW Version '$V'"
echo #
echo " AUTHOR: DeadManWalking (DeadManWalkingTO-GitHub)"
echo " (https://github.com/DeadManWalkingTO)"
echo #
echo '###############################################################################'
echo #
echo 'ETHminerBuildScriptDmW'
echo "1. Auto Remove old Ethminer's Directory"
echo "2. Auto Clone (Download) latest Master of Ethminer"
echo "3. Auto Configure Ethminer"
echo "4. Auto Build Ethminer"
echo #
read -n1 -r -p "Press any key to continue... " key
echo #
echo #
#========== Initializing ==========
DmW_Project_Name_V=Ethminer
DmW_Project_Name=ethminer
DmW_Project_Git=https://github.com/ethereum-mining/ethminer.git
#Change Directory to Home
echo "=================================================="
echo "Change Directory to Home"
echo #
cd ~
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#========== Run ==========
#Remove old Project's Directory
echo "=================================================="
echo 'Remove old '$DmW_Project_Name_V"'s Directory"
echo #
rm -rf $DmW_Project_Name
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Download Project
echo "=================================================="
echo 'Download '$DmW_Project_Name_V
echo #
git clone --depth=1 --branch=master $DmW_Project_Git
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Change Directory to Project's
echo "=================================================="
echo 'Change Directory to '$DmW_Project_Name_V"'s"
echo #
cd $DmW_Project_Name
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Git Fetch
echo "=================================================="
echo "Git Fetch"
git fetch -q origin
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1
#Git Checkout
echo "=================================================="
echo "Git Checkout"
git checkout -qf FETCH_HEAD
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1
#Git Submodules
echo "=================================================="
echo "Git Submodules"
echo #
git submodule update --init --recursive
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Make Build Directory
echo "=================================================="
echo "Make Build Directory"
echo #
mkdir -p build
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Change Directory to Build
echo "=================================================="
echo "Change Directory to Build"
echo #
cd build
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Configure Project
echo "=================================================="
echo 'Configure' $DmW_Project_Name_V
echo #
DmW_MSG="Enable CUDA mining."
echo $DmW_MSG
read -p "Enable? (For Yes type Y or y. Anything else for No.) " -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHASHCUDA=ON'
else
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHASHCUDA=OFF'
fi
DmW_MSG="Enable OpenCL mining."
echo $DmW_MSG
read -p "Enable? (For Yes type Y or y. Anything else for No.) " -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHASHCL=ON'
DmWCL=1
else
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHASHCL=OFF'
DmWCL=0
fi
if [ "$DmWCL" == "1" ]
then
DmW_MSG="Install AMD binary kernels."
echo $DmW_MSG
read -p "Install? (For Yes type Y or y. Anything else for No.) " -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DBINKERN=ON'
else
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DBINKERN=OFF'
fi
fi
DmW_MSG="Enable D-Bus support, OFF by default."
echo $DmW_MSG
read -p "Enable? (For Yes type Y or y. Anything else for No.) " -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHDBUS=ON'
else
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHDBUS=OFF'
fi
DmW_MSG="Enable API Server."
echo $DmW_MSG
read -p "Enable? (For Yes type Y or y. Anything else for No.) " -n 1 -r
echo #
if [[ $REPLY =~ ^[Yy]$ ]]
then
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHDBUS=ON'
else
DmW_CMAKE_CONFIG=$DmW_CMAKE_CONFIG' -DETHDBUS=OFF'
fi
echo #
cmake .. $DmW_CMAKE_CONFIG
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Build Project
echo "=================================================="
echo 'Build '$DmW_Project_Name_V
echo #
cmake --build .
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Copy Project to Home Directory
echo "=================================================="
echo 'Copy '$DmW_Project_Name_V' to Home Directory'
echo #
cp ~/$DmW_Project_Name/build/ethminer/Release/ethminer ~
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#Change Directory to Home
echo "=================================================="
echo "Change Directory to Home"
echo #
cd ~
if [ $? -eq 0 ]; then echo; echo "Done"; else echo; echo "Fail"; exit; fi
echo "=================================================="
echo #
sleep 1s
#ETHminerBuildScriptDmW was completed
echo "=================================================="
echo "ETHminerBuildScriptDmW was completed"
echo "=================================================="
echo #
#========== End ==========
read -n1 -r -p "Press any key to continue... " key
echo #
exit 0
#========== EoF ==========