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

Re: Newbie: where to place src files for compilation



"Holger Wiechert" <holger.wiechert@web.de> writes:
> I just need a tip about where to place source files.
> I downloaded the kernel sources (kernel-source-2.4.18)
> and the kernel-headers (kernel-headers-2.4.18-bf.2.4) via dselect.
> So they are now in /usr/src. I read somewhere that it's not a good
> idea to place them directly below /usr/src.
> Can anyone give me a good hint where to put (extract) the sources
> and how the final directory structure should look like?

Anywhere you want.  I happen to use $HOME/src for some things and
/usr/local/src for others.  (The place I use /usr/local/src it's
because /usr/local is on a larger partition.)  If you're installing
external kernel modules (ALSA, OpenAFS, lm-sensors, ...), those also
come in tarballs in /usr/src; if you're unpacking them somewhere else,
you need to set MODULE_LOC to point to that directory (default is
/usr/src/modules).

> Is it usually a good approach to manually change the makefile such
> that the compiler will find the headers or is there any better way
> (like using the compiler's search path and only providing a link
> to the sources)?

Probably the best approach is to give the location of the kernel
headers on the command line:

  make KERNEL_LOCATION=/usr/local/src/linux-2.4.19

(Using whatever magic variable for KERNEL_LOCATION is in the Makefile,
and whatever value for it is appropriate.)

Also, if you're building your own kernel, I highly recommend using
kernel-package.  Install the kernel-package package, and read
/usr/share/doc/kernel-package/README.Debian for details.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: