-
Notifications
You must be signed in to change notification settings - Fork 9
/
SDVTOOL.bat
executable file
·280 lines (251 loc) · 9.21 KB
/
SDVTOOL.bat
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
@ Echo off
REM -----------------------------------------------------------------------
REM Copyright (c) 2010-2017 Red Hat, Inc.
REM
REM Author(s):
REM Miki Mishael <[email protected]>
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions
REM are met :
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and / or other materials provided with the distribution.
REM 3. Neither the names of the copyright holders nor the names of their contributors
REM may be used to endorse or promote products derived from this software
REM without specific prior written permission.
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
REM ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM ENT OF SUBSTITUTE GOODS
REM OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
REM HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
REM LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
REM OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
REM SUCH DAMAGE.
REM -----------------------------------------------------------------------
Rem This script was made to run Static Driver Verifier.
Rem This script was Tested only on Windows 2008R2 and visual studio 2012.
Rem ver SdvTool 1.0.0.0
REM for running auto from build system use without any parameters.
SETLOCAL
IF "%~1"=="" ( SET var=1)
IF "%~1"=="" ( Goto PRERUN)
:Menu
cls
COLOR 0B
Echo.
Echo.= Menu ================= Ver 1.0.0.0 ===================
Echo.
Echo Please choose which operation would you like to Verify:
Echo.
Echo (1): Verify All Projects (ALL Configurations)
Echo (2): Verify NetKVM (ALL Configurations)
Echo (3): Verify Vioserial (ALL Configurations)
Echo (4): Verify Balloon (ALL Configurations)
Echo (5): Verify Vioscsi (ALL Configurations)
Echo (6): Verify Viostor (ALL Configurations)
Echo (7): Quit
Echo.
Echo ========================================================
Echo.
Echo Please choose which operation you would like to Verify,Then enter.
Echo E.g: 1 "Enter":
Echo.
SET /P var=[Choose Verify:]
Echo.
if "%var%"=="7" (
Goto End
)
if "%var%"=="1" ( Goto PRERUN)
if "%var%"=="2" ( Goto PRERUN)
if "%var%"=="3" ( Goto PRERUN)
if "%var%"=="4" ( Goto PRERUN)
if "%var%"=="5" ( Goto PRERUN)
if "%var%"=="6" ( Goto PRERUN)
Echo *******************************************************************
Echo * Wrong Operation Argument, Please Try Again in 5 sec ... *
Echo *******************************************************************
Ping -n 5 127.0.0.1 > NUL
Goto Menu
:PRERUN
Rem *******************************************************************
Rem Init all parameters
Rem *******************************************************************
SET ROOT_PATH=%~dp0
SET all=
SET err=0
SET /A cnt=2
SET parm1=
SET parm2=
SET parm3=
SET parm4=
Rem *******************************************************************
Rem *******************************************************************
Rem Build VirtIO
Rem *******************************************************************
COLOR
cd VirtIO
call buildAll.bat
cd ..
Rem *******************************************************************
Rem NetKVM Vioserial Balloon Vioscsi Viostor
Rem *******************************************************************
:Var
if "%var%"=="1" ( Goto Process)
if "%var%"=="2" ( Goto NetKVM)
if "%var%"=="3" ( Goto Vioserial)
if "%var%"=="4" ( Goto Balloon)
if "%var%"=="5" ( Goto Vioscsi)
if "%var%"=="6" ( Goto Viostor)
Echo = Variables ============================================
Echo.
Rem *****************************************************************************
Rem Set PROJECT_XML_PATH, PROJECT_DIR_PATH PROJECT_NAME, ROOT_PATH for RunSdv.bat
Rem *****************************************************************************
:NetKVM
SET PROJECT_XML_PATH=%ROOT_PATH%"NetKVM\NetKVM.vcxproj"
SET PROJECT_DIR_PATH=%ROOT_PATH%"NetKVM"
SET PROJECT_NAME="NetKVM"
Goto SetParam
:Vioserial
SET PROJECT_XML_PATH=%ROOT_PATH%"vioserial\sys\vioser.vcxproj"
SET PROJECT_DIR_PATH=%ROOT_PATH%"vioserial\sys"
SET PROJECT_NAME="vioser"
Goto SetParam
:Balloon
SET PROJECT_XML_PATH=%ROOT_PATH%"balloon\sys\balloon.vcxproj"
SET PROJECT_DIR_PATH=%ROOT_PATH%"balloon\sys"
SET PROJECT_NAME="balloon"
Goto SetParam
:Vioscsi
SET PROJECT_XML_PATH=%ROOT_PATH%"vioscsi\vioscsi.vcxproj"
SET PROJECT_DIR_PATH=%ROOT_PATH%"vioscsi"
SET PROJECT_NAME="vioscsi"
Goto SetParam
:Viostor
SET PROJECT_XML_PATH=%ROOT_PATH%"viostor\viostor.vcxproj"
SET PROJECT_DIR_PATH=%ROOT_PATH%"viostor"
SET PROJECT_NAME="viostor"
Goto SetParam
:SetParam
SET parm1=%ROOT_PATH%
SET parm2=%PROJECT_XML_PATH%
SET parm3=%PROJECT_DIR_PATH%
SET parm4=%PROJECT_NAME%
if "%all%"=="true" GOTO IterateAll
Goto Process
Rem *******************************************************************
Rem Start processing
Rem *******************************************************************
:Process
if "%var%"=="1" (
SET all=true
:p2
Goto Vioserial
:p3
Goto Balloon
:p4
Goto Viostor
:p5
Goto Vioscsi
:p6
Goto NetKVM
:IterateAll
call RunSdv.bat %parm1% %parm2% %parm3% %parm4%
IF %ERRORLEVEL% NEQ 0 SET err=1
SET /A cnt+=1
if %cnt% GTR 6 GOTO END
Goto p%cnt%
)
call RunSdv.bat %parm1% %parm2% %parm3% %parm4%
IF %ERRORLEVEL% NEQ 0 goto Error4
GOTO Menu
Rem *******************************************************************
Rem Error handling
Rem *******************************************************************
:Error1
Echo ************************************************************************
Echo * !!!!Wrong Project name!!!! *
Echo ************************************************************************
Echo.
Ping -n 3 127.0.0.1 > NUL
ENDLOCAL
color
EXIT /B 1
:Error2
Echo *******************************************************************************
Echo * Wrong Configuration, Couldn't find in project you chose, Please Try Again...*
Echo *******************************************************************************
Echo.
Ping -n 3 127.0.0.1 > NUL
ENDLOCAL
color
EXIT /B 1
:Error3
Echo ***************************************************************************
Echo * Wrong Platform, There isn't in project you chose, Please Try Again ... *
Echo ***************************************************************************
Echo.
Ping -n 3 127.0.0.1 > NUL
ENDLOCAL
color
EXIT /B 1
:Error4
Echo ***************************************************************************
Echo * General Error, Please Try Again ... *
Echo ***************************************************************************
Echo.
Ping -n 3 127.0.0.1 > NUL
ENDLOCAL
color
EXIT /B 1
Rem *******************************************************************
Rem Get user input for project name and validate it.
Rem *******************************************************************
:start
SET /P parm1=[Please Choose project name then Enter:]
Echo Please wait,Validating Project Name...
Ping -n 1 %parm1% | find "TTL" > NUL
IF %ERRORLEVEL% NEQ 0 goto Error1
Rem *******************************************************************
Rem Get user input for Configuration Time
Rem *******************************************************************
:Next1
SET /P parm2=[Please Choose Configuration then Enter:]
Echo Please wait,Validating Project Name...
Ping -n 1 %parm1% | find "TTL" > NUL
IF %ERRORLEVEL% NEQ 0 goto Error2
Goto Next2
Rem *******************************************************************
Rem Get user input for Platform
Rem *******************************************************************
:Next2
SET /P parm3=[Please Choose Platform then Enter:]
Echo Please wait,Validating Platform Name...
Ping -n 1 %parm1% | find "TTL" > NUL
IF %ERRORLEVEL% NEQ 0 goto Error3
Goto Next3
Rem *******************************************************************
Rem End and ReSET all parameters
Rem *******************************************************************
:END
color
SET var=
SET ans=
SET parm1=
SET parm2=
SET parm3=
SET parm4=
SET var=
SET all=
SET cnt=
Echo Thank you,Good Bye!
COLOR
ENDLOCAL
Ping -n 5 127.0.0.1 > NUL
EXIT /B %err%