[U-Boot] [PATCH v2 6/7] moveconfig: Add a parameter to accept a list to build
Joe Hershberger
joe.hershberger at ni.com
Mon May 11 19:23:17 CEST 2015
This is helpful to re-attempt to move failed boards from a previous run
without starting over.
Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
Changes in v2: None
tools/moveconfig.py | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 5572be9..ad9dbac 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -397,7 +397,7 @@ class Slots:
ret = False
return ret
-def move_config(config_attr, jobs=1):
+def move_config(config_attr, options):
check_top_directory()
print 'Moving %s (type: %s, default: %s, no_spl: %s) ... (jobs: %d)' % (
@@ -405,22 +405,25 @@ def move_config(config_attr, jobs=1):
config_attr['type'],
config_attr['default'],
config_attr['no_spl_support'],
- jobs)
-
- # All the defconfig files to be processed
- defconfigs = []
- for (dirpath, dirnames, filenames) in os.walk('configs'):
- dirpath = dirpath[len('configs') + 1:]
- for filename in fnmatch.filter(filenames, '*_defconfig'):
- if fnmatch.fnmatch(filename, '.*'):
- continue
- defconfigs.append(os.path.join(dirpath, filename))
+ options.jobs)
+
+ if options.defconfigs:
+ defconfigs = [line.strip() for line in open(options.defconfigs, 'r')]
+ else:
+ # All the defconfig files to be processed
+ defconfigs = []
+ for (dirpath, dirnames, filenames) in os.walk('configs'):
+ dirpath = dirpath[len('configs') + 1:]
+ for filename in fnmatch.filter(filenames, '*_defconfig'):
+ if fnmatch.fnmatch(filename, '.*'):
+ continue
+ defconfigs.append(os.path.join(dirpath, filename))
"""Clean up any previous log of failed moves"""
if os.path.exists('moveconfig.failed'):
os.remove('moveconfig.failed')
- slots = Slots(config_attr, jobs)
+ slots = Slots(config_attr, options.jobs)
# Main loop to process defconfig files:
# Add a new subprocess into a vacant slot.
@@ -453,6 +456,8 @@ def main():
# Add options here
parser.add_option('-j', '--jobs', type='int', default=cpu_count,
help='the number of jobs to run simultaneously')
+ parser.add_option('-d', '--defconfigs', type='string',
+ help='a file containing a list of defconfigs to move')
parser.usage += ' config type default no_spl_support'
(options, args) = parser.parse_args()
@@ -481,7 +486,7 @@ def main():
if not config_attr['config'].startswith('CONFIG_'):
config_attr['config'] = 'CONFIG_' + config_attr['config']
- move_config(config_attr, options.jobs)
+ move_config(config_attr, options)
if __name__ == '__main__':
main()
--
1.7.11.5
More information about the U-Boot
mailing list