Motion - How To Patch PWC 9 PWCX 9 On Kernel 2dot 6

How To Patch pwc 9.0.x / pwcx 9.0 on Kernel 2.6.7 (and probably later)

The following how-to was originally posted on the Motion Mailing List.

Note that there is now a newer pwc 10.0.4 which is fully GPL and does not need pwcx. See http://www.saillard.org/pwc/ and KennethsCustomKernelWithPWC10andK8000


PWC/PWCX 9.0 on kernel 2.6 mini-howto

You have to re-build your kernel to use it but it is not too bad.

First download the new drivers.

Make sure you have downloaded your kernel sources. Either as a package for your current kernel or as a stock kernel from kernel.org.

I will now describe step by step what you need to do.

Kernel sources are assumed to be in the directory /usr/src/linux and the kernel is 2.6.X. I used 2.6.7 stock. The paths and the kernel build is not the same for 2.4. But you should be able to figure out how to anyway. It is mainly for kernel 2.6.X it is relevant because using pwcx requires a kernel rebuild now with pwc 9.

If you do not have kernel sources there are two ways to get them.

  • Install the kernel source packages (rpm, debian ...)
  • Or install a fresh stock kernel.
A stock kernel can be downloaded from www.kernel.org.

Once downloaded change working directory to /usr/src and run

tar -xvjf /path_to_your_downloaded_tar/linux-2.6.version.tar.bz2
tar -xvjf /home/fooguy/linux-2.6.7.tar.bz2

Make a symbolic link called linux pointing to the new directory

ln -s /usr/src/linux-2.6.7 /usr/src/linux

The two pwc packages are assumed untared in /usr/local but this actually can be any place since their location is temporary.

You untar with tar -zxvf pwc-9.0.2.tar.gz for example

So I now assume you have the directories:

  • /usr/local/pwc-9.0.2
  • /usr/local/pwcx

And finally I assume that your distro is a Fedora/RedHat or at least has its files the same places. And that you have a normal 32-bit x386 type PC.

First we must ensure that we can build a kernel with the same configurations as your current distro kernel.

Your current kernel configuration is found in /boot/config-VERSION where VERSION is your current kernel version. If you have already built your own kernel before - skip this step.

Copy this file to /usr/src/linux to a file called .config

cp /boot/config-VERSION /usr/src/linux/.config

Next we need to copy all the new pwc/pwcx source files to the Kernel source tree.

cp /usr/local/pwc-9.0.2/2.6/*.[ch] /usr/src/linux/drivers/usb/media
cp /usr/local/pwcx-9.0/pwcx/*.[ch] /usr/src/linux/drivers/usb/media
cp /usr/local/pwcx-9.0/x86/libpwcx.a  /usr/src/linux/drivers/usb/media

Now we have to patch the kernel sources to add the pwcx option. Change working directory to /usr/src/linux and run the patch:

cd /usr/src/linux
patch -p1 -s < /usr/local/pwcx-9.0/patch-2.6.4

Start up your kernel configurator

make menuconfig or make xconfig

Go the USB section; you will find a "PWCX decompressor entry" and enable it as module (enter an m)

Save/Exit

If you have already built a kernel before you only have to run 'make modules' and 'make modules_install'

Otherwise the entire kernel build step is.

make bzImage

make modules

open a beer and take some time to enjoy life

make modules_install

make install

When you boot you now have an additional kernel in the menu. Choose this and you should be ready to roll.

Once booted you can manually load the pwc and pwcx with

modprobe pwc

modprobe pwcx

The new pwcx seems to be sneaking in the binary driver without creating the "tainting the kernel" error so no more insmod --force is needed. Nice.

For those using Motion:

Remember that if you use this new pwc/pwcx driver you should replace the pwc-ioctl.h file in the motion source tree by the one that comes with the pwc 9.0.2 package. (default from Motion 3.1.17)

-- KennethLavrsen - 15 Oct 2004


Topic revision: r1 - 15 Oct 2004, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.