diff --git a/SConstruct b/SConstruct index 57134b6863..c4782691ff 100755 --- a/SConstruct +++ b/SConstruct @@ -264,6 +264,8 @@ kconfig_actions = ( 'guiconfig', 'listnewconfig', 'menuconfig', + 'oldconfig', + 'olddefconfig', 'savedefconfig', 'setconfig', ) @@ -317,6 +319,22 @@ Kconfig tools: scons menuconfig build/foo/bar + oldconfig: + Update an existing config by adding settings for new options. This is + the same as the olddefconfig tool, except it asks what values you want + for the new settings. + + scons oldconfig build/foo/bar + + + olddefconfig: + Update an existing config by adding settings for new options. This is + the same as the oldconfig tool, except it uses the default for any new + setting. + + scons olddefconfig build/foo/bar + + savedefconfig: Save a defconfig file which would give rise to the current config. For instance, you could use menuconfig to set up a config how you want @@ -868,6 +886,11 @@ for variant_path in variant_paths: elif kconfig_action == 'menuconfig': kconfig.menuconfig(env, kconfig_file.abspath, config_file.abspath, variant_path) + elif kconfig_action == 'oldconfig': + kconfig.oldconfig(env, kconfig_file.abspath, config_file.abspath) + elif kconfig_action == 'olddefconfig': + kconfig.olddefconfig(env, kconfig_file.abspath, + config_file.abspath) elif kconfig_action == 'savedefconfig': if len(kconfig_args) != 1: error('Usage: scons defconfig ') diff --git a/site_scons/gem5_scons/kconfig.py b/site_scons/gem5_scons/kconfig.py index 347e11277d..42b2eec482 100644 --- a/site_scons/gem5_scons/kconfig.py +++ b/site_scons/gem5_scons/kconfig.py @@ -33,6 +33,8 @@ _kconfig_helpers = { "GUICONFIG_PY": "guiconfig.py", "LISTNEWCONFIG_PY": "listnewconfig.py", "MENUCONFIG_PY": "menuconfig.py", + "OLDCONFIG_PY": "oldconfig.py", + "OLDDEFCONFIG_PY": "olddefconfig.py", "SAVEDEFCONFIG_PY": "savedefconfig.py", "SETCONFIG_PY": "setconfig.py", } @@ -118,6 +120,24 @@ def listnewconfig(env, base_kconfig, config_path): error("Failed to run listnewconfig") +def oldconfig(env, base_kconfig, config_path): + """ + Interface of handling oldconfig.py of Kconfiglib + """ + kconfig_env = _prep_env(env, base_kconfig, config_path) + if kconfig_env.Execute('"${OLDCONFIG_PY}" "${BASE_KCONFIG}"') != 0: + error("Failed to run oldconfig") + + +def olddefconfig(env, base_kconfig, config_path): + """ + Interface of handling olddefconfig.py of Kconfiglib + """ + kconfig_env = _prep_env(env, base_kconfig, config_path) + if kconfig_env.Execute('"${OLDDEFCONFIG_PY}" "${BASE_KCONFIG}"') != 0: + error("Failed to run oldconfig") + + def menuconfig( env, base_kconfig, config_path, main_menu_text, style="aquatic" ):