summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorYing-Chun Liu (PaulLiu) <paul.liu@linaro.org>2022-11-08 09:17:29 +0300
committerTom Rini <trini@konsulko.com>2022-11-28 21:06:39 +0300
commitcfbae48219fd81f6c9e1a7b5ee160cdd3005f958 (patch)
treecf1e9db0754ad81314df553a1c69c9e1edeef482 /cmd
parenta3bf193bf4ea8703bcf96b1a34713fb2ae87aa39 (diff)
downloadu-boot-cfbae48219fd81f6c9e1a7b5ee160cdd3005f958.tar.xz
net: Add wget application
This commit adds a simple wget command that can download files from http server. The command syntax is wget ${loadaddr} <path of the file from server> Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com> Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig7
-rw-r--r--cmd/net.c13
2 files changed, 20 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 79848cc6ab..a4b6fc6a5d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1812,6 +1812,13 @@ config SYS_DISABLE_AUTOLOAD
is complete. Enable this option to disable this behavior and instead
require files to be loaded over the network by subsequent commands.
+config CMD_WGET
+ bool "wget"
+ select TCP
+ help
+ wget is a simple command to download kernel, or other files,
+ from a http server over TCP.
+
config CMD_MII
bool "mii"
imply CMD_MDIO
diff --git a/cmd/net.c b/cmd/net.c
index addcad3ac1..f6d9f5ea3a 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -125,6 +125,19 @@ U_BOOT_CMD(
);
#endif
+#if defined(CONFIG_CMD_WGET)
+static int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ return netboot_common(WGET, cmdtp, argc, argv);
+}
+
+U_BOOT_CMD(
+ wget, 3, 1, do_wget,
+ "boot image via network using HTTP protocol",
+ "[loadAddress] [[hostIPaddr:]path and image name]"
+);
+#endif
+
static void netboot_update_env(void)
{
char tmp[22];