mirror-linux/scripts/kconfig
Kees Cook f9afce4f32 kconfig: Add transitional symbol attribute for migration support
During kernel option migrations (e.g. CONFIG_CFI_CLANG to CONFIG_CFI),
existing .config files need to maintain backward compatibility while
preventing deprecated options from appearing in newly generated
configurations. This is challenging with existing Kconfig mechanisms
because:

1. Simply removing old options breaks existing .config files.
2. Manually listing an option as "deprecated" leaves it needlessly
   visible and still writes them to new .config files.
3. Using any method to remove visibility (.e.g no 'prompt', 'if n',
   etc) prevents the option from being processed at all.

Add a "transitional" attribute that creates symbols which are:
- Processed during configuration (can influence other symbols' defaults)
- Hidden from user menus (no prompts appear)
- Omitted from newly written .config files (gets migrated)
- Restricted to only having help sections (no defaults, selects, etc)
  making it truly just a "prior value pass-through" option.

The transitional syntax requires a type argument and prevents type
redefinition:

    config NEW_OPTION
        bool "New option"
        default OLD_OPTION

    config OLD_OPTION
        bool
        transitional
        help
          Transitional config for OLD_OPTION migration.

This allows seamless migration: olddefconfig processes existing
CONFIG_OLD_OPTION=y settings to enable CONFIG_NEW_OPTION=y, while
CONFIG_OLD_OPTION is omitted from newly generated .config files.

Added positive and negative testing via "testconfig" make target.

Co-developed-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250923213422.1105654-2-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
2025-09-24 14:23:35 -07:00
..
lxdialog kconfig: lxdialog: replace strcpy() with strncpy() in inputbox.c 2025-08-06 10:23:36 +09:00
tests kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
.gitignore kconfig: Update all declared targets 2023-01-13 16:29:52 +09:00
Makefile kbuild: suppress stdout from merge_config for silent builds 2025-01-10 23:01:21 +09:00
conf.c kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu() 2025-06-30 12:52:58 +09:00
confdata.c kconfig: use memcmp instead of deprecated bcmp 2025-06-18 10:11:15 +09:00
expr.c kconfig: clear expr::val_is_valid when allocated 2024-10-01 17:05:30 +09:00
expr.h kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
gconf-cfg.sh kconfig: gconf: migrate to GTK 3 2025-07-26 15:31:29 +09:00
gconf.c kconfig: gconf: refactor text_insert_help() 2025-07-26 19:55:37 +09:00
gconf.ui kconfig: gconf: replace GtkImageMenuItem with GtkMenuItem 2025-07-26 19:55:37 +09:00
images.c kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
images.h kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
internal.h kconfig: cache expression values 2024-09-20 09:21:53 +09:00
lexer.l kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
lkc.h kconfig: add a function to dump all menu entries in a tree-like format 2025-07-26 15:31:30 +09:00
lkc_proto.h kconfig: add sym_get_prompt_menu() helper function 2024-11-06 08:46:34 +09:00
mconf-cfg.sh kconfig: add -e and -u options to *conf-cfg.sh scripts 2024-07-16 01:08:36 +09:00
mconf.c kbuild: split x*alloc() functions in kconfig to scripts/include/xalloc.h 2024-09-01 20:34:48 +09:00
menu.c kconfig: add a function to dump all menu entries in a tree-like format 2025-07-26 15:31:30 +09:00
merge_config.sh kconfig: merge_config: use an empty file as initfile 2025-04-06 06:22:01 +09:00
mnconf-common.c kbuild: move some helper headers from scripts/kconfig/ to scripts/include/ 2024-07-21 23:10:43 +09:00
mnconf-common.h kbuild: move some helper headers from scripts/kconfig/ to scripts/include/ 2024-07-21 23:10:43 +09:00
nconf-cfg.sh kconfig: add -e and -u options to *conf-cfg.sh scripts 2024-07-16 01:08:36 +09:00
nconf.c kconfig: nconf: Ensure null termination where strncpy is used 2025-07-26 15:31:17 +09:00
nconf.gui.c kconfig: nconf: Ensure null termination where strncpy is used 2025-07-26 15:31:17 +09:00
nconf.h kconfig: nconf: Add search jump feature 2023-08-13 21:29:41 +09:00
parser.y kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
preprocess.c kbuild: split x*alloc() functions in kconfig to scripts/include/xalloc.h 2024-09-01 20:34:48 +09:00
preprocess.h kconfig: split preprocessor prototypes into preprocess.h 2024-02-19 18:20:40 +09:00
qconf-cfg.sh kconfig: add -e and -u options to *conf-cfg.sh scripts 2024-07-16 01:08:36 +09:00
qconf.cc kconfig: qconf: confine {begin,end}Group to constructor and destructor 2025-07-26 15:31:30 +09:00
qconf.h kconfig: qconf: confine {begin,end}Group to constructor and destructor 2025-07-26 15:31:30 +09:00
streamline_config.pl streamline_config.pl: remove prompt warnings for configs with defaults 2024-11-06 08:46:34 +09:00
symbol.c kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
util.c scripts: move hash function from scripts/kconfig/ to scripts/include/ 2024-09-20 09:21:52 +09:00