Re: Building additional kernel drivers with Debian kernel-source
* Otto Wyss wrote:
With the below I see a whole bunch of problems coming to you. I know because I
have encountered some of them with my own package ipw2100 and have been
investigating the situation for some time now. Let's have a close look:
> Installing the kernel-headers package makes this link but I still can't
> build a module. When I do a
>
> make KERNEL_SOURCE=/usr/src/kernel-source-2.4.26
This will never work, since kernel-source-* contains an unconfigured kernel
tree and therefore lacks essential information. You have to use either a
configured kernel-tree (if building against a custom kernel) or a
kernel-headers package (when building against official Debian kernels).
> I get the following:
>
> rm -f linux/drivers/char/fusion/Makefile
> ln -s Makefile-2.4 linux/drivers/char/fusion/Makefile
If your package need header files from linux/driver/* (I can't tell from the
above, but it might be) then you are screwed up as well since the
kernel-headers package does not ship them. As I understood Christoph Hellwig
on that matter the header files under drivers do not belong to the public
kernel API so it is okay for us to not ship them with the header files. I
encountered that for ipw2100 as well which uses ieee802_11.h from
linux/drivers/net/wireless. I worked around it by copying that file from a
recent kernel source to my module source package.
Anyway it seems like a very bad behaviour to delete files there (the Makefile:
rm -f linux/drivers/char/fusion/Makefile). Your package must not mangle with
files from other packages!
> make -C /usr/src/kernel-source-2.4.26 \
> CPPFLAGS="-D__KERNEL__ -I`pwd`/linux/include
> -I/usr/src/kernel-source-2.4.26/include" \
> SUBDIRS=`pwd`/linux/drivers/char/fusion modules
> make[1]: Entering directory `/usr/src/kernel-source-2.4.26'
This looks like the new style of building kernel modules as introduced with
2.6. If I understood all this correctly it is what is commonly referred to as
"kbuild" which now is also available for 2.4. We have this environment
packaged for 2.6 but not for 2.4. I recently talked with Manoj (Maintainer of
kernel-package) on this matter and hope that we will incorporate kbuild in
the future.
So, many problems and I suggest the following:
1) Depend on kernel-headers and not kernel-source
2) Fix your apckage to not use header files from driver/* (if it does).
3) Do not delete anything from the kernel tree (the Makefile as above)
4) Advertise and contribute to getting kbuild support for 2.4
Good luck and Regards,
Sebastian
--
PGP-Key: http://www.mmweg.rwth-aachen.de/~sebastian.ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
Reply to: