From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: prince.agyeman@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Fri, 03 May 2019 16:19:19 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 16:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,427,1549958400"; d="scan'208";a="148017016" Received: from paagyema-desk2.amr.corp.intel.com ([10.7.159.148]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 16:19:19 -0700 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Nate DeSimone , Ankit Sinha , Michael D Kinney , Isaac W Oram , Liming Gao Subject: [edk2-platforms/devel-MinPlatform] [PATCH v3 0/2] Adding python build script. Date: Fri, 3 May 2019 16:19:17 -0700 Message-Id: X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Michael Kubacki Cc: Nate DeSimone Cc: Ankit Sinha Cc: Michael D Kinney Cc: Isaac W Oram Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 0.1 Signed-off-by: Agyeman changes from v2: - fixed pep8 violations - implemented v2 review recommendations - added clean flag to clean specified platform Overview: WORKSPACE | |------edk2 |------edk2-non-osi |------edk2-platforms | |--Platform | |---Intel | | |------build.cfg: Default build settings. These are overridden by | | | platform specific settings (build_config.cfg) and | | | then command-line settings. | | | | | |------build_bios.py: Main build script. Generic pre-build, build, | | | post-build, and clean functions. | | | | | |------ClevoOpenBoardPkg | | | |------N1xxWU | | | |---build_config.cfg: N1xxWU specific build | | | settings environment variables. | | | | | |------KabylakeOpenBoardPkg | | | |------KabylakeRvp3 | | | |---build_config.cfg: KabylakeRvp3 specific | | | | build settings, environment variables. | | | |---build_board.py: Optional board-specific pre-build, build | | | and clean post-build functions. | | |------PurleyOpenBoardPkg | | | |------BoardMtOlympus | | | |---build_config.cfg: BoardMtOlympus specific | | | build settings, environment variables. | | | |---build_board.py: Optional board-specific pre-build, | | | | build, post-build and clean functions. |------FSP ------------------- Details: ------------------- What it is ---------- These patches add python BIOS build scripts and build configuration files to build platforms under Intel/Platform. Why ---- The reason behind this implementation is to use a cross platform build script to build minplaform BIOS. How it is done ---------------- The python files: ----------------- build_bios.py: The main build file. This script sets up the edk2 build enviroment using the default build.cfg settings and platform specific settings. It uses the configurations found in the build.cfg file to locate the platforms that are configured to use this build script. The path to each of the platform settings can be found under the "PLATFORMS" field within the build.cfg file. The platform specific settings are located in the platform's main directory. Example edk2-platforms/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/build_config.cfg. The build_bios.py script contains the four main functions: - pre_build: Sets up the edk2 build enviroment variables, target.txt file - build: Uses the configurations to Build BIOS - post_build: Does post build processes like cleaning up files generated during the build process - clean: Cleans up the build directory. There are four addtional functions that dynamically import functions from the board's Optional/Additional python script if specified in board settings file's ADDITIONAL_SCRIPTS These four functions are the pre_build_board, build_board, post_build_board, clean_ex functions Board additional (Optional) python build script: ------------------------------------------------ These are python scripts located in the board's main directory, An example Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_board.py If added, its path must be specified in board's settings file, under the field ADDITIONAL_SCRIPTS. Example ADDITIONAL_SCRIPTS = PurleyOpenBoardPkg/BoardMtOlympus/build_board.py If specified, the build_board, pre_build_board, post_build_board, clean_ex must be defined even if they are not use The config files ----------------- build.cfg: ----------- This is file contains the default BIOS build configuration. The default configurations are defined under the "DEFAULT_CONFIG" section of the file. Each of these can be overridden by the board specific setting as defined in the board's build config file. All paths must be separated by forward slashes. All the paths in the main build.cfg are relative to the minplaform WORKSPACE. Example: -------- [DEFAULT_CONFIG] MIN_PACKAGE_TOOLS = edk2-platforms/Platform/Intel/MinPlatformPkg/Tools The PLATFORMS field in the build.cfg file informs build_bios.py about the available platforms that can be built with the build_bios.py. The path to the board specific config file must be relative to location of build_bios.py, Platform/Intel. It is in the format Boardname = BoardPath Example: -------- [PLATFORMS] KabylakeRvp3 = KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg Board Specific Build Settings file: ---------------------------------------- This file is located in the board's main directory. The CONFIG field contains all the build enviroment variables. These values will override any the were specific under DEFAULT_CONFIG in the default build.cfg file. Example is Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg Building BIOS ------------- python build_bios.py -p BOARDNAME -t TOOLCHAIN usage: build_bios.py [-h] --platform {N1xxWU,KabylakeRvp3,BoardMtOlympus} [--toolchain TOOLCHAIN] [--DEBUG] [--RELEASE] [--TEST_RELEASE] [--RELEASE_PDB] [--list] [--cleanall] [--capsule] [--silent] [--performance] [--fsp] Build Help optional arguments: -h, --help show this help message and exit --platform {N1xxWU,KabylakeRvp3,BoardMtOlympus}, -p {N1xxWU,KabylakeRvp3,BoardMtOlympus} the platform to build --toolchain TOOLCHAIN, -t TOOLCHAIN using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition --DEBUG, -d debug flag --RELEASE, -r release flag --TEST_RELEASE, -tr test release flag --RELEASE_PDB, -rp release flag --list, -l lists available platforms --cleanall cleans all --clean cleans specific platform --capsule capsule build enabled --silent silent build enabled --performance performance build enabled --fsp fsp build enabled Agyeman (2): Platform/Intel: Added python build script. Updated the build instructions to include the python script build instructions .../ClevoOpenBoardPkg/N1xxWU/build_config.cfg | 33 + .../KabylakeRvp3/build_board.py | 68 ++ .../KabylakeRvp3/build_config.cfg | 34 + .../BoardMtOlympus/build_board.py | 177 ++++ .../BoardMtOlympus/build_config.cfg | 32 + Platform/Intel/build.cfg | 56 + Platform/Intel/build_bios.py | 976 ++++++++++++++++++ ReadMe.md | 76 ++ 8 files changed, 1452 insertions(+) create mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/build_config.cfg create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_board.py create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/build_board.py create mode 100644 Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/build_config.cfg create mode 100644 Platform/Intel/build.cfg create mode 100644 Platform/Intel/build_bios.py -- 2.19.1.windows.1