Subject: Re: objdirs and readonly /usr/src
To: Andreas Kahari <ak+netbsd@freeshell.org>
From: Johnny Billquist <bqt@update.uu.se>
List: current-users
Date: 02/21/2004 14:32:10
On Sat, 21 Feb 2004, Andreas Kahari wrote:

> On Sat, Feb 21, 2004 at 01:35:15PM +0100, Johnny Billquist wrote:
> > On Sat, 21 Feb 2004, Valeriy E. Ushakov wrote:
> >
> > > On Sat, Feb 21, 2004 at 09:25:20 +0000, Dick Davies wrote:
> > >
> > > > I mount /usr/src readonly over NFS to my current box.
> > > > When I try to build tools, I get this error:
> > > >
> > > >  cc  -O -o nbmake *.o
> > > >  #    objdir  /usr/obj/tools
> > > >  ln: obj: Read-only file system
> > > >
> > > > Which I assume is because build.sh can't make symlinks in /usr/src.
> > > >
> > > > Have I missed something?
> > > > I'm starting to think rsync would be less hassle :)
> > >
> > > Hmm, I build from readonly sources all the time.  What do you have in
> > > your mk.conf?   Sounds like you have some *OBJ* var set in there.
> >
> > No, he have a silly problem that there is no one obvious right solution
> > to.
> >
> > As a part of building, you want to create symlinks from the whole /usr/src
> > tree to somewhere local. So you create an obj symlink in every directory,
> > pointing at somewhere local, writeable. But the creation of the actual
> > symlink itself requires write access to the source directory.
> >
> > Once all the obj symlinks have been created, you don't need write access
> > to /usr/src, but in order to set things up, you do need write access.
>
> So a union-mounted local directory on top of the NFS-mounted
> directory doesn't work in NetBSD either (I had problems with
> it in OpenBSD)?  I can't test it right now as I'm away from my
> machines.

Ah, sorry. Yes, that should work as well. I haven't tried it, but that is
the point of union mounts.
I usually have all the obj symlinks created locally, and then I don't have
to worry. (Since I build on both the machine that exports /usr/src as well
as a number of machines NFS-mounting it, the obj symlinks normally already
exist anyway for me.)

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol