2 @REM Windows batch file to build BIOS ROM
4 @REM Copyright
(c
) 2006 - 2019, Intel Corporation. All rights reserved.
<BR
>
5 @REM SPDX
-License
-Identifier
: BSD
-2-Clause
-Patent
10 SetLocal EnableDelayedExpansion EnableExtensions
12 @REM Go to work space directory.
16 :: Assign initial values
21 set PLATFORM_PACKAGE
=Vlv2TbltDevicePkg
23 set PLATFORM_PATH
=%WORKSPACE%
24 if not exist %PLATFORM_PATH%\
%PLATFORM_PACKAGE% (
25 if defined PACKAGES_PATH
(
26 for %%i IN
(%PACKAGES_PATH%) DO (
27 if exist %%~fi\
%PLATFORM_PACKAGE% (
28 set PLATFORM_PATH
=%%~fi
29 goto PlatformPackageFound
34 echo !!! ERROR
!!! Cannot
find %PLATFORM_PACKAGE% !!!
41 :: Parse Optional arguments
43 if /i
"%~1"=="/?" goto Usage
46 set Build_Flags
=%Build_Flags% /q
51 set Build_Flags
=%Build_Flags% /l
56 set Build_Flags
=%Build_Flags% /y
61 set Build_Flags
=%Build_Flags% /m
66 set Build_Flags
=%Build_Flags% /c
70 if /i
"%~1" == "/ECP" (
71 set Build_Flags
=%Build_Flags% /ecp
77 set Build_Flags
=%Build_Flags% /s
84 set Build_Flags
=%Build_Flags% /x64
89 if /i
"%~1"=="/IA32" (
91 set Build_Flags
=%Build_Flags% /IA32
97 set Stitch_Flags
=%Stitch_Flags% /nG
102 set Stitch_Flags
=%Stitch_Flags% /nM
107 set Stitch_Flags
=%Stitch_Flags% /nB
112 set Stitch_Flags
=%Stitch_Flags% /yL
118 :: Require
2 input parameters
119 if "%~2"=="" goto Usage
121 :: Assign required arguments
122 set Platform_Type
=%~
1
127 ) else set "IFWI_Suffix=/S %~3"
130 echo ======================================================================
131 echo Build_IFWI
: Calling BIOS build Script...
133 call %PLATFORM_PATH%\
%PLATFORM_PACKAGE%\bld_vlv.bat
%Build_Flags% %Platform_Type% %Build_Target%
135 if %ERRORLEVEL% NEQ 0 (
136 echo echo -- Error Building BIOS
& echo.
141 echo Finished Building BIOS.
142 @REM
Set BIOS_ID environment variable here.
143 call %WORKSPACE%\Conf\BiosId.bat
144 echo BIOS_ID
=%BIOS_ID%
146 :: Set the Board_Id
, Build_Type
, Version_Major
, and Version_Minor environment variables
147 find /v
"#" %WORKSPACE%\Conf\BiosId.env
> ver_strings
148 for /f
"tokens=1,3" %%i in
(ver_strings
) do set %%i
=%%j
149 del /f
/q ver_strings
>nul
150 set BIOS_Name
=%BOARD_ID%_
%Arch%_
%BUILD_TYPE%_
%VERSION_MAJOR%_
%VERSION_MINOR%.ROM
152 :: Start Integration process
153 echo ======================================================================
154 echo Build_IFWI
: Calling IFWI Stitching Script...
155 pushd
%PLATFORM_PATH%\
%PLATFORM_PACKAGE%\Stitch
157 :: IFWIStitch.bat
[/nG
] [/nM
] [/nB
] [/B BIOS.rom
] [/C StitchConfig
] [/S IFWISuffix
]
158 call IFWIStitch.bat
%Stitch_Flags% /B
%BIOS_Name% %IFWI_Suffix%
162 if %ERRORLEVEL% NEQ 0 (
163 echo echo -- Error Stitching
%BIOS_Nam% & echo.
167 echo Build_IFWI is finished.
168 echo The final IFWI file is located in
%ROOT_DIR%\Vlv2TbltDevicePkg\Stitch\
169 echo ======================================================================
173 echo Script to build BIOS firmware and stitch the entire IFWI.
175 echo Usage
: Build_IFWI.bat
[options
] PlatformType BuildTarget
[IFWI Suffix
]
177 echo /c CleanAll before building
178 echo /x64
Set Arch to X64
(default
: X64
)
179 echo /IA32
Set Arch to IA32
(default
: X64
)
180 echo /yL Enable SPI lock
182 echo Platform Types
: MNW2
183 echo Build Targets
: Release
, Debug
184 echo IFWI Suffix
: Suffix to
append to
end of IFWI filename
(default
: MM_DD_YYYY
)
186 echo See Stitch
/Stitch_Config.txt
for additional stitching settings.
188 echo If capsule update is needed
, please update CAPSULE_ENABLE
= TRUE in Config.dsc.
189 echo If recovery is needed
, please update RECOVERY_ENABLE
= TRUE in Config.dsc.
190 echo If either of above is TRUE
, please
set OPENSSL_PATH in windows evironment
191 echo and put openssl.exe there
, to generate final capsule image.
196 @REM
CD to platform package.