From c06335b71b3c2ffd2465f55a0460242e5e546e5e Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 21 Jul 2022 20:26:03 +0200 Subject: [PATCH] sys/shell: make cmds submodules Previously `shell_commands` was a "catch-all" module that included shell commands for each and every used module that has a shell companion. Instead, the new `shell_cmds` module is now used to provide shell commands as individually selectable submodules, e.g. `cmd_gnrc_icmpv6_echo` now provides the ICMPv6 echo command (a.k.a. ping). To still have a "catch all" module to pull in shell commands of modules already used, `shell_cmds_default` was introduced. `shell_commands` depends now on `shell_cmds_default` for backward compatibility, but has been deprecated. New apps should use `shell_cmds_default` instead. For a handful of shell commands individual selection was already possible. Those modules now depend on the corresponding `cmd_%` module and they have been deprecated. --- examples/gnrc_networking/Makefile | 2 +- makefiles/deprecated_modules.inc.mk | 10 + makefiles/pseudomodules.inc.mk | 47 +++ sys/Makefile | 4 +- sys/Makefile.dep | 73 ++--- sys/net/gnrc/Makefile.dep | 5 - sys/shell/Kconfig | 2 +- sys/shell/Makefile.dep | 289 +++++++++++++++++ sys/shell/cmds/Kconfig | 298 ++++++++++++++++++ sys/shell/cmds/Makefile | 5 + .../sc_app_metadata.c => cmds/app_metadata.c} | 0 .../sc_at30tse75x.c => cmds/at30tse75x.c} | 0 .../benchmark_udp.c} | 0 .../sc_ccnl.c => cmds/ccn-lite-utils.c} | 0 .../{commands/sc_can.c => cmds/conn_can.c} | 0 .../{commands/sc_cord_ep.c => cmds/cord_ep.c} | 0 .../cryptoauthlib.c} | 0 .../sc_dfplayer.c => cmds/dfplayer.c} | 0 sys/shell/{commands/sc_fib.c => cmds/fib.c} | 0 .../gnrc_icmpv6_echo.c} | 0 .../gnrc_ipv6_blacklist.c} | 0 .../gnrc_ipv6_frag_stats.c} | 0 .../gnrc_ipv6_nib.c} | 0 .../gnrc_ipv6_whitelist.c} | 0 .../sc_gnrc_netif.c => cmds/gnrc_netif.c} | 0 .../sc_gnrc_pktbuf.c => cmds/gnrc_pktbuf.c} | 0 .../sc_gnrc_rpl.c => cmds/gnrc_rpl.c} | 0 .../gnrc_sixlowpan_ctx.c} | 0 .../gnrc_sixlowpan_frag_stats.c} | 0 .../sc_gnrc_udp.c => cmds/gnrc_udp.c} | 0 sys/shell/{commands/sc_heap.c => cmds/heap.c} | 0 .../sc_i2c_scan.c => cmds/i2c_scan.c} | 0 .../sc_lwip_netif.c => cmds/lwip_netif.c} | 0 sys/shell/{commands/sc_disk.c => cmds/mci.c} | 0 .../sc_nanocoap_vfs.c => cmds/nanocoap_vfs.c} | 0 .../netstats_neighbor.c} | 0 sys/shell/{commands/sc_nice.c => cmds/nice.c} | 0 .../sc_nimble_netif.c => cmds/nimble_netif.c} | 0 .../nimble_statconn.c} | 0 .../{commands/sc_openwsn.c => cmds/openwsn.c} | 0 sys/shell/{commands/sc_pm.c => cmds/pm.c} | 0 sys/shell/{commands/sc_ps.c => cmds/ps.c} | 0 .../{commands/sc_random.c => cmds/random.c} | 0 sys/shell/{commands/sc_rtc.c => cmds/rtc.c} | 0 sys/shell/{commands/sc_rtt.c => cmds/rtt.c} | 0 .../sc_saul_reg.c => cmds/saul_reg.c} | 0 .../sc_loramac.c => cmds/semtech-loramac.c} | 0 .../{commands/sc_sht1x.c => cmds/sht1x.c} | 0 sys/shell/{commands/sc_sntp.c => cmds/sntp.c} | 0 sys/shell/{commands/sc_suit.c => cmds/suit.c} | 0 sys/shell/{commands/sc_sys.c => cmds/sys.c} | 0 sys/shell/{commands/sc_vfs.c => cmds/vfs.c} | 6 +- sys/shell/commands/Kconfig | 15 - sys/shell/commands/Makefile | 143 --------- tests/driver_dfplayer/app.config.test | 7 +- tests/periph_i2c/Makefile | 2 +- 56 files changed, 679 insertions(+), 229 deletions(-) create mode 100644 sys/shell/Makefile.dep create mode 100644 sys/shell/cmds/Kconfig create mode 100644 sys/shell/cmds/Makefile rename sys/shell/{commands/sc_app_metadata.c => cmds/app_metadata.c} (100%) rename sys/shell/{commands/sc_at30tse75x.c => cmds/at30tse75x.c} (100%) rename sys/shell/{commands/sc_benchmark_udp.c => cmds/benchmark_udp.c} (100%) rename sys/shell/{commands/sc_ccnl.c => cmds/ccn-lite-utils.c} (100%) rename sys/shell/{commands/sc_can.c => cmds/conn_can.c} (100%) rename sys/shell/{commands/sc_cord_ep.c => cmds/cord_ep.c} (100%) rename sys/shell/{commands/sc_cryptoauthlib.c => cmds/cryptoauthlib.c} (100%) rename sys/shell/{commands/sc_dfplayer.c => cmds/dfplayer.c} (100%) rename sys/shell/{commands/sc_fib.c => cmds/fib.c} (100%) rename sys/shell/{commands/sc_gnrc_icmpv6_echo.c => cmds/gnrc_icmpv6_echo.c} (100%) rename sys/shell/{commands/sc_blacklist.c => cmds/gnrc_ipv6_blacklist.c} (100%) rename sys/shell/{commands/sc_gnrc_ipv6_frag_stats.c => cmds/gnrc_ipv6_frag_stats.c} (100%) rename sys/shell/{commands/sc_gnrc_ipv6_nib.c => cmds/gnrc_ipv6_nib.c} (100%) rename sys/shell/{commands/sc_whitelist.c => cmds/gnrc_ipv6_whitelist.c} (100%) rename sys/shell/{commands/sc_gnrc_netif.c => cmds/gnrc_netif.c} (100%) rename sys/shell/{commands/sc_gnrc_pktbuf.c => cmds/gnrc_pktbuf.c} (100%) rename sys/shell/{commands/sc_gnrc_rpl.c => cmds/gnrc_rpl.c} (100%) rename sys/shell/{commands/sc_gnrc_6ctx.c => cmds/gnrc_sixlowpan_ctx.c} (100%) rename sys/shell/{commands/sc_gnrc_6lo_frag_stats.c => cmds/gnrc_sixlowpan_frag_stats.c} (100%) rename sys/shell/{commands/sc_gnrc_udp.c => cmds/gnrc_udp.c} (100%) rename sys/shell/{commands/sc_heap.c => cmds/heap.c} (100%) rename sys/shell/{commands/sc_i2c_scan.c => cmds/i2c_scan.c} (100%) rename sys/shell/{commands/sc_lwip_netif.c => cmds/lwip_netif.c} (100%) rename sys/shell/{commands/sc_disk.c => cmds/mci.c} (100%) rename sys/shell/{commands/sc_nanocoap_vfs.c => cmds/nanocoap_vfs.c} (100%) rename sys/shell/{commands/sc_netstats_nb.c => cmds/netstats_neighbor.c} (100%) rename sys/shell/{commands/sc_nice.c => cmds/nice.c} (100%) rename sys/shell/{commands/sc_nimble_netif.c => cmds/nimble_netif.c} (100%) rename sys/shell/{commands/sc_nimble_statconn.c => cmds/nimble_statconn.c} (100%) rename sys/shell/{commands/sc_openwsn.c => cmds/openwsn.c} (100%) rename sys/shell/{commands/sc_pm.c => cmds/pm.c} (100%) rename sys/shell/{commands/sc_ps.c => cmds/ps.c} (100%) rename sys/shell/{commands/sc_random.c => cmds/random.c} (100%) rename sys/shell/{commands/sc_rtc.c => cmds/rtc.c} (100%) rename sys/shell/{commands/sc_rtt.c => cmds/rtt.c} (100%) rename sys/shell/{commands/sc_saul_reg.c => cmds/saul_reg.c} (100%) rename sys/shell/{commands/sc_loramac.c => cmds/semtech-loramac.c} (100%) rename sys/shell/{commands/sc_sht1x.c => cmds/sht1x.c} (100%) rename sys/shell/{commands/sc_sntp.c => cmds/sntp.c} (100%) rename sys/shell/{commands/sc_suit.c => cmds/suit.c} (100%) rename sys/shell/{commands/sc_sys.c => cmds/sys.c} (100%) rename sys/shell/{commands/sc_vfs.c => cmds/vfs.c} (99%) delete mode 100644 sys/shell/commands/Kconfig delete mode 100644 sys/shell/commands/Makefile diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index 202d1eb080..c71c41fb1e 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -20,7 +20,7 @@ USEMODULE += gnrc_rpl USEMODULE += auto_init_gnrc_rpl # Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo -USEMODULE += gnrc_udp_cmd +USEMODULE += shell_cmd_gnrc_udp # Add also the shell, some shell commands USEMODULE += shell USEMODULE += shell_commands diff --git a/makefiles/deprecated_modules.inc.mk b/makefiles/deprecated_modules.inc.mk index 13973e94c5..5b98baaaef 100644 --- a/makefiles/deprecated_modules.inc.mk +++ b/makefiles/deprecated_modules.inc.mk @@ -2,5 +2,15 @@ # Keep this list ALPHABETICALLY SORTED!!!!111elven DEPRECATED_MODULES += event_thread_lowest DEPRECATED_MODULES += gnrc_netdev_default +DEPRECATED_MODULES += gnrc_pktbuf_cmd # use shell_cmd_gnrc_pktbuf instead +DEPRECATED_MODULES += gnrc_udp_cmd # use shell_cmd_grnc_udp instead +DEPRECATED_MODULES += heap_cmd # use shell_cmd_heap instead +DEPRECATED_MODULES += i2c_scan # use shell_cmd_i2c_scan instead +DEPRECATED_MODULES += md5sum # use shell_cmd_md5sum instead +DEPRECATED_MODULES += nice # use shell_cmd_nice instead +DEPRECATED_MODULES += random_cmd # use shell_cmd_random instead DEPRECATED_MODULES += sema_deprecated +DEPRECATED_MODULES += shell_commands # use shell_cmds_default instead +DEPRECATED_MODULES += sha1sum # use shell_cmd_sha1sum instead +DEPRECATED_MODULES += sha256sum # use shell_cmd_sha256sum instead DEPRECATED_MODULES += ztimer_now64 diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 71dce205b0..cc74bd46f7 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -211,6 +211,53 @@ PSEUDOMODULES += senml_phydat PSEUDOMODULES += senml_saul PSEUDOMODULES += sha1sum PSEUDOMODULES += sha256sum +PSEUDOMODULES += shell_cmd_app_metadata +PSEUDOMODULES += shell_cmd_at30tse75x +PSEUDOMODULES += shell_cmd_benchmark_udp +PSEUDOMODULES += shell_cmd_ccn-lite-utils +PSEUDOMODULES += shell_cmd_conn_can +PSEUDOMODULES += shell_cmd_cord_ep +PSEUDOMODULES += shell_cmd_cryptoauthlib +PSEUDOMODULES += shell_cmd_dfplayer +PSEUDOMODULES += shell_cmd_fib +PSEUDOMODULES += shell_cmd_gnrc_icmpv6_echo +PSEUDOMODULES += shell_cmd_gnrc_ipv6_blacklist +PSEUDOMODULES += shell_cmd_gnrc_ipv6_frag_stats +PSEUDOMODULES += shell_cmd_gnrc_ipv6_nib +PSEUDOMODULES += shell_cmd_gnrc_ipv6_whitelist +PSEUDOMODULES += shell_cmd_gnrc_netif +PSEUDOMODULES += shell_cmd_gnrc_pktbuf +PSEUDOMODULES += shell_cmd_gnrc_rpl +PSEUDOMODULES += shell_cmd_gnrc_sixlowpan_ctx +PSEUDOMODULES += shell_cmd_gnrc_sixlowpan_frag_stats +PSEUDOMODULES += shell_cmd_gnrc_udp +PSEUDOMODULES += shell_cmd_heap +PSEUDOMODULES += shell_cmd_i2c_scan +PSEUDOMODULES += shell_cmd_lwip_netif +PSEUDOMODULES += shell_cmd_mci +PSEUDOMODULES += shell_cmd_md5sum +PSEUDOMODULES += shell_cmd_nanocoap_vfs +PSEUDOMODULES += shell_cmd_netstats_neighbor +PSEUDOMODULES += shell_cmd_nice +PSEUDOMODULES += shell_cmd_nimble_netif +PSEUDOMODULES += shell_cmd_nimble_statconn +PSEUDOMODULES += shell_cmd_openwsn +PSEUDOMODULES += shell_cmd_pm +PSEUDOMODULES += shell_cmd_ps +PSEUDOMODULES += shell_cmd_random +PSEUDOMODULES += shell_cmd_rtc +PSEUDOMODULES += shell_cmd_rtt +PSEUDOMODULES += shell_cmd_saul_reg +PSEUDOMODULES += shell_cmd_semtech-loramac +PSEUDOMODULES += shell_cmd_sha1sum +PSEUDOMODULES += shell_cmd_sha256sum +PSEUDOMODULES += shell_cmd_sht1x +PSEUDOMODULES += shell_cmd_sntp +PSEUDOMODULES += shell_cmd_suit +PSEUDOMODULES += shell_cmd_sys +PSEUDOMODULES += shell_cmd_vfs +PSEUDOMODULES += shell_cmds_default +PSEUDOMODULES += shell_commands PSEUDOMODULES += shell_hooks PSEUDOMODULES += shell_lock_auto_locking PSEUDOMODULES += slipdev_stdio diff --git a/sys/Makefile b/sys/Makefile index c8f1853a4a..d483fc0b53 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -182,8 +182,8 @@ endif ifneq (,$(filter skald,$(USEMODULE))) DIRS += net/ble/skald endif -ifneq (,$(filter shell_commands,$(USEMODULE))) - DIRS += shell/commands +ifneq (,$(filter shell_cmds,$(USEMODULE))) + DIRS += shell/cmds endif ifneq (,$(filter suit%,$(USEMODULE))) DIRS += suit diff --git a/sys/Makefile.dep b/sys/Makefile.dep index 05522b9c9b..6323a2cc2e 100644 --- a/sys/Makefile.dep +++ b/sys/Makefile.dep @@ -57,10 +57,6 @@ ifneq (,$(filter fmt_table,$(USEMODULE))) USEMODULE += fmt endif -ifneq (,$(filter i2c_scan,$(USEMODULE))) - FEATURES_REQUIRED += periph_i2c -endif - ifneq (,$(filter prng_fortuna,$(USEMODULE))) USEMODULE += crypto_aes_128 endif @@ -88,10 +84,6 @@ ifneq (,$(filter ieee802154_security,$(USEMODULE))) USEMODULE += cipher_modes endif -ifneq (,$(filter rtt_cmd,$(USEMODULE))) - FEATURES_REQUIRED += periph_rtt -endif - ifneq (,$(filter trace,$(USEMODULE))) USEMODULE += ztimer USEMODULE += ztimer_usec @@ -289,8 +281,25 @@ ifneq (,$(filter posix_sockets,$(USEMODULE))) USEMODULE += posix_headers endif -ifneq (,$(filter shell,$(USEMODULE))) +ifneq (,$(filter md5sum ,$(USEMODULE))) + USEMODULE += shell_cmd_md5sum +endif + +ifneq (,$(filter sha1sum,$(USEMODULE))) + USEMODULE += shell_cmd_sha1sum +endif + +ifneq (,$(filter sha256sum,$(USEMODULE))) + USEMODULE += shell_cmd_sha256sum +endif + +ifneq (,$(filter random_cmd,$(USEMODULE))) + USEMODULE += shell_cmd_random +endif + +ifneq (,$(filter shell%,$(USEMODULE))) USEMODULE += stdin + include $(RIOTBASE)/sys/shell/Makefile.dep endif # Include all stdio_% dependencies after all USEMODULE += stdio_% @@ -305,49 +314,6 @@ ifneq (,$(filter isrpipe_read_timeout,$(USEMODULE))) USEMODULE += xtimer endif -ifneq (,$(filter shell_commands,$(USEMODULE))) - ifneq (,$(filter dfplayer,$(USEMODULE))) - USEMODULE += auto_init_multimedia - USEMODULE += fmt - endif - - ifneq (,$(filter fib,$(USEMODULE))) - USEMODULE += posix_inet - endif - - ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE))) - USEMODULE += netutils ztimer_usec - endif - - ifneq (,$(gnrc_udp_cmd,$(USEMODULE))) - USEMODULE += netutils - endif - - ifneq (,$(filter nanocoap_vfs,$(USEMODULE))) - USEMODULE += vfs_util - endif - - ifneq (,$(filter nimble_netif,$(USEMODULE))) - USEMODULE += nimble_scanner - USEMODULE += nimble_scanlist - USEMODULE += fmt - endif - - ifneq (,$(filter openwsn_%,$(USEMODULE))) - USEMODULE += netif - USEMODULE += ipv6_addr - endif - - ifneq (,$(filter gnrc_lorawan,$(USEMODULE))) - USEMODULE += gnrc_netif_cmd_lora - endif -endif - -ifneq (,$(filter shell_democommands,$(USEMODULE))) - USEMODULE += rust_riotmodules - USEMODULE += shell -endif - ifneq (,$(filter md5sum sha1sum sha256sum,$(USEMODULE))) USEMODULE += vfs_util USEMODULE += hashes @@ -770,9 +736,6 @@ endif ifneq (,$(filter cord_lc cord_ep,$(USEMODULE))) USEMODULE += core_thread_flags USEMODULE += cord_common - ifneq (,$(filter shell_commands,$(USEMODULE))) - USEMODULE += sock_util - endif ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE))) # requires 64bit timestamps when using xtimer USEMODULE += ztimer64_xtimer_compat diff --git a/sys/net/gnrc/Makefile.dep b/sys/net/gnrc/Makefile.dep index a825c02ffc..dc82c11f8f 100644 --- a/sys/net/gnrc/Makefile.dep +++ b/sys/net/gnrc/Makefile.dep @@ -394,11 +394,6 @@ ifneq (,$(filter gnrc_udp,$(USEMODULE))) USEMODULE += udp endif -ifneq (,$(filter gnrc_udp_cmd,$(USEMODULE))) - USEMODULE += gnrc_udp - USEMODULE += gnrc_pktdump -endif - ifneq (,$(filter gnrc_tcp,$(USEMODULE))) DEFAULT_MODULE += auto_init_gnrc_tcp USEMODULE += gnrc_nettype_tcp diff --git a/sys/shell/Kconfig b/sys/shell/Kconfig index 996c7b05aa..087167fd1f 100644 --- a/sys/shell/Kconfig +++ b/sys/shell/Kconfig @@ -23,7 +23,7 @@ menuconfig MODULE_SHELL select MODULE_STDIN depends on TEST_KCONFIG -rsource "commands/Kconfig" +rsource "cmds/Kconfig" if MODULE_SHELL rsource "Kconfig.config" diff --git a/sys/shell/Makefile.dep b/sys/shell/Makefile.dep new file mode 100644 index 0000000000..65fffb0115 --- /dev/null +++ b/sys/shell/Makefile.dep @@ -0,0 +1,289 @@ +ifneq (,$(filter shell_cmd_%,$(USEMODULE))) + # each and every command is a submodule of shell_cmds + USEMODULE += shell_cmds +endif + +ifneq (,$(filter shell_commands,$(USEMODULE))) + # shell_commands has been renamed to shell_cmds_default, but let's keep this + # for backward compatibility + USEMODULE += shell_cmds_default +endif + +ifneq (,$(filter shell_cmds_default,$(USEMODULE))) + USEMODULE += shell_cmd_sys + + ifneq (,$(filter app_metadata,$(USEMODULE))) + USEMODULE += shell_cmd_app_metadata + endif + ifneq (,$(filter at30tse75x,$(USEMODULE))) + USEMODULE += shell_cmd_at30tse75x + endif + ifneq (,$(filter benchmark_udp,$(USEMODULE))) + USEMODULE += shell_cmd_benchmark_udp + endif + ifneq (,$(filter ccn-lite-utils,$(USEMODULE))) + USEMODULE += shell_cmd_ccn-lite-utils + endif + ifneq (,$(filter conn_can,$(USEMODULE))) + USEMODULE += shell_cmd_conn_can + endif + ifneq (,$(filter cord_ep,$(USEMODULE))) + USEMODULE += shell_cmd_cord_ep + endif + ifneq (,$(filter cryptoauthlib,$(USEPKG))) + USEMODULE += shell_cmd_cryptoauthlib + endif + ifneq (,$(filter dfplayer,$(USEMODULE))) + USEMODULE += shell_cmd_dfplayer + endif + ifneq (,$(filter fib,$(USEMODULE))) + USEMODULE += shell_cmd_fib + endif + ifneq (,$(filter gnrc_ipv6_ext_frag_stats,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_ipv6_frag_stats + endif + ifneq (,$(filter gnrc_ipv6_nib,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_ipv6_nib + endif + ifneq (,$(filter gnrc_ipv6_whitelist,$(USEMODULE))) + USEMODULE += shell_cmd_whitelist + endif + ifneq (,$(filter gnrc_ipv6_blacklist,$(USEMODULE))) + USEMODULE += shell_cmd_blacklist + endif + ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_icmpv6_echo + endif + ifneq (,$(filter gnrc_netif,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_netif + endif + ifneq (,$(filter gnrc_pktbuf_cmd,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_pktbuf + endif + ifneq (,$(filter gnrc_rpl,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_rpl + endif + ifneq (,$(filter gnrc_sixlowpan_ctx,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_sixlowpan_ctx + endif + ifneq (,$(filter gnrc_sixlowpan_frag_stats,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_sixlowpan_frag_stats + endif + ifneq (,$(filter gnrc_udp_cmd,$(USEMODULE))) + USEMODULE += shell_cmd_gnrc_udp + endif + ifneq (,$(filter heap_cmd,$(USEMODULE))) + USEMODULE += shell_cmd_heap + endif + ifneq (,$(filter i2c_scan,$(USEMODULE))) + USEMODULE += shell_cmd_i2c_scan + endif + ifneq (,$(filter lpc2387,$(USEMODULE))) + USEMODULE += shell_cmd_heap + endif + ifneq (,$(filter lwip_netif,$(USEMODULE))) + USEMODULE += shell_cmd_lwip_netif + endif + ifneq (,$(filter mci,$(USEMODULE))) + USEMODULE += shell_cmd_mci + endif + ifneq (,$(filter nanocoap_vfs,$(USEMODULE))) + USEMODULE += shell_cmd_nanocoap_vfs + endif + ifneq (,$(filter netstats_neighbor,$(USEMODULE))) + USEMODULE += shell_cmd_netstats_neighbor + endif + ifneq (,$(filter nice,$(USEMODULE))) + USEMODULE += shell_cmd_nice + endif + ifneq (,$(filter nimble_netif,$(USEMODULE))) + USEMODULE += shell_cmd_nimble_netif + endif + ifneq (,$(filter nimble_statconn,$(USEMODULE))) + USEMODULE += shell_cmd_nimble_statconn + endif + ifneq (,$(filter openwsn,$(USEPKG))) + USEMODULE += shell_cmd_openwsn + endif + ifneq (,$(filter rtt_rtc periph_rtc,$(USEMODULE))) + USEMODULE += shell_cmd_rtc + endif + ifneq (,$(filter saul_reg,$(USEMODULE))) + USEMODULE += shell_cmd_saul_reg + endif + ifneq (,$(filter semtech-loramac,$(USEPKG))) + USEMODULE += shell_cmd_semtech-loramac + endif + ifneq (,$(filter sntp,$(USEMODULE))) + USEMODULE += shell_cmd_sntp + endif + ifneq (,$(filter periph_pm,$(USEMODULE))) + USEMODULE += shell_cmd_pm + endif + ifneq (,$(filter ps,$(USEMODULE))) + USEMODULE += shell_cmd_ps + endif + ifneq (,$(filter sht1x,$(USEMODULE))) + USEMODULE += shell_cmd_sht1x + endif + ifneq (,$(filter suit_transport_worker,$(USEMODULE))) + USEMODULE += shell_cmd_suit + endif + ifneq (,$(filter vfs,$(USEMODULE))) + USEMODULE += shell_cmd_vfs + endif +endif + +ifneq (,$(filter shell_cmd_app_metadata,$(USEMODULE))) + USEMODULE += app_metadata +endif +ifneq (,$(filter shell_cmd_at30tse75x,$(USEMODULE))) + USEMODULE += at30tse75x +endif +ifneq (,$(filter shell_cmd_benchmark_udp,$(USEMODULE))) + USEMODULE += benchmark_udp +endif +ifneq (,$(filter shell_cmd_ccn-lite-utils,$(USEMODULE))) + USEMODULE += ccn-lite-utils +endif +ifneq (,$(filter shell_cmd_conn_can,$(USEMODULE))) + USEMODULE += conn_can +endif +ifneq (,$(filter shell_cmd_cord_ep,$(USEMODULE))) + USEMODULE += cord_ep + USEMODULE += sock_util +endif +ifneq (,$(filter shell_cmd_cryptoauthlib,$(USEPKG))) + USEMODULE += cryptoauthlib +endif +ifneq (,$(filter shell_cmd_dfplayer,$(USEMODULE))) + USEMODULE += auto_init_multimedia + USEMODULE += dfplayer + USEMODULE += fmt +endif +ifneq (,$(filter shell_cmd_fib,$(USEMODULE))) + USEMODULE += fib + USEMODULE += posix_inet +endif +ifneq (,$(filter shell_cmd_gnrc_icmpv6_echo,$(USEMODULE))) + USEMODULE += gnrc_icmpv6_echo + USEMODULE += netutils + USEMODULE += ztimer_usec +endif +ifneq (,$(filter shell_cmd_gnrc_ipv6_blacklist,$(USEMODULE))) + USEMODULE += gnrc_ipv6_blacklist +endif +ifneq (,$(filter shell_cmd_gnrc_ipv6_ext_frag_stats,$(USEMODULE))) + USEMODULE += gnrc_ipv6_frag_stats +endif +ifneq (,$(filter shell_cmd_gnrc_ipv6_nib,$(USEMODULE))) + USEMODULE += gnrc_ipv6_nib +endif +ifneq (,$(filter shell_cmd_gnrc_ipv6_whitelist,$(USEMODULE))) + USEMODULE += gnrc_ipv6_whitelist +endif +ifneq (,$(filter shell_cmd_gnrc_netif,$(USEMODULE))) + USEMODULE += gnrc_netif +endif +ifneq (,$(filter shell_cmd_gnrc_pktbuf,$(USEMODULE))) + USEMODULE += gnrc_pktbuf +endif +ifneq (,$(filter shell_cmd_gnrc_rpl,$(USEMODULE))) + USEMODULE += gnrc_rpl +endif +ifneq (,$(filter shell_cmd_gnrc_sixlowpan_ctx,$(USEMODULE))) + USEMODULE += gnrc_sixlowpan_ctx +endif +ifneq (,$(filter shell_cmd_gnrc_sixlowpan_frag_stats,$(USEMODULE))) + USEMODULE += gnrc_sixlowpan_frag_stats +endif +ifneq (,$(filter shell_cmd_gnrc_udp,$(USEMODULE))) + USEMODULE += gnrc_udp + USEMODULE += gnrc_pktdump +endif +ifneq (,$(filter shell_cmd_i2c_scan,$(USEMODULE))) + FEATURES_REQUIRED += periph_i2c +endif +ifneq (,$(filter shell_cmd_lwip_netif,$(USEMODULE))) + USEMODULE += lwip_netif +endif +ifneq (,$(filter shell_cmd_mci,$(USEMODULE))) + USEMODULE += mci +endif +ifneq (,$(filter shell_cmd_md5sum,$(USEMODULE))) + USEMODULE += shell_cmd_vfs +endif +ifneq (,$(filter shell_cmd_nanocoap_vfs,$(USEMODULE))) + USEMODULE += nanocoap_vfs + USEMODULE += vfs_util +endif +ifneq (,$(filter shell_cmd_netstats_neighbor,$(USEMODULE))) + USEMODULE += netstats_neighbor +endif +ifneq (,$(filter shell_cmd_nimble_netif,$(USEMODULE))) + USEMODULE += fmt + USEMODULE += nimble_netif + USEMODULE += nimble_scanlist + USEMODULE += nimble_scanner +endif +ifneq (,$(filter shell_cmd_nimble_statconn,$(USEMODULE))) + USEMODULE += nimble_statconn +endif +ifneq (,$(filter shell_cmd_openwsn,$(USEMODULE))) + USEMODULE += ipv6_addr + USEMODULE += l2util + USEMODULE += netif + USEPKG += openwsn +endif +ifneq (,$(filter shell_cmd_pm,$(USEMODULE))) + FEATURES_REQUIRED += periph_pm +endif +ifneq (,$(filter shell_cmd_ps,$(USEMODULE))) + USEMODULE += ps +endif +ifneq (,$(filter shell_cmd_random_cmd,$(USEMODULE))) + USEMODULE += random +endif +ifneq (,$(filter shell_cmd_rtc,$(USEMODULE))) + FEATURES_REQUIRED_ANY += periph_rtc|periph_rtt + # beware: this is a bit more tricky than it looks. Before the + # FEAUTRES_REQUIRED_ANY is taken into account, neither periph_rtc nor + # periph_rtt is used. Once it comes to affect, at least one will be in use. + # If periph_rtc is not in used but periph_rtt is, we can provide the RTC + # with rtt_rtc. + ifeq (periph_rtt,$(filter periph_rtc periph_rtt,$(USEMODULE))) + USEMODULE += rtt_rtc + endif +endif +ifneq (,$(filter shell_cmd_rtt,$(USEMODULE))) + FEATURES_REQUIRED += periph_rtt +endif +ifneq (,$(filter shell_cmd_saul_reg,$(USEMODULE))) + USEMODULE += saul_reg +endif +ifneq (,$(filter shell_cmd_semtech-loramac,$(USEPKG))) + USEMODULE += semtech-loramac +endif +ifneq (,$(filter shell_cmd_sha1sum,$(USEMODULE))) + USEMODULE += shell_cmd_vfs +endif +ifneq (,$(filter shell_cmd_sha256sum,$(USEMODULE))) + USEMODULE += shell_cmd_vfs +endif +ifneq (,$(filter shell_cmd_sht1x,$(USEMODULE))) + USEMODULE += sht1x +endif +ifneq (,$(filter shell_cmd_sntp,$(USEMODULE))) + USEMODULE += sntp +endif +ifneq (,$(filter shell_cmd_suit,$(USEMODULE))) + USEMODULE += suit_transport_worker +endif +ifneq (,$(filter shell_cmd_vfs,$(USEMODULE))) + USEMODULE += vfs +endif + +ifneq (,$(filter shell_democommands,$(USEMODULE))) + USEMODULE += rust_riotmodules + USEMODULE += shell +endif diff --git a/sys/shell/cmds/Kconfig b/sys/shell/cmds/Kconfig new file mode 100644 index 0000000000..685eade8c0 --- /dev/null +++ b/sys/shell/cmds/Kconfig @@ -0,0 +1,298 @@ +# Copyright (c) 2022 Otto-von-Guericke-Universität Magdeburg +# +# 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. +# + +menuconfig MODULE_SHELL_CMDS + bool "Support for shell commands" + depends on MODULE_SHELL + +config CONFIG_MODULE_SHELL_COMMANDS + bool + select MODULE_SHELL_CMDS_DEFAULT + help + Deprecated alias for MODULE_SHELL_CMDS_DEFAULT. For new apps, use + MODULE_SHELL_CMDS_DEFAULT directly. + +config MODULE_SHELL_CMDS_DEFAULT + bool "Default shell commands for enabled modules" + select MODULE_SHELL_CMDS + help + Shell commands can be enabled and disabled individually as dedicated + modules. This module instead will select the shell commands of modules + already used, if this is considered as "good default choice". + +config MODULE_SHELL_CMD_APP_METADATA + bool "Command to print app meta data as JSON" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_APP_METADATA + +config MODULE_SHELL_CMD_AT30TSE75X + bool "Command to testAT30TSE75x temperature sensors" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_AT30TSE75X + +config MODULE_SHELL_CMD_BENCHMARK_UDP + bool "Command to perform a UDP benchmark" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_BENCHMARK_UDP + +config MODULE_SHELL_CMD_CCN-LITE-UTILS + bool "Commands to interact with the CCN-Lite stack" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_CCN-LITE-UTILS + +config MODULE_SHELL_CMD_CONN_CAN + bool "Command to interact with the CAN stack" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_CONN_CAN + +config MODULE_SHELL_CMD_CORD_EP + bool "Command to interact with a resource directory endpoint" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_CORD_EP + +config MODULE_SHELL_CMD_CRYPTOAUTHLIB + bool "Command to interact with Microchip CryptoAuth devices" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_CRYPTOAUTHLIB + +config MODULE_SHELL_CMD_DFPLAYER + bool "Command to control a dfplayer MP3 player" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_DFPLAYER + select MODULE_AUTO_INIT_MULTIMEDIA + select MODULE_FMT + +config MODULE_SHELL_CMD_FIB + bool "Command to interact with the Forwarding Information Base (FIB)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_FIB + depends on MODULE_POSIX_INET + +config MODULE_SHELL_CMD_GNRC_ICMPV6_ECHO + bool "Command to send ICMPv6 Echo Requests (a.k.a. ping)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_ICMPV6_ECHO + depends on MODULE_NETUTILS + depends on MODULE_ZTIMER_USEC + +config MODULE_SHELL_CMD_GNRC_IPV6_BLACKLIST + bool "Command to manage IPv6 addresses in reception deny list" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_IPV6_BLACKLIST + +config MODULE_SHELL_CMD_GNRC_IPV6_FRAG_STATS + bool "Command to show IPv6 fragmentation statistics" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_IPV6_FRAG_STATS + +config MODULE_SHELL_CMD_GNRC_IPV6_NIB + bool "Command to configure the neighbor information base" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_IPV6_NIB + +config MODULE_SHELL_CMD_GNRC_IPV6_WHITELIST + bool "Command to manage IPv6 addresses in reception allow list" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_IPV6_WHITELIST + +config MODULE_SHELL_CMD_GNRC_NETIF + bool "Command to manage GNRC network interfaces (ifconfig)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_NETIF + +config MODULE_SHELL_CMD_GNRC_PKTBUF + bool "Command to print stats of the GNRC packet buffer" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_PKTBUF + +config MODULE_SHELL_CMD_GNRC_RPL + bool "Command to configure GNRC's RPL implementation" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_RPL + +config MODULE_SHELL_CMD_GNRC_SIXLOWPAN_CTX + bool "Command to configure 6LoWPAN context in GNRC" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SIXLOWPAN_CTX + +config MODULE_SHELL_CMD_GNRC_SIXLOWPAN_FRAG_STATS + bool "Command to display 6LoWPAN fragment statistics" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_SIXLOWPAN_FRAG_STATS + +config MODULE_SHELL_CMD_GNRC_UDP + bool "Command interface to a UDP server and client" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_GNRC_UDP + depends on MODULE_GNRC_PKTDUMP + +config MODULE_SHELL_CMD_HEAP + bool "Command to print dynamic memory allocation statistics" + depends on MODULE_SHELL_CMDS + +config MODULE_SHELL_CMD_I2C_SCAN + bool "Command to scan for I2C devices" + depends on MODULE_SHELL_CMDS + depends on MODULE_PERIPH_I2C + +config MODULE_SHELL_CMD_LWIP_NETIF + bool "Command to manage lwIP network interfaces (ifconfig)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_LWIP_NETIF + +config MODULE_SHELL_CMD_MCI + bool "Commands to query parameters and read contents from memory cards" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_MCI + +config MODULE_SHELL_CMD_MD5SUM + bool "Command to calculate the MD5 sum of a file" + depends on MODULE_SHELL_CMDS + depends on MODULE_SHELL_CMD_VFS + +config MODULE_SHELL_CMD_NANOCOAP_VFS + bool "Commands to upload/download files to/from a CoAP server" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_NANOCOAP_VFS + depends on MODULE_VFS_UTIL + +config MODULE_SHELL_CMD_NETSTATS_NEIGHBOR + bool "Command to show neighbor statistics" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_NETSTATS_NEIGHBOR + +config MODULE_SHELL_CMD_NICE + bool "Command to change the priority of running threads" + depends on MODULE_SHELL_CMDS + +config MODULE_SHELL_CMD_NIMBLE_NETIF + bool "Command to manage BLE connections for NimBLE" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_FMT + depends on MODULE_NIMBLE_NETIF + depends on MODULE_NIMBLE_SCANLIST + depends on MODULE_NIMBLE_SCANNER + +config MODULE_SHELL_CMD_NIMBLE_STATCONN + bool "Command to controle the NimBLE netif statconn connection manager" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_NIMBLE_STATCONN + +config MODULE_SHELL_CMD_OPENWSN + bool "Commands to interact with the OpenWSN network statck (ifconfig, openwsn)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_IPV6_ADDR + depends on MODULE_L2UTIL + depends on MODULE_NETIF + depends on MODULE_SHELL_CMDS + depends on USEPKG_OPENWSN + +config MODULE_SHELL_CMD_PM + bool "Command to interact with the layered power management subsystem" + default y if MODULE_SHELL_CMDS_DEFAULT && MODULE_PERIPH_PM + depends on MODULE_SHELL_CMDS + depends on HAS_PERIPH_PM + +config MODULE_SHELL_CMD_PS + bool "Command to print information about running threads" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_PS + +config MODULE_SHELL_CMD_RANDOM + bool "Commands to initialize the PRNG and print 32 bit pseudo-random numbers" + depends on MODULE_SHELL_CMDS + depends on MODULE_RANDOM + +config MODULE_SHELL_CMD_RTC + bool "Command to control the peripheral real time clock" + default y if MODULE_SHELL_CMDS_DEFAULT && MODULE_PERIPH_RTC + depends on MODULE_SHELL_CMDS + depends on HAS_PERIPH_RTC || HAS_PERIPH_RTT + depends on MODULE_RTT_RTC || HAS_PERIPH_RTC + +config MODULE_SHELL_CMD_RTT + bool "Command to control the peripheral real time timer" + depends on MODULE_SHELL_CMDS + depends on HAS_PERIPH_RTT + +config MODULE_SHELL_CMD_SAUL_REG + bool "Command to read sensors and control actuators via SAUL" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SAUL_REG + +config MODULE_SHELL_CMD_SEMTECH-LORAMAC + bool "Command to control the Semtech LoRaMAC stack" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SEMTECH-LORAMAC + +config MODULE_SHELL_CMD_SHA1SUM + bool "Command to compute the SHA1 sum of a file" + depends on MODULE_SHELL_CMDS + depends on MODULE_SHELL_CMD_VFS + +config MODULE_SHELL_CMD_SHA256SUM + bool "Command to compute the SHA256 sum of a file" + depends on MODULE_SHELL_CMDS + depends on MODULE_SHELL_CMD_VFS + +config MODULE_SHELL_CMD_SHT1X + bool "Commands to interact with SHT1x sensors" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SHT1X + +config MODULE_SHELL_CMD_SNTP + bool "Command to synchronize time with an SNTP server" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SNTP + +config MODULE_SHELL_CMD_SUIT + bool "Command to trigger a SUIT firmware update" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_SUIT_TRANSPORT_WORKER + +config MODULE_SHELL_CMD_SYS + bool "Common utility commands (version, reboot, bootloader)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + +config MODULE_SHELL_CMD_VFS + bool "Commands for the VFS module (ls, vfs)" + default y if MODULE_SHELL_CMDS_DEFAULT + depends on MODULE_SHELL_CMDS + depends on MODULE_VFS diff --git a/sys/shell/cmds/Makefile b/sys/shell/cmds/Makefile new file mode 100644 index 0000000000..381b1ce28a --- /dev/null +++ b/sys/shell/cmds/Makefile @@ -0,0 +1,5 @@ +MODULE = shell_cmds +BASE_MODULE := shell_cmd +SUBMODULES := 1 + +include $(RIOTBASE)/Makefile.base diff --git a/sys/shell/commands/sc_app_metadata.c b/sys/shell/cmds/app_metadata.c similarity index 100% rename from sys/shell/commands/sc_app_metadata.c rename to sys/shell/cmds/app_metadata.c diff --git a/sys/shell/commands/sc_at30tse75x.c b/sys/shell/cmds/at30tse75x.c similarity index 100% rename from sys/shell/commands/sc_at30tse75x.c rename to sys/shell/cmds/at30tse75x.c diff --git a/sys/shell/commands/sc_benchmark_udp.c b/sys/shell/cmds/benchmark_udp.c similarity index 100% rename from sys/shell/commands/sc_benchmark_udp.c rename to sys/shell/cmds/benchmark_udp.c diff --git a/sys/shell/commands/sc_ccnl.c b/sys/shell/cmds/ccn-lite-utils.c similarity index 100% rename from sys/shell/commands/sc_ccnl.c rename to sys/shell/cmds/ccn-lite-utils.c diff --git a/sys/shell/commands/sc_can.c b/sys/shell/cmds/conn_can.c similarity index 100% rename from sys/shell/commands/sc_can.c rename to sys/shell/cmds/conn_can.c diff --git a/sys/shell/commands/sc_cord_ep.c b/sys/shell/cmds/cord_ep.c similarity index 100% rename from sys/shell/commands/sc_cord_ep.c rename to sys/shell/cmds/cord_ep.c diff --git a/sys/shell/commands/sc_cryptoauthlib.c b/sys/shell/cmds/cryptoauthlib.c similarity index 100% rename from sys/shell/commands/sc_cryptoauthlib.c rename to sys/shell/cmds/cryptoauthlib.c diff --git a/sys/shell/commands/sc_dfplayer.c b/sys/shell/cmds/dfplayer.c similarity index 100% rename from sys/shell/commands/sc_dfplayer.c rename to sys/shell/cmds/dfplayer.c diff --git a/sys/shell/commands/sc_fib.c b/sys/shell/cmds/fib.c similarity index 100% rename from sys/shell/commands/sc_fib.c rename to sys/shell/cmds/fib.c diff --git a/sys/shell/commands/sc_gnrc_icmpv6_echo.c b/sys/shell/cmds/gnrc_icmpv6_echo.c similarity index 100% rename from sys/shell/commands/sc_gnrc_icmpv6_echo.c rename to sys/shell/cmds/gnrc_icmpv6_echo.c diff --git a/sys/shell/commands/sc_blacklist.c b/sys/shell/cmds/gnrc_ipv6_blacklist.c similarity index 100% rename from sys/shell/commands/sc_blacklist.c rename to sys/shell/cmds/gnrc_ipv6_blacklist.c diff --git a/sys/shell/commands/sc_gnrc_ipv6_frag_stats.c b/sys/shell/cmds/gnrc_ipv6_frag_stats.c similarity index 100% rename from sys/shell/commands/sc_gnrc_ipv6_frag_stats.c rename to sys/shell/cmds/gnrc_ipv6_frag_stats.c diff --git a/sys/shell/commands/sc_gnrc_ipv6_nib.c b/sys/shell/cmds/gnrc_ipv6_nib.c similarity index 100% rename from sys/shell/commands/sc_gnrc_ipv6_nib.c rename to sys/shell/cmds/gnrc_ipv6_nib.c diff --git a/sys/shell/commands/sc_whitelist.c b/sys/shell/cmds/gnrc_ipv6_whitelist.c similarity index 100% rename from sys/shell/commands/sc_whitelist.c rename to sys/shell/cmds/gnrc_ipv6_whitelist.c diff --git a/sys/shell/commands/sc_gnrc_netif.c b/sys/shell/cmds/gnrc_netif.c similarity index 100% rename from sys/shell/commands/sc_gnrc_netif.c rename to sys/shell/cmds/gnrc_netif.c diff --git a/sys/shell/commands/sc_gnrc_pktbuf.c b/sys/shell/cmds/gnrc_pktbuf.c similarity index 100% rename from sys/shell/commands/sc_gnrc_pktbuf.c rename to sys/shell/cmds/gnrc_pktbuf.c diff --git a/sys/shell/commands/sc_gnrc_rpl.c b/sys/shell/cmds/gnrc_rpl.c similarity index 100% rename from sys/shell/commands/sc_gnrc_rpl.c rename to sys/shell/cmds/gnrc_rpl.c diff --git a/sys/shell/commands/sc_gnrc_6ctx.c b/sys/shell/cmds/gnrc_sixlowpan_ctx.c similarity index 100% rename from sys/shell/commands/sc_gnrc_6ctx.c rename to sys/shell/cmds/gnrc_sixlowpan_ctx.c diff --git a/sys/shell/commands/sc_gnrc_6lo_frag_stats.c b/sys/shell/cmds/gnrc_sixlowpan_frag_stats.c similarity index 100% rename from sys/shell/commands/sc_gnrc_6lo_frag_stats.c rename to sys/shell/cmds/gnrc_sixlowpan_frag_stats.c diff --git a/sys/shell/commands/sc_gnrc_udp.c b/sys/shell/cmds/gnrc_udp.c similarity index 100% rename from sys/shell/commands/sc_gnrc_udp.c rename to sys/shell/cmds/gnrc_udp.c diff --git a/sys/shell/commands/sc_heap.c b/sys/shell/cmds/heap.c similarity index 100% rename from sys/shell/commands/sc_heap.c rename to sys/shell/cmds/heap.c diff --git a/sys/shell/commands/sc_i2c_scan.c b/sys/shell/cmds/i2c_scan.c similarity index 100% rename from sys/shell/commands/sc_i2c_scan.c rename to sys/shell/cmds/i2c_scan.c diff --git a/sys/shell/commands/sc_lwip_netif.c b/sys/shell/cmds/lwip_netif.c similarity index 100% rename from sys/shell/commands/sc_lwip_netif.c rename to sys/shell/cmds/lwip_netif.c diff --git a/sys/shell/commands/sc_disk.c b/sys/shell/cmds/mci.c similarity index 100% rename from sys/shell/commands/sc_disk.c rename to sys/shell/cmds/mci.c diff --git a/sys/shell/commands/sc_nanocoap_vfs.c b/sys/shell/cmds/nanocoap_vfs.c similarity index 100% rename from sys/shell/commands/sc_nanocoap_vfs.c rename to sys/shell/cmds/nanocoap_vfs.c diff --git a/sys/shell/commands/sc_netstats_nb.c b/sys/shell/cmds/netstats_neighbor.c similarity index 100% rename from sys/shell/commands/sc_netstats_nb.c rename to sys/shell/cmds/netstats_neighbor.c diff --git a/sys/shell/commands/sc_nice.c b/sys/shell/cmds/nice.c similarity index 100% rename from sys/shell/commands/sc_nice.c rename to sys/shell/cmds/nice.c diff --git a/sys/shell/commands/sc_nimble_netif.c b/sys/shell/cmds/nimble_netif.c similarity index 100% rename from sys/shell/commands/sc_nimble_netif.c rename to sys/shell/cmds/nimble_netif.c diff --git a/sys/shell/commands/sc_nimble_statconn.c b/sys/shell/cmds/nimble_statconn.c similarity index 100% rename from sys/shell/commands/sc_nimble_statconn.c rename to sys/shell/cmds/nimble_statconn.c diff --git a/sys/shell/commands/sc_openwsn.c b/sys/shell/cmds/openwsn.c similarity index 100% rename from sys/shell/commands/sc_openwsn.c rename to sys/shell/cmds/openwsn.c diff --git a/sys/shell/commands/sc_pm.c b/sys/shell/cmds/pm.c similarity index 100% rename from sys/shell/commands/sc_pm.c rename to sys/shell/cmds/pm.c diff --git a/sys/shell/commands/sc_ps.c b/sys/shell/cmds/ps.c similarity index 100% rename from sys/shell/commands/sc_ps.c rename to sys/shell/cmds/ps.c diff --git a/sys/shell/commands/sc_random.c b/sys/shell/cmds/random.c similarity index 100% rename from sys/shell/commands/sc_random.c rename to sys/shell/cmds/random.c diff --git a/sys/shell/commands/sc_rtc.c b/sys/shell/cmds/rtc.c similarity index 100% rename from sys/shell/commands/sc_rtc.c rename to sys/shell/cmds/rtc.c diff --git a/sys/shell/commands/sc_rtt.c b/sys/shell/cmds/rtt.c similarity index 100% rename from sys/shell/commands/sc_rtt.c rename to sys/shell/cmds/rtt.c diff --git a/sys/shell/commands/sc_saul_reg.c b/sys/shell/cmds/saul_reg.c similarity index 100% rename from sys/shell/commands/sc_saul_reg.c rename to sys/shell/cmds/saul_reg.c diff --git a/sys/shell/commands/sc_loramac.c b/sys/shell/cmds/semtech-loramac.c similarity index 100% rename from sys/shell/commands/sc_loramac.c rename to sys/shell/cmds/semtech-loramac.c diff --git a/sys/shell/commands/sc_sht1x.c b/sys/shell/cmds/sht1x.c similarity index 100% rename from sys/shell/commands/sc_sht1x.c rename to sys/shell/cmds/sht1x.c diff --git a/sys/shell/commands/sc_sntp.c b/sys/shell/cmds/sntp.c similarity index 100% rename from sys/shell/commands/sc_sntp.c rename to sys/shell/cmds/sntp.c diff --git a/sys/shell/commands/sc_suit.c b/sys/shell/cmds/suit.c similarity index 100% rename from sys/shell/commands/sc_suit.c rename to sys/shell/cmds/suit.c diff --git a/sys/shell/commands/sc_sys.c b/sys/shell/cmds/sys.c similarity index 100% rename from sys/shell/commands/sc_sys.c rename to sys/shell/cmds/sys.c diff --git a/sys/shell/commands/sc_vfs.c b/sys/shell/cmds/vfs.c similarity index 99% rename from sys/shell/commands/sc_vfs.c rename to sys/shell/cmds/vfs.c index f654041e47..1111093369 100644 --- a/sys/shell/commands/sc_vfs.c +++ b/sys/shell/cmds/vfs.c @@ -805,7 +805,7 @@ static inline void _print_digest(const uint8_t *digest, size_t len, const char * printf(" %s\n", file); } -#if MODULE_MD5SUM +#if MODULE_SHELL_CMD_MD5SUM #include "hashes/md5.h" static int _vfs_md5sum_cmd(int argc, char **argv) { @@ -834,7 +834,7 @@ static int _vfs_md5sum_cmd(int argc, char **argv) SHELL_COMMAND(md5sum, "Compute and check MD5 message digest", _vfs_md5sum_cmd); #endif -#if MODULE_SHA1SUM +#if MODULE_SHELL_CMD_SHA1SUM #include "hashes/sha1.h" static int _vfs_sha1sum_cmd(int argc, char **argv) { @@ -863,7 +863,7 @@ static int _vfs_sha1sum_cmd(int argc, char **argv) SHELL_COMMAND(sha1sum, "Compute and check SHA1 message digest", _vfs_sha1sum_cmd); #endif -#if MODULE_SHA256SUM +#if MODULE_SHELL_CMD_SHA256SUM #include "hashes/sha256.h" static int _vfs_sha256sum_cmd(int argc, char **argv) { diff --git a/sys/shell/commands/Kconfig b/sys/shell/commands/Kconfig deleted file mode 100644 index 667308ae7a..0000000000 --- a/sys/shell/commands/Kconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2020 HAW Hamburg -# -# 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. -# - -menuconfig MODULE_SHELL_COMMANDS - bool "Basic shell commands" - depends on MODULE_SHELL - -config MODULE_I2C_SCAN - bool "I2c scanner" - depends on MODULE_SHELL - depends on MODULE_PERIPH_I2C diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile deleted file mode 100644 index a69bfba6a6..0000000000 --- a/sys/shell/commands/Makefile +++ /dev/null @@ -1,143 +0,0 @@ -MODULE = shell_commands - -SRC = sc_sys.c - -ifneq (,$(filter app_metadata,$(USEMODULE))) - SRC += sc_app_metadata.c -endif -ifneq (,$(filter benchmark_udp,$(USEMODULE))) - SRC += sc_benchmark_udp.c -endif -ifneq (,$(filter dfplayer,$(USEMODULE))) - SRC += sc_dfplayer.c -endif -ifneq (,$(filter mci,$(USEMODULE))) - SRC += sc_disk.c -endif -ifneq (,$(filter nice,$(USEMODULE))) - SRC += sc_nice.c -endif -ifneq (,$(filter periph_pm,$(USEMODULE))) - SRC += sc_pm.c -endif -ifneq (,$(filter ps,$(USEMODULE))) - SRC += sc_ps.c -endif -ifneq (,$(filter heap_cmd,$(USEMODULE))) - SRC += sc_heap.c -endif -ifneq (,$(filter sht1x,$(USEMODULE))) - SRC += sc_sht1x.c -endif -ifneq (,$(filter lpc2387,$(USEMODULE))) - SRC += sc_heap.c -endif -ifneq (,$(filter random_cmd,$(USEMODULE))) - SRC += sc_random.c -endif -ifneq (,$(filter at30tse75x,$(USEMODULE))) - SRC += sc_at30tse75x.c -endif -ifneq (,$(filter gnrc_netif,$(USEMODULE))) - SRC += sc_gnrc_netif.c -endif -ifneq (,$(filter gnrc_udp_cmd,$(USEMODULE))) - SRC += sc_gnrc_udp.c -endif -ifneq (,$(filter netstats_neighbor,$(USEMODULE))) - SRC += sc_netstats_nb.c -endif -ifneq (,$(filter fib,$(USEMODULE))) - SRC += sc_fib.c -endif -ifneq (,$(filter gnrc_ipv6_ext_frag_stats,$(USEMODULE))) - SRC += sc_gnrc_ipv6_frag_stats.c -endif -ifneq (,$(filter gnrc_ipv6_nib,$(USEMODULE))) - SRC += sc_gnrc_ipv6_nib.c -endif -ifneq (,$(filter gnrc_ipv6_whitelist,$(USEMODULE))) - SRC += sc_whitelist.c -endif -ifneq (,$(filter gnrc_ipv6_blacklist,$(USEMODULE))) - SRC += sc_blacklist.c -endif -ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE))) - SRC += sc_gnrc_icmpv6_echo.c -endif -ifneq (,$(filter gnrc_pktbuf_cmd,$(USEMODULE))) - SRC += sc_gnrc_pktbuf.c -endif -ifneq (,$(filter gnrc_rpl,$(USEMODULE))) - SRC += sc_gnrc_rpl.c -endif -ifneq (,$(filter gnrc_sixlowpan_ctx,$(USEMODULE))) - SRC += sc_gnrc_6ctx.c -endif -ifneq (,$(filter gnrc_sixlowpan_frag_stats,$(USEMODULE))) - SRC += sc_gnrc_6lo_frag_stats.c -endif -ifneq (,$(filter saul_reg,$(USEMODULE))) - SRC += sc_saul_reg.c -endif -ifneq (,$(filter ccn-lite-utils,$(USEMODULE))) - SRC += sc_ccnl.c -endif -ifneq (,$(filter sntp,$(USEMODULE))) - SRC += sc_sntp.c -endif -ifneq (,$(filter vfs,$(USEMODULE))) - SRC += sc_vfs.c -endif -ifneq (,$(filter conn_can,$(USEMODULE))) - SRC += sc_can.c -endif -ifneq (,$(filter cord_ep,$(USEMODULE))) - SRC += sc_cord_ep.c -endif - -ifneq (,$(filter openwsn,$(USEPKG))) - SRC += sc_openwsn.c -endif - -ifneq (,$(filter lwip_netif,$(USEMODULE))) - SRC += sc_lwip_netif.c -endif - -ifneq (,$(filter rtt_rtc periph_rtc,$(USEMODULE))) - SRC += sc_rtc.c -endif - -ifneq (,$(filter rtt_cmd,$(USEMODULE))) - SRC += sc_rtt.c -endif - -ifneq (,$(filter i2c_scan,$(USEMODULE))) - SRC += sc_i2c_scan.c -endif - -ifneq (,$(filter semtech-loramac,$(USEPKG))) - SRC += sc_loramac.c -endif - -ifneq (,$(filter nanocoap_vfs,$(USEMODULE))) - SRC += sc_nanocoap_vfs.c -endif - -ifneq (,$(filter nimble_netif,$(USEMODULE))) - SRC += sc_nimble_netif.c -endif - -ifneq (,$(filter nimble_statconn,$(USEMODULE))) - SRC += sc_nimble_statconn.c -endif - -ifneq (,$(filter suit_transport_worker,$(USEMODULE))) - SRC += sc_suit.c -endif - -ifneq (,$(filter cryptoauthlib,$(USEPKG))) - SRC += sc_cryptoauthlib.c -endif - -include $(RIOTBASE)/Makefile.base diff --git a/tests/driver_dfplayer/app.config.test b/tests/driver_dfplayer/app.config.test index 413048393b..7bf727fc4d 100644 --- a/tests/driver_dfplayer/app.config.test +++ b/tests/driver_dfplayer/app.config.test @@ -2,10 +2,11 @@ # application configuration. This is only needed during migration. CONFIG_MODULE_DFPLAYER=y -# enable event thread in lowest priority +# enable event thread CONFIG_MODULE_EVENT=y CONFIG_MODULE_EVENT_THREAD=y -# enable shell with basic commands +# enable shell CONFIG_MODULE_SHELL=y -CONFIG_MODULE_SHELL_COMMANDS=y +# pull in default commands for selected modules +CONFIG_MODULE_SHELL_CMDS_DEFAULT=y diff --git a/tests/periph_i2c/Makefile b/tests/periph_i2c/Makefile index f2d1595375..53cf57fd4a 100644 --- a/tests/periph_i2c/Makefile +++ b/tests/periph_i2c/Makefile @@ -6,7 +6,7 @@ FEATURES_OPTIONAL = periph_i2c_reconfigure USEMODULE += shell USEMODULE += shell_commands -USEMODULE += i2c_scan +USEMODULE += cmd_i2c_scan USEMODULE += xtimer # avoid running Kconfig by default