The Linux Wacom Project
SourceForge.net Logo

Linux Wacom Project HOWTO

3.9 - Building (usb)hid.ko (for kernel 2.6)






In the linuxwacom-0.8.0-3.tar.bz2 file, you will find hid-core.c, which have special exceptions for wacom. This file is not built by default, so you will need to reconfigure the package and run make again.

Note, for kernel 2.6.18 and later, no need to build hid any more. For other kernels, refer to Testing Tablet Detection to see if you need to build hid or not.

You need to configure usbhid as a module under your kernel source tree before configuring linuxwacom.

On some distributions, Mandrake or Mandriva included, the (usb)hid.ko driver that located in the kernel modules directory appears to be compressed. You need to run gzip on the module and copy (usb)hid.ko.gz instead.

[jej@ayukawa wacom]$./configure --enable-hid --with-kernel=your-kernel-src-dir
...
  BUILD OPTIONS:
              hid.o - yes
...

Kernel 2.6.11 and 2.6.12 are in src/2.6.11. Kernels 2.6.16 and 2.6.17 are handled in src/2.6.16. Kernels 2.6.18/19/20/21/22 are in src/2.6.18. All the other kernels are processed in its own src/2.6.x. New 2.6 directories will be created when compatibility issue occurs.

For those who like to build everything from the source tree, please skip the make and install steps below. Scroll down to the end of this page to see the steps with light blue background.

If everything works properly, you'll see the following from the make:

[jej@ayukawa linuxwacom]$ make
...
Making all in 2.6.9
make[3]: Entering directory `/home/jej/linuxwacom/src/2.6.9'
    Building linuxwacom drivers for 2.6 kernel.
make -C /usr/src/linux M=/home/jej/linuxwacom/src/2.6.9
make[4]: Entering directory `/home/jej/linux-2.6.9'
  LD      /home/jej/linuxwacom/src/2.6.9/built-in.o
  CC [M]  /home/jej/linuxwacom/src/2.6.9/hid-core.o
  CC [M]  /home/jej/linuxwacom/src/2.6.9/hid-input.o
  LD [M]  /home/jej/linuxwacom/src/2.6.9/usbhid.o
  Building modules, stage 2.
  MODPOST
  CC      /home/jej/linuxwacom/src/2.6.9/usbhid.mod.o
  LD [M]  /home/jej/linuxwacom/src/2.6.9/usbhid.ko
make[4]: Leaving directory `/usr/src/linux'
...

Then, use the following steps to install the driver:

[jej@ayukawa linuxwacom]$su
[jej@ayukawa linuxwacom]#cd src/2.6.9
[jej@ayukawa 2.6.9]#cp usbhid.ko /lib/modules/your-kernel-ver/kernel/drivers/usb/input
[jej@ayukawa 2.6.9]#reboot

This part is for those who want to manually build the kernel drivers from source tree. If you already followed the steps above, you can move on to next page.

Please backup your related kernel files first then copy the source from the related linuxwacom directory to the source tree and rebuild the kernel. An example for kernel 2.6.9 is as following:

[jej@ayukawa linuxwacom]$ cp /usr/src/linux/drivers/usb/input/hid-core.c /usr/src/linux/drivers/usb/input/hid-core.c.2.6.9
[jej@ayukawa linuxwacom]$ cp src/2.6.9/hid-core.c /usr/src/linux/drivers/usb/input/
[jej@ayukawa linuxwacom]$ cd /usr/src/linux
[jej@ayukawa linux]$ make
[jej@ayukawa linux]$ su
[jej@ayukawa linux]# make install
[jej@ayukawa linux]# make modules_install
[jej@ayukawa linux]# reboot







Copyright (C) 2002-2008 - LinuxWacom -Last updated September 1, 2008
This website and its contents are licensed under the GNU FDL.