MOL Compiling (cont)

mol-general@lists.maconlinux.org mol-general@lists.maconlinux.org
Thu, 5 Sep 2002 13:44:26 +0200


On Thu, Sep 05, 2002 at 06:55:33AM -0400, Stew Benedict wrote:
> > It's always a good idea to keep the symlink /usr/src/linux up to date with
> > the current kernel source you're using as many programs rely on the headers
> > in the kernel source for compilation.
> > 
> > To create the symlink, use the command; ln -sf /usr/src/linux-2.4.xx
> > /usr/src/linux
> 
> Thsi advice does not always apply these days.  Many distributions now ship
> kernel-headers that were used to build glibc as a seperate package, and
> the kernel-source symlinks no longer exist. In most cases it is better to
> build user-space programs using the same kernel headers that were used for
> your running glibc.
> 
> Stew Benedict

True. I think there is consensus that the system should be set
up as follows:

1. The directories

	/usr/include/linux
	/usr/include/asm

should be the kernel headers used to build glibc. In other words,
these should typically _not_ be symlinks to /usr/src/linux/include/*.

2. /usr/src/linux _may_ be a symbolic link to the currently running
kernel. Many external kernel modules still assumes that this is the
case. Avoiding this practice is however a good idea in my opinion.

3. /lib/modules/2.4.x/build should be a symbolic link to the 2.4.x
source used in building the 2.4.x modules. When a custom kernel
is build, this symlink will be installed during the 'make modules_install'
step. Thus, this step should be perform even if everything essential
is compiled directly into the kernel.

MOL looks for the kernel headers using /lib/modules/2.4.x/build.
If this symlink does not exist or is broken, it tries to use
/usr/src/linux. Usage of /lib/modules/2.4.x/build is much prefered
to /usr/src/linux. In particular, the risk of a version mismatch between
the kernel and the kernel headers is substantially reduced.

(MOL uses /lib/modules/2.4.x/build since 0.9.45 or 0.9.55).

Cheers,

/Samuel