Index: libi386/pxe.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/libi386/pxe.c,v retrieving revision 1.20 diff -u -r1.20 pxe.c --- libi386/pxe.c 25 Aug 2003 23:28:31 -0000 1.20 +++ libi386/pxe.c 10 Mar 2005 15:29:20 -0000 @@ -413,6 +413,22 @@ /* structure truncated here */ }; extern struct nfs_iodesc nfs_root_node; +extern int rpc_port; + +static void +pxe_rpcmountcall() +{ + struct iodesc *d; + int error; + + if (!(d = socktodesc(pxe_sock))) + return; + d->myport = htons(--rpc_port); + d->destip = rootip; + if ((error = nfs_getrootfh(d, rootpath, nfs_root_node.fh)) != 0) + printf("NFS MOUNT RPC error: %d\n", error); + nfs_root_node.iodesc = d; +} static void pxe_setnfshandle(char *rootpath) @@ -421,6 +437,14 @@ u_char *fh; char buf[2 * NFS_FHSIZE + 3], *cp; + /* + * If NFS files were never opened, we need to do mount call + * ourselves. Use nfs_root_node.iodesc as flag indicating + * previous NFS usage. + */ + if (nfs_root_node.iodesc == NULL) + pxe_rpcmountcall(); + fh = &nfs_root_node.fh[0]; buf[0] = 'X'; cp = &buf[1];