buildman: Use oldconfig when adjusting the config
We cannot be sure that the new config is consistent, particularly when changing a major item like CONFIG_CMDLINE. Use 'make oldconfig' to check that and avoid any such problems. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -480,7 +480,7 @@ class Builder:
|
|||||||
Args:
|
Args:
|
||||||
commit: Commit object that is being built
|
commit: Commit object that is being built
|
||||||
brd: Board object that is being built
|
brd: Board object that is being built
|
||||||
stage: Stage that we are at (mrproper, config, build)
|
stage: Stage that we are at (mrproper, config, oldconfig, build)
|
||||||
cwd: Directory where make should be run
|
cwd: Directory where make should be run
|
||||||
args: Arguments to pass to make
|
args: Arguments to pass to make
|
||||||
kwargs: Arguments to pass to command.run_pipe()
|
kwargs: Arguments to pass to command.run_pipe()
|
||||||
|
@@ -426,6 +426,12 @@ class BuilderThread(threading.Thread):
|
|||||||
|
|
||||||
# Now do the build, if everything looks OK
|
# Now do the build, if everything looks OK
|
||||||
if result.return_code == 0:
|
if result.return_code == 0:
|
||||||
|
if adjust_cfg:
|
||||||
|
oldc_args = list(args) + ['oldconfig']
|
||||||
|
oldc_result = self.make(commit, brd, 'oldconfig', cwd,
|
||||||
|
*oldc_args, env=env)
|
||||||
|
if oldc_result.return_code:
|
||||||
|
return oldc_result
|
||||||
result = self._build(commit, brd, cwd, args, env, cmd_list,
|
result = self._build(commit, brd, cwd, args, env, cmd_list,
|
||||||
config_only)
|
config_only)
|
||||||
if adjust_cfg:
|
if adjust_cfg:
|
||||||
|
@@ -439,6 +439,8 @@ class TestFunctional(unittest.TestCase):
|
|||||||
tools.write_file(fname, b'CONFIG_SOMETHING=1')
|
tools.write_file(fname, b'CONFIG_SOMETHING=1')
|
||||||
return command.CommandResult(return_code=0,
|
return command.CommandResult(return_code=0,
|
||||||
combined='Test configuration complete')
|
combined='Test configuration complete')
|
||||||
|
elif stage == 'oldconfig':
|
||||||
|
return command.CommandResult(return_code=0)
|
||||||
elif stage == 'build':
|
elif stage == 'build':
|
||||||
stderr = ''
|
stderr = ''
|
||||||
fname = os.path.join(cwd or '', out_dir, 'u-boot')
|
fname = os.path.join(cwd or '', out_dir, 'u-boot')
|
||||||
@@ -461,7 +463,7 @@ Some images are invalid'''
|
|||||||
return command.CommandResult(return_code=0)
|
return command.CommandResult(return_code=0)
|
||||||
|
|
||||||
# Not handled, so abort
|
# Not handled, so abort
|
||||||
print('make', stage)
|
print('_HandleMake failure: make', stage)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Example function to print output lines
|
# Example function to print output lines
|
||||||
|
Reference in New Issue
Block a user