Read on...
After I had posted the first version of this guide, a lot of people mailed me to share their problems and experiences. So this version of the HowTo will reflect the latest changes and suggestions.
The safest FireWire devices to use at the moment are either read-only devices (DVD, CDROM) or harddisk devices. According to various user reports, it is also possible to use FireWire cameras without too much effort. However, I haven't been able to try it for myself yet as I don't have any such devices.
As for the CDROM devices, good news to the owners of CDRW drives. FireWire drivers in the latest kernel versions do no longer make everything crash when trying to burn a CD. Using FireWire CDRW devices should be relatively safe now. I don't know exactly about DVDR drives.
The biggest problem is still to get the drives recognized. In about 1/3 of the cases, the drivers simply don't load correctly and give a I/O Serialization message, meaning in short "No drive found". The classic solution is to reboot and hope it works next time. However, the kernel modules have become way more stable and it is usually safe to try to load and unload them at run time. I wrote a little utility that will try to reload the drivers as often as necessary for the drive(s) connected to get recognized. The utility is a small hack and should not be considered as an everyday solution :P
To use it, download it here, copy it to /usr/bin and as root user do a chmod a+x /usr/bin/mntfw on it, and type mntfw sda (The problem here is that it will reload the drivers until it will find a drive as /dev/sda or bail out as failed after 5 tries, so you will have to know where your drive usually gets connected to (sda, sdb, sdc, etc). I am working on a mntfw auto option but I'm not done yet :)
This HowTo is based on my own experience with a LaCie FireWire harddrive on kernel 2.4.10-ben0 and later. I am currently using kernel 2.4.15-ben0 and I recommend you use that version or newer as it has the latest FireWire updates.
If you follow the following steps, you should be able to get your harddisk or optical drive working.
Step 1) Compiling FireWire support into the kernel
It is preferable not to compile it in, but rather to compile it as modules.
For those that do now want to play around with kernel sources, we will provide precompiled kernels soon, so all you'll have to do is to wait a bit.
If you want to learn how to compile your own kernel, a kernel compilation guide is available for both iMacs and iBooks.
For the rest of you, here's what to do. First, you'll have to rsync BenH's current 2.4.x development kernel (2.4.15-ben0 or later). To do so, you'll have to:
1. cd /usr/src/linux
2. rsync -arvz rsync.penguinppc.org::linux-2.4-benh . <- don't forget the dot!
3. Once download is done, do your usual configs with either menuconfig or xconfig
Make sure the following options are compiled as modules:
IEEE 1394 (FireWire) support (EXPERIMENTAL) -> IEEE 1394 (FireWire) support (EXPERIMENTAL)
IEEE 1394 (FireWire) support (EXPERIMENTAL) -> Texas Instruments PCILynx support
IEEE 1394 (FireWire) support (EXPERIMENTAL) -> OHCI-1394 support
IEEE 1394 (FireWire) support (EXPERIMENTAL) -> SBP-2 support
IEEE 1394 (FireWire) support (EXPERIMENTAL) -> RAW IEEE1394 I/O support
Switch Excessive debugging output to "No" (else you will get heaps of logs)
Step 2) Configuring the boot process
Add the following lines to your /etc/modules.conf:
# FireWire support
pre-install ohci1394 modprobe ieee1394
pre-install sbp2 modprobe ohci1394
Then open up your /etc/init.d/boot.local and add:
echo "Enabling FireWire drives..."
/sbin/modprobe sbp2
Okay, that should be it... Now reboot your machine, make sure that your FireWire device is plugged in and turned on.
Step 3) Okay, so where do i find my drive now?
The FireWire drivers will remap each FW device they find to the SCSI interface of the kernel. Thus your FireWire devices will look like they were SCSI devices. They are then accessible as /dev/sda, /dev/sdb, etc.
Once your desktop is fired up again, open a terminal window and do the following to find out where your drive is:
doctomoe@ibook:~ > dmesg | grep ttached
Result will look like:
Attached scsi disk sda at scsi1, channel 0, id 0, lun 0
If you don't get any such message, your drive most probably did not get recognized. You may try again by rebooting or give my mntfw (see above) utility a try. So in my case, my harddrive has been attached to /dev/sda
This is confirmed by pdisk:
root@ibook:/home/doctomoe > pdisk /dev/sda
Edit /dev/sda -
Command (? for help): p
Partition map (with 512 byte blocks) on '/dev/sda'
#: type name length base ( size )
1: Apple_partition_map 'Apple ' 63 @ 1
2: Apple_Driver43*'Macintosh_SL' 128 @ 64
3: Apple_Driver_ATA*'Macintosh_SL' 128 @ 192
4: Apple_FWDriver 'Macintosh_SL' 224 @ 320
5: Apple_Free 'Extra ' 224 @ 544
6: Apple_HFS 'FW1 ' 9774000 @ 768 ( 4.7G)
7: Apple_HFS 'FW2 ' 9774000 @ 9774768 ( 4.7G)
8: Apple_HFS 'FW3 ' 9774000 @ 19548768 ( 4.7G)
9: Apple_HFS 'Shared ' 9779000 @ 29322768 ( 4.7G)
10: Apple_Free 'Extra ' 567 @ 39101768
Device block size=512, Number of Blocks=39102335 (18.6G)
DeviceType=0x1, DeviceId=0x1
Drivers-
1: 90 @ 64, type=0x1
2: 96 @ 192, type=0x701
You can then mount any HFS (simple) partition or any other partition type Linux will recognize using the standard commands.
For instance my partition N# 9, named Shared is a HFS partition I use to exchange files between Linux and MacOS. I can use it like any other Mac partition on Linux once mounted:
root@ibook:/home/doctomoe > mount -t hfs /dev/sda9 /mnt/mac
root@ibook:/home/doctomoe > cd /mnt/mac
root@ibook:/mnt/mac > ls -la
total 1204
drwxr-xr-x 9 root root 17 Oct 12 20:01 .
drwxr-xr-x 4 root root 4096 Aug 28 22:06 ..
-rwxr-xr-x 1 root root 6148 Oct 12 17:04 .DS_Store
drwxr-xr-x 4 root root 5 Oct 12 20:02 .Trashes
dr-xr-xr-x 2 root root 17 Oct 12 20:01 .finderinfo
dr-xr-xr-x 2 root root 17 Oct 12 20:01 .resource
-rw-r--r-- 1 root root 300 Oct 12 20:01 .rootinfo
-rwxr-xr-x 1 root root 307200 Oct 11 20:16 Desktop DB
-rwxr-xr-x 1 root root 2 Oct 11 20:16 Desktop DF
drwxr-xr-x 4 root root 5 Oct 11 20:16 Desktop Folder
-rwxr-xr-x 1 root root 414208 Oct 11 20:16 Norton FS Data
-rwxr-xr-x 1 root root 100 Oct 12 20:04 Norton FS Index
-rwxr-xr-x 1 root root 102400 Oct 11 21:35 Norton FS Volume
-rwxr-xr-x 1 root root 15360 Oct 11 21:35 Norton FS Volume 2
drwxr-xr-x 5 root root 6 Oct 12 20:01 Temporary Items
drwxr-xr-x 4 root root 6 Oct 11 20:16 TheVolumeSettingsFolder
drwxr-xr-x 4 root root 5 Oct 11 20:16 Trash
As you can see, there's not much on it at the moment, hehe :)
If you have the pmud Power Saver daemon installed, it is preferable to unload the FireWire modules before going to sleep and to reload them when waking up from sleep. You can do so by adding:
rmmod sbp2
rmmod ohci1394
rmmod ieee1394
and
modprobe sbp2
to the right spots of your /etc/power/pwrctl or /etc/power/pwrctl-local file, depending on teh distribution you use. I hope this small HowTo will help you to use your FireWire devices. If there are any questions or concerns, don't hesitate to .


