public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Adriano Cordova <adrianox@gmail.com>
To: u-boot@lists.denx.de
Cc: joe.hershberger@ni.com, rfried.dev@gmail.com,
	jerome.forissier@linaro.org, xypron.glpk@gmx.de,
	ilias.apalodimas@linaro.org, Adriano Cordova <adrianox@gmail.com>
Subject: [PATCH v2 1/7] net: Kconfig: add CONFIG_WGET symbol
Date: Mon, 11 Nov 2024 18:08:55 -0300	[thread overview]
Message-ID: <20241111210901.560691-2-adrianox@gmail.com> (raw)
In-Reply-To: <20241111210901.560691-1-adrianox@gmail.com>

Let net/wget.c and net/lwip/wget.c depend on CONFIG_WGET, and
cmd/wget.c depend on CONFIG_CMD_WGET. This way, the wget code
can be used regardless of whether the wget command is available.

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
---

(no changes since v1)

 cmd/Kconfig       | 5 +----
 net/Kconfig       | 9 +++++++++
 net/Makefile      | 2 +-
 net/lwip/Makefile | 2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 636833646f..8f3ad94089 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2115,11 +2115,8 @@ config CMD_TFTPBOOT
 
 config CMD_WGET
 	bool "wget"
-	depends on CMD_NET
 	default y if SANDBOX
-	select PROT_TCP if NET
-	select PROT_TCP_LWIP if NET_LWIP
-	select PROT_DNS_LWIP if NET_LWIP
+	select WGET
 	help
 	  wget is a simple command to download kernel, or other files,
 	  from a http server over TCP.
diff --git a/net/Kconfig b/net/Kconfig
index 76ab7d91ee..b4bb68dd61 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -244,6 +244,15 @@ config NET_RANDOM_ETHADDR
 	  generated. It will be saved to the appropriate environment variable,
 	  too.
 
+config WGET
+	bool "Enable wget"
+	select PROT_TCP if NET
+	select PROT_TCP_LWIP if NET_LWIP
+	select PROT_DNS_LWIP if NET_LWIP
+	help
+	  Selecting this will enable wget, an interface to send HTTP requests
+	  via the network stack.
+
 config TFTP_BLOCKSIZE
 	int "TFTP block size"
 	default 1468
diff --git a/net/Makefile b/net/Makefile
index 209377aeb2..7c917b318c 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_$(PHASE_)TCP_FUNCTION_FASTBOOT)  += fastboot_tcp.o
 obj-$(CONFIG_CMD_WOL)  += wol.o
 obj-$(CONFIG_PROT_UDP) += udp.o
 obj-$(CONFIG_PROT_TCP) += tcp.o
-obj-$(CONFIG_CMD_WGET) += wget.o
+obj-$(CONFIG_WGET) += wget.o
 
 # Disable this warning as it is triggered by:
 # sprintf(buf, index ? "foo%d" : "foo", index)
diff --git a/net/lwip/Makefile b/net/lwip/Makefile
index f2558f8763..79dd6b3fb5 100644
--- a/net/lwip/Makefile
+++ b/net/lwip/Makefile
@@ -5,4 +5,4 @@ obj-$(CONFIG_CMD_DHCP) += dhcp.o
 obj-$(CONFIG_CMD_DNS) += dns.o
 obj-$(CONFIG_CMD_PING) += ping.o
 obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
-obj-$(CONFIG_CMD_WGET) += wget.o
+obj-$(CONFIG_WGET) += wget.o
-- 
2.43.0


  reply	other threads:[~2024-11-12  2:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 21:08 [PATCH v2 0/7] wget: Expose wget to applications Adriano Cordova
2024-11-11 21:08 ` Adriano Cordova [this message]
2024-11-16 20:33   ` [PATCH v2 1/7] net: Kconfig: add CONFIG_WGET symbol Heinrich Schuchardt
2024-11-11 21:08 ` [PATCH v2 2/7] net: wget: add definition of struct wget_http_info Adriano Cordova
2024-11-16 20:29   ` Heinrich Schuchardt
2024-11-11 21:08 ` [PATCH v2 3/7] net: wget: Add interface to issue wget_requests using wget_http_info Adriano Cordova
2024-11-11 21:08 ` [PATCH v2 4/7] net: wget: integrate struct wget_info into legacy wget code Adriano Cordova
2024-11-11 21:08 ` [PATCH v2 5/7] net: wget: make wget_with_dns return value compatible with its lwip version Adriano Cordova
2024-11-11 21:09 ` [PATCH v2 6/7] net/lwip: wget: put server_name and port into wget_ctx Adriano Cordova
2024-11-11 21:09 ` [PATCH v2 7/7] net/lwip: wget: integrate struct wget_info into wget code Adriano Cordova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241111210901.560691-2-adrianox@gmail.com \
    --to=adrianox@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox