[PATCH 1/2] boot: Add BOOTSCRIPT_DHCP Kconfig option for boot_script_dhcp env

Wadim Egorov w.egorov at phytec.de
Thu May 8 15:14:44 CEST 2025


Introduce a new Kconfig option BOOTSCRIPT_DHCP to allow setting a value
for boot_script_dhcp in the default environment.

Signed-off-by: Wadim Egorov <w.egorov at phytec.de>
---
 boot/Kconfig          | 18 ++++++++++++++++++
 include/env_default.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/boot/Kconfig b/boot/Kconfig
index fb37d912bc9..ed34eff5b7a 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -875,6 +875,24 @@ config BOOTMETH_SCRIPT
 	  This provides a way to try out standard boot on an existing boot flow.
 	  It is not enabled by default to save space.
 
+config USE_BOOTSCRIPT_DHCP
+	bool "Enable default DHCP boot script filename"
+	depends on BOOTMETH_SCRIPT
+	help
+	  Enable this option if you want to set a default value for the
+	  'boot_script_dhcp' environment variable, which is used to fetch a
+	  boot script via TFTP over the network.
+
+	  If unsure, say N.
+
+config BOOTSCRIPT_DHCP
+	string "Default boot script filename (boot_script_dhcp)"
+	depends on USE_BOOTSCRIPT_DHCP
+	help
+	  This option sets the default value for the 'boot_script_dhcp' environment
+	  variable, which is used to fetch a boot script over the network via TFTP.
+	  The script must reside in the top-level directory of the TFTP server.
+
 config UPL
 	bool "upl - Universal Payload Specification"
 	imply CMD_UPL
diff --git a/include/env_default.h b/include/env_default.h
index 60c39f9853f..c72cf123004 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -124,6 +124,9 @@ const char default_environment[] = {
 #ifdef CONFIG_MTDPARTS_DEFAULT
 	"mtdparts="	CONFIG_MTDPARTS_DEFAULT		"\0"
 #endif
+#ifdef CONFIG_BOOTSCRIPT_DHCP
+	"boot_script_dhcp="	CONFIG_BOOTSCRIPT_DHCP	"\0"
+#endif
 #ifdef CONFIG_EXTRA_ENV_TEXT
 	/* This is created in the Makefile */
 	CONFIG_EXTRA_ENV_TEXT
-- 
2.34.1



More information about the U-Boot mailing list