mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.
This commit is contained in:
parent
549e510df4
commit
f739b33f57
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101112
@ -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;
|
||||
|
@ -209,6 +209,7 @@ net_getparams(sock)
|
||||
{
|
||||
char buf[MAXHOSTNAMELEN];
|
||||
char temp[FNAME_SIZE];
|
||||
struct iodesc *d;
|
||||
int i;
|
||||
n_long smask;
|
||||
|
||||
@ -284,6 +285,14 @@ net_getparams(sock)
|
||||
bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1);
|
||||
}
|
||||
printf("net_open: server path: %s\n", rootpath);
|
||||
|
||||
d = socktodesc(sock);
|
||||
sprintf(temp, "%6D", d->myea, ":");
|
||||
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.hwaddr", temp, 1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user