summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-04-01 10:35:19 -0400
committerTom Rini <[email protected]>2022-04-01 10:35:19 -0400
commit5b160c3a13f80708b4a720119cd2a1ef161e57f0 (patch)
tree68773d9d158334a4f5894ac9111328f2ee06ecad /tools
parent52d8100b1d60b656e3e311e3312fed43d388088a (diff)
parent0a3689cb86236d42522bf9eb0be942aa7761dfc1 (diff)
Merge branch '2022-04-01-Kconfig-migrations-and-cleanups' into next
- Migrate a number of CONFIG symbols to Kconfig. Of note, with this we now complete migration of CONFIG_SYS_EXTRA_OPTIONS.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genboardscfg.py12
-rwxr-xr-xtools/moveconfig.py65
2 files changed, 1 insertions, 76 deletions
diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 07bf681d1d9..ecdc166d7b9 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -111,7 +111,6 @@ class KconfigScanner:
'vendor' : 'SYS_VENDOR',
'board' : 'SYS_BOARD',
'config' : 'SYS_CONFIG_NAME',
- 'options' : 'SYS_EXTRA_OPTIONS'
}
def __init__(self):
@@ -149,7 +148,6 @@ class KconfigScanner:
'board': <board_name>,
'target': <target_name>,
'config': <config_header_name>,
- 'options': <extra_options>
}
"""
# strip special prefixes and save it in a temporary file
@@ -185,14 +183,6 @@ class KconfigScanner:
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
params['arch'] = 'aarch64'
- # fix-up options field. It should have the form:
- # <config name>[:comma separated config options]
- if params['options'] != '-':
- params['options'] = params['config'] + ':' + \
- params['options'].replace(r'\"', '"')
- elif params['config'] != params['target']:
- params['options'] = params['config']
-
return params
def scan_defconfigs_for_multiprocess(queue, defconfigs):
@@ -378,7 +368,7 @@ def format_and_output(params_list, output):
output: The path to the output file
"""
FIELDS = ('status', 'arch', 'cpu', 'soc', 'vendor', 'board', 'target',
- 'options', 'maintainers')
+ 'maintainers')
# First, decide the width of each column
max_length = dict([ (f, 0) for f in FIELDS])
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 84bc875fff8..09617a07f91 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -443,70 +443,6 @@ def cleanup_headers(configs, args):
cleanup_one_header(header_path, patterns, args)
cleanup_empty_blocks(header_path, args)
-def cleanup_one_extra_option(defconfig_path, configs, args):
- """Delete config defines in CONFIG_SYS_EXTRA_OPTIONS in one defconfig file.
-
- Args:
- defconfig_path: path to the cleaned defconfig file.
- configs: A list of CONFIGs to remove.
- args (Namespace): program arguments
- """
-
- start = 'CONFIG_SYS_EXTRA_OPTIONS="'
- end = '"'
-
- lines = read_file(defconfig_path)
-
- for i, line in enumerate(lines):
- if line.startswith(start) and line.endswith(end):
- break
- else:
- # CONFIG_SYS_EXTRA_OPTIONS was not found in this defconfig
- return
-
- old_tokens = line[len(start):-len(end)].split(',')
- new_tokens = []
-
- for token in old_tokens:
- pos = token.find('=')
- if not (token[:pos] if pos >= 0 else token) in configs:
- new_tokens.append(token)
-
- if new_tokens == old_tokens:
- return
-
- tolines = copy.copy(lines)
-
- if new_tokens:
- tolines[i] = start + ','.join(new_tokens) + end
- else:
- tolines.pop(i)
-
- show_diff(lines, tolines, defconfig_path, args.color)
-
- if args.dry_run:
- return
-
- write_file(defconfig_path, tolines)
-
-def cleanup_extra_options(configs, args):
- """Delete config defines in CONFIG_SYS_EXTRA_OPTIONS in defconfig files.
-
- Args:
- configs: A list of CONFIGs to remove.
- args (Namespace): program arguments
- """
- if not confirm(args, 'Clean up CONFIG_SYS_EXTRA_OPTIONS?'):
- return
-
- configs = [ config[len('CONFIG_'):] for config in configs ]
-
- defconfigs = get_all_defconfigs()
-
- for defconfig in defconfigs:
- cleanup_one_extra_option(os.path.join('configs', defconfig), configs,
- args)
-
def cleanup_whitelist(configs, args):
"""Delete config whitelist entries
@@ -1803,7 +1739,6 @@ doc/develop/moveconfig.rst for documentation.'''
if configs:
cleanup_headers(configs, args)
- cleanup_extra_options(configs, args)
cleanup_whitelist(configs, args)
cleanup_readme(configs, args)