[edk2-devel] [Patch 12/16] Vlv2TbltDevicePkg: Remove directory assumptions from build scripts

Sun, Zailiang zailiang.sun at intel.com
Thu May 9 07:55:01 UTC 2019


Reviewed-by: Zailiang Sun <zailiang.sun at intel.com>

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Thursday, May 9, 2019 12:31 PM
> To: devel at edk2.groups.io
> Cc: Sun, Zailiang <zailiang.sun at intel.com>; Qian, Yi <yi.qian at intel.com>
> Subject: [Patch 12/16] Vlv2TbltDevicePkg: Remove directory assumptions
> from build scripts
> 
> In preparation for moving Vlv2TbltDevicePkg to the edk2-platforms
> repository, the batch scripts used to build this platform are updated to not
> make any assumptions about the directory location of Vlv2TbltDevicePkg.
> 
> Cc: Zailiang Sun <zailiang.sun at intel.com>
> Cc: Yi Qian <yi.qian at intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> ---
>  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
> index 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_IFWI.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
> - at REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> + at REM Copyright (c) 2006 - 2019, Intel Corporation. All rights
> +reserved.<BR>
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent  @REM
> 
> @@ -18,11 +18,26 @@ set exitCode=0
>  set "Build_Flags= "
>  set "Stitch_Flags= "
>  set Arch=X64
> -set WORKSPACE=%CD%
> -set CORE_PATH=%WORKSPACE%\edk2
> -set PLATFORM_PATH=%WORKSPACE%\edk2
>  set PLATFORM_PACKAGE=Vlv2TbltDevicePkg
> 
> +set PLATFORM_PATH=%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=%%~fi
> +        goto PlatformPackageFound
> +      )
> +    )
> +  ) else (
> +    echo.
> +    echo !!! ERROR !!! Cannot find %PLATFORM_PACKAGE% !!!
> +    echo.
> +    goto Exit
> +  )
> +)
> +:PlatformPackageFound
> +
>  :: Parse Optional arguments
>  :OptLoop
>  if /i "%~1"=="/?" 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=%BIOS_ID%
> 
>  :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor
> environment variables -find /v "#" %CORE_PATH%\Conf\BiosId.env >
> ver_strings
> +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings
>  for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j  del /f/q
> ver_strings >nul  set
> BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%
> _%VERSION_MINOR%.ROM
> @@ -137,10 +152,10 @@ set
> BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%
> _%VERSION_MINOR%.ROM
>  :: Start Integration process
>  echo
> ==========================================================
> ============
>  echo Build_IFWI:  Calling IFWI Stitching Script...
> -pushd %CORE_PATH%\%PLATFORM_PACKAGE%\Stitch
> +pushd %PLATFORM_PATH%\%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 %BIOS_Name% %IFWI_Suffix%
> 
>   @echo off
>  popd
> diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat
> b/Vlv2TbltDevicePkg/Stitch/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
> - at REM Copyright (c) 2006   - 2014, Intel Corporation. All rights reserved.<BR>
> + at REM Copyright (c) 2006   - 2019, Intel Corporation. All rights reserved.<BR>
>  @REM
>  @REM   SPDX-License-Identifier: BSD-2-Clause-Patent
>  @REM
> @@ -9,6 +9,25 @@
>  @echo off
>  SetLocal EnableDelayedExpansion EnableExtensions
> 
> +set PLATFORM_BIN_PACKAGE=%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=%%~fi\Vlv2SocBinPkg
> +        goto PlatformBinPackageFound
> +      )
> +    )
> +  ) else (
> +    echo.
> +    echo !!! ERROR !!! Cannot find %PLATFORM_NAME% !!!
> +    echo.
> +    goto BldFail
> +  )
> +)
> +:PlatformBinPackageFound
> +
> +
>  :: Set script defaults
>  set exitCode=0
>  set BackupRom=1
> @@ -185,7 +204,7 @@ for %%i in (%BIOS_Names%) do (
>      echo Generating IFWI... %BIOS_ID%.bin
>      echo.
> 
> -    copy /b/y !IFWI_HEADER_FILE!
> + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin
> + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SEC_VERSION!\Vacant.bin
> + !BIOS_Rom! %BIOS_ID%.bin
> +    copy /b/y !IFWI_HEADER_FILE! +
> + %PLATFORM_BIN_PACKAGE%\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin
> +
> + %PLATFORM_BIN_PACKAGE%\SEC\!SEC_VERSION!\Vacant.bin
> + !BIOS_Rom!
> + %BIOS_ID%.bin
>      echo.
>      echo
> ==========================================================
> =================
>  )
> diff --git a/Vlv2TbltDevicePkg/bldX64.bat b/Vlv2TbltDevicePkg/bldX64.bat
> deleted file mode 100644 index 50dc5b1f07..0000000000
> --- a/Vlv2TbltDevicePkg/bldX64.bat
> +++ /dev/null
> @@ -1,216 +0,0 @@
> - at REM @file
> - at REM   Windows batch file to build BIOS ROM
> - at REM
> - at REM Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -
> @REM SPDX-License-Identifier: BSD-2-Clause-Patent - at REM
> -
> - at echo off
> - at echo.
> - at time /t
> -
> - at if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log - at if
> exist %WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log - at if
> exist %WORKSPACE%\Conf\build_rule.txt
> del %WORKSPACE%\Conf\build_rule.txt - at if
> exist %WORKSPACE%\Conf\FrameworkDatabase.db
> del %WORKSPACE%\Conf\FrameworkDatabase.db
> - at if exist %WORKSPACE%\Conf\target.txt
> del %WORKSPACE%\Conf\target.txt - at if
> exist %WORKSPACE%\Conf\tools_def.txt
> del %WORKSPACE%\Conf\tools_def.txt - at if exist conf\.cache rmdir /q /s
> conf\.cache
> -
> - at set target=DEBUG
> -
> - at if /i "%1" == "release" set TARGET=RELEASE - at if /i "%2" == "release" set
> TARGET=RELEASE - at if /i "%3" == "release" set TARGET=RELEASE - at if /i "%4"
> == "release" set TARGET=RELEASE - at if /i "%5" == "release" set
> TARGET=RELEASE
> -
> - at set PlatformType=NO_PLATFORM
> - at set config_file=.\Vlv2TbltDevicePkg\PlatformPkgConfig.dsc
> - at set EVN_debug_file=.\Vlv2TbltDevicePkg\BiosIdx64D.env
> - at set EVN_release_file=.\Vlv2TbltDevicePkg\BiosIdx64R.env
> - at set auto_config_inc=.\Vlv2TbltDevicePkg\AutoPlatformCFG.txt
> -
> - at if  "%1" == "MNW2" (
> -  set %PlatformType% = MNW2
> -  @echo  Setting Baley Bay platform configration and BIOS ID ...
> -  findstr /b /v BOARD_ID %EVN_debug_file% > newfile.env
> -  echo BOARD_ID = MNW2MAX >> newfile.env
> -  type newfile.env > %EVN_debug_file%
> -  findstr /b /v BOARD_ID %EVN_release_file% > newfile.env
> -  echo BOARD_ID = MNW2MAX >> newfile.env
> -  type newfile.env > %EVN_release_file%
> -  echo DEFINE ENBDT_PF_BUILD = TRUE  >> %auto_config_inc%
> -  echo DEFINE X64_CONFIG = TRUE  >> %auto_config_inc%
> -  goto PLATFORM_SETTING_DONE
> -)
> -
> - at if  "%PlatformType%" == "NO_PLATFORM" (
> -  goto BldFail
> -)
> -
> -rem clearup the temp file
> -:PLATFORM_SETTING_DONE
> - at DEL NEWFILE.ENV
> - at DEL NEWFILE.CFG
> -
> - at REM Define platform specific environment variables.
> - at REM
> - at set PLATFORM_PACKAGE=Vlv2TbltDevicePkg
> - at set SCRIPT_ERROR=0
> -
> - at REM Set basic environment.
> - at echo.
> - at echo Run edksetup.bat batch file.
> - at echo.
> - at del Conf\build_rule.txt
> - at REM @del Conf\tools_def.txt
> - at call edksetup.bat
> -
> -
> - at echo.
> - at echo Set the VS2008 environment.
> - at echo.
> - at if defined VS90COMNTOOLS (
> -  if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat"
> -  if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 9.0\Common7\Tools\" (
> -    set TOOL_CHAIN_TAG=VS2008
> -  ) else (
> -    set TOOL_CHAIN_TAG=VS2008x86
> -  )
> -) else (
> -  echo.
> -  echo !!! ERROR !!! VS2008 not installed correctly. VS90COMNTOOLS not
> defined. !!!
> -  echo.
> -  set SCRIPT_ERROR=1
> -  goto :BldEnd
> -)
> -
> - at echo.
> - at echo Set build environment.
> - at echo.
> - at if not exist
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% (
> -  mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%
> -)
> -
> -
> - at REM Set clean build option
> - at set CLEAN_BUILD_OPTION=-e
> -
> - at findstr /V "ACTIVE_PLATFORM TARGET TARGET_ARCH TOOL_CHAIN_TAG
> BUILD_RULE_CONF" Conf\target.txt >
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> -
> - at echo ACTIVE_PLATFORM
> = %PLATFORM_PACKAGE%/PlatformPkgX64.dsc     >>
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> - at echo TARGET          = %TARGET%                                  >>
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> - at echo TARGET_ARCH     = IA32 X64                                  >>
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> - at echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                          >>
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> - at echo BUILD_RULE_CONF = Conf/build_rule.txt                       >>
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt
> - at move /Y
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.t
> xt Conf
> -
> -
> -
> - at echo.
> - at echo Create BiosIdx64.
> - at echo.
> - at if not exist
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64 (
> -  mkdir
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64
> -)
> -
> - at if "%TARGET%" == "DEBUG" (
> -  set BIOS_ID_FILE=BiosIdx64D.env
> -
> -) else (
> -  set BIOS_ID_FILE=BiosIdx64R.env
> -
> -)
> -
> -
> -GenBiosId.exe -i %PLATFORM_PACKAGE%\%BIOS_ID_FILE% -o
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64\Bio
> sId.bin
> - at if %ERRORLEVEL% NEQ 0 goto BldFail
> -
> - at echo off
> -echo Copy reference code ASL files.
> -
> -
> - at if /i "/s" == "%1" goto BldSilent
> - at if /i "/s" == "%2" goto BldSilent
> - at if /i "/s" == "%3" goto BldSilent
> - at if /i "/s" == "%4" goto BldSilent
> - at if /i "/s" == "%5" goto BldSilent
> -
> -build -n %NUMBER_OF_PROCESSORS%
> - at if %ERRORLEVEL% NEQ 0 goto BldFail
> -
> - at If %SCRIPT_ERROR% EQU 1 goto BldFail
> - at goto BldSuccess
> -
> -:BldSilent
> -
> -build -n %NUMBER_OF_PROCESSORS% 1>>EDK2.log 2>&1 -
> @if %ERRORLEVEL% NEQ 0 goto BldFail
> -
> -
> - at If %SCRIPT_ERROR% EQU 1 goto BldFail
> -
> -:BldSuccess
> - at echo off
> -del
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.beforeconfig.fd 1>>EDK2.log 2>&1 -del
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\HiiD
> efaultData.txt 1>>EDK2.log 2>&1
> -copy /y
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.f
> d
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.beforeconfig.fd 1>>EDK2.log 2>&1
> -
> - at echo.
> - at echo Extract setup default value from VFR
> (Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Hii
> DefaultData.txt)
> - at echo.
> -fce read -i
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.beforeconfig.fd >
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\HiiD
> efaultData.txt
> -
> -
> - at echo Update FD with default Hii value successfully! (both 'Setup' and
> 'SetupDefault') - at echo.
> -fce mirror -i
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.beforeconfig.fd -o
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.fd Setup SetupDefault 1>>EDK2.log 2>&1
> -
> - at echo off
> -del
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.f
> d
> -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%\ROM\*
> -rd /Q
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
> -:Gen8MImage
> -
> -copy /b
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX
> 64.fd Vlv2TbltDevicePkg\RomImage\bios.rom
> -
> -pushd Vlv2TbltDevicePkg\RomImage\
> - at if "%TARGET%" == "DEBUG" (
> -    call signbiosX64_debug.bat
> -) else (
> -    call signbiosX64_release.bat
> -)
> -
> -call ftoolbuild.bat
> -call ftoolbuild_sec_enable.bat
> -popd
> -
> - at echo off
> -mkdir
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
> -move Vlv2TbltDevicePkg\RomImage\SPI_Image\*
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM\ >
> NUL
> -
> -call GenBIOS.bat X64
> -
> - at echo on
> -
> - at echo TARGET:               %TARGET%
> - at echo TOOL_CHAIN_TAG:       %TOOL_CHAIN_TAG%
> - at echo BIOS location:
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV
> - at echo SPI Images location:
> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
> - at echo.
> - at echo The EDKII BIOS build has successfully completed!
> - at echo.
> - at goto BldEnd
> -
> -:BldFail
> - at echo.
> - at echo The EDKII BIOS Build has failed!
> - at echo.
> -exit /b 1
> -
> -:BldEnd
> - at 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
> - at REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> + at REM Copyright (c) 2006 - 2019, Intel Corporation. All rights
> +reserved.<BR>
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent  @REM
> 
> @@ -15,25 +15,60 @@ echo.
>  ::*********************************************************
> *************
>  :: Initial Setup
>  ::*********************************************************
> *************
> -set WORKSPACE=%CD%
>  if %WORKSPACE:~-1%==\ set WORKSPACE=%WORKSPACE:~0,-1%  set /a
> build_threads=1  set "Build_Flags= "
>  set exitCode=0
>  set Arch=X64
>  set Source=0
> -set CORE_PATH=%WORKSPACE%\edk2
> -set PLATFORM_PATH=%WORKSPACE%\edk2
> -cd ./edk2
> +set PLATFORM_NAME=Vlv2TbltDevicePkg
> +
> +set CORE_PATH=%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=%%~fi
> +        goto CorePathFound
> +      )
> +    )
> +  ) else (
> +    echo.
> +    echo !!! ERROR !!! Cannot find edksetup.bat !!!
> +    echo.
> +    goto BldFail
> +  )
> +)
> +:CorePathFound
> +
> +set PLATFORM_PACKAGE=%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=%%~fi\%PLATFORM_NAME%
> +        goto PlatformPackageFound
> +      )
> +    )
> +  ) else (
> +    echo.
> +    echo !!! ERROR !!! Cannot find %PLATFORM_NAME% !!!
> +    echo.
> +    goto BldFail
> +  )
> +)
> +:PlatformPackageFound
> +
> +cd %CORE_PATH%
> 
>  :: Clean up previous build files.
> -if exist %CORE_PATH%\edk2.log del %CORE_PATH%\edk2.log -if
> exist %CORE_PATH%\unitool.log del %CORE_PATH%\unitool.log -if
> exist %CORE_PATH%\Conf\target.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_rule.txt
> del %CORE_PATH%\Conf\build_rule.txt -if
> exist %CORE_PATH%\Conf\FrameworkDatabase.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
> +%WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log if exist
> +%WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt if
> exist
> +%WORKSPACE%\Conf\tools_def.txt
> del %WORKSPACE%\Conf\tools_def.txt if
> +exist %WORKSPACE%\Conf\build_rule.txt del
> +%WORKSPACE%\Conf\build_rule.txt if exist
> +%WORKSPACE%\Conf\FrameworkDatabase.db del
> +%WORKSPACE%\Conf\FrameworkDatabase.db
> +if exist %WORKSPACE%\Conf\.cache rmdir
> /q/s %WORKSPACE%\Conf\.cache
> 
>  :: Setup EDK environment. Edksetup puts new copies of target.txt,
> tools_def.txt, build_rule.txt in WorkSpace\Conf
>  :: Also run edksetup as soon as possible to avoid it from changing
> environment variables we're overriding @@ -41,8 +76,6 @@
> call %CORE_PATH%\edksetup.bat Rebuild  @echo off
> 
>  :: Define platform specific environment variables.
> -set PLATFORM_NAME=Vlv2TbltDevicePkg
> -set PLATFORM_PACKAGE=%PLATFORM_PATH%\Vlv2TbltDevicePkg
>  set config_file=%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc
>  set auto_config_inc=%PLATFORM_PACKAGE%\AutoPlatformCFG.txt
> 
> @@ -82,9 +115,9 @@ if /i "%~1" == "/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"=="" goto Usage
> 
>  ::Remove the values for Platform_Type and Build_Target from BiosIdX.env
> and stage in Conf\  if "%Arch%"=="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
> + > %WORKSPACE%\Conf\BiosId.env
>      echo DEFINE X64_CONFIG = FALSE  >> %auto_config_inc%
>  ) else if "%Arch%"=="X64" (
> -    findstr /b /v "BOARD_ID
> BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.env > Conf\BiosId.env
> +    findstr /b /v "BOARD_ID  BUILD_TYPE"
> + %PLATFORM_PACKAGE%\BiosIdx64R.env > %WORKSPACE%\Conf\BiosId.
> env
>      echo DEFINE X64_CONFIG = TRUE  >> %auto_config_inc%
>  )
> 
>  :: -- Build flags settings for each Platform --  echo Setting  %1  platform
> configuration and BIOS ID...
>  if /i "%~1" == "MNW2" (
> -    echo BOARD_ID = MNW2MAX >> Conf\BiosId.env
> +    echo BOARD_ID = MNW2MAX >> %WORKSPACE%\Conf\BiosId.env
>      echo DEFINE ENBDT_PF_BUILD = TRUE   >> %auto_config_inc%
> 
>  ) else (
> @@ -128,10 +161,10 @@ set Platform_Type=%~1
> 
>  if /i "%~2" == "RELEASE" (
>      set target=RELEASE
> -    echo BUILD_TYPE = R >> Conf\BiosId.env
> +    echo BUILD_TYPE = R >> %WORKSPACE%\Conf\BiosId.env
>  ) else (
>      set target=DEBUG
> -    echo BUILD_TYPE = D >> Conf\BiosId.env
> +    echo BUILD_TYPE = D >> %WORKSPACE%\Conf\BiosId.env
>  )
> 
>  ::*********************************************************
> *************
> @@ -181,43 +214,40 @@ if defined VS140COMNTOOLS (
>  )
> 
>  echo Ensuring correct build directory is present for GenBiosId...
> -set
> BUILD_PATH=Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG%
> +set
> +BUILD_PATH=%WORKSPACE%\Build\%PLATFORM_NAME%\%TARGET%_%
> TOOL_CHAIN_TAG%
> 
>  echo Modifing Conf files for this build...
>  :: Remove lines with these tags from target.txt -findstr /V "TARGET
> TARGET_ARCH  TOOL_CHAIN_TAG  BUILD_RULE_CONF  ACTIVE_PLATFORM
> MAX_CONCURRENT_THREAD_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"
> +%WORKSPACE%\Conf\target.txt > %WORKSPACE%\Conf\target.txt.tmp
> 
> -echo TARGET          = %TARGET%                                  >> Conf\target.txt.tmp
> +echo TARGET
> = %TARGET%                                  >> %WORKSPACE%\Conf\target.txt.tmp
>  if "%Arch%"=="IA32" (
> -    echo TARGET_ARCH = IA32                                       >> Conf\target.txt.tmp
> +    echo TARGET_ARCH =
> IA32                                       >> %WORKSPACE%\Conf\target.txt.tmp
>  ) else if "%Arch%"=="X64" (
> -    echo TARGET_ARCH = IA32 X64                                  >> Conf\target.txt.tmp
> +    echo TARGET_ARCH = IA32
> X64                                  >> %WORKSPACE%\Conf\target.txt.tmp
>  )
> -echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                                  >>
> Conf\target.txt.tmp
> -echo BUILD_RULE_CONF = Conf/build_rule.txt                               >>
> Conf\target.txt.tmp
> +echo TOOL_CHAIN_TAG
> = %TOOL_CHAIN_TAG%                                  >> %WORKSPACE%\Conf\target.txt
> .tmp
> +echo BUILD_RULE_CONF =
> Conf/build_rule.txt                               >> %WORKSPACE%\Conf\target.txt.tmp
>  if %Source% == 0 (
> -  echo ACTIVE_PLATFORM
> = %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc        >>
> Conf\target.txt.tmp
> +  echo ACTIVE_PLATFORM
> = %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc        >> %WORKSPACE%
> \Conf\target.txt.tmp
>  ) else (
> -  echo ACTIVE_PLATFORM
> = %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc  >>
> Conf\target.txt.tmp
> +  echo ACTIVE_PLATFORM
> = %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc
> + >> %WORKSPACE%\Conf\target.txt.tmp
>  )
> -echo MAX_CONCURRENT_THREAD_NUMBER
> = %build_threads%                      >> Conf\target.txt.tmp
> +echo MAX_CONCURRENT_THREAD_NUMBER
> = %build_threads%                      >> %WORKSPACE%\Conf\target.txt.tmp
> 
> -move /Y Conf\target.txt.tmp Conf\target.txt >nul
> +move
> /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt
> +>nul
> 
>  ::*********************************************************
> *************
>  :: Build BIOS
>  ::*********************************************************
> *************
> 
>  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
> +%PLATFORM_PACKAGE%\GenBiosId.exe -
> i %WORKSPACE%\Conf\BiosId.env -o
> +%BUILD_PATH%\IA32\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat
>  if "%Arch%"=="X64" (
> -   if not exist %WORKSPACE%\%BUILD_PATH%\X64
> mkdir %WORKSPACE%\%BUILD_PATH%\X64
> -   GenBiosId.exe -i %CORE_PATH%\Conf\BiosId.env -
> o %WORKSPACE%\%BUILD_PATH%\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
> + %BUILD_PATH%\X64\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat
>  )
> -popd
> -
> 
>  if %ERRORLEVEL% NEQ 0 goto BldFail
> 
> @@ -235,23 +265,23 @@ echo Running fce...
> 
>  pushd %PLATFORM_PACKAGE%
>  :: Extract Hii data from build and store in HiiDefaultData.txt -fce read -
> i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd > %WORKSPACE%\%BUILD_PA
> TH%\FV\HiiDefaultData.txt
> +%PLATFORM_PACKAGE%\fce read -i %BUILD_PATH%\FV\Vlv.fd >
> +%BUILD_PATH%\FV\HiiDefaultData.txt
> 
>  :: save changes to VlvXXX.fd
> -fce update -i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd -
> s %WORKSPACE%\%BUILD_PATH%\FV\HiiDefaultData.txt -
> o %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd
> +%PLATFORM_PACKAGE%\fce update -i %BUILD_PATH%\FV\Vlv.fd -s
> +%BUILD_PATH%\FV\HiiDefaultData.txt -
> o %BUILD_PATH%\FV\Vlv%Arch%.fd
>  popd
> 
>  if %ERRORLEVEL% NEQ 0 goto BldFail
>  ::echo FD successfully updated with default Hii values.
> 
>  :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor
> environment variables -find /v "#" Conf\BiosId.env > ver_strings
> +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings
>  for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j  del /f/q
> ver_strings >nul
> 
>  set
> BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%
> _%VERSION_MINOR%.ROM
> -copy
> /y/b %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd  %PLATFORM_PAT
> H%\%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
> +%BUILD_PATH%\FV\Vlv%Arch%.fd  %BUILD_PATH%\FV\Vlv.ROM >nul
> 
>  echo.
>  echo Build location:     %BUILD_PATH%
> @@ -261,13 +291,8 @@ echo -------------------- The EDKII BIOS build has
> successfully completed. -----  echo.
> 
>  @REM build capsule here
> - at REMif "%openssl_path%" == "" (
> - at REM    echo -- Error:  OPENSSL_PATH not set.  Capule and Recovery images
> not generated.
> - at REM    set exitCode=1
> - at REM    goto Exit
> - at REM
> - at REM echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv
> - at REM build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc
> +echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv
> +build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc
> 
>  goto Exit
> 
> diff --git a/Vlv2TbltDevicePkg/bld_vlv.sh b/Vlv2TbltDevicePkg/bld_vlv.sh
> index 51d3acacb4..ec3a325db7 100755
> --- a/Vlv2TbltDevicePkg/bld_vlv.sh
> +++ b/Vlv2TbltDevicePkg/bld_vlv.sh
> @@ -242,9 +242,8 @@ VERSION_MINOR=$(grep '^VERSION_MINOR'
> Conf/BiosId.env | cut -d ' ' -f 3 | cut -c  BOARD_ID=$(grep '^BOARD_ID'
> Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-7)
> BIOS_Name="$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_
> "$VERSION_MINOR".ROM
> 
> BIOS_ID="$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VE
> RSION_MINOR"_GCC.bin
> -cp -f $BUILD_PATH/FV/VLV.fd  $WORKSPACE/$BIOS_Name
>  SEC_VERSION=1.0.2.1060v5
> -cat
> $IFWI_HEADER_FILE ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/VLV_SEC_RE
> GION.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/Vacant.bin
> $BIOS_Name > ./$PLATFORM_PACKAGE/Stitch/$BIOS_ID
> +cat $IFWI_HEADER_FILE
> +../Vlv2Binaries/Vlv2SocBinPkg/SEC/$SEC_VERSION/VLV_SEC_REGION.bin
> +../Vlv2Binaries/Vlv2SocBinPkg/SEC/$SEC_VERSION/Vacant.bin
> +$BUILD_PATH/FV/VLV.fd > ./$PLATFORM_PACKAGE/Stitch/$BIOS_ID
> 
> 
>  echo Skip "Running BIOS_Signing ..."
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40299): https://edk2.groups.io/g/devel/message/40299
Mute This Topic: https://groups.io/mt/31551781/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list