===================================

BootLoader Build environment setup
===================================

Windows os
----------------------
Here are the detailed Instructions to compile the Boot build on Windows machine.

Please read the Required tool versions: For correct tool versions, see Table 3-2 and set the export paths appropriately.

1. Install Python3.10.x or later version
   
2. Install Device tree Compiler
   Qcom internal only
      Please Install  Device tree compiler (DTC) from QPM(Qualcom package management). make sure to have the binaries available at c:\\Apps\\DTC 
   For external customer
      Please get the DTC compiler from open source distribution and refer to below user guide.
      https://docs.qualcomm.com/bundle/80-PE663-2/resource/80-PE663-2.pdf

3. Install the below python add-on with pip install.
	  Open command prompt,make sure using python3.10.x or later version. 
      Please run "python -m pip install -r <root>\boot_images\boot_tools\dtschema_tools\oss\requirements.txt".

4. Install the SDLLVM compiler. 
      Install SDLLVM 16.0.7 from QPM.
      The path may vary depending on the Installation and please copy them at C:\\Apps\\LLVM\\16.0.7\\bin path.

5. Install iasl package

       Download iasl from here https://acpica.org/
       Rename the downloaded folder to ASL
       Move it to C drive (C:/ASL/iasl.exe)
       Add C:/ASL/iasl in env variable path

6.  Install the Visual Studio from V2015 to V2019.

       On a successful Installation, please open visual studio to install VC++. 

7. Build env setup:

       Please set these Environment variables for compilation 

            set SECTOOLS_DIR=<target_root>\common\sectoolsv2\
  



Linux os
----------------------
Linux development workstation requires ubuntu 18.04 or later version.

1. Install Python3.10.x or later version
   
2. Install Device tree Compiler
      Please get the DTC compiler from open source distribution and refer to below user guide.
      https://docs.qualcomm.com/bundle/80-PE663-2/resource/80-PE663-2.pdf

3. Install the below python add-on with pip install.
	  Open command prompt,make sure using python3.10.x or later version. 
      Please run "python -m pip install -r <root>/boot_images/boot_tools/dtschema_tools/oss/requirements.txt".

4. Install the SDLLVM compiler. 
      Install SDLLVM 16.0.7.
      The path may vary depending on the Installation and please copy them at /pkg/qct/software/llvm/release/arm/16.0.7 path.

5. Install iasl package
      sudo apt-get install iasl
	  
6. Install Sectools V2:

       Please set these Environment variables for sectools 
       export SECTOOLS_DIR="META_PATH"/common/sectoolsv2/ext/Linux/
			
Compile boot images
=======================			
			
Open a command prompt with administrator privilege. cd to to <target_root> where the boot source is present.

Use following command to build boot images 
  python boot_images/boot_tools/buildex.py  -t <target_name> -v <variant> -r [release|debug]
  
Example of Hamoa boot build command:
  python boot_images/boot_tools/buildex.py -t hamoa -v wp -r debug. 
  
Run  python boot_images/boot_tools/buildex.py -h to get more detial usage of buildex.py.
