buildman: Allow adjusting board config on the fly
Add a -a option to specify changes to the config before the build
commences. For example
buildman -a ~CONFIG_CMDLINE
disables CONFIG_CMDLINE before doing the build.
This makes it easier to try things out as well as to write tests without
creating a new board or manually manging the .config file.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 122f0d1..720bbb2 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -250,7 +250,7 @@
mrproper=False, per_board_out_dir=False,
config_only=False, squash_config_y=False,
warnings_as_errors=False, work_in_output=False,
- test_thread_exceptions=False):
+ test_thread_exceptions=False, adjust_cfg=None):
"""Create a new Builder object
Args:
@@ -280,6 +280,15 @@
test_thread_exceptions: Uses for tests only, True to make the
threads raise an exception instead of reporting their result.
This simulates a failure in the code somewhere
+ adjust_cfg_list (list of str): List of changes to make to .config
+ file before building. Each is one of (where C is the config
+ option with or without the CONFIG_ prefix)
+
+ C to enable C
+ ~C to disable C
+ C=val to set the value of C (val must have quotes if C is
+ a string Kconfig
+
"""
self.toolchains = toolchains
self.base_dir = base_dir
@@ -315,6 +324,8 @@
self.squash_config_y = squash_config_y
self.config_filenames = BASE_CONFIG_FILENAMES
self.work_in_output = work_in_output
+ self.adjust_cfg = adjust_cfg
+
if not self.squash_config_y:
self.config_filenames += EXTRA_CONFIG_FILENAMES
self._terminated = False
@@ -1747,6 +1758,7 @@
job.commits = commits
job.keep_outputs = keep_outputs
job.work_in_output = self.work_in_output
+ job.adjust_cfg = self.adjust_cfg
job.step = self._step
if self.num_threads:
self.queue.put(job)