aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/net.c6
-rw-r--r--net/net.c20
2 files changed, 6 insertions, 20 deletions
diff --git a/cmd/net.c b/cmd/net.c
index eca6dd8..89721b8 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],
diff --git a/net/net.c b/net/net.c
index 333102e..1b6781d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -216,26 +216,6 @@ int __maybe_unused net_busy_flag;
/**********************************************************************/
-static int on_bootfile(const char *name, const char *value, enum env_op op,
- int flags)
-{
- if (flags & H_PROGRAMMATIC)
- return 0;
-
- switch (op) {
- case env_op_create:
- case env_op_overwrite:
- copy_filename(net_boot_file_name, value,
- sizeof(net_boot_file_name));
- break;
- default:
- break;
- }
-
- return 0;
-}
-U_BOOT_ENV_CALLBACK(bootfile, on_bootfile);
-
static int on_ipaddr(const char *name, const char *value, enum env_op op,
int flags)
{