From owner-freebsd-stable@FreeBSD.ORG Wed May 4 07:09:39 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6677416A4CE; Wed, 4 May 2005 07:09:39 +0000 (GMT) Received: from 62-15-215-178.inversas.jazztel.es (62-15-215-178.inversas.jazztel.es [62.15.215.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id E535843D2F; Wed, 4 May 2005 07:09:37 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from redesjm.local (orion.redesjm.local [192.168.254.16]) j4479UBu006180; Wed, 4 May 2005 09:09:30 +0200 (CEST) (envelope-from josemi@redesjm.local) Received: from localhost (localhost [[UNIX: localhost]]) by redesjm.local (8.13.3/8.13.3/Submit) id j4479TBj001081; Wed, 4 May 2005 09:09:29 +0200 (CEST) (envelope-from josemi@redesjm.local) From: Jose M Rodriguez To: stable@freebsd.org Date: Wed, 4 May 2005 09:09:28 +0200 User-Agent: KMail/1.8 References: <200504281542.43241.josemi@redesjm.local> In-Reply-To: <200504281542.43241.josemi@redesjm.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200505040909.29085.josemi@redesjm.local> X-AntiVirus: checked by AntiVir Milter (version: 1.1.0-3; AVE: 6.30.0.7; VDF: 6.30.0.155; host: antares.redesjm.local) cc: re@freebsd.org Subject: Re: MFC pxe fixes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2005 07:09:39 -0000 El Jueves, 28 de Abril de 2005 15:42, Jose M Rodriguez escribi=F3: > Hi, > > I note that the long standing bug that prevents do a nfsroot mount > after operate pxeloader in tftp mode is recent solved in -CURRENT > pxe.c > > I think this can be missed for 5.4 REL, but I'll be glad to see this > MFC as time permitting. > I pointing to changes in revs 1.21 and 1.22 of=20 src/sys/boot/i386/libi386/pxe.c In special, rev 1.21, from kan, 7 weeks ago. I can't see this breaking any ABI, but making things work as documented. =20 Tested on RELENG_5_4 as attached patch =2D- josemi =2D-- pxe.diff begins here --- Index: pxe.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/freebsd/src/sys/boot/i386/libi386/pxe.c,v retrieving revision 1.20 diff -u -r1.20 pxe.c =2D-- pxe.c 25 Aug 2003 23:28:31 -0000 1.20 +++ pxe.c 28 Apr 2005 17:49:35 -0000 @@ -27,7 +27,7 @@ */ =20 #include =2D__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/pxe.c,v 1.20 2003/08/25=20 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/pxe.c,v 1.22 2005/04/17=20 21:38:22 wollman Exp $"); =20 #include #include @@ -308,6 +308,7 @@ } setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); + setenv("dhcp.host-name", hostname, 1); } } pxe_opens++; @@ -413,6 +414,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 =3D socktodesc(pxe_sock))) + return; + d->myport =3D htons(--rpc_port); + d->destip =3D rootip; + if ((error =3D nfs_getrootfh(d, rootpath, nfs_root_node.fh)) !=3D 0)=20 + printf("NFS MOUNT RPC error: %d\n", error); + nfs_root_node.iodesc =3D d; +} =20 static void pxe_setnfshandle(char *rootpath) @@ -421,6 +438,14 @@ u_char *fh; char buf[2 * NFS_FHSIZE + 3], *cp; =20 + /* + * 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 =3D=3D NULL) + pxe_rpcmountcall(); + fh =3D &nfs_root_node.fh[0]; buf[0] =3D 'X'; cp =3D &buf[1]; =2D-- pxe.diff ends here ---