forked from feizwang/quarkfsp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
BuildFsp2_0.sh
executable file
·502 lines (442 loc) · 16.7 KB
/
BuildFsp2_0.sh
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
## @file
# @copyright
# Copyright (c) 2008 - 2016, Intel Corporation All rights reserved
# This software and associated documentation (if any) is furnished
# under a license and may only be used or copied in accordance
# with the terms of the license. Except as permitted by such
# license, no part of this software or documentation may be
# reproduced, stored in a retrieval system, or transmitted in any
# form or by any means without the express written consent of
# Intel Corporation.
# This file contains an 'Intel Peripheral Driver' and is
# licensed for Intel CPUs and chipsets under the terms of your
# license agreement with Intel or your vendor. This file may
# be modified by the user, subject to additional terms of the
# license agreement
##
#!/bin/sh
FSP_PACKAGE=QuarkFspPkg
FSP_BIN_PKG_NAME=QuarkFspBinPkg
PLATFORM_NAME=QuarkFsp2_0
BIN_SUB_DIR=Fsp2_0
FSP_PKG_CONF_NAME=QuarkFspPkgConfig
FSP_PKG_EXT_CONF_NAME=QuarkFspPkgExtConfig
TOOL_CHAIN=GCC48
Edksetup=edksetup.sh
FSP_T_UPD_GUID=34686CA3-34F9-4901-B82A-BA630F0714C6
FSP_M_UPD_GUID=39A250DB-E465-4DD1-A2AC-E2BD3C0E2385
FSP_S_UPD_GUID=CAE3605B-5B34-4C85-B3D7-27D54273C40F
ErrorCode=0
OUT_DIR=Build
export TOOL_CHAIN
function USAGE()
{
echo
echo "$0 \[-h \| -? \| -r32 \| -fr32 \| -d32 \| -clean\]"
echo
return 1
}
function Clean(){
echo Removing Build and Conf directories ...
if [ -d Build ]
then
rm -r Build
fi
if [ -d Conf/.cache ]
then
rm -r Conf/.cache
fi
if [ -f *.log ]
then
rm *.log
fi
WORKSPACE=
EDK_TOOLS_PATH=
return 0
}
function PreBuildFail(){
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspUpd.h ]
then
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FsptUpd.h ]
then
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FsptUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspmUpd.h ]
then
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspmUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspsUpd.h ]
then
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspsUpd.h
fi
#/q /f
return 0
}
function PreBuildRet(){
set $1=0
echo End of PreBuild ...
echo
return 0
}
function CopyBin(){
if [ -f $1/*.efi ]
then
cp $1/*.efi $2
#/D /U /Y > NUL
fi
if [ -f $1/*.inf ]
then
cp $1/*.inf $2
#/D /U /Y > NUL
fi
if [ -f $1/*.depex ]
then
cp $1/*.depex $2
#/D /U /Y > NUL
fi
}
function PreBuild(){
# Create the necessary directories
if [ ! -e $OUT_DIR ]
then
mkdir $OUT_DIR
fi
if [ ! -e $OUT_DIR/$PLATFORM_NAME ]
then
mkdir $OUT_DIR/$PLATFORM_NAME
fi
if [ ! -e $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN ]
then
mkdir $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN
fi
if [ ! -e $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/ ]
then
mkdir $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/
fi
echo Generating UPD.TXT files
python IntelFsp2Pkg/Tools/GenCfgOpt.py \
UPDTXT \
$FSP_PACKAGE/$PLATFORM_NAME.dsc \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
$BD_MACRO
error=256
if [ $? -eq $error ]
then
echo DSC is not changed, no need to recreate MAP and BIN file
else
error=0
if [ $? -ne $error ]
then
echo error: $?
return 1
fi
echo UPD TXT file was generated successfully !
echo Remove the UPD.BIN and UPD.MAP files ...
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_T_UPD_GUID.bin \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_T_UPD_GUID.map \
#2>nul
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_M_UPD_GUID.bin \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_M_UPD_GUID.map \
#2>nul
rm $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_S_UPD_GUID.bin \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_S_UPD_GUID.map \
#2>nul
echo Generating FSP-T GUID .BIN and .MAP files
BaseTools/BinWrappers/PosixLike/BPDG \
-o $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_T_UPD_GUID.bin \
-m $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_T_UPD_GUID.map \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_T_UPD_GUID.txt
if [ $? -eq "1" ]
then
return 1
fi
echo Generating FSP-M GUID .BIN and .MAP files
BaseTools/BinWrappers/PosixLike/BPDG \
-o $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_M_UPD_GUID.bin \
-m $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_M_UPD_GUID.map \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_M_UPD_GUID.txt
if [ $? -eq "1" ]
then
return 1
fi
echo Generating FSP-S GUID .BIN and .MAP files
BaseTools/BinWrappers/PosixLike/BPDG \
-o $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_S_UPD_GUID.bin \
-m $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_S_UPD_GUID.map \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/$FSP_S_UPD_GUID.txt
if [ $? -eq "1" ]
then
return 1
fi
fi
echo Generate the UPD header files
touch $FSP_PACKAGE/Include/BootLoaderPlatformData.h
python IntelFsp2Pkg/Tools/GenCfgOpt.py \
HEADER \
$FSP_PACKAGE/$PLATFORM_NAME.dsc \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
$FSP_PACKAGE/Include/BootLoaderPlatformData.h \
$FSP_PACKAGE/$FSP_PKG_CONF_NAME.dsc \
$FSP_PACKAGE/$FSP_PKG_EXT_CONF_NAME.dsc \
$BD_MACRO
if [ $? -eq "256" ]
then
echo
# No need to recreate the UPD header files
else
if [ $? -eq "1" ]
then
echo
fi
echo UPD header files were generated successfully!
echo Generate BSF File ...
if [ -f $FSP_BIN_PKG_NAME/$BIN_SUB_DIR/fsp.bsf ]
then
rm -f $FSP_BIN_PKG_NAME/$BIN_SUB_DIR/fsp.bsf
fi
python IntelFsp2Pkg/Tools/GenCfgOpt.py \
GENBSF \
$FSP_PACKAGE/$PLATFORM_NAME.dsc \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Fsp.bsf \
$BD_MACRO
if [ $? -eq "1" ]
then
return 1
fi
echo BSF file was generated successfully !
if [ -f $WORKSPACE/$FSP_PACKAGE/Include/FspUpd.h ]
then chmod +w $WORKSPACE/$FSP_PACKAGE/Include/FspUpd.h
fi
if [ -f $WORKSPACE/$FSP_PACKAGE/Include/FsptUpd.h ]
then chmod +w $WORKSPACE/$FSP_PACKAGE/Include/FsptUpd.h
fi
if [ -f $WORKSPACE/$FSP_PACKAGE/Include/FspmUpd.h ]
then chmod +w $WORKSPACE/$FSP_PACKAGE/Include/FspmUpd.h
fi
if [ -f $WORKSPACE/$FSP_PACKAGE/Include/FspsUpd.h ]
then chmod +w $WORKSPACE/$FSP_PACKAGE/Include/FspsUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspUpd.h ]
then
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspUpd.h $FSP_PACKAGE/Include/FspUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FsptUpd.h ]
then
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FsptUpd.h $FSP_PACKAGE/Include/FsptUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspmUpd.h ]
then
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspmUpd.h $FSP_PACKAGE/Include/FspmUpd.h
fi
if [ -f $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspsUpd.h ]
then
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/FspsUpd.h $FSP_PACKAGE/Include/FspsUpd.h
fi
fi
}
function PostBuild(){
echo Start of PostBuild ...
if [ $? -ne 0 ]
then
return 1
fi
echo Patch FSP-T Image ...
python IntelFsp2Pkg/Tools/PatchFv.py \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
FSP-T:QUARK \
"0x0000, _BASE_FSP-T_, @Temporary Base" \
"<[0x0000]>+0x00AC, [<[0x0000]>+0x0020], @FSP-T Size" \
"<[0x0000]>+0x00B0, [0x0000], @FSP-T Base" \
"<[0x0000]>+0x00B4, ([<[0x0000]>+0x00B4] & 0xFFFFFFFF) | 0x0001, @FSP-T Image Attribute" \
"<[0x0000]>+0x00B6, ([<[0x0000]>+0x00B6] & 0xFFFF0FFC) | 0x1000 | $FSP_BUILD_TYPE | $FSP_RELEASE_TYPE, @FSP-T Component Attribute" \
"<[0x0000]>+0x00B8, 70BCF6A5-FFB1-47D8-B1AE-EFE5508E23EA:0x1C - <[0x0000]>, @FSP-T CFG Offset" \
"<[0x0000]>+0x00BC, [70BCF6A5-FFB1-47D8-B1AE-EFE5508E23EA:0x14] & 0xFFFFFF - 0x001C, @FSP-T CFG Size" \
"<[0x0000]>+0x00C4, FspSecCoreT:_TempRamInitApi - [0x0000], @TempRamInit API" \
"0x0000, 0x00000000, @Restore the value"
if [ $? -ne 0 ]
then
return 1
fi
echo Patch FSP-M Image ...
python IntelFsp2Pkg/Tools/PatchFv.py \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
FSP-M:QUARK \
"0x0000, _BASE_FSP-M_, @Temporary Base" \
"<[0x0000]>+0x00AC, [<[0x0000]>+0x0020], @FSP-M Size" \
"<[0x0000]>+0x00B0, [0x0000], @FSP-M Base" \
"<[0x0000]>+0x00B4, ([<[0x0000]>+0x00B4] & 0xFFFFFFFF) | 0x0001, @FSP-M Image Attribute" \
"<[0x0000]>+0x00B6, ([<[0x0000]>+0x00B6] & 0xFFFF0FFC) | 0x2000 | $FSP_BUILD_TYPE | $FSP_RELEASE_TYPE, @FSP-M Component Attribute" \
"<[0x0000]>+0x00B8, D5B86AEA-6AF7-40D4-8014-982301BC3D89:0x1C - <[0x0000]>, @FSP-M CFG Offset" \
"<[0x0000]>+0x00BC, [D5B86AEA-6AF7-40D4-8014-982301BC3D89:0x14] & 0xFFFFFF - 0x001C, @FSP-M CFG Size" \
"<[0x0000]>+0x00D0, FspSecCoreM:_FspMemoryInitApi - [0x0000], @MemoryInitApi API" \
"<[0x0000]>+0x00D4, FspSecCoreM:_TempRamExitApi - [0x0000], @TempRamExit API" \
"FspSecCoreM:_FspPeiCoreEntryOff, PeiCore:__ModuleEntryPoint - [0x0000], @PeiCore Entry" \
"0x0000, 0x00000000, @Restore the value" \
"FspSecCoreM:_FspInfoHeaderRelativeOff, FspSecCoreM:_AsmGetFspInfoHeader - {912740BE-2284-4734-B971-84B027353F0C:0x1C}, @FSP-M Header Offset"
if [ $? -ne 0 ]
then
return 1
fi
echo Patch FSP-S Image ...
python IntelFsp2Pkg/Tools/PatchFv.py \
$OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV \
FSP-S:QUARK \
"0x0000, _BASE_FSP-S_, @Temporary Base" \
"<[0x0000]>+0x00AC, [<[0x0000]>+0x0020], @FSP-S Size" \
"<[0x0000]>+0x00B0, [0x0000], @FSP-S Base" \
"<[0x0000]>+0x00B4, ([<[0x0000]>+0x00B4] & 0xFFFFFFFF) | 0x0001, @FSP-S Image Attribute" \
"<[0x0000]>+0x00B6, ([<[0x0000]>+0x00B6] & 0xFFFF0FFC) | 0x3000 | $FSP_BUILD_TYPE | $FSP_RELEASE_TYPE, @FSP-S Component Attribute" \
"<[0x0000]>+0x00B8, E3CD9B18-998C-4F76-B65E-98B154E5446F:0x1C - <[0x0000]>, @FSP-S CFG Offset" \
"<[0x0000]>+0x00BC, [E3CD9B18-998C-4F76-B65E-98B154E5446F:0x14] & 0xFFFFFF - 0x001C, @FSP-S CFG Size" \
"<[0x0000]>+0x00D8, FspSecCoreS:_FspSiliconInitApi - [0x0000], @SiliconInit API" \
"<[0x0000]>+0x00CC, FspSecCoreS:_NotifyPhaseApi - [0x0000], @NotifyPhase API" \
"0x0000, 0x00000000, @Restore the value"
if [ $? -ne 0 ]
then
return 1
fi
return 0
}
function Build32(){
if [ ! -e BaseTools/BinWrappers/PosixLike/build ]
then
make -C ./BaseTools/Source/C
fi
chmod +w $FSP_PACKAGE/$PLATFORM_NAME.dsc
OverrideBaseTools $*
gcc -v
echo build -m $FSP_PACKAGE/Fsp2Header/FspHeader.inf $BD_ARGS -DCFG_PREBUILD
build -m $FSP_PACKAGE/Fsp2Header/FspHeader.inf $BD_ARGS -DCFG_PREBUILD
if [ $? -ne 0 ]
then
exit 1
fi
PreBuild $*
if [ $? -eq 1 ]
then
exit 1
fi
build $BD_ARGS
if [ $? -ne 0 ]
then
exit 1
fi
PostBuild
if [ $? -ne 0 ]
then
exit 1
fi
}
function ReleaseBuild32(){
BD_TARGET=RELEASE
BD_MACRO="-D CFG_OUTDIR="$OUT_DIR
DSCFILE="-p "$FSP_PACKAGE/$PLATFORM_NAME.dsc #" -y ReleaseBuild32Log.log"
BD_ARGS=$DSCFILE" -b RELEASE "$BD_MACRO" -a IA32 -n 1 -t "$TOOL_CHAIN
FSP_BUILD_TYPE=0x0001
FSP_RELEASE_TYPE=0x0000
Build32 $*
}
function FinalReleaseBuild32(){
BD_TARGET=RELEASE
BD_MACRO="-D CFG_OUTDIR="$OUT_DIR
DSCFILE="-p "$FSP_PACKAGE/$PLATFORM_NAME.dsc #" -y ReleaseBuild32Log.log"
BD_ARGS=$DSCFILE" -b RELEASE "$BD_MACRO" -a IA32 -n 1 -t "$TOOL_CHAIN
FSP_BUILD_TYPE=0x0001
FSP_RELEASE_TYPE=0x0002
Build32 $*
}
function DebugBuild32(){
BD_TARGET=DEBUG
BD_MACRO="-D CFG_DEBUG=1 -D DEBUG_BIOS_ENABLE=TRUE -D CFG_OUTDIR="$OUT_DIR
DSCFILE="-p "$FSP_PACKAGE/$PLATFORM_NAME.dsc #" -y DebugBuild32Log.log"
#echo $DSCFILE
BD_ARGS=$DSCFILE" -b DEBUG "$BD_MACRO" -a IA32 -n 1 -t "$TOOL_CHAIN
FSP_BUILD_TYPE=0x0000
FSP_RELEASE_TYPE=0x0000
Build32 $*
}
function CopyFspBinaryToBinPkg(){
# Create the necessary directories
if [ ! -e $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET ]
then
mkdir $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET
fi
if [ ! -e $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include ]
then
mkdir $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include
fi
# Delete the output files
if [ -e $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include/FspmUpd.h ]
then
chmod +w $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include/*
rm $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include/*
fi
if [ -e $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET/QUARK.fd ]
then
chmod +w $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET/*
rm $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET/*
fi
# Copy the header files
echo Copy FSP files to $FSP_BIN_PKG_NAME/$BIN_SUB_DIR
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/*.h $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/Include/
# Copy the .FD file
cp $OUT_DIR/$PLATFORM_NAME/$BD_TARGET"_"$TOOL_CHAIN/FV/QUARK.fd $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET/
# Split the .FD file
echo Split the FSP Image ...
python IntelFsp2Pkg/Tools/SplitFspBin.py \
split \
-n "FSP.fd" \
-f $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET/QUARK.fd \
-o $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR/$BD_TARGET
}
function OverrideBaseTools() {
if [ -e $FSP_PACKAGE/Override/BaseTools/Conf/build_rule.template ]
then
echo Overriding build_rule.template...
cp -f $FSP_PACKAGE/Override/BaseTools/Conf/build_rule.template Conf/build_rule.txt
fi
if [ -e $FSP_PACKAGE/Override/BaseTools/Conf/tools_def.template ]
then
echo Overriding tools_def.template...
cp -f $FSP_PACKAGE/Override/BaseTools/Conf/tools_def.template Conf/tools_def.txt
fi
}
if [ ! -d Conf ]
then
mkdir Conf
fi
. ./$Edksetup
if [ ! -d $WORKSPACE/$FSP_BIN_PKG_NAME ]
then
mkdir $WORKSPACE/$FSP_BIN_PKG_NAME
fi
if [ ! -d $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR ]
then
mkdir $WORKSPACE/$FSP_BIN_PKG_NAME/$BIN_SUB_DIR
fi
if [ "$1" = "-clean" ]
then
Clean
elif [ "$1" = "-fr32" ]
then
FinalReleaseBuild32
CopyFspBinaryToBinPkg
elif [ "$1" = "-r32" ]
then
ReleaseBuild32
CopyFspBinaryToBinPkg
elif [ "$1" = "-d32" ]
then
DebugBuild32
CopyFspBinaryToBinPkg
elif [ -z "$1" ]
then
DebugBuild32
else
echo
echo ERROR: $1 is not valid parameter.
USAGE
fi