shell: do not enable subsystem/driver shell modules by default

Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.

The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.

This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-11-16 15:09:40 +01:00 committed by Carles Cufí
parent f345378db1
commit c0c8952739
31 changed files with 3 additions and 28 deletions

View file

@ -17,7 +17,6 @@ if ADC
config ADC_SHELL config ADC_SHELL
bool "ADC Shell" bool "ADC Shell"
default y
depends on SHELL depends on SHELL
help help
Enable ADC Shell for testing. Enable ADC Shell for testing.

View file

@ -27,7 +27,6 @@ config AUDIO_CODEC_INIT_PRIORITY
config AUDIO_CODEC_SHELL config AUDIO_CODEC_SHELL
bool "Audio Codec shell" bool "Audio Codec shell"
default y
depends on SHELL depends on SHELL
help help
Enable the Audio Codec shell with Audio Codec related commands. Enable the Audio Codec shell with Audio Codec related commands.

View file

@ -25,7 +25,6 @@ config CAN_INIT_PRIORITY
config CAN_SHELL config CAN_SHELL
bool "CAN shell" bool "CAN shell"
default y
depends on SHELL depends on SHELL
select POLL select POLL
help help

View file

@ -25,7 +25,6 @@ if CLOCK_CONTROL_NRF
config CLOCK_CONTROL_NRF_SHELL config CLOCK_CONTROL_NRF_SHELL
bool "Shell commands" bool "Shell commands"
depends on SHELL depends on SHELL
default y if SHELL
choice CLOCK_CONTROL_NRF_SOURCE choice CLOCK_CONTROL_NRF_SOURCE
prompt "32KHz clock source" prompt "32KHz clock source"

View file

@ -19,7 +19,6 @@ source "subsys/logging/Kconfig.template.log_config"
config DAC_SHELL config DAC_SHELL
bool "DAC shell" bool "DAC shell"
default y
depends on SHELL depends on SHELL
help help
Enable DAC related shell commands. Enable DAC related shell commands.

View file

@ -19,7 +19,6 @@ config EDAC_ERROR_INJECT
config EDAC_SHELL config EDAC_SHELL
bool "EDAC Shell" bool "EDAC Shell"
depends on SHELL depends on SHELL
default y if SHELL
help help
Enable EDAC shell for debugging EDAC. Enable EDAC shell for debugging EDAC.

View file

@ -24,7 +24,6 @@ config EEPROM_INIT_PRIORITY
config EEPROM_SHELL config EEPROM_SHELL
bool "EEPROM shell" bool "EEPROM shell"
default y
depends on SHELL depends on SHELL
help help
Enable the EEPROM shell with EEPROM related commands. Enable the EEPROM shell with EEPROM related commands.

View file

@ -53,7 +53,6 @@ config FLASH_SHELL
bool "Flash shell" bool "Flash shell"
depends on SHELL && FLASH_PAGE_LAYOUT depends on SHELL && FLASH_PAGE_LAYOUT
select MPU_ALLOW_FLASH_WRITE if ARM_MPU select MPU_ALLOW_FLASH_WRITE if ARM_MPU
default y
help help
Enable the flash shell with flash related commands such as test, Enable the flash shell with flash related commands such as test,
write, read and erase. write, read and erase.

View file

@ -16,7 +16,6 @@ source "subsys/logging/Kconfig.template.log_config"
config HWINFO_SHELL config HWINFO_SHELL
bool "HWINFO Shell" bool "HWINFO Shell"
default y
depends on SHELL depends on SHELL
help help
Enable hwinfo Shell for testing. Enable hwinfo Shell for testing.

View file

@ -15,7 +15,6 @@ if I2C
config I2C_SHELL config I2C_SHELL
bool "I2C Shell" bool "I2C Shell"
default y
depends on SHELL depends on SHELL
help help
Enable I2C Shell. Enable I2C Shell.

View file

@ -21,7 +21,6 @@ source "subsys/logging/Kconfig.template.log_config"
config LORA_SHELL config LORA_SHELL
bool "LoRa Shell" bool "LoRa Shell"
default y
depends on SHELL depends on SHELL
help help
Enable LoRa Shell for testing. Enable LoRa Shell for testing.

View file

@ -15,7 +15,6 @@ if MDIO
config MDIO_SHELL config MDIO_SHELL
bool "MDIO Shell" bool "MDIO Shell"
default y
depends on SHELL depends on SHELL
help help
Enable MDIO Shell. Enable MDIO Shell.

View file

@ -82,7 +82,6 @@ config PCIE_PRT
config PCIE_SHELL config PCIE_SHELL
bool "PCIe/new PCI Shell" bool "PCIe/new PCI Shell"
default y
depends on SHELL depends on SHELL
help help
Enable commands for debugging PCI(e) using the built-in shell. Enable commands for debugging PCI(e) using the built-in shell.

View file

@ -32,7 +32,6 @@ config PM_CPU_OPS_PSCI
config PSCI_SHELL config PSCI_SHELL
bool "Support for PSCI interface shell commands" bool "Support for PSCI interface shell commands"
default y
depends on SHELL && PM_CPU_OPS_PSCI depends on SHELL && PM_CPU_OPS_PSCI
help help
Say Y here if you need to enable PSCI interface shell commands Say Y here if you need to enable PSCI interface shell commands

View file

@ -22,7 +22,6 @@ config PWM_INIT_PRIORITY
config PWM_SHELL config PWM_SHELL
bool "PWM shell" bool "PWM shell"
default y
depends on SHELL depends on SHELL
help help
Enable the PWM related shell commands. Enable the PWM related shell commands.

View file

@ -17,7 +17,6 @@ config REGULATOR_THREAD_SAFE_REFCNT
config REGULATOR_SHELL config REGULATOR_SHELL
bool "Regulator shell" bool "Regulator shell"
default y
depends on SHELL depends on SHELL
help help
Enable regulator shell framework, for interacting with regulators via Enable regulator shell framework, for interacting with regulators via

View file

@ -32,7 +32,6 @@ config SENSOR_SHELL
depends on SHELL depends on SHELL
select CBPRINTF_FP_SUPPORT select CBPRINTF_FP_SUPPORT
select SENSOR_ASYNC_API select SENSOR_ASYNC_API
default y if !SHELL_MINIMAL
help help
This shell provides access to basic sensor data. This shell provides access to basic sensor data.

View file

@ -12,7 +12,6 @@ if SMBUS
config SMBUS_SHELL config SMBUS_SHELL
bool "SMBus Shell" bool "SMBus Shell"
default y
depends on SHELL depends on SHELL
help help
Enable SMBus Shell. Enable SMBus Shell.

View file

@ -26,7 +26,6 @@ config W1_INIT_PRIORITY
config W1_SHELL config W1_SHELL
bool "1-Wire Shell" bool "1-Wire Shell"
depends on SHELL depends on SHELL
default y if !SHELL_MINIMAL
help help
Enable 1-Wire Shell for testing. Enable 1-Wire Shell for testing.

View file

@ -3,7 +3,6 @@
config WDT_SHELL config WDT_SHELL
bool "Watchdog (WDT) shell" bool "Watchdog (WDT) shell"
default y
depends on SHELL depends on SHELL
help help
Enable WDT shell. Enable WDT shell.

View file

@ -32,7 +32,6 @@ endif # PCIE_PRT
config ACPI_SHELL config ACPI_SHELL
bool "ACPI command Shell" bool "ACPI command Shell"
default y
depends on SHELL depends on SHELL
help help
Enable commands for debugging ACPI using the built-in shell. Enable commands for debugging ACPI using the built-in shell.

View file

@ -1,4 +1,5 @@
CONFIG_SMBUS=y CONFIG_SMBUS=y
CONFIG_SMBUS_SHELL=y
CONFIG_SMBUS_INTEL_PCH=y CONFIG_SMBUS_INTEL_PCH=y
CONFIG_SMBUS_LOG_LEVEL_DBG=y CONFIG_SMBUS_LOG_LEVEL_DBG=y
CONFIG_USERSPACE=y CONFIG_USERSPACE=y

View file

@ -5,5 +5,6 @@ CONFIG_SHELL=y
CONFIG_LOG=y CONFIG_LOG=y
CONFIG_GPIO=y CONFIG_GPIO=y
CONFIG_REGULATOR=y CONFIG_REGULATOR=y
CONFIG_REGULATOR_SHELL=y
CONFIG_SENSOR=y CONFIG_SENSOR=y
CONFIG_LED=y CONFIG_LED=y

View file

@ -7,4 +7,5 @@ CONFIG_GETOPT=y
CONFIG_GETOPT_LONG=y CONFIG_GETOPT_LONG=y
CONFIG_GPIO=y CONFIG_GPIO=y
CONFIG_REGULATOR=y CONFIG_REGULATOR=y
CONFIG_REGULATOR_SHELL=y
CONFIG_WATCHDOG=y CONFIG_WATCHDOG=y

View file

@ -71,7 +71,6 @@ endchoice
config DEBUG_COREDUMP_SHELL config DEBUG_COREDUMP_SHELL
bool "Coredump shell" bool "Coredump shell"
default y
depends on SHELL depends on SHELL
help help
This shell provides access to coredump and its backends. This shell provides access to coredump and its backends.

View file

@ -33,7 +33,6 @@ endchoice
config MCUBOOT_SHELL config MCUBOOT_SHELL
bool "MCUboot shell" bool "MCUboot shell"
default y
depends on MCUBOOT_IMG_MANAGER depends on MCUBOOT_IMG_MANAGER
depends on SHELL depends on SHELL
help help

View file

@ -15,7 +15,6 @@ config LOG_CMDS
bool "Shell commands" bool "Shell commands"
depends on SHELL depends on SHELL
depends on !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL depends on !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL
default y if SHELL
config LOG_TEST_CLEAR_MESSAGE_SPACE config LOG_TEST_CLEAR_MESSAGE_SPACE
bool "Clear message after allocation" bool "Clear message after allocation"

View file

@ -151,7 +151,6 @@ endmenu # "Zephyr optimizations"
config OPENTHREAD_SHELL config OPENTHREAD_SHELL
bool "OpenThread shell" bool "OpenThread shell"
depends on SHELL depends on SHELL
default y
config MBEDTLS_PROMPTLESS config MBEDTLS_PROMPTLESS
bool bool

View file

@ -20,7 +20,6 @@ config STATS_NAMES
config STATS_SHELL config STATS_SHELL
bool "Statistics Shell Command" bool "Statistics Shell Command"
default y
depends on STATS && SHELL depends on STATS && SHELL
imply STATS_NAMES imply STATS_NAMES
help help

View file

@ -18,7 +18,6 @@ source "subsys/logging/Kconfig.template.log_config"
config USBD_SHELL config USBD_SHELL
bool "USB device shell" bool "USB device shell"
default y
depends on SHELL depends on SHELL
help help
Enable USB device shell. Enable USB device shell.

View file

@ -17,7 +17,6 @@ source "subsys/logging/Kconfig.template.log_config"
config USBH_SHELL config USBH_SHELL
bool "USB host shell" bool "USB host shell"
default y
depends on SHELL depends on SHELL
help help
Shell commands for USB host support. Shell commands for USB host support.