tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: building 9.1 kernel with /usr/src elsewhere?



Omnibus reply here.  Thank you, everyone; I have a better understanding
of the actual problem (admittedly that's a low bar, given how little I
understood it before) and two different workarounds.

[Brian Buhrow]

> hello.  I regularly build kernels outside of the /usr/src location.

But does /usr/src exist at the time?

> My technique is to install the source in some location:
> /usr/local/netbsd/src-91, for example, then put my configuration file
> in: /usr/local/netbsd/src-91/sys/arch/<arch>/conf/<conf filename>
> Then
> cd /usr/local/netbsd/src-91/sys/arch/<arch>/conf
> config <CONFIG FILE>
> cd ../compile/<CONFIG>
> make -j 4 >& make.log

I'd prefer to avoid assuming the user who wants to build the kernel can
write into the source directory tree.  You may note the source tree was
(admittedly only by implication) owned by abcxyz but I was doing the
build as mouse.

That said, this does appear to work.  (Well, I didn't use -j, but then,
I practically never do, and the machine I'm doing this on is
single-core.)  I didn't wait for the whole build, but it doesn't fail
fast the way the run that prompted my mail did.

[Taylor R Campbell]

> Does it make a difference if you set
> NETBSDSRCDIR=/home/abcxyz/netbsd-9.1/usr/src when you run make?

Yes, that appears to make the symptom go away.  (I probably would not
have stumbled across that; /usr/src/BUILDING mentions NETBSDSRCDIR only
twice, neither time documenting it, only mentioning it in examples.  It
likely would have taken enough digging to locate the actual culprit for
me to discover it.  But still, it does seem to work.)

> I always build out of my home directory, never /usr/src, but I also
> always use build.sh and the make wrapper it creates [...]

Ugh, I hate using build.sh for small things like individual kernels.
It always (well, far too often, at least) insists on rebuilding make,
which takes significant time on some machines, like my shark, and
requires extra writable filesystem space.  If there's a reasonably easy
way to avoid it, I prefer to.

That said, if NetBSD wants to desupport building even kernels without
using build.sh, that's its choice; what I think of it does't matter.
(But I do think that, in that case, config(1) should be documented as
an internal tool, not intended for use other than by build.sh.)

[Johnny Billquist]

> You should build the kernel using build.sh, [...]

See above.

> Don't try to make things complicated by doing all that stuff by hand.
> :-)

build.sh _is_ the complicated way, to me.  It's a large, complex, and
slow tool I find even less understandable than config(1) and make(1).
It also has way too much "when we want your opinion we'll give it to
you" for my taste.

Which I suppose is just another way of saying that NetBSD, having lost
interest in users like me, is moving even farther in that same
direction.  Sic transit gloria mundi.

I don't squawk much about build.sh because it does bring benefits; the
biggest one I notice is probably painless cross-compiles.  But I'd
never run into this price before.  5.2 doesn't exhibit the misbehaviour
at all, so I couldn't've noticed it except at work, and I think I've
never tried to build a kernel without /usr/src in place before (at work
or not).

[matthew green]

>> make[1]: don't know how to make absvdi2.c. Stop
> what happens if you run "make USETOOLS=no"?

Fast failure, superficially looking like the same one.

[Valery Ushakov]

> Mail-Followup-To: matthew green <mrg%eterna.com.au@localhost>,
> 	Mouse <mouse%Rodents-Montreal.ORG@localhost>, tech-kern%netbsd.org@localhost

Um, why would you think I'd want people to mail followups to _me_?  I
would prefer - though admittedly it's a weak preference, weak enough I
practically never mention it - that people _not_ mail me when they're
already sending to the list.

> The problem is that NETBSDSRCDIR cannot be inferred for a randomly
> located kernel builddir and sys/lib/libkern/Makefile.compiler-rt uses
> it.

In that case, maybe config(1) should write a suitable setting of
NETBSDSRCDIR into the Makefile it generates?  At least when -s is given
with an absolute path?

> Our makefile spaghetti is a bit out of control.

I've felt so often enough myself.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index