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

Re: Packaging a Kernel module (i386 only)



Steve Kemp <skx@debian.org> writes:

>   What is the recommended way to distribute a kernel module?
>
>   I see the options as :
>
>     1.  Making a kernel-patch which could be build with
>         kernel-package.

Is it a patch, or a module?  I'd expect that most things come as one
or the other.

>     2.  Providing it in source form and expecting the user to build it,
>        like the nvidia module.
>     3.  Building on my machine to produce a binary x86 module, and
>        making the binary package Depends: upon kernel-image-2.4.21-386

I'd say that recommended practice is to always produce a -source
package, and to produce binary module packages if it's practical.  The
-source package should contain only documentation and a tar file in
/usr/src, which unpacks to a directory under modules/.  (So,
/usr/src/foo.tar.gz contains modules/foo/.)  The unpacked source is
then a valid Debian source tree which can be built with kernel-package
('make-kpkg modules-image'); see the kernel-package documentation for
what this entails.

Actually building modules for the stock Debian kernels takes some
effort.  I have code to do it in the lm-sensors and i2c source
packages, but it's currently disabled; you're welcome to borrow it.

Rumor is that the module-assistant package can also help with this
situation, but I haven't actually gotten to looking at what it can do.

>   The last one is the one I like best as I wish to distribute my module
>  on multiple machines easily.  I'm assuming that option means that if
>  the "depened" kernel isn't installed at the time the module is
>  installed then it will be pulled in and the current kernel will be
>  removed.

It's unlikely that the current kernel will be removed; Debian readily
supports having multiple kernels installed.  Installing a new kernel
might or might not make that kernel the default, depending on boot
loader configuration and whether the admin chooses to rerun LILO.

>   (This isn't something that I'm currently interested in moving into
>  Debian proper; it's a module for providing "trusted path execution"
>  which I've written and am planning on running on all my boxen).

...in that case, then, you're almost certainly happier building a
module specifically for the kernel(s) you're using.  Building a
general module source package still might be convenient if you find
yourself rebuilding kernels regularly; if you're building a kernel
with kernel-package and you have packaged module source set up, it's
just one more command to build all of the add-on modules.

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



Reply to: