mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 00:20:44 +09:00
cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
7f0c3c51c2
commit
a4092dbd81
@ -288,13 +288,26 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
CONFIG_SYS_VXWORKS_SERVERNAME);
|
CONFIG_SYS_VXWORKS_SERVERNAME);
|
||||||
|
|
||||||
tmp = getenv("ipaddr");
|
tmp = getenv("ipaddr");
|
||||||
if (tmp)
|
if (tmp) {
|
||||||
ptr += sprintf(build_buf + ptr, "e=%s", tmp);
|
ptr += sprintf(build_buf + ptr, "e=%s", tmp);
|
||||||
|
tmp = getenv("netmask");
|
||||||
|
if (tmp) {
|
||||||
|
__be32 addr = getenv_ip("netmask").s_addr;
|
||||||
|
ptr += sprintf(build_buf + ptr, ":%08x ",
|
||||||
|
ntohl(addr));
|
||||||
|
} else {
|
||||||
|
ptr += sprintf(build_buf + ptr, " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tmp = getenv("serverip");
|
tmp = getenv("serverip");
|
||||||
if (tmp)
|
if (tmp)
|
||||||
ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
|
ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
|
||||||
|
|
||||||
|
tmp = getenv("gatewayip");
|
||||||
|
if (tmp)
|
||||||
|
ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
|
||||||
|
|
||||||
tmp = getenv("hostname");
|
tmp = getenv("hostname");
|
||||||
if (tmp)
|
if (tmp)
|
||||||
ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
|
ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
|
||||||
|
Loading…
Reference in New Issue
Block a user