lkml.org 
[lkml]   [2001]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to build modules outside the kernel tree? [Was: Proper way to release binary driver?]
Eric W. Biederman wrote:
> So for solutions (That I know of):
>
> With recent kernels with modules_install a:
> /lib/modules/`uname -r`/build
> directory is created, that effectively points to the kernel source
> tree the modules were built with. With the 2.4.x currently this is a
> symlink so but it should be o.k. It needs to be checked that the
> distributors are using this directory appropriately, but it looks like
> a good thing to support. Longterm this looks like a solution
> to the problem, of how to get kernel headers to match a kernel.
>
> This should even has a chance to work with people who build their own
> kernel.
>
> With Redhat and many derivatives as a fallback there is kernel source in
> /usr/src/linux that does it's best to match the currently running
> kernel.
>
> Using either of those locations for the source to kernel headers it
> should be possible to build a package that as part of it's install
> process compiles appropriate drivers, at least for most of the cases.
>
> I suspect there is enough work in this for someone to create a support
> package, that included makefiles and all the rest to assist in
> building a drivers on various platforms. Any takers?

I have done exactly this, which I've used for a few device drivers. The
Makefile can usually find the kernel source tree for the running kernel
by looking in the sensible places, it knows where to install modules,
and it is even able to get the right $(CFLAGS) from a configured kernel
tree.

The package includes a "compat.h", which rather like other similar files
("kcompat24.h") provides a 2.4-series API that works with all kernels
going back to 2.0, on all platforms I hope. (I grepped the patches to
find out when each API change that I'm interested in occurred). This
doesn't include network driver API though, just your basic PCI search
and read/write/ioctl/mmap/get_user interfaces.

The nice result is that, from a single source .tar.gz, "make" builds and
installs a driver module written with (more or less) the 2.4 API on any
kernel from 2.0 to 2.4, and the driver source is not full of ifdefs.

I suppose you're wondering where to get these files. Mail me and I'll
see if there's much demand.

cheers,
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.063 / U:24.168 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site