Subject: Re: Exporting /usr/src
To: Andy R <quadreverb@yahoo.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 03/29/2002 20:52:09
On Fri, 29 Mar 2002, Andy R wrote:

> Thanks for your help, it turns out that when I removed
> the -alldirs flag from /etc/exports it then worked.

Sorry -- I can't explain that.

> So
> here's what I have in my /etc/exports file:
>
> /usr/src -maproot=root sparky
>
> I guess my real question is: What is the proper way to
> export the /usr/src tree so I can build from other
> boxes?

There's more than one way to do it. If your situation permits you to
use -maproot=root, then the nfs mount is just like any locally mounted
partition (except for the sharing thing).

> I assume things get written to this directory
> from the client (for sure when I build the kernel), so
> what happens when I want to build again from another
> client? Do I have to clean the source tree on the nfs
> server every time?

First of all, "make build" normally cleans the tree, unless you set
UPDATE=yes. Even with UPDATE, if your clients are all the same
platform, then it doesn't matter. If they're different archs, you can
set 'OBJMACHINE=yes' in "/etc/mk.conf", and the objdirs will take the
form "obj.<machine_arch>". You can do even more with MAKEOBJDIRPREFIX,
but I've never used that. (See /usr/share/mk/bsd.README for details.)

Or, you can set BSDOBJDIR to a local directory, and then only a
symlink gets created in the shared sources. That works fine, too.
Sharing the kernel build dirs isn't much of a problem, since each
client will probably have it's own kernel.

For "xsrc", you need write privs on the source dir, and it's a good
idea to run "make cleandir" on the old platform before switching to
the new one. Fortunately, there's not as much to build there as for
the base system, nor does it change as often.

Frederick