From d7a45eafda633edf14a8fe6fe430174889de0c4e Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:30 -0500 Subject: net: Make CMD_NET a menuconfig Previously, CMD_NET was an alias for 2 commands (bootp and tftpboot) and they we not able to be disabled. Separate out those 2 commands and move CMD_NET up to the menu level, which more accurately represents the code. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham Reviewed-by: Duncan Hare --- cmd/Kconfig | 25 +++++++++++++++++-------- cmd/net.c | 4 ++++ 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'cmd') diff --git a/cmd/Kconfig b/cmd/Kconfig index d440675b6e..fb742272d8 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1021,25 +1021,35 @@ config CMD_SETEXPR endmenu -menu "Network commands" - if NET -config CMD_NET - bool "bootp, tftpboot" +menuconfig CMD_NET + bool "Network commands" + default y + +if CMD_NET + +config CMD_BOOTP + bool "bootp" default y help - Network commands. bootp - boot image via network using BOOTP/TFTP protocol + +config CMD_TFTPBOOT + bool "tftpboot" + default y + help tftpboot - boot image via network using TFTP protocol config CMD_TFTPPUT bool "tftp put" + depends on CMD_TFTPBOOT help TFTP put command, for uploading files to a server config CMD_TFTPSRV bool "tftpsrv" + depends on CMD_TFTPBOOT help Act as a TFTP server and boot the first received file @@ -1050,13 +1060,12 @@ config CMD_RARP config CMD_DHCP bool "dhcp" - depends on CMD_NET + depends on CMD_BOOTP help Boot image via network using DHCP/TFTP protocol config CMD_PXE bool "pxe" - depends on CMD_NET select MENU help Boot image via network using PXE protocol @@ -1107,7 +1116,7 @@ config CMD_ETHSW endif -endmenu +endif menu "Misc commands" diff --git a/cmd/net.c b/cmd/net.c index d7c776aacf..67888d4e18 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -14,6 +14,7 @@ static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); +#ifdef CONFIG_CMD_BOOTP static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common(BOOTP, cmdtp, argc, argv); @@ -24,7 +25,9 @@ U_BOOT_CMD( "boot image via network using BOOTP/TFTP protocol", "[loadAddress] [[hostIPaddr:]bootfilename]" ); +#endif +#ifdef CONFIG_CMD_TFTPBOOT int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret; @@ -40,6 +43,7 @@ U_BOOT_CMD( "boot image via network using TFTP protocol", "[loadAddress] [[hostIPaddr:]bootfilename]" ); +#endif #ifdef CONFIG_CMD_TFTPPUT static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -- cgit v1.2.3