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.20, mailfrom: nathaniel.l.desimone@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Fri, 03 May 2019 17:36:53 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 17:36:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,427,1549958400"; d="scan'208";a="154595231" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by FMSMGA003.fm.intel.com with ESMTP; 03 May 2019 17:36:52 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.50]) by ORSMSX108.amr.corp.intel.com ([169.254.2.238]) with mapi id 14.03.0415.000; Fri, 3 May 2019 17:36:51 -0700 From: "Nate DeSimone" To: "devel@edk2.groups.io" , "Agyeman, Prince" CC: "Kubacki, Michael A" , "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: AQHVAgakIGdlHOlGuUeZSPSqiBUtkqZaHqgw Date: Sat, 4 May 2019 00:36:51 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AAEAA37E1@ORSMSX114.amr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzNhNmU4OTYtMTMzNS00NTk1LTlhYzctNDg0YWE4M2JmZmY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoid0NyVGhBQTB0NXh1TWdncHdwU2s3c0tjNndBdWxQU0NMaWV1WmZXUFVoN2pheXpUUmthT0dtalg3ZjNQUm9OZSJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: devel@edk2.groups.io On Behalf Of Agyeman, Pr= ince Sent: Friday, May 3, 2019 4:19 PM To: devel@edk2.groups.io Cc: Kubacki, Michael A ; Desimone, Nathaniel = L ; Sinha, Ankit ; K= inney, Michael D ; Oram, Isaac W ; Gao, Liming Subject: [edk2-devel] [edk2-platforms/devel-MinPlatform] [PATCH v3 0/2] Ad= ding python build script. 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 o= verridden by | | | platform specific settings (build_c= onfig.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 specifi= c build | | | settings envir= onment variables. | | | | | |------KabylakeOpenBoardPkg | | | |------KabylakeRvp3 | | | |---build_config.cfg: KabylakeRvp3= specific | | | | build settin= gs, 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-s= pecific pre-build, | | | | build, post-buil= d 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 scr= ipt 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 env= iroment using the default build.cfg settings and platform specific settings= . It uses the configurations found in the build.cfg file to locate the plat= forms that are configured to use this build script. The path to each of the platform settings can be found under the "PLATFORM= S" field within the build.cfg file. The platform specific settings are locate= d in the platform's main directory. Example edk2-platforms/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/build_confi= g.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 setting= s file's ADDITIONAL_SCRIPTS These four functions are the pre_build_board, b= uild_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 f= ield ADDITIONAL_SCRIPTS. Example ADDITIONAL_SCRIPTS =3D PurleyOpenBoardPkg/BoardMtOlympus/build_boa= rd.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 i= n the board's build config file. All paths must be separated by forward sla= shes. All the paths in the main build.cfg are relative to the minplaform WORKSPA= CE. Example: -------- [DEFAULT_CONFIG] MIN_PACKAGE_TOOLS =3D edk2-platforms/Platform/Intel/MinPlatformPkg/Too= ls 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 =3D BoardPath Example: -------- [PLATFORMS] KabylakeRvp3 =3D 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 t= he default build.cfg file. Example is Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg Building BIOS ------------- 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] [--cleanall] [--capsule] [--silent] [--performance] [--fsp] Build H= elp 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=20 --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.c= fg 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