From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: michael.a.kubacki@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Fri, 03 May 2019 19:14:23 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 19:14:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,428,1549958400"; d="scan'208";a="167524327" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga004.fm.intel.com with ESMTP; 03 May 2019 19:14:22 -0700 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 3 May 2019 19:14:22 -0700 Received: from orsmsx122.amr.corp.intel.com ([169.254.11.68]) by ORSMSX111.amr.corp.intel.com ([169.254.12.39]) with mapi id 14.03.0415.000; Fri, 3 May 2019 19:14:22 -0700 From: "Kubacki, Michael A" To: "devel@edk2.groups.io" , "Agyeman, Prince" CC: "Desimone, Nathaniel L" , "Sinha, Ankit" , "Kinney, Michael D" , "Oram, Isaac W" , "Gao, Liming" Subject: Re: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH v3 0/2] Adding python build script. Thread-Topic: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH v3 0/2] Adding python build script. Thread-Index: AQHVAgaj2TFbLpeCwkefJib7tf13D6ZaOerQ Date: Sat, 4 May 2019 02:14:21 +0000 Message-ID: <49AB4ACB9627B8468F29D589A27B7455888E6F74@ORSMSX122.amr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGUwNjZlMjItOGY3OS00MzgyLTgwZjEtNmY3ZTJiMGUyYzg3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMDhhMW4zNlZFcWRTME5uVU5sNUw5XC9oOFBXWUY4ZlJDZkhtaEI4VUhlN01kR2xQVUUxODQ0YUdzeElXaDQxaVYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: michael.a.kubacki@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Agyeman, Prince > Sent: Friday, May 3, 2019 4:19 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, > Nathaniel L ; Sinha, Ankit > ; Kinney, Michael D ; > Oram, Isaac W ; Gao, Liming > > Subject: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH v3 0/2] > Adding python build script. >=20 > Cc: Michael Kubacki > Cc: Nate DeSimone > Cc: Ankit Sinha > Cc: Michael D Kinney > Cc: Isaac W Oram > Cc: Liming Gao >=20 > Contributed-under: TianoCore Contribution Agreement 0.1 > Signed-off-by: Agyeman >=20 >=20 > changes from v2: > - fixed pep8 violations > - implemented v2 review recommendations > - added clean flag to clean specified platform >=20 > 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 pr= e-build, build, > | | | post-build, and clean functio= ns. > | | | > | | |------ClevoOpenBoardPkg > | | | |------N1xxWU > | | | |---build_config.cfg: N1xxWU speci= fic build > | | | settings env= ironment variables. > | | | > | | |------KabylakeOpenBoardPkg > | | | |------KabylakeRvp3 > | | | |---build_config.cfg: KabylakeRv= p3 specific > | | | | build sett= ings, environment variables. > | | | |---build_board.py: Optional boa= rd-specific pre-build, > build > | | | and clean po= st-build functions. > | | |------PurleyOpenBoardPkg > | | | |------BoardMtOlympus > | | | |---build_config.cfg: BoardMtOlymp= us specific > | | | build settin= gs, environment variables. > | | | |---build_board.py: Optional board= -specific pre-build, > | | | | build, post-bu= ild and clean functions. > |------FSP >=20 >=20 > ------------------- > Details: > ------------------- > What it is > ---------- > These patches add python BIOS build scripts and build configuration file= s to > build platforms under Intel/Platform. >=20 >=20 > Why > ---- > The reason behind this implementation is to use a cross platform build s= cript > to build minplaform BIOS. >=20 >=20 > 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 se= ttings. > It uses the configurations found in the build.cfg file to locate the pla= tforms > 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 loca= ted in the > platform's main directory. > Example edk2- > platforms/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/build_config.cfg. >=20 > The build_bios.py script contains the four main functions: > - pre_build: Sets up the edk2 build enviroment variables, target.txt fil= e > - 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. >=20 > There are four addtional functions that dynamically import functions fro= m > the board's Optional/Additional python script if specified in board sett= ings > file's ADDITIONAL_SCRIPTS These four functions are the pre_build_board, > build_board, post_build_board, clean_ex functions >=20 >=20 > Board additional (Optional) python build script: > ------------------------------------------------ > These are python scripts located in the board's main directory, An examp= le > 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 =3D > 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 >=20 >=20 > The config files > ----------------- > build.cfg: > ----------- > This is file contains the default BIOS build configuration. >=20 > The default configurations are defined under the "DEFAULT_CONFIG" sectio= n > 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 sl= ashes. > All the paths in the main build.cfg are relative to the minplaform > WORKSPACE. > Example: > -------- > [DEFAULT_CONFIG] > MIN_PACKAGE_TOOLS =3D edk2- > platforms/Platform/Intel/MinPlatformPkg/Tools >=20 > The PLATFORMS field in the build.cfg file informs build_bios.py about th= e > 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 =3D BoardPa= th >=20 > Example: > -------- > [PLATFORMS] > KabylakeRvp3 =3D KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg >=20 >=20 > 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 >=20 >=20 > Building BIOS > ------------- >=20 > python build_bios.py -p BOARDNAME -t TOOLCHAIN >=20 > usage: build_bios.py [-h] --platform > {N1xxWU,KabylakeRvp3,BoardMtOlympus} > [--toolchain TOOLCHAIN] [--DEBUG] [--RELEASE] > [--TEST_RELEASE] [--RELEASE_PDB] [--list] [--cleanal= l] > [--capsule] [--silent] [--performance] [--fsp] Build= Help >=20 > 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 >=20 > Agyeman (2): > Platform/Intel: Added python build script. > Updated the build instructions to include the python script build > instructions >=20 > .../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 >=20 > -- > 2.19.1.windows.1 >=20 >=20 >=20