summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2019-06-17 13:10:30 +0800
committerChasel Chiu <chasel.chiu@intel.com>2019-06-19 09:59:40 +0800
commitc10e0d9edeca18118f4472eed5c2a62ffe06032e (patch)
tree7cf806595da1f2ab9dc3b725406cb4ff87adcb3f
parent0fb0b3b49d3cf266dd09821557cc6403474e4fd7 (diff)
Platform/Intel:Add build parameter to support Binary Cache
Need extend the options in the Intel/build_bios.py file to support Binary Cache. --hash: Enable hash-based caching during build process. --binary-destination: Generate a cache of binary files in the specified directory. --binary-source: Consume a cache of binary files from the specified directory. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Shifei A Lu <shifei.a.lu@intel.com> Cc: Xiaohu Zhou <bowen.zhou@intel.com> Cc: Isaac W Oram <isaac.w.oram@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Michael Kubacki <michael.a.kubacki@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
-rw-r--r--Platform/Intel/build_bios.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py
index 09ecedde..c01b953d 100644
--- a/Platform/Intel/build_bios.py
+++ b/Platform/Intel/build_bios.py
@@ -343,6 +343,7 @@ def build(config):
print(" SILENT_MODE = ", config.get("SILENT_MODE"))
print(" REBUILD_MODE = ", config.get("REBUILD_MODE"))
print(" BUILD_ROM_ONLY = ", config.get("BUILD_ROM_ONLY"))
+ print(" BINARY_CACHE_CMD_LINE = ", config.get("HASH"), config.get("BINARY_CACHE_CMD_LINE"))
print("==========================================")
command = ["build", "-n", config["NUMBER_OF_PROCESSORS"]]
@@ -353,6 +354,10 @@ def build(config):
if config["EXT_BUILD_FLAGS"] and config["EXT_BUILD_FLAGS"] != "":
command.append(config["EXT_BUILD_FLAGS"])
+ if config.get('BINARY_CACHE_CMD_LINE'):
+ command.append(config['HASH'])
+ command.append(config['BINARY_CACHE_CMD_LINE'])
+
if config.get("SILENT_MODE", "FALSE") == "TRUE":
command.append("--silent")
command.append("--quiet")
@@ -858,6 +863,17 @@ def get_cmd_config_arguments(arguments):
if arguments.fspapi is True:
result["API_MODE_FSP_WRAPPER_BUILD"] = "TRUE"
+ if not arguments.UseHashCache:
+ result['BINARY_CACHE_CMD_LINE'] = ''
+ elif arguments.BinCacheDest:
+ result['HASH'] = '--hash'
+ result['BINARY_CACHE_CMD_LINE'] = '--binary-destination=%s' % arguments.BinCacheDest
+ elif arguments.BinCacheSource:
+ result['HASH'] = '--hash'
+ result['BINARY_CACHE_CMD_LINE'] = '--binary-source=%s' % arguments.BinCacheSource
+ else:
+ result['BINARY_CACHE_CMD_LINE'] = ''
+
return result
@@ -934,6 +950,17 @@ def get_cmd_arguments(build_config):
parser.add_argument("--fspapi", help="API mode fsp wrapper build enabled",
action='store_true', dest="fspapi")
+ parser.add_argument("--hash", action="store_true", dest="UseHashCache", default=False,
+ help="Enable hash-based caching during build process.")
+
+ parser.add_argument("--binary-destination", help="Generate a cache of binary \
+ files in the specified directory.",
+ action='store', dest="BinCacheDest")
+
+ parser.add_argument("--binary-source", help="Consume a cache of binary files \
+ from the specified directory.",
+ action='store', dest="BinCacheSource")
+
return parser.parse_args()