summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/nfs.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libstand/nfs.c b/lib/libstand/nfs.c
index e126a85..76a4b8d 100644
--- a/lib/libstand/nfs.c
+++ b/lib/libstand/nfs.c
@@ -387,10 +387,14 @@ nfs_open(upath, f)
{
struct iodesc *desc;
struct nfs_iodesc *currfd;
+ char buf[2 * NFS_FHSIZE + 3];
+ u_char *fh;
+ char *cp;
+ int i;
#ifndef NFS_NOSYMLINK
struct nfs_iodesc *newfd;
struct nfsv2_fattrs *fa;
- char *cp, *ncp;
+ char *ncp;
int c;
char namebuf[NFS_MAXPATHLEN + 1];
char linkbuf[NFS_MAXPATHLEN + 1];
@@ -422,6 +426,16 @@ nfs_open(upath, f)
return (error);
nfs_root_node.iodesc = desc;
+ fh = &nfs_root_node.fh[0];
+ buf[0] = 'X';
+ cp = &buf[1];
+ for (i = 0; i < NFS_FHSIZE; i++, cp += 2)
+ sprintf(cp, "%02x", fh[i]);
+ sprintf(cp, "X");
+ setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
+ setenv("boot.nfsroot.path", rootpath, 1);
+ setenv("boot.nfsroot.nfshandle", buf, 1);
+
#ifndef NFS_NOSYMLINK
/* Fake up attributes for the root dir. */
fa = &nfs_root_node.fa;
OpenPOWER on IntegriCloud