Build_IFWI.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. ## Assign initial values
  22. exitCode=0
  23. Build_Flags=
  24. Stitch_Flags=
  25. Arch=X64
  26. PLATFORM_PACKAGE=Vlv2TbltDevicePkg
  27. ## Parse Optional arguments
  28. if [ "$1" == "/?" ]; then
  29. Usage
  30. fi
  31. for (( i=1; i<=$#; ))
  32. do
  33. if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/Q" ]; then
  34. Build_Flags="$Build_Flags /q"
  35. shift
  36. elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/L" ]; then
  37. Build_Flags="$Build_Flags /l"
  38. shift
  39. elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then
  40. Build_Flags="$Build_Flags /c"
  41. shift
  42. elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/ECP" ]; then
  43. Build_Flags="$Build_Flags /ecp"
  44. shift
  45. elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
  46. Arch=X64
  47. Build_Flags="$Build_Flags /x64"
  48. shift
  49. elif [ "$1" == "/nG" ]; then
  50. Stitch_Flags="$Stitch_Flags /nG"
  51. shift
  52. elif [ "$1" == "/nM" ]; then
  53. Stitch_Flags="$Stitch_Flags /nM"
  54. shift
  55. elif [ "$1" == "/nB" ]; then
  56. Stitch_Flags="$Stitch_Flags /nB"
  57. shift
  58. elif [ "$1" == "/nV" ]; then
  59. Stitch_Flags="$Stitch_Flags /nV"
  60. shift
  61. elif [ "$1" == "/yL" ]; then
  62. Build_Flags="$Build_Flags /yL"
  63. shift
  64. else
  65. break
  66. fi
  67. done
  68. ## Require 2 input parameters
  69. if [ "$2" == "" ]; then
  70. Usage
  71. fi
  72. ## Assign required arguments
  73. Platform_Type=$1
  74. Build_Target=$2
  75. if [ "$3" == "" ]; then
  76. IFWI_Suffix=
  77. else
  78. IFWI_Suffix="/S $3"
  79. fi
  80. ## Go to root directory
  81. cd ..
  82. ## Build BIOS
  83. echo "======================================================================"
  84. echo "Build_IFWI: Calling BIOS build Script..."
  85. ./$PLATFORM_PACKAGE/bld_vlv.sh $Build_Flags $Platform_Type $Build_Target
  86. echo
  87. echo Finished Building BIOS.
  88. ## Start Integration process
  89. echo ======================================================================
  90. echo Skip "Build_IFWI: Calling IFWI Stitching Script..."
  91. echo
  92. echo Build_IFWI is finished.
  93. echo The final IFWI file is located in Stitch
  94. echo ======================================================================