|
Home > Archive > Debian Developers > August 2004 > Building additional kernel drivers with Debian kernel-source
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Building additional kernel drivers with Debian kernel-source
|
|
| Otto Wyss 2004-08-14, 5:50 pm |
| DirectFB requires to build the kernel fusion driver from source. It
therefore needs a symlink "/lib/modules/2.4.26-1-k7/build" which points
to the right location in the the kernel tree. Neither installing the
appropriate kernel-header nor the kernel-source package installs this
symlink. How can I manually add this link?
See
"http://www.directfb.org/mailinglists/directfb-dev/2004/08-2004/msg00047
..html".
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Stephen Cormier 2004-08-14, 5:50 pm |
| On August 14, 2004 10:59 am, Otto Wyss wrote:
> DirectFB requires to build the kernel fusion driver from source. It
> therefore needs a symlink "/lib/modules/2.4.26-1-k7/build" which
> points to the right location in the the kernel tree. Neither
> installing the appropriate kernel-header nor the kernel-source
> package installs this symlink. How can I manually add this link?
>
> See
> "http://www.directfb.org/mailinglists/directfb-dev/2004/08-2004/msg00
>047 .html".
>
> O. Wyss
I do seem to remember reading somewhere that you link the kernel headers
directory to the build one so try ln
-s /usr/src/kernel-headers-2.4.26-1-k7 /lib/modules/2.4.26-1-k7/build.
Stephen
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Martin List-Petersen 2004-08-14, 5:50 pm |
| On Sat, 2004-08-14 at 16:11, Stephen Cormier wrote:
> On August 14, 2004 10:59 am, Otto Wyss wrote:
>
> I do seem to remember reading somewhere that you link the kernel headers
> directory to the build one so try ln
> -s /usr/src/kernel-headers-2.4.26-1-k7 /lib/modules/2.4.26-1-k7/build.
It is not a good idea to do that, because the machine you are building the kernel on doesn't have to be the same
machine, that the kernel-module is intended for.
You have the path to the needed kernel-source or kerne-headers in $(KSRC). Use it. Either
you need to modify DirectFB's makefile or specify the variable on make.
Like: $(MAKE) -C $(CURDIR) KERNELPATH=$(KSRC)
That requires of course, that the makefile is looking for the variable KERNELPATH and let that override the path
to the symlink instead.
Kind regards,
Martin List-Petersen
| |
| Stephen Cormier 2004-08-14, 5:50 pm |
| On August 14, 2004 01:38 pm, Martin List-Petersen wrote:
> On Sat, 2004-08-14 at 16:11, Stephen Cormier wrote:
>
> It is not a good idea to do that, because the machine you are
> building the kernel on doesn't have to be the same machine, that the
> kernel-module is intended for.
>
> You have the path to the needed kernel-source or kerne-headers in
> $(KSRC). Use it. Either you need to modify DirectFB's makefile or
> specify the variable on make.
>
> Like: $(MAKE) -C $(CURDIR) KERNELPATH=$(KSRC)
>
> That requires of course, that the makefile is looking for the
> variable KERNELPATH and let that override the path to the symlink
> instead.
>
> Kind regards,
> Martin List-Petersen
Please do not CC me I read this list obviously and did not ask for it
when offering information I had read somewhere to help the OP.
Stephen
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Otto Wyss 2004-08-16, 5:59 pm |
| > On August 14, 2004 10:59 am, Otto Wyss wrote:
>
> I do seem to remember reading somewhere that you link the kernel headers
> directory to the build one so try ln
> -s /usr/src/kernel-headers-2.4.26-1-k7 /lib/modules/2.4.26-1-k7/build.
>
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
I get the following:
rm -f linux/drivers/char/fusion/Makefile
ln -s Makefile-2.4 linux/drivers/char/fusion/Makefile
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'
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.
make[1]: Leaving directory `/usr/src/kernel-source-2.4.26'
make[1]: *** [modules] Error 1
make: *** [all] Error 2
Doesn't have the normal kernel-sources packages module support enabled?
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Sebastian Ley 2004-08-16, 5:59 pm |
| * 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/~se....ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Otto Wyss 2004-08-17, 5:55 pm |
| > * 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:
>
Thanks Sebastian for your fine description of the problem.
> 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
>
All I want is to build the fusion kernel driver from DirectFB
"http://www.directfb.org" to work with the Debian kernel 2.4.26. How can
I do this the simplest and fastest way? I don't need the correct
solution as long as it works since I need this driver for testing. Any
working hack is welcomed.
> 1) Depend on kernel-headers and not kernel-source
Okay.
> 2) Fix your apckage to not use header files from driver/* (if it does).
Not possible the fusion kernel driver isn't my package.
> 3) Do not delete anything from the kernel tree (the Makefile as above)
There shouldn't be _any_ other fusion driver in the kernel tree
> 4) Advertise and contribute to getting kbuild support for 2.4
???
In the reasoning behind the kernel packages Debian seems to have
forgotten that someone want's to test a driver. Okay it might make sense
to remove linux/driver/* for the package but then there has to be a
description somewhere (where?) how this can be achieved by other means.
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Sebastian Ley 2004-08-17, 5:55 pm |
| * Otto Wyss wrote:
> All I want is to build the fusion kernel driver from DirectFB
> "http://www.directfb.org" to work with the Debian kernel 2.4.26.
Ah, all right. I misunderstood your intentions, I thought you were packaging
some kernel module (as this would have been ontopic on -devel ;-) )
> How can I do this the simplest and fastest way? I don't need the correct
> solution as long as it works since I need this driver for testing. Any
> working hack is welcomed.
Hm, in this case I would perhaps grab kernel-source-2.4.26 (*),
copy /boot/config-2.4.26-$WHATEVERARCHVERSION to .config in that directory
and make oldconfig. You might need to do a make dep, I don't know. Then you
can use kernel-source-2.4.26 to build against.
This is untested and comes without warranty, good luck ;-)
Regards,
Sebastian
(*) Yeah, I know I told you to take kernel-headers instead but I was lead be
false assumptions on your intentions ;-)
--
PGP-Key: http://www.mmweg.rwth-aachen.de/~se....ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Otto Wyss 2004-08-17, 5:55 pm |
| > * Otto Wyss wrote:
>
>
> Ah, all right. I misunderstood your intentions, I thought you were packaging
> some kernel module (as this would have been ontopic on -devel ;-) )
>
I agree to help me solve this problem might be a little off topic but
that the standard Debian kernel package isn't usable in this case is
_on_topic_ :-( .
>
> Hm, in this case I would perhaps grab kernel-source-2.4.26 (*),
> copy /boot/config-2.4.26-$WHATEVERARCHVERSION to .config in that directory
> and make oldconfig. You might need to do a make dep, I don't know. Then you
> can use kernel-source-2.4.26 to build against.
>
> This is untested and comes without warranty, good luck ;-)
>
Thanks a lot I'll try it.
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Matijs van Zuijlen 2004-08-18, 5:58 pm |
| On Tue, Aug 17, 2004 at 10:12:35PM +0200, Otto Wyss wrote:
> Thanks a lot I'll try it.
The kernel-build-* packages are probably what you want. They're
specifically meant for building external modules for the stock debian
kernels. You'll also need to install the corresponding kernel-headers-*,
but you have that, I think. Be sure to read the README.Debian file.
HTH,
--
Matijs van Zuijlen
| |
| Otto Wyss 2004-08-18, 5:58 pm |
| > The kernel-build-* packages are probably what you want. They're
> specifically meant for building external modules for the stock debian
> kernels. You'll also need to install the corresponding kernel-headers-*,
> but you have that, I think. Be sure to read the README.Debian file.
>
>From the description kernel-build should but I still get
rm -f linux/drivers/char/fusion/Makefile
ln -s Makefile-2.4 linux/drivers/char/fusion/Makefile
make -C /lib/modules/2.4.26-1-k7/build \
CPPFLAGS="-D__KERNEL__ -I`pwd`/linux/include
-I/lib/modules/2.4.26-1-k7/build/include" \
SUBDIRS=`pwd`/linux/drivers/char/fusion modules
make[1]: Entering directory `/usr/src/kernel-headers-2.4.26-1-k7'
make[1]: Leaving directory `/usr/src/kernel-headers-2.4.26-1-k7'
make[1]: *** No rule to make target `modules'. Stop.
make: *** [all] Error 2
To make sure I've clean system I first removed any kernel-xxx Package
(except kernel-image of course) and then installed kernel-build hoping
all the dependences work => the same result.
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Sebastian Ley 2004-08-18, 5:58 pm |
| * Otto Wyss wrote:
> To make sure I've clean system I first removed any kernel-xxx Package
> (except kernel-image of course) and then installed kernel-build hoping
> all the dependences work => the same result.
As I already said: We have no kbuild environment for 2.4 packaged. The
kernel-build-2.4.c packages just depend on all kernel-header files for all
arches for a specific debian kernel version.
Sebastian
--
PGP-Key: http://www.mmweg.rwth-aachen.de/~se....ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Otto Wyss 2004-08-19, 5:58 pm |
| > As I already said: We have no kbuild environment for 2.4 packaged. The
> kernel-build-2.4.c packages just depend on all kernel-header files for all
> arches for a specific debian kernel version.
>
And there seems to be no kernel-build-2.6.x package. Back to hand made
then.
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Matijs van Zuijlen 2004-08-22, 6:11 pm |
| On Thu, Aug 19, 2004 at 05:42:32PM +0200, Otto Wyss wrote:
> And there seems to be no kernel-build-2.6.x package. Back to hand made
> then.
I was surprised to see this, since I have kernel-build-2.6.7-powerpc
installed. It turns out they only exist for powerpc. Sorry for giving such
useless advice .
--
Matijs van Zuijlen
| |
| Sebastian Ley 2004-08-22, 6:11 pm |
| * Otto Wyss wrote:
>
> And there seems to be no kernel-build-2.6.x package. Back to hand made
> then.
For 2.6 it will work with kernel-headers-2.6.x. It contains the kbuild
environment (partially in an extra package kernel-kbuild-2.6-x, on which the
kernel-headers packages for 2.6 depend).
Sebastian
--
PGP-Key: http://www.mmweg.rwth-aachen.de/~se....ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Otto Wyss 2004-08-22, 6:11 pm |
| > For 2.6 it will work with kernel-headers-2.6.x. It contains the kbuild
> environment (partially in an extra package kernel-kbuild-2.6-x, on which the
> kernel-headers packages for 2.6 depend).
>
Unfortunately there's _no_ kernel-kbuild-2.6.7 package, there are only
for 2.6.5 and 2.6.6. On the other side there isn't a kernel-image-2.6.6
nor -2.6.5 while there is a kernel-source-2.6.7 and -2.6.6.
Another question is the dependences. kernel-kbuild-2.6.6 depends only on
libc6 while kernel-build-2.4.26 depends on the related kernel-header
packages.
IMO it would make sense to either have all releated packages of a kernel
version or none at all. I hope when Debian/sarge is released this is
corrected.
O. Wyss
--
How to enhance your code, see "http://freshmeat.net/projects/wxguide/"
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
| |
| Sebastian Ley 2004-08-22, 6:11 pm |
| * Otto Wyss wrote:
>
> Unfortunately there's _no_ kernel-kbuild-2.6.7 package, there are only
> for 2.6.5 and 2.6.6. On the other side there isn't a kernel-image-2.6.6
> nor -2.6.5 while there is a kernel-source-2.6.7 and -2.6.6.
No, if you truely want to understand the situation I suggest examining the
packages yourself.
For each and every kernel version $VER there is a kernel-headers-$VER package.
This is true for 2.4 and 2.6 kernels and these packages contain the header
files, which you need to build external modules. kernel-build-2.4.x is
nothing more than a dependency on all kernel-headers-2.4.x-extra, where extra
are the arch specific kernel header versions.
To make kernel development easier, kbuild was invented. Don't ask me what
exactly it does in detail. One beneift is, that it incorporates all kernel
module building logic, so that module developers just have to set some
variables and then call a Makefile from the kernel. Which is exactly what the
module you want to build does.
kbuild is a collection of Makefiles and scripts. The Makefile stuff is
incorporated in the kernel-headers-2.6.x packages, while the scripts (being
API stable and arch independant) are in a separate package kernel-kbuild-2.6
on which the kernel-headers-2.6.x pakcages depend. So this kbuild stuff is
packaged for 2.6 kernels, and you get it for free and automatically and
magically by installing the appropriate kernel-headers-2.6.x package. For 2.4
this stuff is not packaged, so the module building logic must be present in
the corresponding module's Makefile and if it isn't, you can't build it
against kernel-headers packages for 2.4.
> IMO it would make sense to either have all releated packages of a kernel
> version or none at all. I hope when Debian/sarge is released this is
> corrected.
They are. Of course we do not mirror each and every kernel version but only
the latest few, as you might guess is reasonable considering the space a
single version with all arch and variants consumes.
Sebastian
--
PGP-Key: http://www.mmweg.rwth-aachen.de/~se....ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E F6DB 97E0 3309 9FD6 E3E6
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|
|
|
|