[U-Boot] [PATCH] net/bootp: add CONFIG_BOOTP_BOOTFILE
Christian Gmeiner
christian.gmeiner at gmail.com
Tue Jan 14 09:29:31 CET 2014
In some cases the TFTP server provides a bootfile name, which
does not expects our requirements. Make it possible to
not store the TFTP provided bootfile in the environment.
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
README | 4 ++++
net/bootp.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/README b/README
index aea82be..dc5c153 100644
--- a/README
+++ b/README
@@ -1921,6 +1921,10 @@ CBFS (Coreboot Filesystem) support
CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip
environment variable, not the BOOTP server.
+ CONFIG_BOOTP_BOOTFILE - TFTP bootfile will be the bootfile
+ environment variable, not the filename provided by
+ BOOTP server.
+
CONFIG_BOOTP_MAY_FAIL - If the DHCP server is not found
after the configured retry count, the call will fail
instead of starting over. This can be used to fail over
diff --git a/net/bootp.c b/net/bootp.c
index 4300f1c..5e76827 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -106,6 +106,7 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
#endif
NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if !defined(CONFIG_BOOTP_BOOTFILE)
if (strlen(bp->bp_file) > 0)
copy_filename(BootFile, bp->bp_file, sizeof(BootFile));
@@ -117,6 +118,7 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
*/
if (*BootFile)
setenv("bootfile", BootFile);
+#endif
}
static int truncate_sz(const char *name, int maxlen, int curlen)
--
1.7.10.4
More information about the U-Boot
mailing list