Skip to content

Commit c06335b

Browse files
committed
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.
1 parent 6e68744 commit c06335b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+679
-229
lines changed

examples/gnrc_networking/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ USEMODULE += gnrc_rpl
2020
USEMODULE += auto_init_gnrc_rpl
2121
# Additional networking modules that can be dropped if not needed
2222
USEMODULE += gnrc_icmpv6_echo
23-
USEMODULE += gnrc_udp_cmd
23+
USEMODULE += shell_cmd_gnrc_udp
2424
# Add also the shell, some shell commands
2525
USEMODULE += shell
2626
USEMODULE += shell_commands

makefiles/deprecated_modules.inc.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22
# Keep this list ALPHABETICALLY SORTED!!!!111elven
33
DEPRECATED_MODULES += event_thread_lowest
44
DEPRECATED_MODULES += gnrc_netdev_default
5+
DEPRECATED_MODULES += gnrc_pktbuf_cmd # use shell_cmd_gnrc_pktbuf instead
6+
DEPRECATED_MODULES += gnrc_udp_cmd # use shell_cmd_grnc_udp instead
7+
DEPRECATED_MODULES += heap_cmd # use shell_cmd_heap instead
8+
DEPRECATED_MODULES += i2c_scan # use shell_cmd_i2c_scan instead
9+
DEPRECATED_MODULES += md5sum # use shell_cmd_md5sum instead
10+
DEPRECATED_MODULES += nice # use shell_cmd_nice instead
11+
DEPRECATED_MODULES += random_cmd # use shell_cmd_random instead
512
DEPRECATED_MODULES += sema_deprecated
13+
DEPRECATED_MODULES += shell_commands # use shell_cmds_default instead
14+
DEPRECATED_MODULES += sha1sum # use shell_cmd_sha1sum instead
15+
DEPRECATED_MODULES += sha256sum # use shell_cmd_sha256sum instead
616
DEPRECATED_MODULES += ztimer_now64

makefiles/pseudomodules.inc.mk

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,53 @@ PSEUDOMODULES += senml_phydat
211211
PSEUDOMODULES += senml_saul
212212
PSEUDOMODULES += sha1sum
213213
PSEUDOMODULES += sha256sum
214+
PSEUDOMODULES += shell_cmd_app_metadata
215+
PSEUDOMODULES += shell_cmd_at30tse75x
216+
PSEUDOMODULES += shell_cmd_benchmark_udp
217+
PSEUDOMODULES += shell_cmd_ccn-lite-utils
218+
PSEUDOMODULES += shell_cmd_conn_can
219+
PSEUDOMODULES += shell_cmd_cord_ep
220+
PSEUDOMODULES += shell_cmd_cryptoauthlib
221+
PSEUDOMODULES += shell_cmd_dfplayer
222+
PSEUDOMODULES += shell_cmd_fib
223+
PSEUDOMODULES += shell_cmd_gnrc_icmpv6_echo
224+
PSEUDOMODULES += shell_cmd_gnrc_ipv6_blacklist
225+
PSEUDOMODULES += shell_cmd_gnrc_ipv6_frag_stats
226+
PSEUDOMODULES += shell_cmd_gnrc_ipv6_nib
227+
PSEUDOMODULES += shell_cmd_gnrc_ipv6_whitelist
228+
PSEUDOMODULES += shell_cmd_gnrc_netif
229+
PSEUDOMODULES += shell_cmd_gnrc_pktbuf
230+
PSEUDOMODULES += shell_cmd_gnrc_rpl
231+
PSEUDOMODULES += shell_cmd_gnrc_sixlowpan_ctx
232+
PSEUDOMODULES += shell_cmd_gnrc_sixlowpan_frag_stats
233+
PSEUDOMODULES += shell_cmd_gnrc_udp
234+
PSEUDOMODULES += shell_cmd_heap
235+
PSEUDOMODULES += shell_cmd_i2c_scan
236+
PSEUDOMODULES += shell_cmd_lwip_netif
237+
PSEUDOMODULES += shell_cmd_mci
238+
PSEUDOMODULES += shell_cmd_md5sum
239+
PSEUDOMODULES += shell_cmd_nanocoap_vfs
240+
PSEUDOMODULES += shell_cmd_netstats_neighbor
241+
PSEUDOMODULES += shell_cmd_nice
242+
PSEUDOMODULES += shell_cmd_nimble_netif
243+
PSEUDOMODULES += shell_cmd_nimble_statconn
244+
PSEUDOMODULES += shell_cmd_openwsn
245+
PSEUDOMODULES += shell_cmd_pm
246+
PSEUDOMODULES += shell_cmd_ps
247+
PSEUDOMODULES += shell_cmd_random
248+
PSEUDOMODULES += shell_cmd_rtc
249+
PSEUDOMODULES += shell_cmd_rtt
250+
PSEUDOMODULES += shell_cmd_saul_reg
251+
PSEUDOMODULES += shell_cmd_semtech-loramac
252+
PSEUDOMODULES += shell_cmd_sha1sum
253+
PSEUDOMODULES += shell_cmd_sha256sum
254+
PSEUDOMODULES += shell_cmd_sht1x
255+
PSEUDOMODULES += shell_cmd_sntp
256+
PSEUDOMODULES += shell_cmd_suit
257+
PSEUDOMODULES += shell_cmd_sys
258+
PSEUDOMODULES += shell_cmd_vfs
259+
PSEUDOMODULES += shell_cmds_default
260+
PSEUDOMODULES += shell_commands
214261
PSEUDOMODULES += shell_hooks
215262
PSEUDOMODULES += shell_lock_auto_locking
216263
PSEUDOMODULES += slipdev_stdio

sys/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ endif
182182
ifneq (,$(filter skald,$(USEMODULE)))
183183
DIRS += net/ble/skald
184184
endif
185-
ifneq (,$(filter shell_commands,$(USEMODULE)))
186-
DIRS += shell/commands
185+
ifneq (,$(filter shell_cmds,$(USEMODULE)))
186+
DIRS += shell/cmds
187187
endif
188188
ifneq (,$(filter suit%,$(USEMODULE)))
189189
DIRS += suit

sys/Makefile.dep

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ ifneq (,$(filter fmt_table,$(USEMODULE)))
5757
USEMODULE += fmt
5858
endif
5959

60-
ifneq (,$(filter i2c_scan,$(USEMODULE)))
61-
FEATURES_REQUIRED += periph_i2c
62-
endif
63-
6460
ifneq (,$(filter prng_fortuna,$(USEMODULE)))
6561
USEMODULE += crypto_aes_128
6662
endif
@@ -88,10 +84,6 @@ ifneq (,$(filter ieee802154_security,$(USEMODULE)))
8884
USEMODULE += cipher_modes
8985
endif
9086

91-
ifneq (,$(filter rtt_cmd,$(USEMODULE)))
92-
FEATURES_REQUIRED += periph_rtt
93-
endif
94-
9587
ifneq (,$(filter trace,$(USEMODULE)))
9688
USEMODULE += ztimer
9789
USEMODULE += ztimer_usec
@@ -289,8 +281,25 @@ ifneq (,$(filter posix_sockets,$(USEMODULE)))
289281
USEMODULE += posix_headers
290282
endif
291283

292-
ifneq (,$(filter shell,$(USEMODULE)))
284+
ifneq (,$(filter md5sum ,$(USEMODULE)))
285+
USEMODULE += shell_cmd_md5sum
286+
endif
287+
288+
ifneq (,$(filter sha1sum,$(USEMODULE)))
289+
USEMODULE += shell_cmd_sha1sum
290+
endif
291+
292+
ifneq (,$(filter sha256sum,$(USEMODULE)))
293+
USEMODULE += shell_cmd_sha256sum
294+
endif
295+
296+
ifneq (,$(filter random_cmd,$(USEMODULE)))
297+
USEMODULE += shell_cmd_random
298+
endif
299+
300+
ifneq (,$(filter shell%,$(USEMODULE)))
293301
USEMODULE += stdin
302+
include $(RIOTBASE)/sys/shell/Makefile.dep
294303
endif
295304

296305
# Include all stdio_% dependencies after all USEMODULE += stdio_%
@@ -305,49 +314,6 @@ ifneq (,$(filter isrpipe_read_timeout,$(USEMODULE)))
305314
USEMODULE += xtimer
306315
endif
307316

308-
ifneq (,$(filter shell_commands,$(USEMODULE)))
309-
ifneq (,$(filter dfplayer,$(USEMODULE)))
310-
USEMODULE += auto_init_multimedia
311-
USEMODULE += fmt
312-
endif
313-
314-
ifneq (,$(filter fib,$(USEMODULE)))
315-
USEMODULE += posix_inet
316-
endif
317-
318-
ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE)))
319-
USEMODULE += netutils ztimer_usec
320-
endif
321-
322-
ifneq (,$(gnrc_udp_cmd,$(USEMODULE)))
323-
USEMODULE += netutils
324-
endif
325-
326-
ifneq (,$(filter nanocoap_vfs,$(USEMODULE)))
327-
USEMODULE += vfs_util
328-
endif
329-
330-
ifneq (,$(filter nimble_netif,$(USEMODULE)))
331-
USEMODULE += nimble_scanner
332-
USEMODULE += nimble_scanlist
333-
USEMODULE += fmt
334-
endif
335-
336-
ifneq (,$(filter openwsn_%,$(USEMODULE)))
337-
USEMODULE += netif
338-
USEMODULE += ipv6_addr
339-
endif
340-
341-
ifneq (,$(filter gnrc_lorawan,$(USEMODULE)))
342-
USEMODULE += gnrc_netif_cmd_lora
343-
endif
344-
endif
345-
346-
ifneq (,$(filter shell_democommands,$(USEMODULE)))
347-
USEMODULE += rust_riotmodules
348-
USEMODULE += shell
349-
endif
350-
351317
ifneq (,$(filter md5sum sha1sum sha256sum,$(USEMODULE)))
352318
USEMODULE += vfs_util
353319
USEMODULE += hashes
@@ -770,9 +736,6 @@ endif
770736
ifneq (,$(filter cord_lc cord_ep,$(USEMODULE)))
771737
USEMODULE += core_thread_flags
772738
USEMODULE += cord_common
773-
ifneq (,$(filter shell_commands,$(USEMODULE)))
774-
USEMODULE += sock_util
775-
endif
776739
ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
777740
# requires 64bit timestamps when using xtimer
778741
USEMODULE += ztimer64_xtimer_compat

sys/net/gnrc/Makefile.dep

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ ifneq (,$(filter gnrc_udp,$(USEMODULE)))
394394
USEMODULE += udp
395395
endif
396396

397-
ifneq (,$(filter gnrc_udp_cmd,$(USEMODULE)))
398-
USEMODULE += gnrc_udp
399-
USEMODULE += gnrc_pktdump
400-
endif
401-
402397
ifneq (,$(filter gnrc_tcp,$(USEMODULE)))
403398
DEFAULT_MODULE += auto_init_gnrc_tcp
404399
USEMODULE += gnrc_nettype_tcp

sys/shell/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ menuconfig MODULE_SHELL
2323
select MODULE_STDIN
2424
depends on TEST_KCONFIG
2525

26-
rsource "commands/Kconfig"
26+
rsource "cmds/Kconfig"
2727

2828
if MODULE_SHELL
2929
rsource "Kconfig.config"

0 commit comments

Comments
 (0)