mirror-linux/scripts/kconfig/tests
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
..
auto_submenu kconfig: convert to SPDX License Identifier 2018-12-28 22:22:28 +09:00
choice kconfig: remove tristate choice support 2024-07-16 01:08:36 +09:00
choice_randomize kconfig: tests: add a test for randconfig with dependent choices 2024-03-21 02:39:55 +09:00
choice_randomize2 kconfig: tests: test dependency after shuffling choices 2024-03-21 02:40:39 +09:00
err_recursive_dep kconfig: recursive checks drop file/lineno 2024-07-20 16:33:45 +09:00
err_recursive_inc kconfig: tests: fix recursive inclusion unit test 2019-06-05 02:33:10 +09:00
err_transitional kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
new_choice_with_dep kconfig: convert to SPDX License Identifier 2018-12-28 22:22:28 +09:00
no_write_if_dep_unmet kconfig: convert to SPDX License Identifier 2018-12-28 22:22:28 +09:00
preprocess
transitional kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
conftest.py kconfig: Fix BrokenPipeError warnings in selftests 2025-09-24 14:23:35 -07:00
pytest.ini