Subject: building -current (was Re: reproducible kernel panic w/ 2.0RC4MP)
To: Tim Kelly <hockey@dialectronics.com>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: netbsd-docs
Date: 11/08/2004 18:29:40
[ Originally at port-macppc, added netbsd-docs to Cc:, since this seems to
be a problem with online documentation ]

> > Finish doing what? You should build the tools first.
> 
> I thought I was doing that.
> >From http://www.netbsd.org/Documentation/current/#using-anoncvs
> 
> "Building NetBSD from source
> (assuming you have an up-to-date NetBSD binary snapshot, and source in
> /usr/src, on your machine already; further assuming your BSDOBJDIR
> should be /usr/obj):
> 
> To build userland the first time:
> 
> # mkdir /usr/obj
> # cd /usr/src
> 
> # ./build.sh -O /usr/obj -D /usr/NetBSD-new-build -T /usr/tools build
> # ./build.sh -O /usr/obj -D /usr/NetBSD-new-build -T /usr/tools
> # install=/
> 
> 
> When you build your system for the first time using build.sh, a set of
> tools for future use of compilations will be built, too. Any subsequent
> compilation should reuse the already compiled tools, and thus take less
> time."
> 

That's probably OK. But, if the only thing you want to do is to wire down
one SCSI device, then why do you compile -current? I'm just curious.

> 
> > See http://www.netbsd.org/Documentation/current/#updating, note that
> > you can do step#4 (building the kernel) before step#3 (building
> > distribution). Then you will have a -current kernel and you can try it
> > without having a-current userland.
> 
> Yes, but I have been unable to get into releng.netbsd.org for several
> days. The connection keeps getting refused. This has prevented me from
> obtaining the tarballs and updating this way, so I was following the
> instructions for "Tracking NetBSD-current with anoncvs." I had been able
> to get one tarball, sys.tgz, before and did unpack that one, but I ran
> cvs update -dP Saturday and it appeared to have moved or updated several
> files. Other than that, everything came in via cvs.

The building process should be completely independent of the way you
obtained the source. At the web page, the instructions for building are
duplicated, once at "Updating an existing system" and for the second time
under "Tracking NetBSD-current with anoncvs", every time they are a bit
different. This seems confusing and generally wrong.

> 
> I can not say that I have an up-to-date binary snapshot, as the most
> recent build date from ftp.fr.netbsd.org for macppc is not the most

I do not think that you need an up-to-date binary snapshot. (If your
snapshot was up-to-date, you would not need to update it at all...). This
sentence is IMHO also confusing and wrong.

> nbconfig was in /usr/tools/bin at one time, according to locate, but it
> is not there now. I believe that some of the problems I've had with the
> kernel panics in MP left the tools tree in an unstable state or I ended
> up blowing it away when I installed RC4 on top of RC2, to unify the
> kernel and installed binaries.

I do not thing that the interface between kernel and userland between RC2
and RC4 changed.

> > so I thought it would be the
> > > same. It seemed like I could skip step 7 if I followed the next four
> > > steps, which I planned to do.
> > 
> > The document says that it is a "good idea" to use the new toolchain,
> > which you have just proved :-)
> 
> So just to clarify, if I do 
> # ./build.sh -O /usr/obj -D /usr/NetBSD-new-build -T /usr/tools build

The documentation for build.sh at /usr/src/BUILDING says:

     The following operations are supported by build.sh:

          build         Build the system as per ``make build''.  This
	  		option implies the obj and tools operations.

> 
> this won't build a new toolchain from the sources?

So, it will.

But, if you just type "config", it won't be used, because it woiil find
the config that you have in your $PATH, not the nbconfig from tools.

> I took the document to describe two separate approaches, in which the
> steps were independent of each other. Is this incorrect?

which document?

Bye	Pavel