Bug#370651: kernel-package: README.modules: "User instructions" are incomplete and misleading
Manoj Srivastava <srivasta@debian.org> wrote:
> The description is fine for header packages and source
> packages that are produced by kernel-package itself. However,
> official header and source packages are incomplete, and are missing
> information useful for compiling third party modules using
> kernel-package. Since the information is removed _after_ make-kpkg
> has created it, I am redirecting this bug report.
Thanks for looking into this.
[...]
> header packages produced by make-kpkg already have this
> directory. This is removed, for some reason, from the official
> header packages, breaking the building of third party modules by end
> users using make-kpkg, or any possibility of just running
> ./debian/rules modules_image directly.
I don't understand this. And I find that I was imprecise in my
description. In fact the prepackaged third-party module sources already
contain a debian directory in their tarball, but don't work
nevertheless. Let's take the (non-free) thinkpad-source package as an
example:
frank@riesling:/usr/src$ tar -xzf thinkpad.tar.gz
frank@riesling:/usr/src$ cd modules/thinkpad/
frank@riesling:/usr/src/modules/thinkpad$ ./debian/rules KSRC=/usr/src/linux-headers-2.6.16-2-686/ binary
make: Nothing to be done for `binary'.
frank@riesling:/usr/src/modules/thinkpad$ ./debian/rules KSRC=/usr/src/linux-headers-2.6.16-2/ binary
make: Nothing to be done for `binary'.
frank@riesling:/usr/src/modules/thinkpad$
It seems to me as if this was rather a bug in the way those third-party
modules are packaged.
>> So this method does not work.
>
> For official kernel header packages, no, since they are
> incomplete.
What's the information that is missing? Is there already a bug report
about that?
>> Since this refers to using official Debian kernels, and it doesn't
>> make sense to recreate the kernel image then, I thought it should
>> also work this way. But it doesn't. First, make-kpkg complains
>> that I need to run at least "make-kpkg debian" first. I did that,
>> but after that include/linux/version.h does not exist, and I get an
>> error message that versions don't match (the one from version.h is,
>> well, the empty string). This is the only point where I think not
>> only README.modules needs adjustment, but also the error message
>> from make-kpkg: It should tell me what I have to run to make the
>> modules_image target actually work.
>
> Err. This has nothing to do with kernel-package,
> include/linux/version.h is created by the kernel buld system, and
> since you are taking a short cut, you are expected to know that make
> oldconfig would create that.
Nice that you expect that from me... In fact I'm sure that I sort of
new this once upon a time; not in the sense that make oldconfig creates
version.h, but in the sense of a rule "always run make oldconfig when
you copied a .config file over". However, I think the description in
the README should be targetted at users who are at least as dumb as I
am: Usually you can tell people "If you don't know how to compile a
kernel, just take the distribution's packaged kernel". But with
third-party modules, that frequently doesn't work, and even newbies need
to compile the modules.
Therefore I think the descriptions should be more explicit here; or
instead refer newbies to tools like module-assistant.
Ooops. And what you said seems to be wrong. I just did:
$ rm -rf linux-source-2.6.16/ modules
$ tar -xjf /usr/src/linux-source-2.6.16.tar.bz2
$ tar -xzf /usr/src/thinkpad.tar.gz
$ cd linux-source-2.6.16/
$ cp /boot/config-2.6.16-2-686 .config
$ make oldconfig
$ ls include/linux/version.h
ls: include/linux/version.h: No such file or directory
$
So make oldconfig does not create version.h.
>> Since I and my computer had enough time, I just compiled a (useless)
>> kernel image along with the modules images, and that worked fine.
>
> Well, that was the default mechanism.
Are you kidding? Why should one compile the complete kernel, when all I
need are some third-party modules?
> I think you ran into a broken header package, or, at least,
> one that is not condusive to building third party modules with
> kernel-package; and so I am redirecting this bug.
The second problem (version.h is not generated by make-kpkg as needed)
happened in a complete kernel source tree, not only with headers.
Regards, Frank
--
Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX)
Reply to: