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

RFC: Potential solution for module building




So, a week or so ago, I asked for comments on some problems I've been
having with the Debian kernel modules build system for modules not in
the Linux source tree.  I'm only dealing with modules for upload to
Debian.  The make-kpkg solution seems to work for individuals building
modules for their own systems, and any areas where it does not work
can probably be addressed with kernel-package bugs.  

I've received a few comments and have also had several informative
side discussions on the issue on IRC and with a few people in person.
I believe I'm ready to  look at proposing a solution to the problem.

First, here is what I want to accomplish:

I want to provide a mechanism for building binary modules for upload
to Debian in an automated manner.  The set of kernel images to build
for needs to be determined by the architecture maintainers.  For
Sparc, modversions are not used so you can probably build one sparc
and one sparc64 module.  For i386, you need to build a module for each
kernel image flavor.  

Ben wants architecture maintainers to be able to build binary
modules to go along with their kernel images.  Herbert implied he'd
rather see module maintainers set up source packages for each
architecture.  I tend to be somewhere in between.   So, it seems that
a solution that allows architecture maintainers to build modules and
that allows module maintainers to build modules would be preferable.
IN most cases you would choose on a module-by-module basis whether it
would be built by the architecture maintainer or by the module maintainer.


I propose creating a set of tools--say call them debmodbuilder--to
help in building modules.  The primary tool would be a script to take
a modules config file and an image-set config  file and to build
modules.

The modules config file would specify which modules to build and which
packages contained the source tarball.  This file would be located in
the debian directory of source packages.  Architecture kernel-image
maintainers could add a module config file to their kernel-image
packages to say what modules to build.  Module maintainers who
maintain modules not build by the kernel-image maintainers could
include trivial module config files in the debian directory of their source
package to identify that their module should be built.  A sample of
what a module config file might look like is included near the bottom
of the message.

The image-set config file would specify which kernel images to
build against.  For each image you would specify the kernel
version and subarchitecture.  For example, Herbert's 386 kernel might
specify a version of 2.4.3 and a subarchitecture of 386.  The
subarchitecture is part of the module package name, but not of the
module installation location under /lib/modules.  The kernel config
file would also specify which set of kernel headers to use; this is
required because for some architectures like sparc, kernel headers are
reused for multiple subarchitectures.  This file would be included in
the debian directory of the architecture-specific kernel-image source
package.  It would also be installed as discussed shortly.  A sample
of what this file might look like is included at the end of the
message. 

In addition to potentially using the tool to help build modules, the
kernel image source package would also include a binary package that
depended on all the appropriate  kernel headers and included a copy of
the kernel config file for module builders to use.


This would require kernel image maintainers for architectures with
binary modules to create such kernel image configuration tool.  I'd be
happy to work with people  to help build automation for this into
existing kernel image source packages.  Then, kernel image maintainers
could build any modules they want to build for their arch, as well as
making it is for module builders to build for their arch.

I'd also be happy to write the module building tools:  I envision
tools to:

* Build the module debs given a module and image-set config file,
  integrating the built debs into debian/files.  This could be called
  from the debian/rules file for architecture-specific kernel-image
  source packages and from the debian/rules files for source packages
  that module maintainers maintain to build their modules.

* Generate appropriate build-depends  for module source packages given
  a module config file.  

* Generate depends: line for the binary package including the kernel
  config file given a image-set config file.

* Generate stanzas for debian/control given a image-set and module config
  file set.  I'm not sure this is useful, although it could allow you
  to get the binary line in your source  dsc file right.


Comments?  If I write these tools and they don't suck, will people be
willing to try using them?


Sample modules config file:

Module: openafs # untars into modules/openafs
Source-Package: openafs-modules-source 
TarFile: /usr/src/openafs.tar.gz #sources of module live here
Architecture: i386, sparc, powerpc

Module: something-else
Source-Package: something-else-source
TarFile: /usr/src/something-else.module.tar.gz
Architecture: i386, sparc, powerpc, alpha

Sample image-set config file:

Image: 2.4.4
Subarch: i386
Depends: kernel-headers-2.4.4-i386
Headers: kernel-headers-2.4.4-i386 # path to headers from /usr/src

Image: 2.4.4
subarch: k7
Depends: kernel-headers-2.4.4-k7
Headers: kernel-headers-2.4.4-k7

			   Acknowledgements

I'd like to thank Greg Stark, Ted Ts'o and David Maze for reviewing
this proposal.  Their comments were very useful in finding places
where I had insufficient detail.



Reply to: