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 <joe.hershberger@ni.com> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Duncan Hare <dh@synoia.com>
This commit is contained in:
parent
b107fd5bab
commit
d7a45eafda
25
cmd/Kconfig
25
cmd/Kconfig
@ -1021,25 +1021,35 @@ config CMD_SETEXPR
|
|||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Network commands"
|
|
||||||
|
|
||||||
if NET
|
if NET
|
||||||
|
|
||||||
config CMD_NET
|
menuconfig CMD_NET
|
||||||
bool "bootp, tftpboot"
|
bool "Network commands"
|
||||||
|
default y
|
||||||
|
|
||||||
|
if CMD_NET
|
||||||
|
|
||||||
|
config CMD_BOOTP
|
||||||
|
bool "bootp"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Network commands.
|
|
||||||
bootp - boot image via network using BOOTP/TFTP protocol
|
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
|
tftpboot - boot image via network using TFTP protocol
|
||||||
|
|
||||||
config CMD_TFTPPUT
|
config CMD_TFTPPUT
|
||||||
bool "tftp put"
|
bool "tftp put"
|
||||||
|
depends on CMD_TFTPBOOT
|
||||||
help
|
help
|
||||||
TFTP put command, for uploading files to a server
|
TFTP put command, for uploading files to a server
|
||||||
|
|
||||||
config CMD_TFTPSRV
|
config CMD_TFTPSRV
|
||||||
bool "tftpsrv"
|
bool "tftpsrv"
|
||||||
|
depends on CMD_TFTPBOOT
|
||||||
help
|
help
|
||||||
Act as a TFTP server and boot the first received file
|
Act as a TFTP server and boot the first received file
|
||||||
|
|
||||||
@ -1050,13 +1060,12 @@ config CMD_RARP
|
|||||||
|
|
||||||
config CMD_DHCP
|
config CMD_DHCP
|
||||||
bool "dhcp"
|
bool "dhcp"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
help
|
help
|
||||||
Boot image via network using DHCP/TFTP protocol
|
Boot image via network using DHCP/TFTP protocol
|
||||||
|
|
||||||
config CMD_PXE
|
config CMD_PXE
|
||||||
bool "pxe"
|
bool "pxe"
|
||||||
depends on CMD_NET
|
|
||||||
select MENU
|
select MENU
|
||||||
help
|
help
|
||||||
Boot image via network using PXE protocol
|
Boot image via network using PXE protocol
|
||||||
@ -1107,7 +1116,7 @@ config CMD_ETHSW
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endmenu
|
endif
|
||||||
|
|
||||||
menu "Misc commands"
|
menu "Misc commands"
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
|
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[])
|
static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
return netboot_common(BOOTP, cmdtp, argc, argv);
|
return netboot_common(BOOTP, cmdtp, argc, argv);
|
||||||
@ -24,7 +25,9 @@ U_BOOT_CMD(
|
|||||||
"boot image via network using BOOTP/TFTP protocol",
|
"boot image via network using BOOTP/TFTP protocol",
|
||||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_TFTPBOOT
|
||||||
int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@ -40,6 +43,7 @@ U_BOOT_CMD(
|
|||||||
"boot image via network using TFTP protocol",
|
"boot image via network using TFTP protocol",
|
||||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_TFTPPUT
|
#ifdef CONFIG_CMD_TFTPPUT
|
||||||
static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
19
net/Kconfig
19
net/Kconfig
@ -24,7 +24,7 @@ config NETCONSOLE
|
|||||||
|
|
||||||
config NET_TFTP_VARS
|
config NET_TFTP_VARS
|
||||||
bool "Control TFTP timeout and count through environment"
|
bool "Control TFTP timeout and count through environment"
|
||||||
depends on CMD_NET
|
depends on CMD_TFTPBOOT
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
If set, allows controlling the TFTP timeout through the
|
If set, allows controlling the TFTP timeout through the
|
||||||
@ -35,39 +35,38 @@ config NET_TFTP_VARS
|
|||||||
|
|
||||||
config BOOTP_BOOTPATH
|
config BOOTP_BOOTPATH
|
||||||
bool "Enable BOOTP BOOTPATH"
|
bool "Enable BOOTP BOOTPATH"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
|
|
||||||
config BOOTP_DNS
|
config BOOTP_DNS
|
||||||
bool "Enable bootp DNS"
|
bool "Enable bootp DNS"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
|
|
||||||
config BOOTP_GATEWAY
|
config BOOTP_GATEWAY
|
||||||
bool "Enable BOOTP gateway"
|
bool "Enable BOOTP gateway"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
|
|
||||||
config BOOTP_HOSTNAME
|
config BOOTP_HOSTNAME
|
||||||
bool "Enable BOOTP hostname"
|
bool "Enable BOOTP hostname"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
|
|
||||||
config BOOTP_PXE
|
config BOOTP_PXE
|
||||||
bool "Enable BOOTP PXE"
|
bool "Enable BOOTP PXE"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
|
|
||||||
config BOOTP_SUBNETMASK
|
config BOOTP_SUBNETMASK
|
||||||
bool "Enable BOOTP subnetmask"
|
bool "Enable BOOTP subnetmask"
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
depends on CMD_NET
|
|
||||||
|
|
||||||
config BOOTP_PXE_CLIENTARCH
|
config BOOTP_PXE_CLIENTARCH
|
||||||
hex
|
hex
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
default 0x16 if ARM64
|
default 0x16 if ARM64
|
||||||
default 0x15 if ARM
|
default 0x15 if ARM
|
||||||
default 0 if X86
|
default 0 if X86
|
||||||
|
|
||||||
config BOOTP_VCI_STRING
|
config BOOTP_VCI_STRING
|
||||||
string
|
string
|
||||||
depends on CMD_NET
|
depends on CMD_BOOTP
|
||||||
default "U-Boot.armv7" if CPU_V7 || CPU_V7M
|
default "U-Boot.armv7" if CPU_V7 || CPU_V7M
|
||||||
default "U-Boot.armv8" if ARM64
|
default "U-Boot.armv8" if ARM64
|
||||||
default "U-Boot.arm" if ARM
|
default "U-Boot.arm" if ARM
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
obj-y += checksum.o
|
obj-y += checksum.o
|
||||||
obj-$(CONFIG_CMD_NET) += arp.o
|
obj-$(CONFIG_CMD_NET) += arp.o
|
||||||
obj-$(CONFIG_CMD_NET) += bootp.o
|
obj-$(CONFIG_CMD_BOOTP) += bootp.o
|
||||||
obj-$(CONFIG_CMD_CDP) += cdp.o
|
obj-$(CONFIG_CMD_CDP) += cdp.o
|
||||||
obj-$(CONFIG_CMD_DNS) += dns.o
|
obj-$(CONFIG_CMD_DNS) += dns.o
|
||||||
ifdef CONFIG_DM_ETH
|
ifdef CONFIG_DM_ETH
|
||||||
@ -24,7 +24,7 @@ obj-$(CONFIG_CMD_NFS) += nfs.o
|
|||||||
obj-$(CONFIG_CMD_PING) += ping.o
|
obj-$(CONFIG_CMD_PING) += ping.o
|
||||||
obj-$(CONFIG_CMD_RARP) += rarp.o
|
obj-$(CONFIG_CMD_RARP) += rarp.o
|
||||||
obj-$(CONFIG_CMD_SNTP) += sntp.o
|
obj-$(CONFIG_CMD_SNTP) += sntp.o
|
||||||
obj-$(CONFIG_CMD_NET) += tftp.o
|
obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
|
||||||
|
|
||||||
# Disable this warning as it is triggered by:
|
# Disable this warning as it is triggered by:
|
||||||
# sprintf(buf, index ? "foo%d" : "foo", index)
|
# sprintf(buf, index ? "foo%d" : "foo", index)
|
||||||
|
Loading…
Reference in New Issue
Block a user