iPod Mini

I call my iPod Midget (it asked for a name). It's a green, "Windows" (ie. FAT32 formatted) iPod Mini v1 (4GB). I use it at work (connected to a Windows machine) and at home (connected to Luksusdyret). Despite Apple's claims in their FAQ, it works fine.

I have "upgraded" to an iPod Shuffle. Midget is now used by my wife.

Connecting to Linux

There's a problem connecting Midget to many Linux distros. One I tried was my work machine which runs SuSE 9.0. Yellow Dog Linux 3.0.1 is also affected.

Original material: http://www.linuxquestions.org/questions/showthread.php?postid=1197015#post1197015

In my case I'm using a mini iPod with USB2, but the same problem (and solution) probably applies to the firewire interface or newer generation large iPods, but I don't have either of these to test.

To make a long story short, you can solve the problem by disabling the feature CONFIG_EFI_PARTITION in your kernel and rebuilding the kernel. This problem could potentially happen with both 2.4 and 2.6 kernels.

A longer story follows and perhaps someone can come up with a more sensible solution for the long run.

The iPod looks like a removable disk drive to the host computer. When it is attached to the computer, the mini iPod reports a capacity of 7999488 512-byte sectors (or about 4GB). This turns out to be wrong for whatever reason. The mini iPod only really has 7999376 sectors and it exaggerates by 112 sectors. The other quality of the iPod is that if the computer attempts to read a sector greater than the actual capacity but less than the reported capacity, the iPod will dutifully report an I/O error, but it won't respond to any future requests until you unplug/plug the iPod.

This creates a fragile situation where the host computer can croak the iPod by reading one of these 112 tacitly illegal sectors. If you ask me, this is an Apple bug (or maybe a bug of their disk supplier or firewire/USB interface supplier), but a bug nonetheless.

So, when a new disk is presented to the linux kernel, linux first goes out and tries to find the partition table for the disk. Usually this is the first sectors of the disk (traditional microsoft partition table we've been using for 20 years), but there are also a number of other types of partition tables. The kernel uses a heuristic to look for different types of partition tables and the kernel configuration specifies which partition types are attempted.

The "EFI" partition table is a new type of partition table that is part of the "extensible firmware initiative", this is a good thing for the future. I don't know anything about EFI partition tables, except that as part of looking for an EFI table linux goes out and reads the last few sectors of the disk (sector 7999480 in the case of a mini iPod). The kernel looks for an EFI partition before looking for an old fashioned MSDOS partition table and this croaks the iPod. If you disable support for EFI partition tables (CONFIG_EFI_PARTITION) the mini iPod will work fine. I don't know of a quick fix short of rebuilding the kernel.

Of course, once it's working, previous advice about setting up hotplug correctly and having the right /etc/fstab entries and such apply, but the iPod is just great under linux and gtkpod is a fantastic program for managing the iPod.

I hope this helps.

The instructions I used (for building a 2.4.21-260 kernel) are:

  1. Install the kernel source from the distro with YAST
  2. Check for any updates (since the distro source won't match your running kernel if you've installed updates)
  3. Clean out any previous builds
    cd /usr/src/linux
    make mrproper
    
  4. mrproper kills the include directory so you need to fix it up again
    ( cd ../linux-2.4.21-260-include/default; tar cf - include ) | tar xf -
    
  5. copy a known good .config file to /usr/src/linux. There is a good one at /boot/
    cp /boot/config-2.4.21-260-default .config
    
  6. Edit .config and
    • Change the line that says
          CONFIG_EFI_PARTION=y
      
      to
          # CONFIG_EFI_PARTITION is not set
      
    • Change CONFIG_CFGNAME to "noefi" (so the "default" kernel is not replaced)
  7. Build the kernel
    make dep
    make
    make modules
    make modules_install
    make install
    
  8. If you have problems (I got a missing efi_* symbol in fs/fs.o) use make [menu|x]config and just disable "Advanced Partition Types" (under File Systems -> Advanced).
  9. Fixup your bootloader (eg. edit /boot/grub/menu.lst and check the /boot/vmlinuz symlink).

A similar process (without the SuSE-specific bits) should work on other distros.

Changing Icons

I wrote iPodIcons so that I could change the icons on my iPod with a nice GUI. So far I haven't killed it.