1 #!/usr/bin/env bash 2 ##********************************************************************** 3 ## Function define 4 ##********************************************************************** 5 function Usage ( ) { 6 echo 7 echo "Script to build BIOS firmware and stitch the entire IFWI." 8 echo 9 echo "Usage: Build_IFWI.bat [options] PlatformType BuildTarget " 10 echo 11 echo 12 echo " /yL [option] : Enable SPI lock" 13 echo " Platform Types: MNW2" 14 echo " Build Targets: Release, Debug" 15 echo 16 echo " See Stitch/Stitch_Config.txt for additional stitching settings." 17 echo 18 echo 19 exit 0 20 } 21 22 ## Assign initial values 23 exitCode=0 24 Build_Flags= 25 Stitch_Flags= 26 Arch=X64 27 PLATFORM_PACKAGE=Vlv2TbltDevicePkg 28 29 ## Parse Optional arguments 30 if [ "$1" == "/?" ]; then 31 Usage 32 fi 33 34 for (( i=1; i<=$#; )) 35 do 36 if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/Q" ]; then 37 Build_Flags="$Build_Flags /q" 38 shift 39 elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/L" ]; then 40 Build_Flags="$Build_Flags /l" 41 shift 42 elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then 43 Build_Flags="$Build_Flags /c" 44 shift 45 elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/ECP" ]; then 46 Build_Flags="$Build_Flags /ecp" 47 shift 48 elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then 49 Arch=X64 50 Build_Flags="$Build_Flags /x64" 51 shift 52 elif [ "$1" == "/nG" ]; then 53 Stitch_Flags="$Stitch_Flags /nG" 54 shift 55 elif [ "$1" == "/nM" ]; then 56 Stitch_Flags="$Stitch_Flags /nM" 57 shift 58 elif [ "$1" == "/nB" ]; then 59 Stitch_Flags="$Stitch_Flags /nB" 60 shift 61 elif [ "$1" == "/nV" ]; then 62 Stitch_Flags="$Stitch_Flags /nV" 63 shift 64 elif [ "$1" == "/yL" ]; then 65 Build_Flags="$Build_Flags /yL" 66 shift 67 else 68 break 69 fi 70 done 71 72 ## Require 2 input parameters 73 if [ "$2" == "" ]; then 74 Usage 75 fi 76 77 ## Assign required arguments 78 Platform_Type=$1 79 Build_Target=$2 80 if [ "$3" == "" ]; then 81 IFWI_Suffix= 82 else 83 IFWI_Suffix="/S $3" 84 fi 85 86 ## Go to root directory 87 cd .. 88 89 ## Build BIOS 90 echo "======================================================================" 91 echo "Build_IFWI: Calling BIOS build Script..." 92 ./$PLATFORM_PACKAGE/bld_vlv.sh $Build_Flags $Platform_Type $Build_Target 93 94 echo 95 echo Finished Building BIOS. 96 97 ## Start Integration process 98 echo ====================================================================== 99 echo Skip "Build_IFWI: Calling IFWI Stitching Script..." 100 101 echo 102 echo Build_IFWI is finished. 103 echo The final IFWI file is located in Stitch 104 echo ====================================================================== 105