From 561960769fe0a6c5c330208fc1a77b12aac6a553 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Wed, 17 Feb 2021 17:10:51 +0100 Subject: [PATCH] shell/Kconfig: make config options usable with dependency resolution --- sys/shell/Kconfig | 38 +++++++++++++++++--------------------- sys/shell/Kconfig.config | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 sys/shell/Kconfig.config diff --git a/sys/shell/Kconfig b/sys/shell/Kconfig index f5b2a37b8b..996c7b05aa 100644 --- a/sys/shell/Kconfig +++ b/sys/shell/Kconfig @@ -5,6 +5,19 @@ # directory for more details. # +if !TEST_KCONFIG + +menuconfig KCONFIG_USEMODULE_SHELL + bool "Configure the Shell interpreter" + depends on USEMODULE_SHELL + +if KCONFIG_USEMODULE_SHELL +rsource "Kconfig.config" +endif # KCONFIG_USEMODULE_SHELL + +endif # !TEST_KCONFIG + +if TEST_KCONFIG menuconfig MODULE_SHELL bool "Shell interpreter" select MODULE_STDIN @@ -12,25 +25,8 @@ menuconfig MODULE_SHELL rsource "commands/Kconfig" -menuconfig KCONFIG_USEMODULE_SHELL - bool "Configure the Shell interpreter" - depends on USEMODULE_SHELL +if MODULE_SHELL +rsource "Kconfig.config" +endif -if KCONFIG_USEMODULE_SHELL - -config SHELL_SHUTDOWN_ON_EXIT - bool "Shutdown RIOT on shell exit" - default y if HAS_CPU_NATIVE - help - Some systems (e.g Ubuntu 20.04) close stdin on CTRL-D / EOF - That means we can't just re-start the shell. - Instead terminate RIOT, which is also the behavior a user would expect - from a CLI application. - -config SHELL_NO_ECHO - bool "Disable echo" - -config SHELL_NO_PROMPT - bool "Disable prompt" - -endif # KCONFIG_USEMODULE_SHELL +endif # TEST_KCONFIG diff --git a/sys/shell/Kconfig.config b/sys/shell/Kconfig.config new file mode 100644 index 0000000000..7f40edcf32 --- /dev/null +++ b/sys/shell/Kconfig.config @@ -0,0 +1,26 @@ +# Copyright (c) 2021 Freie Universität +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +# XXX This file only is required since there is no easy way to use these config +# options with both the final MODULE_SHELL and KCONFIG_USEMODULE_SHELL in a +# nicely looking and easy to migrate way. After migration, the content of this +# file can be folded back into `sys/shell/Kconfig` + +config SHELL_SHUTDOWN_ON_EXIT + bool "Shutdown RIOT on shell exit" + default y if HAS_CPU_NATIVE + help + Some systems (e.g Ubuntu 20.04) close stdin on CTRL-D / EOF + That means we can't just re-start the shell. + Instead terminate RIOT, which is also the behavior a user would expect + from a CLI application. + +config SHELL_NO_ECHO + bool "Disable echo" + +config SHELL_NO_PROMPT + bool "Disable prompt"