From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yi.qian@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Thu, 09 May 2019 06:21:21 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 06:21:20 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 09 May 2019 06:21:20 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 06:21:20 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 9 May 2019 06:21:19 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.249]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.213]) with mapi id 14.03.0415.000; Thu, 9 May 2019 21:21:17 +0800 From: "Qian, Yi" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Sun, Zailiang" Subject: Re: [Patch 12/16] Vlv2TbltDevicePkg: Remove directory assumptions from build scripts Thread-Topic: [Patch 12/16] Vlv2TbltDevicePkg: Remove directory assumptions from build scripts Thread-Index: AQHVBiAVvyRfZfFUZEWzYqUnogapdqZix+RA Date: Thu, 9 May 2019 13:21:17 +0000 Message-ID: References: <20190509043111.15272-1-michael.d.kinney@intel.com> <20190509043111.15272-13-michael.d.kinney@intel.com> In-Reply-To: <20190509043111.15272-13-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: yi.qian@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed by Qian, Yi Thanks QianYi -----Original Message----- From: Kinney, Michael D=20 Sent: Thursday, May 9, 2019 12:31 PM To: devel@edk2.groups.io Cc: Sun, Zailiang ; Qian, Yi Subject: [Patch 12/16] Vlv2TbltDevicePkg: Remove directory assumptions fro= m build scripts In preparation for moving Vlv2TbltDevicePkg to the edk2-platforms reposito= ry, the batch scripts used to build this platform are updated to not make a= ny assumptions about the directory location of Vlv2TbltDevicePkg. Cc: Zailiang Sun Cc: Yi Qian Signed-off-by: Michael D Kinney --- Vlv2TbltDevicePkg/.gitignore | 2 + Vlv2TbltDevicePkg/Build_IFWI.bat | 31 +++- Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat | 23 ++- Vlv2TbltDevicePkg/bldX64.bat | 216 ------------------------ Vlv2TbltDevicePkg/bld_vlv.bat | 129 ++++++++------ Vlv2TbltDevicePkg/bld_vlv.sh | 3 +- 6 files changed, 124 insertions(+), 280 deletions(-) delete mode 100644 = Vlv2TbltDevicePkg/bldX64.bat diff --git a/Vlv2TbltDevicePkg/.gitignore b/Vlv2TbltDevicePkg/.gitignore i= ndex b4699122b8..c7698262ad 100644 --- a/Vlv2TbltDevicePkg/.gitignore +++ b/Vlv2TbltDevicePkg/.gitignore @@ -1,3 +1,5 @@ AutoPlatformCFG.txt Stitch/Stitching.log Stitch/MNW*.bin +Stitch/MNW*.rom +Stitch/MNW*.rom.orig diff --git a/Vlv2TbltDevicePkg/Build_IFWI.bat b/Vlv2TbltDevicePkg/Build_IF= WI.bat index 9a3063397e..887206703a 100644 --- a/Vlv2TbltDevicePkg/Build_IFWI.bat +++ b/Vlv2TbltDevicePkg/Build_IFWI.bat @@ -1,7 +1,7 @@ @REM @file @REM Windows batch file to build BIOS ROM @REM -@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. +@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights=20 +reserved.
@REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM =20 @@ -18,11 +18,26 @@ set exitCode=3D0 set "Build_Flags=3D " set "Stitch_Flags=3D " set Arch=3DX64 -set WORKSPACE=3D%CD% -set CORE_PATH=3D%WORKSPACE%\edk2 -set PLATFORM_PATH=3D%WORKSPACE%\edk2 set PLATFORM_PACKAGE=3DVlv2TbltDevicePkg =20 +set PLATFORM_PATH=3D%WORKSPACE% +if not exist %PLATFORM_PATH%\%PLATFORM_PACKAGE% ( + if defined PACKAGES_PATH ( + for %%i IN (%PACKAGES_PATH%) DO ( + if exist %%~fi\%PLATFORM_PACKAGE% ( + set PLATFORM_PATH=3D%%~fi + goto PlatformPackageFound + ) + ) + ) else ( + echo. + echo !!! ERROR !!! Cannot find %PLATFORM_PACKAGE% !!! + echo. + goto Exit + ) +) +:PlatformPackageFound + :: Parse Optional arguments :OptLoop if /i "%~1"=3D=3D"/?" goto Usage @@ -125,11 +140,11 @@ if %ERRORLEVEL% NEQ 0 ( echo. echo Finished Building BIOS. @REM Set BIOS_ID environment variable here. -call %CORE_PATH%\Conf\BiosId.bat +call %WORKSPACE%\Conf\BiosId.bat echo BIOS_ID=3D%BIOS_ID% =20 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environ= ment variables -find /v "#" %CORE_PATH%\Conf\BiosId.env > ver_strings +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j del /f/q ver= _strings >nul set BIOS_Name=3D%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJO= R%_%VERSION_MINOR%.ROM @@ -137,10 +152,10 @@ set BIOS_Name=3D%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERS= ION_MAJOR%_%VERSION_MINOR%.ROM :: Start Integration process echo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D echo Build_IFWI: Calling IFWI Stitching Script... -pushd %CORE_PATH%\%PLATFORM_PACKAGE%\Stitch +pushd %PLATFORM_PATH%\%PLATFORM_PACKAGE%\Stitch =20 :: IFWIStitch.bat [/nG] [/nM] [/nB] [/B BIOS.rom] [/C StitchConfig] [/S= IFWISuffix] - call IFWIStitch.bat %Stitch_Flags% /B ..\..\%BIOS_Name% %IFWI_Suffix% + call IFWIStitch.bat %Stitch_Flags% /B %BIOS_Name% %IFWI_Suffix% @echo off popd diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat b/Vlv2TbltDevicePkg/S= titch/IFWIStitch.bat index 7c3ebbd1c6..200ca05a23 100644 --- a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat +++ b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat @@ -1,7 +1,7 @@ @REM @file @REM Windows batch file to build BIOS ROM @REM -@REM Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.=
+@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.=
@REM=20 @REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM @@ -9,6 +9,25 @@ @echo off SetLocal EnableDelayedExpansion EnableExtensions =20 +set PLATFORM_BIN_PACKAGE=3D%WORKSPACE%\Vlv2SocBinPkg +if not exist %PLATFORM_BIN_PACKAGE% ( + if defined PACKAGES_PATH ( + for %%i IN (%PACKAGES_PATH%) DO ( + if exist %%~fi\Vlv2SocBinPkg ( + set PLATFORM_BIN_PACKAGE=3D%%~fi\Vlv2SocBinPkg + goto PlatformBinPackageFound + ) + ) + ) else ( + echo. + echo !!! ERROR !!! Cannot find %PLATFORM_NAME% !!! + echo. + goto BldFail + ) +) +:PlatformBinPackageFound + + :: Set script defaults set exitCode=3D0 set BackupRom=3D1 @@ -185,7 +204,7 @@ for %%i in (%BIOS_Names%) do ( echo Generating IFWI... %BIOS_ID%.bin echo. =20 - copy /b/y !IFWI_HEADER_FILE! + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SE= C_VERSION!\VLV_SEC_REGION.bin + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SEC_VER= SION!\Vacant.bin + !BIOS_Rom! %BIOS_ID%.bin + copy /b/y !IFWI_HEADER_FILE! +=20 + %PLATFORM_BIN_PACKAGE%\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin +=20 + %PLATFORM_BIN_PACKAGE%\SEC\!SEC_VERSION!\Vacant.bin + !BIOS_Rom!=20 + %BIOS_ID%.bin echo. echo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D ) diff --git a/Vlv2TbltDevicePkg/bldX64.bat b/Vlv2TbltDevicePkg/bldX64.bat d= eleted file mode 100644 index 50dc5b1f07..0000000000 --- a/Vlv2TbltDevicePkg/bldX64.bat +++ /dev/null @@ -1,216 +0,0 @@ -@REM @file -@REM Windows batch file to build BIOS ROM -@REM -@REM Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -@echo. -@time /t - -@if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log -@if exist %WORKS= PACE%\unitool.log del %WORKSPACE%\unitool.log -@if exist %WORKSPACE%\Conf\b= uild_rule.txt del %WORKSPACE%\Conf\build_rule.txt -@if exist %WORKSPACE%\Co= nf\FrameworkDatabase.db del %WORKSPACE%\Conf\FrameworkDatabase.db -@if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt -@i= f exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_def.txt -= @if exist conf\.cache rmdir /q /s conf\.cache - -@set target=3DDEBUG - -@if /i "%1" =3D=3D "release" set TARGET=3DRELEASE -@if /i "%2" =3D=3D "re= lease" set TARGET=3DRELEASE -@if /i "%3" =3D=3D "release" set TARGET=3DRELE= ASE -@if /i "%4" =3D=3D "release" set TARGET=3DRELEASE -@if /i "%5" =3D=3D = "release" set TARGET=3DRELEASE - -@set PlatformType=3DNO_PLATFORM -@set config_file=3D.\Vlv2TbltDevicePkg\PlatformPkgConfig.dsc -@set EVN_debug_file=3D.\Vlv2TbltDevicePkg\BiosIdx64D.env -@set EVN_release_file=3D.\Vlv2TbltDevicePkg\BiosIdx64R.env -@set auto_config_inc=3D.\Vlv2TbltDevicePkg\AutoPlatformCFG.txt - -@if "%1" =3D=3D "MNW2" ( - set %PlatformType% =3D MNW2 - @echo Setting Baley Bay platform configration and BIOS ID ... - findstr /b /v BOARD_ID %EVN_debug_file% > newfile.env - echo BOARD_ID =3D MNW2MAX >> newfile.env - type newfile.env > %EVN_debug_file% - findstr /b /v BOARD_ID %EVN_release_file% > newfile.env - echo BOARD_ID =3D MNW2MAX >> newfile.env - type newfile.env > %EVN_release_file% - echo DEFINE ENBDT_PF_BUILD =3D TRUE >> %auto_config_inc% - echo DEFINE X64_CONFIG =3D TRUE >> %auto_config_inc% - goto PLATFORM_SETTING_DONE -) - -@if "%PlatformType%" =3D=3D "NO_PLATFORM" ( - goto BldFail -) - -rem clearup the temp file -:PLATFORM_SETTING_DONE -@DEL NEWFILE.ENV -@DEL NEWFILE.CFG - -@REM Define platform specific environment variables. -@REM -@set PLATFORM_PACKAGE=3DVlv2TbltDevicePkg -@set SCRIPT_ERROR=3D0 - -@REM Set basic environment. -@echo. -@echo Run edksetup.bat batch file. -@echo. -@del Conf\build_rule.txt -@REM @del Conf\tools_def.txt -@call edksetup.bat - - -@echo. -@echo Set the VS2008 environment. -@echo. -@if defined VS90COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" - if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 9.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2008 - ) else ( - set TOOL_CHAIN_TAG=3DVS2008x86 - ) -) else ( - echo. - echo !!! ERROR !!! VS2008 not installed correctly. VS90COMNTOOLS not de= fined. !!! - echo. - set SCRIPT_ERROR=3D1 - goto :BldEnd -) - -@echo. -@echo Set build environment. -@echo. -@if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% ( - mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% -) - - -@REM Set clean build option -@set CLEAN_BUILD_OPTION=3D-e - -@findstr /V "ACTIVE_PLATFORM TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE= _CONF" Conf\target.txt > Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%= \target.txt - -@echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkgX64.dsc >> Bu= ild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt -@echo TARGET =3D %TARGET% >> Bu= ild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt -@echo TARGET_ARCH =3D IA32 X64 >> Bu= ild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt -@echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% >> Bu= ild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt -@echo BUILD_RULE_CONF =3D Conf/build_rule.txt >> Bu= ild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt -@move /Y Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt Co= nf - - - -@echo. -@echo Create BiosIdx64. -@echo. -@if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64 ( - mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64 -) - -@if "%TARGET%" =3D=3D "DEBUG" ( - set BIOS_ID_FILE=3DBiosIdx64D.env - -) else ( - set BIOS_ID_FILE=3DBiosIdx64R.env - -) - - -GenBiosId.exe -i %PLATFORM_PACKAGE%\%BIOS_ID_FILE% -o Build\%PLATFORM_PAC= KAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64\BiosId.bin -@if %ERRORLEVEL% NEQ 0 goto BldFail - -@echo off -echo Copy reference code ASL files. - - -@if /i "/s" =3D=3D "%1" goto BldSilent -@if /i "/s" =3D=3D "%2" goto BldSilent -@if /i "/s" =3D=3D "%3" goto BldSilent -@if /i "/s" =3D=3D "%4" goto BldSilent -@if /i "/s" =3D=3D "%5" goto BldSilent - -build -n %NUMBER_OF_PROCESSORS% -@if %ERRORLEVEL% NEQ 0 goto BldFail - -@If %SCRIPT_ERROR% EQU 1 goto BldFail -@goto BldSuccess - -:BldSilent - -build -n %NUMBER_OF_PROCESSORS% 1>>EDK2.log 2>&1 -@if %ERRORLEVEL% NEQ 0 = goto BldFail - - -@If %SCRIPT_ERROR% EQU 1 goto BldFail - -:BldSuccess -@echo off -del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeco= nfig.fd 1>>EDK2.log 2>&1 -del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN= _TAG%\FV\HiiDefaultData.txt 1>>EDK2.log 2>&1 -copy /y Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.fd = Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeconfig.f= d 1>>EDK2.log 2>&1 - -@echo. -@echo Extract setup default value from VFR (Build\%PLATFORM_PACKAGE%\%TAR= GET%_%TOOL_CHAIN_TAG%\FV\HiiDefaultData.txt) -@echo. -fce read -i Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.= beforeconfig.fd > Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Hii= DefaultData.txt - - -@echo Update FD with default Hii value successfully! (both 'Setup' and 'S= etupDefault') -@echo. -fce mirror -i Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX6= 4.beforeconfig.fd -o Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\= VlvX64.fd Setup SetupDefault 1>>EDK2.log 2>&1 - -@echo off -del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.fd -del Vlv2TbltDevicePkg\RomImage\bios.rom -if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM goto = Gen8MImage -del /q /f Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\RO= M\* -rd /Q Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM -:Gen8MImage - -copy /b Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.fd V= lv2TbltDevicePkg\RomImage\bios.rom - -pushd Vlv2TbltDevicePkg\RomImage\ -@if "%TARGET%" =3D=3D "DEBUG" ( - call signbiosX64_debug.bat -) else ( - call signbiosX64_release.bat -) - -call ftoolbuild.bat -call ftoolbuild_sec_enable.bat -popd - -@echo off -mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM -move Vlv2TbltDevicePkg\RomImage\SPI_Image\* Build\%PLATFORM_PACKAGE%\%TAR= GET%_%TOOL_CHAIN_TAG%\ROM\ > NUL - -call GenBIOS.bat X64 - -@echo on - -@echo TARGET: %TARGET% -@echo TOOL_CHAIN_TAG: %TOOL_CHAIN_TAG% -@echo BIOS location: Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN= _TAG%\FV -@echo SPI Images location: Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN= _TAG%\ROM -@echo. -@echo The EDKII BIOS build has successfully completed! -@echo. -@goto BldEnd - -:BldFail -@echo. -@echo The EDKII BIOS Build has failed! -@echo. -exit /b 1 - -:BldEnd -@time /t -exit /b 0 diff --git a/Vlv2TbltDevicePkg/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat= index c5314833c0..dcc8b1a95a 100644 --- a/Vlv2TbltDevicePkg/bld_vlv.bat +++ b/Vlv2TbltDevicePkg/bld_vlv.bat @@ -1,7 +1,7 @@ @REM @file @REM Windows batch file to build BIOS ROM @REM -@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. +@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights=20 +reserved.
@REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM =20 @@ -15,25 +15,60 @@ echo. ::********************************************************************** :: Initial Setup ::********************************************************************** -set WORKSPACE=3D%CD% if %WORKSPACE:~-1%=3D=3D\ set WORKSPACE=3D%WORKSPACE:~0,-1% set /a build= _threads=3D1 set "Build_Flags=3D " set exitCode=3D0 set Arch=3DX64 set Source=3D0 -set CORE_PATH=3D%WORKSPACE%\edk2 -set PLATFORM_PATH=3D%WORKSPACE%\edk2 -cd ./edk2 +set PLATFORM_NAME=3DVlv2TbltDevicePkg + +set CORE_PATH=3D%WORKSPACE% +if not exist %CORE_PATH%\edksetup.bat ( + if defined PACKAGES_PATH ( + for %%i IN (%PACKAGES_PATH%) DO ( + if exist %%~fi\edksetup.bat ( + set CORE_PATH=3D%%~fi + goto CorePathFound + ) + ) + ) else ( + echo. + echo !!! ERROR !!! Cannot find edksetup.bat !!! + echo. + goto BldFail + ) +) +:CorePathFound + +set PLATFORM_PACKAGE=3D%WORKSPACE%\%PLATFORM_NAME% +if not exist %PLATFORM_PACKAGE% ( + if defined PACKAGES_PATH ( + for %%i IN (%PACKAGES_PATH%) DO ( + if exist %%~fi\%PLATFORM_NAME% ( + set PLATFORM_PACKAGE=3D%%~fi\%PLATFORM_NAME% + goto PlatformPackageFound + ) + ) + ) else ( + echo. + echo !!! ERROR !!! Cannot find %PLATFORM_NAME% !!! + echo. + goto BldFail + ) +) +:PlatformPackageFound + +cd %CORE_PATH% =20 :: Clean up previous build files. -if exist %CORE_PATH%\edk2.log del %CORE_PATH%\edk2.log -if exist %CORE_PA= TH%\unitool.log del %CORE_PATH%\unitool.log -if exist %CORE_PATH%\Conf\targ= et.txt del %CORE_PATH%\Conf\target.txt -if exist %CORE_PATH%\Conf\tools_def= .txt del %CORE_PATH%\Conf\tools_def.txt -if exist %CORE_PATH%\Conf\build_ru= le.txt del %CORE_PATH%\Conf\build_rule.txt -if exist %CORE_PATH%\Conf\Frame= workDatabase.db del %CORE_PATH%\Conf\FrameworkDatabase.db -if exist conf\.cache rmdir /q/s conf\.cache +if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log if exist=20 +%WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log if exist=20 +%WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt if exist=20 +%WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_def.txt if=20 +exist %WORKSPACE%\Conf\build_rule.txt del=20 +%WORKSPACE%\Conf\build_rule.txt if exist=20 +%WORKSPACE%\Conf\FrameworkDatabase.db del=20 +%WORKSPACE%\Conf\FrameworkDatabase.db +if exist %WORKSPACE%\Conf\.cache rmdir /q/s %WORKSPACE%\Conf\.cache =20 :: Setup EDK environment. Edksetup puts new copies of target.txt, tools_d= ef.txt, build_rule.txt in WorkSpace\Conf :: Also run edksetup as soon as possible to avoid it from changing enviro= nment variables we're overriding @@ -41,8 +76,6 @@ call %CORE_PATH%\edksetu= p.bat Rebuild @echo off =20 :: Define platform specific environment variables. -set PLATFORM_NAME=3DVlv2TbltDevicePkg -set PLATFORM_PACKAGE=3D%PLATFORM_PATH%\Vlv2TbltDevicePkg set config_file=3D%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc set auto_config_inc=3D%PLATFORM_PACKAGE%\AutoPlatformCFG.txt =20 @@ -82,9 +115,9 @@ if /i "%~1" =3D=3D "/c" ( del /f/s/q build > nul rmdir /s/q build ) - if exist conf\.cache ( - del /f/s/q conf\.cache > nul - rmdir /s/q conf\.cache + if exist %WORKSPACE%\Conf\.cache ( + del /f/s/q %WORKSPACE%\Conf\.cache > nul + rmdir /s/q %WORKSPACE%\Conf\.cache ) echo. shift @@ -107,17 +140,17 @@ if "%~1"=3D=3D"" goto Usage =20 ::Remove the values for Platform_Type and Build_Target from BiosIdX.env a= nd stage in Conf\ if "%Arch%"=3D=3D"IA32" ( - findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env >= Conf\BiosId.env + findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env= =20 + > %WORKSPACE%\Conf\BiosId.env echo DEFINE X64_CONFIG =3D FALSE >> %auto_config_inc% ) else if "%Arch%"=3D=3D"X64" ( - findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.en= v > Conf\BiosId.env + findstr /b /v "BOARD_ID BUILD_TYPE"=20 + %PLATFORM_PACKAGE%\BiosIdx64R.env > %WORKSPACE%\Conf\BiosId.env echo DEFINE X64_CONFIG =3D TRUE >> %auto_config_inc% ) =20 :: -- Build flags settings for each Platform -- echo Setting %1 platfo= rm configuration and BIOS ID... if /i "%~1" =3D=3D "MNW2" ( - echo BOARD_ID =3D MNW2MAX >> Conf\BiosId.env + echo BOARD_ID =3D MNW2MAX >> %WORKSPACE%\Conf\BiosId.env echo DEFINE ENBDT_PF_BUILD =3D TRUE >> %auto_config_inc% =20 ) else ( @@ -128,10 +161,10 @@ set Platform_Type=3D%~1 =20 if /i "%~2" =3D=3D "RELEASE" ( set target=3DRELEASE - echo BUILD_TYPE =3D R >> Conf\BiosId.env + echo BUILD_TYPE =3D R >> %WORKSPACE%\Conf\BiosId.env ) else ( set target=3DDEBUG - echo BUILD_TYPE =3D D >> Conf\BiosId.env + echo BUILD_TYPE =3D D >> %WORKSPACE%\Conf\BiosId.env ) =20 ::********************************************************************** @@ -181,43 +214,40 @@ if defined VS140COMNTOOLS ( ) =20 echo Ensuring correct build directory is present for GenBiosId... -set BUILD_PATH=3DBuild\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG% +set=20 +BUILD_PATH=3D%WORKSPACE%\Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG% =20 echo Modifing Conf files for this build... :: Remove lines with these tags from target.txt -findstr /V "TARGET TARG= ET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_PLATFORM MAX_CONCURRENT_T= HREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp +findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF +ACTIVE_PLATFORM MAX_CONCURRENT_THREAD_NUMBER"=20 +%WORKSPACE%\Conf\target.txt > %WORKSPACE%\Conf\target.txt.tmp =20 -echo TARGET =3D %TARGET% >> Con= f\target.txt.tmp +echo TARGET =3D %TARGET% >> %WO= RKSPACE%\Conf\target.txt.tmp if "%Arch%"=3D=3D"IA32" ( - echo TARGET_ARCH =3D IA32 >> Co= nf\target.txt.tmp + echo TARGET_ARCH =3D IA32 >> %W= ORKSPACE%\Conf\target.txt.tmp ) else if "%Arch%"=3D=3D"X64" ( - echo TARGET_ARCH =3D IA32 X64 >> Con= f\target.txt.tmp + echo TARGET_ARCH =3D IA32 X64 >> %WO= RKSPACE%\Conf\target.txt.tmp ) -echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% = >> Conf\target.txt.tmp -echo BUILD_RULE_CONF =3D Conf/build_rule.txt = >> Conf\target.txt.tmp +echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% = >> %WORKSPACE%\Conf\target.txt.tmp +echo BUILD_RULE_CONF =3D Conf/build_rule.txt = >> %WORKSPACE%\Conf\target.txt.tmp if %Source% =3D=3D 0 ( - echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc = >> Conf\target.txt.tmp + echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc = >> %WORKSPACE%\Conf\target.txt.tmp ) else ( - echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc= >> Conf\target.txt.tmp + echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc= + >> %WORKSPACE%\Conf\target.txt.tmp ) -echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% = >> Conf\target.txt.tmp +echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% = >> %WORKSPACE%\Conf\target.txt.tmp =20 -move /Y Conf\target.txt.tmp Conf\target.txt >nul +move /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt=20 +>nul =20 ::********************************************************************** :: Build BIOS ::********************************************************************** =20 echo Creating BiosId... -pushd %PLATFORM_PACKAGE% -if not exist %WORKSPACE%\%BUILD_PATH%\IA32 mkdir %WORKSPACE%\%BUILD_PATH= %\IA32 - GenBiosId.exe -i %CORE_PATH%\Conf\BiosId.env -o %WORKSPACE%\%BUILD_PATH= %\IA32\BiosId.bin -ob %CORE_PATH%\Conf\BiosId.bat +if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32=20 +%PLATFORM_PACKAGE%\GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o=20 +%BUILD_PATH%\IA32\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat if "%Arch%"=3D=3D"X64" ( - if not exist %WORKSPACE%\%BUILD_PATH%\X64 mkdir %WORKSPACE%\%BUILD_PA= TH%\X64 - GenBiosId.exe -i %CORE_PATH%\Conf\BiosId.env -o %WORKSPACE%\%BUILD_PAT= H%\X64\BiosId.bin -ob %CORE_PATH%\Conf\BiosId.bat + if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64 + %PLATFORM_PACKAGE%\GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o=20 + %BUILD_PATH%\X64\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat ) -popd - =20 if %ERRORLEVEL% NEQ 0 goto BldFail =20 @@ -235,23 +265,23 @@ echo Running fce... =20 pushd %PLATFORM_PACKAGE% :: Extract Hii data from build and store in HiiDefaultData.txt -fce read = -i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd > %WORKSPACE%\%BUILD_PATH%\FV\HiiDefa= ultData.txt +%PLATFORM_PACKAGE%\fce read -i %BUILD_PATH%\FV\Vlv.fd >=20 +%BUILD_PATH%\FV\HiiDefaultData.txt =20 :: save changes to VlvXXX.fd -fce update -i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd -s %WORKSPACE%\%BUILD_PA= TH%\FV\HiiDefaultData.txt -o %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd +%PLATFORM_PACKAGE%\fce update -i %BUILD_PATH%\FV\Vlv.fd -s=20 +%BUILD_PATH%\FV\HiiDefaultData.txt -o %BUILD_PATH%\FV\Vlv%Arch%.fd popd =20 if %ERRORLEVEL% NEQ 0 goto BldFail ::echo FD successfully updated with default Hii values. =20 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environ= ment variables -find /v "#" Conf\BiosId.env > ver_strings +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j del /f/q ver= _strings >nul =20 set BIOS_Name=3D%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_M= INOR%.ROM -copy /y/b %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd %PLATFORM_PATH%\%BIOS= _Name% >nul -copy /y/b %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd %WORKSPACE= %\%BUILD_PATH%\FV\Vlv.ROM >nul +copy /y/b %BUILD_PATH%\FV\Vlv%Arch%.fd +%PLATFORM_PACKAGE%\Stitch\%BIOS_Name% >nul copy /y/b=20 +%BUILD_PATH%\FV\Vlv%Arch%.fd %BUILD_PATH%\FV\Vlv.ROM >nul =20 echo. echo Build location: %BUILD_PATH% @@ -261,13 +291,8 @@ echo -------------------- The EDKII BIOS build has su= ccessfully completed. ----- echo. =20 @REM build capsule here -@REMif "%openssl_path%" =3D=3D "" ( -@REM echo -- Error: OPENSSL_PATH not set. Capule and Recovery images= not generated. -@REM set exitCode=3D1 -@REM goto Exit -@REM -@REM echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv -@REM build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc +echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv +build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc =20 goto Exit =20 diff --git a/Vlv2TbltDevicePkg/bld_vlv.sh b/Vlv2TbltDevicePkg/bld_vlv.sh i= ndex 51d3acacb4..ec3a325db7 100755 --- a/Vlv2TbltDevicePkg/bld_vlv.sh +++ b/Vlv2TbltDevicePkg/bld_vlv.sh @@ -242,9 +242,8 @@ VERSION_MINOR=3D$(grep '^VERSION_MINOR' Conf/BiosId.en= v | cut -d ' ' -f 3 | cut -c BOARD_ID=3D$(grep '^BOARD_ID' Conf/BiosId.env= | cut -d ' ' -f 3 | cut -c 1-7) BIOS_Name=3D"$BOARD_ID"_"$Arch"_"$BUILD_T= YPE"_"$VERSION_MAJOR"_"$VERSION_MINOR".ROM BIOS_ID=3D"$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MI= NOR"_GCC.bin -cp -f $BUILD_PATH/FV/VLV.fd $WORKSPACE/$BIOS_Name SEC_VERSION=3D1.0.2.1060v5 -cat $IFWI_HEADER_FILE ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/VLV_SEC_REGI= ON.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/Vacant.bin $BIOS_Name > ./$PL= ATFORM_PACKAGE/Stitch/$BIOS_ID +cat $IFWI_HEADER_FILE=20 +../Vlv2Binaries/Vlv2SocBinPkg/SEC/$SEC_VERSION/VLV_SEC_REGION.bin=20 +../Vlv2Binaries/Vlv2SocBinPkg/SEC/$SEC_VERSION/Vacant.bin=20 +$BUILD_PATH/FV/VLV.fd > ./$PLATFORM_PACKAGE/Stitch/$BIOS_ID =20 =20 echo Skip "Running BIOS_Signing ..." -- 2.21.0.windows.1 --=20 Qian Yi