diff options
author | bapt <bapt@FreeBSD.org> | 2016-11-16 07:05:42 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-11-16 07:05:42 +0000 |
commit | b17512a2eeb89c9d416bdcb4d18e7c3421d37fd2 (patch) | |
tree | b9cb44dcf15eb32abd83351ff8b59e8dbdc8f8de /sys/boot/i386 | |
parent | 6cdfcd5230da6d451be1e4fdb48eff13b7057301 (diff) | |
download | FreeBSD-src-b17512a2eeb89c9d416bdcb4d18e7c3421d37fd2.zip FreeBSD-src-b17512a2eeb89c9d416bdcb4d18e7c3421d37fd2.tar.gz |
MFC r308477:
make pxeboot consistent with common/dev_net.c
Always define boot.netif.server in kenv in pxeboot
Add "boot.tftproot.server" to kenv when pxeboot uses tftpfs
Change the code order when setting env for TFTP or NFS to be the same as
common/dev_net.c
Reported by: tsoome
Diffstat (limited to 'sys/boot/i386')
-rw-r--r-- | sys/boot/i386/libi386/pxe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index 28046f3..844ebf2 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -311,6 +311,7 @@ pxe_open(struct open_file *f, ...) setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); + setenv("boot.netif.server", inet_ntoa(rootip), 1); if (bootplayer.Hardware == ETHER_TYPE) { sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); @@ -324,12 +325,12 @@ pxe_open(struct open_file *f, ...) printf("pxe_open: server path: %s\n", rootpath); printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip)); - if (netproto == NET_NFS) { + if (netproto == NET_TFTP) { + setenv("boot.tftproot.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); + } else if (netproto == NET_NFS) { setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); - } else if (netproto == NET_TFTP) { - setenv("boot.netif.server", inet_ntoa(rootip), 1); - setenv("boot.tftproot.path", rootpath, 1); } setenv("dhcp.host-name", hostname, 1); |