summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-19 12:29:10 -0200
committerRenato Botelho <renato@netgate.com>2016-10-19 12:29:10 -0200
commit02fa2d6083daaf327638f8e0fb9aa0be9bff743a (patch)
tree0552dcf115d54bfc7426ba7339d13bf975963cb9 /sys/boot/i386
parentcb642130dfc50717bb970a104c44aa7690930a38 (diff)
parent3311d8689070efe9e08ded9ba391646ed81fe884 (diff)
downloadFreeBSD-src-02fa2d6083daaf327638f8e0fb9aa0be9bff743a.zip
FreeBSD-src-02fa2d6083daaf327638f8e0fb9aa0be9bff743a.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/libi386/pxe.c35
-rw-r--r--sys/boot/i386/loader/conf.c4
-rw-r--r--sys/boot/i386/pxeldr/pxeboot.88
3 files changed, 27 insertions, 20 deletions
diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c
index 096ebc4..28046f3 100644
--- a/sys/boot/i386/libi386/pxe.c
+++ b/sys/boot/i386/libi386/pxe.c
@@ -288,10 +288,15 @@ pxe_open(struct open_file *f, ...)
bootp(pxe_sock, BOOTP_PXE);
if (rootip.s_addr == 0)
rootip.s_addr = bootplayer.sip;
-#ifdef LOADER_NFS_SUPPORT
- if (!rootpath[0])
+
+ netproto = NET_NFS;
+ if (tftpip.s_addr != 0) {
+ netproto = NET_TFTP;
+ rootip.s_addr = tftpip.s_addr;
+ }
+
+ if (netproto == NET_NFS && !rootpath[0])
strcpy(rootpath, PXENFSROOTPATH);
-#endif
for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
if (rootpath[i] == ':')
@@ -315,17 +320,17 @@ pxe_open(struct open_file *f, ...)
sprintf(mtu, "%u", intf_mtu);
setenv("boot.netif.mtu", mtu, 1);
}
-#ifdef LOADER_NFS_SUPPORT
printf("pxe_open: server addr: %s\n", inet_ntoa(rootip));
printf("pxe_open: server path: %s\n", rootpath);
printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip));
- setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
- setenv("boot.nfsroot.path", rootpath, 1);
-#else
- setenv("boot.netif.server", inet_ntoa(rootip), 1);
- setenv("boot.tftproot.path", rootpath, 1);
-#endif
+ 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);
setenv("pxeboot.ip", inet_ntoa(myip), 1);
@@ -359,10 +364,10 @@ pxe_close(struct open_file *f)
if (pxe_opens > 0)
return(0);
-#ifdef LOADER_NFS_SUPPORT
- /* get an NFS filehandle for our root filesystem */
- pxe_setnfshandle(rootpath);
-#endif
+ if (netproto == NET_NFS) {
+ /* get an NFS filehandle for our root filesystem */
+ pxe_setnfshandle(rootpath);
+ }
if (pxe_sock >= 0) {
@@ -422,7 +427,6 @@ pxe_perror(int err)
return;
}
-#ifdef LOADER_NFS_SUPPORT
/*
* Reach inside the libstand NFS code and dig out an NFS handle
* for the root filesystem.
@@ -533,7 +537,6 @@ pxe_setnfshandle(char *rootpath)
setenv("boot.nfsroot.nfshandlelen", buf, 1);
}
#endif /* OLD_NFSV2 */
-#endif /* LOADER_NFS_SUPPORT */
void
pxenv_call(int func)
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index 38df74d..29ce1e3 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$");
* XXX as libi386 and biosboot merge, some of these can become linker sets.
*/
-#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
-#error "Cannot have both tftp and nfs support yet."
-#endif
-
#if defined(LOADER_FIREWIRE_SUPPORT)
extern struct devsw fwohci;
#endif
diff --git a/sys/boot/i386/pxeldr/pxeboot.8 b/sys/boot/i386/pxeldr/pxeboot.8
index d2ca703..7f57d5a 100644
--- a/sys/boot/i386/pxeldr/pxeboot.8
+++ b/sys/boot/i386/pxeldr/pxeboot.8
@@ -85,6 +85,14 @@ expects to fetch
.Pa /boot/loader.rc
from the specified server before loading any other files.
.Pp
+.Nm
+defaults to a conservative 1024 byte NFS data packet size.
+This may be changed by setting the
+.Va nfs.read_size
+variable in
+.Pa /boot/loader.conf .
+Valid values range from 1024 to 4096 bytes.
+.Pp
In all other respects,
.Nm
acts just like
OpenPOWER on IntegriCloud