[PLUG] Replacement for /usr/src?

Wil Cooley wcooley at nakedape.cc
Wed Jan 17 17:22:23 UTC 2007


On Tue, 2007-01-16 at 15:52 -0800, MJang wrote:
> On Tue, 2007-01-16 at 14:22 -0800, Rich Shepard wrote:
> >    It was suggested by someone on a newsgroup that /usr/src/linux has been
> > deprecated for several years, and kernels and SlackBuilds should be done as
> > a user in another directory rather than there, as root.
> 
> FWIW, Red Hat / Fedora is doing it completely differently. Kernel
> sources now come from source code packages, and are installed in some
> long directory - e.g., my RHEL 5 b2 kernel source is in:
> 
> /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i386/

That's just where the src.rpm installs by default if you install it as
root.  Which you shouldn't, because you shouldn't build as root.  (The
only exception is things like the VMware configuration, which requires
it, but that's because it's driven by a vendor-provided script that
values customer-ease-of-use over security.)

A lot of work has gone into packaging in the last few years to ensure
that packages build as non-root.  See my page here for setting up a
non-root RPM build environment:

http://nakedape.cc/wiki/ApplicationNotes_2fRpmNotes

> To simplify the process of building drivers, there's also a kernel-devel
> package that doesn't include all kernel source - that's installed in:
> 
> /usr/src/kernels/2.6.18-1.2747.el5-i686/
> 
> To make this work with generic stuff that need /usr/src/linux, I've had
> to create it as a soft link to the actual source code directory.
> 
> Don't know if Red Hat's actions mean that /usr/src/linux is being
> deprecated though.

Since 2.4 (and possibly earlier) the convention for out-of-mainline
drivers is to look for the the necessary headers in 
"/lib/modules/$(uname -r)/build", which is usually symlink to wherever
the distro decided to put them.  There are, however, still some broken
build systems that require /usr/src/linux.  (I don't recall now what,
but I recall seeing it in the past couple of years.)

Wil
-- 
Wil Cooley <wcooley at nakedape.cc>
http://nakedape.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20070117/05551386/attachment.asc>


More information about the PLUG mailing list