Building the latest IEEE1394 kernel drivers (2.6 only)

From FreeBoB

Important remarks =

For advanced users only! Don't do this unless you know what you are doing! This is not nescessary for ordinary users, it's for developers trying to solve kernel level problems.

Don't use a Firewire harddisk or another spb2 device with the drivers compiled using this procedure. The patchsets also include changes to the scsi subsystem, which you are not actually applying.

If you use a kernel that is patched with the -rt patch of Ingo Molnar, you have to extract the ieee1394 related parts of the -rt patch and apply them manually to the new drivers. Otherwise you will get kernel oops'es. If you don't understand the previous sentences, don't bother trying this.

Update procedure

Kernel 2.6 has a mechanism to compile modules for an already installed kernel. This page explains how to compile the newest IEEE1394 modules using this system.

  • First get the kernel source code matching your kernel from kernel.org.
  • Unpack the kernel source code somewhere. Copy the drivers/ieee1394 directory to some temp dir (e.g. ~/tmp/ieee1394-git).
  • Next get the driver patches from http://me.in-berlin.de/~s5r6/linux1394/updates/, Get the merged patchset for your kernel version. For me this is 2.6.14.x/2.6.14.x_ieee1394_v56.patch.bz2. Unbzip2 it into the ~/tmp/ieee1394-git directory
  • Apply the patchset.
cd ~/tmp/ieee1394-git
patch -p3 < 2.6.14.x_ieee1394_v56.patch

There will be some files that fail to be patched, but that's ok: 
 feature-removal-schedule.txt
 sd.c
 scsi_lib.c


  • Change the following line in Makefile:
cmd_oui2c = $(CONFIG_SHELL) $(srctree)/$(src)/oui2c.sh < $< > $@

to:

cmd_oui2c = $(CONFIG_SHELL) $(src)/oui2c.sh < $< > $@
  • Now you can use the following command to compile the modules (in the temp dir):
make -C /lib/modules/`uname -r`/build/ M=`pwd` modules

Installing is done with (as root):

make -C /lib/modules/`uname -r`/build/ M=`pwd` modules_install

If you want to compile for another kernel than the one you have to replace the `uname -r` with the correct version string.

  • To use them you have to remove the 1394 modules (as root)
/sbin/modprobe -r raw1394
/sbin/modprobe -r dv1394
/sbin/modprobe -r ohci1394
/sbin/modprobe -r ieee1394

and then reload them:

/sbin/modprobe -r ohci1394
/sbin/modprobe -r raw1394
/sbin/modprobe -r dv1394
(the ieee1394 module is loaded automatically)
  • You can also load the new modules without installing them into your /lib/xxx/modules tree. I recommend this to test the modules first. You can do this as follows:
/sbin/modprobe -r raw1394
/sbin/modprobe -r dv1394
/sbin/modprobe -r ohci1394
/sbin/modprobe -r ieee1394

/sbin/insmod "./ieee1394.ko"
/sbin/insmod "./ohci1394.ko"
/sbin/insmod "./raw1394.ko"
/sbin/insmod "./dv1394.ko"

(note that now the ieee1394 module isn't auto-loaded)