# Get a Mac IPod to work on x86 w/ native HFS+ support

## VisualPhoenix

Ok guys... so until I get my ipod fixed and functional sometime tomorrow I'll let you all know exactly what I did to get it working...

Step 1: 

```
emerge sys-kernel/pfeifer-sources/pfeifer-sources-2.4.20.1_pre12.ebuild
```

Step 2 : 

```
download patches-2.4.21-pfeifer-r1_pre4.tar.bz2
```

Step 3: 

```
un-Bzip patches-2.4.21-pfeifer-r1_pre4.tar.bz2 and copy out the 017_hfsplus patch
```

Step 4 : 

```
Download http://www.ardistech.com/hfsplus/hfsplus-20030702.tar.gz
```

Step 5: 

```
Untar hfsplus-20030702.tar.gz
```

Step 6: 

```
Copy hfsplus-20030702/hfsplus/* files to /usr/src/linux-2.4.20-pfeifer-r1_pre12
```

Step 7: 

```
patch -p1 -d ../location/of/hfsplus_patch/017_hfsplus < /usr/src/linux-2.4.20-pfeifer-r1_pre12
```

Step 8 : 

```
cd /usr/src/linux-2.4.20-pfeifer-r1_pre12/fs/hfsplus
```

Step 9 : 

```
nano -w inode.c

 line 89 of inode.c:

-if (PageActive(node->page[i])) {

+if (PageActiveAnon(node->page[i])) {

```

Step 10 : 

```
cd /usr/src/linux-2.4.20-pfeifer-r1_pre12/kernel/
```

Step 11: 

```
nano -w ksyms.c

between line 280 and 281 of kernel/ksyms.c:

 

 EXPORT_SYMBOL(set_page_dirty);

 +EXPORT_SYMBOL(mark_page_accessed);

 EXPORT_SYMBOL(vfs_readlink);

```

Step 12: 

```
cd /usr/src/
```

Step 13 : 

```
rm linux
```

Step 14 : 

```
ln -s /usr/src/linux-2.4.20-pfeifer-r1_pre12 linux
```

Step 15 : 

```
Build kernel with File Systems>HFSPLUS built as a module
```

Step 16 : 

```
Enable Mac Parition Support in File Systems>Partition Types>Mac Partition Support
```

Step 17 : 

```
Save Kernel
```

Step 18 :

```
 make dep && make clean bzImage modules modules_install
```

Step 19 : 

```
mount /boot
```

Step 20 : 

```
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinux-pfeifer-2.4.20
```

Step 21 : 

```
nano -w /etc/lilo.conf
```

Step 22 : 

```
Add necessary lines for new kernel

MINE looks like:

# Linux bootable partition config begins

        image = /boot/vmlinuz-pfeifer-2.4.20-pre12

        initrd = /boot/initrd-pfeifer-2.4.20-pre12.gz

        root = /dev/sda3

        label = Pfeifer-2.4.20

        read-only # read-only for checking

#       #root = /devices/discs/disc0/part3

```

Step 23: 

```
run /sbin/lilo
```

Step 24: 

```
REBOOT AND GOOD LUCK!
```

[/code] 

NOTE!!!! WARNINGS!!!!  It is important you do the following each time you wish to mount or unmount your ipod!!!! NOTE!!!! WARNINGS!!!!

I make a dumb little script that does the following (I KNOW THIS CAN BE REVISED TO BE BETTER!!):

FILE: mount_ipod.sh

```

echo "Cleaning up modules if they are running..."

rmmod sbp2

rmmod ohci1394

rmmod ieee1394

rmmod hfsplus

echo "Now mounting the IPOD... I hope its plugged in... You have 5 seconds."

sleep 1

modprobe hfsplus

sleep 4

modprobe ieee1394

sleep 5

modprobe ohci1394

sleep 10

mount /mnt/ipod

```

FILE: umount_ipod.sh

```

echo "Unmounting Ipod"

umount /mnt/ipod

sleep 4

rmmod sbp2

sleep 4

rmmod ohci1394

sleep 4

rmmod ieee1394

```

IT IS IMPORTANT TO NOTE THAT ALL IEEE1394 DRIVERS MUST BE REMOVED BEFORE CONNECTING YOUR IPOD!

actually, the real kicker is ochi1394 -- i find that it crashes quite a bit if you only rmmod sbp2, remove the ipod, and expect it to act alright when you put it back in... As a precaution I suggest unloading all ieee1394 drivers before pluging in your ipod, then modprobing them -- and for unmounting, unmounting the drive, removing all modules, THEN unplugging the IPod.

GOOD LUCK AND HAPPY TESTING!Last edited by VisualPhoenix on Thu Aug 07, 2003 4:07 am; edited 1 time in total

----------

## VisualPhoenix

Also note that pfeifer-sources-2.4.21.1_pre4.ebuild has hfsplus support pre-built into the kernel... This guide is for people like me who want 2.4.20 support.

----------

## VisualPhoenix

That reminds me... If doing

```
mount -t hfsplus /dev/sdXx /mnt/ipod 
```

returns errors about a bad superblock it is possible to correct it however i'm working on getting patches for the mac version of fsck and testing it...

WHATEVER YOU DO IF IT SAYS THAT YOU FAILED TO UNMOUNT THE IPOD AND TO RUN FSCK ON THE DRIVE DO NOT

I REPEAT

DO NOT RUN THE FOLLOWING COMMANDS! 

WARNING DO NOT RUN 

```
 mount -nw -t hfsplus -o remount /dev/sdXx 
```

WARNING DO NOT RUN 

```
 mount -t hfsplus -force  /dev/sdXx 
```

 DO NOT INSTALL  

```
 emerge hfsplusutils 
```

HFSPLUSUTILS can TANK your drive... IF you emerge it ONLY use it if you believe you have corrupted the superblock and want to try in desperation to back up your system. Its dubious that you will have success

----------

## Kihaji

Don't forget, for ease of use the difference between a Mac Ipod and a Windows Ipod is just a format away.

----------

## VisualPhoenix

true -- however apple users get newer firmware updates  :Smile: 

----------

## jerry arns

Just a note to say that kernel 2.6.1 as HFS+ support and that there is no need to patch the kernel anymore.

I have a gentoo ppc on a iBook, and use my HFS+ iPod 15Gig with gtkpod and it works very well.

----------

## uglyman

 *Quote:*   

> WARNING DO NOT RUN
> 
> Code:
> 
>  mount -nw -t hfsplus -o remount /dev/sdXx
> ...

 

Hi I am trying to get my new ipod working with hfs+.  I agree whole heartedly with the above mentioned advice, as I have screwed up my ipod several times with hfsplusutils this week. but my question is, if we get that error about cleanly unmounting.... what SHOULD we do? I am using the hfsplus support in the 2.6.9 (I think, I am at work now though) kernel. It seems that some people dont  have the problem every time like I do and I am wondering if it is because I am using USB instead of firewire (gonna get a firewire card this week).

----------

## uglyman

hmm found this. I am about to try it. hopefully my house doesn't burn down:

http://svn.exactcode.de/t2/trunk/package/base/linux26/99-hfsplus.patch

had to do it by hand... but it was pretty straight forward.

----------

## uglyman

working great so far!.... hope I am not speaking too soon.   :Very Happy:   :Very Happy:   :Very Happy:   :Very Happy: 

----------

