From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=mang.guo@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 95A9A21F85E8A for ; Tue, 27 Mar 2018 23:42:55 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 23:48:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,370,1517904000"; d="scan'208";a="27626567" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 27 Mar 2018 23:48:52 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 23:48:51 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 23:48:51 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.226]) with mapi id 14.03.0319.002; Wed, 28 Mar 2018 14:48:41 +0800 From: "Guo, Mang" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Wei, David" , "Yao, Jiewen" Thread-Topic: [Patch 1/5] Vlv2TbltDevicePkg: Fix build scripts Thread-Index: AQHTxlZUuDVnE9Gja0GUhSQ/v6jljqPlNONA Date: Wed, 28 Mar 2018 06:48:40 +0000 Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1525CE454@SHSMSX103.ccr.corp.intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> <20180328053330.13272-2-michael.d.kinney@intel.com> In-Reply-To: <20180328053330.13272-2-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 Subject: Re: [Patch 1/5] Vlv2TbltDevicePkg: Fix build scripts X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2018 06:42:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Mang -----Original Message----- From: Kinney, Michael D=20 Sent: Wednesday, March 28, 2018 1:33 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D; Wei, David; Guo, Mang; Yao, Jiewen Subject: [Patch 1/5] Vlv2TbltDevicePkg: Fix build scripts From: Michael D Kinney https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Update build scripts to work with edk2 and Vlv2Binaries in PACKAGES_PATH. Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney --- Vlv2TbltDevicePkg/.gitignore | 3 + Vlv2TbltDevicePkg/Build_IFWI.bat | 8 +-- Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat | 2 +- Vlv2TbltDevicePkg/bld_vlv.bat | 117 +++++++++++++++++-----------= ---- 4 files changed, 72 insertions(+), 58 deletions(-) create mode 100644 Vlv= 2TbltDevicePkg/.gitignore diff --git a/Vlv2TbltDevicePkg/.gitignore b/Vlv2TbltDevicePkg/.gitignore ne= w file mode 100644 index 0000000000..b4699122b8 --- /dev/null +++ b/Vlv2TbltDevicePkg/.gitignore @@ -0,0 +1,3 @@ +AutoPlatformCFG.txt +Stitch/Stitching.log +Stitch/MNW*.bin diff --git a/Vlv2TbltDevicePkg/Build_IFWI.bat b/Vlv2TbltDevicePkg/Build_IFW= I.bat index ac22a76b73..c8e3ec3d76 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 - 2014, Intel Corporation. All rights reserved. +@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 +reserved.
@REM This program and the accompanying materials @REM are licensed and ma= de available under the terms and conditions of the BSD License @REM which = accompanies this distribution. The full text of the license may be found a= t @@ -131,11 +131,11 @@ if %ERRORLEVEL% NEQ 0 ( echo. echo Finished Building BIOS. @REM Set BIOS_ID environment variable here. -call 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 environm= ent 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 set BIOS_Name=3D%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR= %_%VERSION_MINOR%.ROM @@ -149,7 +149,7 @@ if "%Platform_Type%" =3D=3D "BYTC" ( pushd %PLATFORM_PACKAGE%\Stitch ) :: 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 %WORKSPACE%\%BIOS_Name%=20 + %IFWI_Suffix% =20 @echo off popd diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat b/Vlv2TbltDevicePkg/St= itch/IFWIStitch.bat index f3a9cf3d74..5f19983c91 100644 --- a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat +++ b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat @@ -191,7 +191,7 @@ for %%i in (%BIOS_Names%) do ( echo Generating IFWI... %BIOS_ID%.bin echo. =20 - copy /b/y !IFWI_HEADER_FILE! + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERS= ION!\VLV_SEC_REGION.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\Vacan= t.bin + !BIOS_Rom! %BIOS_ID%.bin + copy /b/y !IFWI_HEADER_FILE! +=20 + %WORKSPACE%\Vlv2Binaries\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\VLV_SEC + _REGION.bin +=20 + %WORKSPACE%\Vlv2Binaries\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\Vacant. + bin + !BIOS_Rom! %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/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat = index a1d8c5b525..27bc4e7c41 100644 --- a/Vlv2TbltDevicePkg/bld_vlv.bat +++ b/Vlv2TbltDevicePkg/bld_vlv.bat @@ -20,8 +20,8 @@ echo. ::********************************************************************** :: Initial Setup ::********************************************************************** -set WORKSPACE=3D%CD% -if %WORKSPACE:~-1%=3D=3D\ set WORKSPACE=3D%WORKSPACE:~0,-1% +REM set WORKSPACE=3D%CD% +REM if %WORKSPACE:~-1%=3D=3D\ set WORKSPACE=3D%WORKSPACE:~0,-1% set /a build_threads=3D1 set "Build_Flags=3D " set exitCode=3D0 @@ -36,7 +36,7 @@ if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf= \target.txt if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\t= ools_def.txt if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf= \build_rule.txt if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSP= ACE%\Conf\FrameworkDatabase.db -if exist conf\.cache rmdir /q/s conf\.cache +if exist %WORKSPACE%\Conf\.cache rmdir /q/s %WORKSPACE%\Conf\.cache =20 :: Setup EDK environment. Edksetup puts new copies of target.txt, tools_de= f.txt, build_rule.txt in WorkSpace\Conf :: Also run edksetup as soon as possible to avoid it from changing environ= ment variables we're overriding @@ -48,7 +48,7 @@ set PLATFORM_PACKAGE=3DVl= v2TbltDevicePkg set config_file=3D.\%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc set auto_config_inc=3D.\%PLATFORM_PACKAGE%\AutoPlatformCFG.txt =20 -set EDK_SOURCE=3D%WORKSPACE%\EdkCompatibilityPkg +REM set EDK_SOURCE=3D%WORKSPACE%\EdkCompatibilityPkg =20 ::create new AutoPlatformCFG.txt file copy /y nul %auto_config_inc% >nul @@ -109,17 +109,17 @@ if "%~1"=3D=3D"" goto Usage =20 ::Remove the values for Platform_Type and Build_Target from BiosIdX.env an= d 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.env= > 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 platfor= m 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 ( @@ -130,37 +130,23 @@ 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 ::********************************************************************** -:: Additional EDK Build Setup/Configuration -::********************************************************************** -echo. +:: Additional EDK Build Setup/Configuration +::********************************************************************* +* +echo. echo Setting the Build environment for VS2008/VS2010/VS2012/VS2013... -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 if defined VS100COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat" - if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 10.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2010 +if defined VS140COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS140COMNTOOLS%\vsvars32.bat" + if /I "%VS140COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 14.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2015 ) else ( - set TOOL_CHAIN_TAG=3DVS2010x86 - ) -) else if defined VS110COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat" - if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 11.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2012 - ) else ( - set TOOL_CHAIN_TAG=3DVS2012x86 + set TOOL_CHAIN_TAG=3DVS2015x86 ) ) else if defined VS120COMNTOOLS ( if not defined VSINSTALLDIR call "%VS120COMNTOOLS%\vsvars32.bat" @@ -169,35 +155,56 @@ if defined VS90COMNTOOLS ( ) else ( set TOOL_CHAIN_TAG=3DVS2013x86 ) -) else ( - echo --ERROR: VS2008/VS2010/VS2012/VS2013 not installed correctly. VS90= COMNTOOLS/VS100COMNTOOLS/VS110COMNTOOLS/VS120COMNTOOLS not defined ^^! +) else if defined VS110COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat" + if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 11.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2012 + ) else ( + set TOOL_CHAIN_TAG=3DVS2012x86 + ) +) else if defined VS100COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat" + if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 10.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2010 + ) else ( + set TOOL_CHAIN_TAG=3DVS2010x86 + ) +) else if defined VS90COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" + if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studio= 9.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2008 + ) else ( + set TOOL_CHAIN_TAG=3DVS2008x86 + ) +) else ( + echo --ERROR: VS2008/VS2010/VS2012/VS2013/VS2015 not installed correctl= y. VS90COMNTOOLS/VS100COMNTOOLS/VS110COMNTOOLS/VS120COMNTOOLS/VS140COMMONTO= OLS not defined ^^! echo. goto :BldFail -) +) =20 echo Ensuring correct build directory is present for GenBiosId... -set BUILD_PATH=3DBuild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% +set=20 +BUILD_PATH=3D%WORKSPACE%\Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TA +G% =20 echo Modifing Conf files for this build... :: Remove lines with these tags from target.txt -findstr /V "TARGET TARGE= T_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_PLATFORM MAX_CONCURRENT_TH= READ_NUMBER" Conf\target.txt > Conf\target.txt.tmp +findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF =20 +ACTIVE_PLATFORM MAX_CONCURRENT_THREAD_NUMBER"=20 +%WORKSPACE%\Conf\target.txt > %WORKSPACE%\Conf\target.txt.tmp =20 -echo TARGET =3D %TARGET% >> Conf= \target.txt.tmp +echo TARGET =3D %TARGET% >> %WOR= KSPACE%\Conf\target.txt.tmp if "%Arch%"=3D=3D"IA32" ( - echo TARGET_ARCH =3D IA32 >> Conf= \target.txt.tmp + echo TARGET_ARCH =3D IA32 >> %WOR= KSPACE%\Conf\target.txt.tmp ) else if "%Arch%"=3D=3D"X64" ( - echo TARGET_ARCH =3D IA32 X64 >> Conf= \target.txt.tmp + echo TARGET_ARCH =3D IA32 X64 >> %WOR= KSPACE%\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 = =20 + >> %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 @@ -205,11 +212,11 @@ move /Y Conf\target.txt.tmp Conf\target.txt >nul =20 echo Creating BiosId... pushd %PLATFORM_PACKAGE% -if not exist ..\%BUILD_PATH%\IA32 mkdir ..\%BUILD_PATH%\IA32 - GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\IA32\BiosId.bin -= ob ..\Conf\BiosId.bat +if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 + 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 ..\%BUILD_PATH%\X64 mkdir ..\%BUILD_PATH%\X64 - GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\X64\BiosId.bin -= ob ..\Conf\BiosId.bat + if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64 + GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o=20 + %BUILD_PATH%\X64\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat ) popd =20 @@ -230,10 +237,10 @@ echo Running fce... =20 pushd %PLATFORM_PACKAGE% :: Extract Hii data from build and store in HiiDefaultData.txt -fce read -= i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.txt +fce read -i %BUILD_PATH%\FV\Vlv.fd > %BUILD_PATH%\FV\HiiDefaultData.txt =20 :: save changes to VlvXXX.fd -fce update -i ..\%BUILD_PATH%\FV\Vlv.fd -s ..\%BUILD_PATH%\FV\HiiDefaultDa= ta.txt -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd +fce update -i %BUILD_PATH%\FV\Vlv.fd -s=20 +%BUILD_PATH%\FV\HiiDefaultData.txt -o %BUILD_PATH%\FV\Vlv%Arch%.fd =20 popd =20 @@ -241,7 +248,7 @@ if %ERRORLEVEL% NEQ 0 goto BldFail ::echo FD successfu= lly updated with default Hii values. =20 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environm= ent 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 @@ -257,7 +264,11 @@ echo -------------------- The EDKII BIOS build has suc= cessfully completed. ----- echo. =20 @REM build capsule here -if "%openssl_path%" =3D=3D "" goto Exit +if "%openssl_path%" =3D=3D "" ( + echo -- Error: OPENSSL_PATH not set. Capule and Recovery images not = generated. + set exitCode=3D1 + goto Exit +) echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc =20 -- 2.14.2.windows.3