Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Apr 2002 02:24:12 +0100
From:      Brian Somers <brian@freebsd-services.com>
To:        Marcel Moolenaar <marcel@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@freebsd-services.com
Subject:   Re: cvs commit: src/sys/ia64/ia64 autoconf.c 
Message-ID:  <200204070124.g371OCq7013418@hak.lan.Awfulhak.org>
In-Reply-To: Message from Marcel Moolenaar <marcel@FreeBSD.org>  of "Sat, 06 Apr 2002 13:09:08 -0800." <200204062109.g36L98L74346@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> marcel      2002/04/06 13:09:08 PST
> 
>   Modified files:
>     sys/ia64/ia64        autoconf.c 
>   Log:
>   Add prototype for bootpc_init when BOOTP is defined.
>   
>   Revision  Changes    Path
>   1.14      +4 -0      src/sys/ia64/ia64/autoconf.c

I think you should be including nfsclient/nfsdiskless.h rather than 
re-prototyping.  I've quoted a followup that I wrote recently on 
cvs-all (applies to i386 only):

: > On Thu, 4 Apr 2002, Brian Somers wrote:
: > 
: > > > brian       2002/04/04 09:58:21 PST
: > > >
: > > >   Modified files:
: > > >     sys/i386/i386        autoconf.c
: > > >     sys/ia64/ia64        autoconf.c
: > > >   Log:
: > > >   Back out the previous commit.
: > > >
: > > >   In the i386 case, options BOOTP requires options NFS_ROOT as well as
: > > >   options NFSCLIENT.  With *both* the NFS options, a bootpc_init()
: > > >   prototype is brought in by nfsclient/nfsdiskless.h.
: > > >
: > > >   In the ia64 case, it just doesn't work and my change just pushes it
: > > >   further away from working.
: > > >
: > > >   Suggested to be wrong by:       bde
: > > >
: > > >   Revision  Changes    Path
: > > >   1.166     +0 -1      src/sys/i386/i386/autoconf.c
: > > >   1.13      +0 -1      src/sys/ia64/ia64/autoconf.c
: > >
: > > Methinks that options BOOTP hasn't been tested much on non-i386
: > > platforms.  The call to bootpc_init() isn't present on alpha or
: > > powerpc and I'm suspicious about ia64 & sparc64.
: > 
: > I use BOOTP, BOOTP_NFSROOT and BOOTP_NFSV3 options on ia64 and they work
: > fine (I also have NFSCLIENT and NFS_ROOT).
: 
: It seems that BOOTP works ok, but only when certain conditions are 
: met.
: 
: BOOTP on it's own seems to insist on a root device being given by 
: the bootp server at runtime in bootpc_call() - unless BOOTP_TIMEOUT 
: is defined and >0.  This should probably depend on BOOTP_NFSROOT.
: 
: -Werror has broken BOOTP on it's own on some archs due to the missing 
: bootpc_init() prototype:
: 
:   sparc64 declares it's own bootpc_init() prototype in autoconf.c and 
:   never includes nfsclient/nfsdiskless.h.
: 
:   i386 requires NFSCLIENT and NFS_ROOT so that it includes 
:   nfsclient/nfsdiskless.h.
: 
:   ia64 doesn't prototype bootpc_init or include   
:   nfsclient/nfsdiskless.h, so it's *probably* broken by -Werror.
: 
:   alpha and powerpc don't even call bootpc_init() from 
:   cpu_rootconf().
: 
: I have a patch for i386 (attached), but I can't test it with much 
: more than a compile at the moment as I triple-panic:
: 
: panic: Assertion (opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE | MTX_SLEEPABLE | MTX_NOWITNESS | MTX_DUPOK)) == 0 failed at /usr/src/sys/kern/kern_mutex.c:807
: Uptime: 0s
: panic: Assertion mtx_unowned(m) failed at /usr/src/sys/kern/kern_mutex.c:856
: Uptime: 0s
: panic: _sx_xlock (shutdown_post_sync): xlock already held @ /usr/src/sys/kern/kern_shutdown.c:332
: Uptime: 0s
: 
: > -- 
: > Doug Rabson				Mail:  dfr@nlsystems.com
: > 					Phone: +44 20 8348 6160
: 
: -- 
: Brian <brian@freebsd-services.com>                <brian@Awfulhak.org>
:       http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
: Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>
: 
: Index: conf/NOTES
: ===================================================================
: RCS file: /home/ncvs/src/sys/conf/NOTES,v
: retrieving revision 1.1017
: diff -u -r1.1017 NOTES
: --- conf/NOTES	4 Apr 2002 18:01:55 -0000	1.1017
: +++ conf/NOTES	5 Apr 2002 11:46:00 -0000
: @@ -1637,7 +1637,6 @@
:  # Kernel BOOTP support
:  
:  options 	BOOTP		# Use BOOTP to obtain IP address/hostname
: -				# Requires NFSCLIENT and NFS_ROOT
:  options 	BOOTP_NFSROOT	# NFS mount root filesystem using BOOTP info
:  options 	BOOTP_NFSV3	# Use NFS v3 to NFS mount root
:  options 	BOOTP_COMPAT	# Workaround for broken bootp daemons.
: Index: i386/i386/autoconf.c
: ===================================================================
: RCS file: /home/ncvs/src/sys/i386/i386/autoconf.c,v
: retrieving revision 1.166
: diff -u -r1.166 autoconf.c
: --- i386/i386/autoconf.c	4 Apr 2002 17:58:18 -0000	1.166
: +++ i386/i386/autoconf.c	5 Apr 2002 11:28:23 -0000
: @@ -63,16 +63,17 @@
:  #include <sys/mount.h>
:  #include <sys/cons.h>
:  
: -#if defined(NFSCLIENT) && defined(NFS_ROOT)
: -#include <sys/socket.h>
: -#include <net/if.h>
: +#if defined(NFSCLIENT) && defined(NFS_ROOT) && !defined(BOOTP_NFSROOT)
:  #include <net/if_dl.h>
:  #include <net/if_types.h>
: -#include <net/if_var.h>
:  #include <net/ethernet.h>
: -#include <netinet/in.h>
: -#include <nfs/rpcv2.h>
: +#endif
: +
: +#if defined(BOOTP)
: +#include <sys/socket.h>
: +#include <net/if.h>
:  #include <nfs/nfsproto.h>
: +#include <netinet/in.h>
:  #include <nfsclient/nfs.h>
:  #include <nfsclient/nfsdiskless.h>
:  #endif
: Index: nfsclient/bootp_subr.c
: ===================================================================
: RCS file: /home/ncvs/src/sys/nfsclient/bootp_subr.c,v
: retrieving revision 1.36
: diff -u -r1.36 bootp_subr.c
: --- nfsclient/bootp_subr.c	13 Mar 2002 09:23:11 -0000	1.36
: +++ nfsclient/bootp_subr.c	5 Apr 2002 11:53:29 -0000
: @@ -679,7 +679,10 @@
:  		     ifctx = ifctx->next) {
:  			ifctx->outstanding = 0;
:  			if (bootpc_ifctx_isresolved(ifctx)  != 0 &&
: -			    gotrootpath != 0) {
: +#ifndef BOOTP_NFSROOT
: +			    gotrootpath != 0
: +#endif
: +			    ) {
:  				continue;
:  			}
:  			if (bootpc_ifctx_isfailed(ifctx) != 0)
: 
: 
: 
: 

-- 
Brian <brian@freebsd-services.com>                <brian@Awfulhak.org>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204070124.g371OCq7013418>