Subject: Re: Source code nfs share setup
To: Julian Coleman <jdc@coris.org.uk>
From: Andy R <quadreverb@yahoo.com>
List: netbsd-docs
Date: 01/03/2004 17:52:26
--- Julian Coleman <jdc@coris.org.uk> wrote:
> > Can someone direct me to documentation on correct
> > setup for a NetBSD src share for multiple machines
> > building possibly at the same time?
> > 
> > I've been searching and can't find anything. It
> would
> > be nice if this subject was covered in the online
> doc
> > somewhere.
> > 
> > I know NFS fairly well, but I'm wondering if there
> are
> > any "gotchas" specific to this task.
> 
> I think the main thing is to have the source mounted
> read-only on all the
> machines that you do a build on.  This stops an
> accidental write into the
> sources from one machine affecting the others.
> 
> My setup is:
> 
>   NFS server with:
>     /dev/sd0h       /srcs           ffs    
> rw,nodev,nosuid         0       2
>     /srcs/current/src       /usr/src               
> null    ro
>     /srcs/pkgsrc            /usr/pkgsrc            
> null    ro
>     /srcs/xsrc              /usr/xsrc              
> null    ro
>     (/srcs is exported to all machines)
> 
>   NFS clients with
>     server:/srcs/current/src       /usr/src         
>       nfs     ro,-b
>     server:/srcs/xsrc              /usr/xsrc        
>       nfs     ro,-b
>     server:/srcs/pkgsrc            /usr/pkgsrc      
>       nfs     ro,-b
> 
> When I build the world, I set:
> 
>   MAKEOBJDIRPREFIX=/usr/obj/$DESTARCH
>  
> TOOLDIR=$MAKEOBJDIRPREFIX/usr/src/tools/tools.`uname
> -s`-`uname -r`-$ARCH
> 
> where $DESTARCH is the architecture I'm building and
> $ARCH is the local
> architecture (these could be different for cross
> builds, e.g. ARCH=alpha,
> DESTARCH=atari).  This separates all the builds into
> /usr/obj/$DESTARCH,
> as some machines share the same /usr/obj (e.g. all
> the sparcs).
> 
> When I build a package, I set:
> 
>   WRKOBJDIR?=/usr/obj/pkg/${MACHINE_ARCH}
> 
> in /etc/mk.conf, so that all packages are separated
> by architecture.  One
> snag with a read only pkgsrc is that you must do all
> the package fetches on
> the server.  I do this by running:
> 
>   make fetch-list-recursive
> 
> on the packages that I want to build, so that I have
> all the distfiles before
> I start.  Some packages have different files for
> different architectures, so
> you'll also need:
> 
>   make MACHINE_ARCH=$DESTARCH fetch-list-recursive
> 
> to make the list of the other architectures.  I then
> fetch all the files into
> /srcs/pkgsrc/distfiles.  One other way would be to
> have /usr/pkgsrc/distfiles
> be a symbolic link into a shared read-write
> directory.
> 
> J

Thanks a lot, this really helps. I'm now beginning to
build my dreamcast and sparc machines to test it out.
This is going above and beyond my expectations for a
response!

Copying netbsd-docs in case this is something that
someone might want to put on the site. I don't think
there is anything there like this. This is nice for
maintaining a large number of machines from one source
tree.

Andy

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/