From 32cc6ae273128510cffc536fc72f260181ef1744 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 11 Feb 2022 13:23:18 -0700 Subject: patman: Correct pylint errors Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass --- doc/develop/python_cq.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/develop') diff --git a/doc/develop/python_cq.rst b/doc/develop/python_cq.rst index 3f99f1d9c0b..1e209ff197d 100644 --- a/doc/develop/python_cq.rst +++ b/doc/develop/python_cq.rst @@ -77,4 +77,15 @@ If the pylint version is updated in CI, this may result in needing to regenerate `scripts/pylint.base`. +Checking for errors +------------------- + +If you only want to check for pylint errors, use:: + + PYTHONPATH=/path/to/scripts/dtc/pylibfdt/ make pylint_err + +This will show only pylint errors. Note that you must set PYTHONPATH to point +to the pylibfdt directory build by U-Boot (typically the sandbox_spl board). If +you have used `make qcheck` then it sill be in `board-sandbox_spl`. + .. _`PEP 8`: https://www.python.org/dev/peps/pep-0008/ -- cgit v1.3.1 From abe5d1184f276a0789365316061a14834dbc8dc4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 4 Mar 2022 08:43:08 -0700 Subject: event: Add documentation Add documentation for events, including the event command. Signed-off-by: Simon Glass --- doc/develop/event.rst | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/develop/index.rst | 1 + doc/usage/event.rst | 49 ++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 4 files changed, 117 insertions(+) create mode 100644 doc/develop/event.rst create mode 100644 doc/usage/event.rst (limited to 'doc/develop') diff --git a/doc/develop/event.rst b/doc/develop/event.rst new file mode 100644 index 00000000000..6e144cfcddf --- /dev/null +++ b/doc/develop/event.rst @@ -0,0 +1,66 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Events +====== + +U-Boot supports a way for various events to be handled by interested +subsystems. This provide a generic way to handle 'hooks' like setting up the +CPUs after driver model is active, or reading a partition table after a new +block device is probed. + +Rather than using weak functions and direct calls across subsystemss, it is +often easier to use an event. + +An event consists of a type (e.g. EVT_DM_POST_INIT) and some optional data, +in `union event_data`. An event spy can be creasted to watch for events of a +particular type. When the event is created, it is sent to each spy in turn. + + +Declaring a spy +--------------- + +To declare a spy, use something like this:: + + static int snow_setup_cpus(void *ctx, struct event *event) + { + /* do something */ + return 0; + } + EVENT_SPY(EVT_DM_POST_INIT, snow_setup_cpus); + +Your function is called when EVT_DM_POST_INIT is emitted, i.e. after driver +model is inited (in SPL, or in U-Boot proper before and after relocation). + + +Debugging +--------- + +To assist with debugging events, enable `CONFIG_EVENT_DEBUG` and +`CONFIG_CMD_EVENT`. The :doc:`../usage/event` command can then be used to +provide a spy list. + +It is also possible to list spy information from the U-Boot executable,, using +the `event_dump.py` script:: + + $ scripts/event_dump.py /tmp/b/sandbox/u-boot + Event type Id Source location + -------------------- ------------------------------ ------------------------------ + EVT_MISC_INIT_F f:sandbox_misc_init_f arch/sandbox/cpu/start.c:125 + +This shows each event spy in U-Boot, along with the event type, function name +(or ID) and source location. + +Note that if `CONFIG_EVENT_DEBUG` is not enabled, the event ID is missing, so +the function is shown instead (with an `f:` prefix as above). Since the ID is +generally the same as the function name, this does not matter much. + +The event type is decoded by the symbol used by U-Boot for the event linker +list. Symbols have the form:: + + _u_boot_list_2_evspy_info_2_EVT_MISC_INIT_F + +so the event type can be read from the end. To manually list spy information +in an image, use $(CROSS_COMPILE)nm:: + + nm u-boot |grep evspy |grep list + 00000000002d6300 D _u_boot_list_2_evspy_info_2_EVT_MISC_INIT_F diff --git a/doc/develop/index.rst b/doc/develop/index.rst index 93ebfa485f5..2e6d6c302a5 100644 --- a/doc/develop/index.rst +++ b/doc/develop/index.rst @@ -17,6 +17,7 @@ Implementation distro driver-model/index environment + event global_data logging makefiles diff --git a/doc/usage/event.rst b/doc/usage/event.rst new file mode 100644 index 00000000000..c0f8acd727b --- /dev/null +++ b/doc/usage/event.rst @@ -0,0 +1,49 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +event command +============= + +Synopsis +-------- + +:: + + event list + +Description +----------- + +The event command provides spy list. + +This shows the following information: + +Seq + Sequence number of the spy, numbered from 0 + +Type + Type of the spy, both as a number and a label. If `CONFIG_EVENT_DEBUG` is + not enabled, the label just shows `(unknown)`. + +Function + Address of the function to call + +ID + ID string for this event, if `CONFIG_EVENT_DEBUG` is enabled. Otherwise this + just shows `?`. + + +See :doc:`../develop/event` for more information on events. + +Example +------- + +:: + + => event list + Seq Type Function ID + 0 7 misc_init_f 55a070517c68 ? + +Configuration +------------- + +The event command is only available if CONFIG_CMD_EVENT=y. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 0aacf531b22..750102830b5 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -29,6 +29,7 @@ Shell commands x86/cbsysinfo conitrace echo + event exception extension exit -- cgit v1.3.1 From eeec00072d7a0b5b91896d014618e558ce438738 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 24 Mar 2022 17:18:06 -0400 Subject: global: Remove CONFIG_SYS_EXTRA_OPTIONS support All options have now been migrated to Kconfig correctly so remove this support. Signed-off-by: Tom Rini --- boot/Kconfig | 13 ---------- doc/README.kconfig | 7 ----- doc/develop/moveconfig.rst | 3 +-- scripts/Makefile.autoconf | 4 --- scripts/build-whitelist.sh | 23 +++------------- tools/genboardscfg.py | 12 +-------- tools/moveconfig.py | 65 ---------------------------------------------- 7 files changed, 5 insertions(+), 122 deletions(-) (limited to 'doc/develop') diff --git a/boot/Kconfig b/boot/Kconfig index 394b26f246a..0514d3b3f80 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -339,19 +339,6 @@ config OF_STDOUT_VIA_ALIAS incorrect when used with device tree as this option does not exist / should not be used. -config SYS_EXTRA_OPTIONS - string "Extra Options (DEPRECATED)" - help - The old configuration infrastructure (= mkconfig + boards.cfg) - provided the extra options field. If you have something like - "HAS_BAR,BAZ=64", the optional options - #define CONFIG_HAS - #define CONFIG_BAZ 64 - will be defined in include/config.h. - This option was prepared for the smooth migration from the old - configuration to Kconfig. Since this option will be removed sometime, - new boards should not use this option. - config HAVE_SYS_TEXT_BASE bool depends on !NIOS2 && !XTENSA diff --git a/doc/README.kconfig b/doc/README.kconfig index 0689f66c2cd..808cf56e59c 100644 --- a/doc/README.kconfig +++ b/doc/README.kconfig @@ -99,7 +99,6 @@ Kconfig. Each field of boards.cfg was converted as follows: Vendor -> CONFIG_SYS_VENDOR defined by Kconfig Board -> CONFIG_SYS_BOARD defined by Kconfig Target -> File name of defconfig (configs/_defconfig) - Options -> CONFIG_SYS_EXTRA_OPTIONS defined by Kconfig Maintainers -> "M:" entry of MAINTAINERS @@ -140,12 +139,6 @@ When removing an obsolete board, the following steps are generally needed: TODO ---- -- The option field of boards.cfg, which was used for the pre-Kconfig - configuration, moved to CONFIG_SYS_EXTRA_OPTIONS verbatim now. - Board maintainers are expected to implement proper Kconfig options - and switch over to them. Eventually CONFIG_SYS_EXTRA_OPTIONS will go away. - CONFIG_SYS_EXTRA_OPTIONS should not be used for new boards. - - In the pre-Kconfig, a single board had multiple entries in the boards.cfg file with differences in the option fields. The corresponding defconfig files were auto-generated when switching to Kconfig. Now we have too many diff --git a/doc/develop/moveconfig.rst b/doc/develop/moveconfig.rst index 2f53ea52b71..bfb7aff3582 100644 --- a/doc/develop/moveconfig.rst +++ b/doc/develop/moveconfig.rst @@ -295,8 +295,7 @@ Available options -y, --yes Instead of prompting, automatically go ahead with all operations. This - includes cleaning up headers, CONFIG_SYS_EXTRA_OPTIONS, the config whitelist - and the README. + includes cleaning up headers, the config whitelist and the README. To see the complete list of supported options, run:: diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf index 0b3ffa08bfa..00c03817792 100644 --- a/scripts/Makefile.autoconf +++ b/scripts/Makefile.autoconf @@ -100,10 +100,6 @@ tpl/include/autoconf.mk: tpl/u-boot.cfg # Prior to Kconfig, it was generated by mkconfig. Now it is created here. define filechk_config_h (echo "/* Automatically generated - do not edit */"; \ - for i in $$(echo $(CONFIG_SYS_EXTRA_OPTIONS) | sed 's/,/ /g'); do \ - echo \#define CONFIG_$$i \ - | sed '/=/ {s/=/ /;q; } ; { s/$$/ 1/; }'; \ - done; \ echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\ echo \#include \; \ echo \#include \; \ diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh index 6feb9b67cf5..37630c0271c 100755 --- a/scripts/build-whitelist.sh +++ b/scripts/build-whitelist.sh @@ -10,30 +10,13 @@ # export LC_ALL=C LC_COLLATE=C -# There are two independent greps. The first pulls out the component parts -# of CONFIG_SYS_EXTRA_OPTIONS. An example is: +# Looks for the rest of the CONFIG options, but exclude those in Kconfig and +# defconfig files. # -# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) -# -# We want this to produce: -# CONFIG_SUN7I_GMAC -# CONFIG_AHCI -# CONFIG_SATAPWR -# -# The second looks for the rest of the CONFIG options, but excludes those in -# Kconfig and defconfig files. -# -( -git grep CONFIG_SYS_EXTRA_OPTIONS |sed -n \ - 's/.*CONFIG_SYS_EXTRA_OPTIONS="\(.*\)"/\1/ p' \ - | tr , '\n' \ - | sed 's/ *\([A-Za-z0-9_]*\).*/CONFIG_\1/' - git grep CONFIG_ | \ egrep -vi "(Kconfig:|defconfig:|README|\.py|\.pl:)" \ | tr ' \t' '\n\n' \ - | sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' -) \ + | sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' \ |sort |uniq >scripts/config_whitelist.txt.tmp1; # Finally, we need a list of the valid Kconfig options to exclude these from 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': , 'target': , 'config': , - '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: - # [: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) -- cgit v1.3.1 From 25b8acee2ea11a9edc100c42a61f5d6187eb6167 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Sat, 2 Apr 2022 18:18:57 -0400 Subject: Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support" Unfortunately, we require additional logic to buildman to support this removal and still use SYS_SOC, etc, for build targets. This reverts commit eeec00072d7a0b5b91896d014618e558ce438738. Signed-off-by: Tom Rini --- boot/Kconfig | 13 ++++++++++ doc/README.kconfig | 7 +++++ doc/develop/moveconfig.rst | 3 ++- scripts/Makefile.autoconf | 4 +++ scripts/build-whitelist.sh | 23 +++++++++++++--- tools/genboardscfg.py | 12 ++++++++- tools/moveconfig.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 122 insertions(+), 5 deletions(-) (limited to 'doc/develop') diff --git a/boot/Kconfig b/boot/Kconfig index 0514d3b3f80..394b26f246a 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -339,6 +339,19 @@ config OF_STDOUT_VIA_ALIAS incorrect when used with device tree as this option does not exist / should not be used. +config SYS_EXTRA_OPTIONS + string "Extra Options (DEPRECATED)" + help + The old configuration infrastructure (= mkconfig + boards.cfg) + provided the extra options field. If you have something like + "HAS_BAR,BAZ=64", the optional options + #define CONFIG_HAS + #define CONFIG_BAZ 64 + will be defined in include/config.h. + This option was prepared for the smooth migration from the old + configuration to Kconfig. Since this option will be removed sometime, + new boards should not use this option. + config HAVE_SYS_TEXT_BASE bool depends on !NIOS2 && !XTENSA diff --git a/doc/README.kconfig b/doc/README.kconfig index 808cf56e59c..0689f66c2cd 100644 --- a/doc/README.kconfig +++ b/doc/README.kconfig @@ -99,6 +99,7 @@ Kconfig. Each field of boards.cfg was converted as follows: Vendor -> CONFIG_SYS_VENDOR defined by Kconfig Board -> CONFIG_SYS_BOARD defined by Kconfig Target -> File name of defconfig (configs/_defconfig) + Options -> CONFIG_SYS_EXTRA_OPTIONS defined by Kconfig Maintainers -> "M:" entry of MAINTAINERS @@ -139,6 +140,12 @@ When removing an obsolete board, the following steps are generally needed: TODO ---- +- The option field of boards.cfg, which was used for the pre-Kconfig + configuration, moved to CONFIG_SYS_EXTRA_OPTIONS verbatim now. + Board maintainers are expected to implement proper Kconfig options + and switch over to them. Eventually CONFIG_SYS_EXTRA_OPTIONS will go away. + CONFIG_SYS_EXTRA_OPTIONS should not be used for new boards. + - In the pre-Kconfig, a single board had multiple entries in the boards.cfg file with differences in the option fields. The corresponding defconfig files were auto-generated when switching to Kconfig. Now we have too many diff --git a/doc/develop/moveconfig.rst b/doc/develop/moveconfig.rst index bfb7aff3582..2f53ea52b71 100644 --- a/doc/develop/moveconfig.rst +++ b/doc/develop/moveconfig.rst @@ -295,7 +295,8 @@ Available options -y, --yes Instead of prompting, automatically go ahead with all operations. This - includes cleaning up headers, the config whitelist and the README. + includes cleaning up headers, CONFIG_SYS_EXTRA_OPTIONS, the config whitelist + and the README. To see the complete list of supported options, run:: diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf index 00c03817792..0b3ffa08bfa 100644 --- a/scripts/Makefile.autoconf +++ b/scripts/Makefile.autoconf @@ -100,6 +100,10 @@ tpl/include/autoconf.mk: tpl/u-boot.cfg # Prior to Kconfig, it was generated by mkconfig. Now it is created here. define filechk_config_h (echo "/* Automatically generated - do not edit */"; \ + for i in $$(echo $(CONFIG_SYS_EXTRA_OPTIONS) | sed 's/,/ /g'); do \ + echo \#define CONFIG_$$i \ + | sed '/=/ {s/=/ /;q; } ; { s/$$/ 1/; }'; \ + done; \ echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\ echo \#include \; \ echo \#include \; \ diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh index 37630c0271c..6feb9b67cf5 100755 --- a/scripts/build-whitelist.sh +++ b/scripts/build-whitelist.sh @@ -10,13 +10,30 @@ # export LC_ALL=C LC_COLLATE=C -# Looks for the rest of the CONFIG options, but exclude those in Kconfig and -# defconfig files. +# There are two independent greps. The first pulls out the component parts +# of CONFIG_SYS_EXTRA_OPTIONS. An example is: # +# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) +# +# We want this to produce: +# CONFIG_SUN7I_GMAC +# CONFIG_AHCI +# CONFIG_SATAPWR +# +# The second looks for the rest of the CONFIG options, but excludes those in +# Kconfig and defconfig files. +# +( +git grep CONFIG_SYS_EXTRA_OPTIONS |sed -n \ + 's/.*CONFIG_SYS_EXTRA_OPTIONS="\(.*\)"/\1/ p' \ + | tr , '\n' \ + | sed 's/ *\([A-Za-z0-9_]*\).*/CONFIG_\1/' + git grep CONFIG_ | \ egrep -vi "(Kconfig:|defconfig:|README|\.py|\.pl:)" \ | tr ' \t' '\n\n' \ - | sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' \ + | sed -n 's/^\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' +) \ |sort |uniq >scripts/config_whitelist.txt.tmp1; # Finally, we need a list of the valid Kconfig options to exclude these from diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index ecdc166d7b9..07bf681d1d9 100755 --- a/tools/genboardscfg.py +++ b/tools/genboardscfg.py @@ -111,6 +111,7 @@ class KconfigScanner: 'vendor' : 'SYS_VENDOR', 'board' : 'SYS_BOARD', 'config' : 'SYS_CONFIG_NAME', + 'options' : 'SYS_EXTRA_OPTIONS' } def __init__(self): @@ -148,6 +149,7 @@ class KconfigScanner: 'board': , 'target': , 'config': , + 'options': } """ # strip special prefixes and save it in a temporary file @@ -183,6 +185,14 @@ class KconfigScanner: if params['arch'] == 'arm' and params['cpu'] == 'armv8': params['arch'] = 'aarch64' + # fix-up options field. It should have the form: + # [: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): @@ -368,7 +378,7 @@ def format_and_output(params_list, output): output: The path to the output file """ FIELDS = ('status', 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', - 'maintainers') + 'options', '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 09617a07f91..84bc875fff8 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -443,6 +443,70 @@ 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 @@ -1739,6 +1803,7 @@ 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) -- cgit v1.3.1