summaryrefslogtreecommitdiff
path: root/cmd/net.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2018-07-04 03:36:42 +0300
committerJoe Hershberger <joe.hershberger@ni.com>2018-07-26 22:08:20 +0300
commitf43308fa0c7834d9707a2c212591275d1e095e50 (patch)
tree2c70d2c73a657c2df736b335b32fd77a2b2bc8ff /cmd/net.c
parent16cf145fd659a01c5db7f286e8c9a4700f736920 (diff)
downloadu-boot-f43308fa0c7834d9707a2c212591275d1e095e50.tar.xz
net: Read bootfile from env on netboot_common()
Instead of depending on a env callback for bootfile, read it explicitly. We do this because the bootfile can be specified on the command line and if it is, we will overwrite the internal variable. If a netboot_common() is called again with no bootfile parameter, we want to use the one in the environment. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'cmd/net.c')
-rw-r--r--cmd/net.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/net.c b/cmd/net.c
index eca6dd8918..89721b8f8b 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -192,6 +192,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
switch (argc) {
case 1:
+ /* refresh bootfile name from env */
+ copy_filename(net_boot_file_name, env_get("bootfile"),
+ sizeof(net_boot_file_name));
break;
case 2: /*
@@ -203,6 +206,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
addr = simple_strtoul(argv[1], &end, 16);
if (end == (argv[1] + strlen(argv[1]))) {
load_addr = addr;
+ /* refresh bootfile name from env */
+ copy_filename(net_boot_file_name, env_get("bootfile"),
+ sizeof(net_boot_file_name));
} else {
net_boot_file_name_explicit = true;
copy_filename(net_boot_file_name, argv[1],