My car has a CD player build-in that supports MP3 CDs. However, it’s fairly picky on the format of the disc. I tried to burn a CD using Burn Folder which comes with Leopard, which creates a multistandard disc containing a HFS+, an ISO-9660 with Rock Ridge, and a Joliet with Rock Ridge. While this looks very nice on paper, the car’s CD player was less satisfied: “Error CD”.
Another issue is that the player has no support for M3U-playlists. It does, however, support “albums” (directories), which can be used to emulate playlists. Just add a number prefix to each filename and it’ll work. Placing the same file in multiple playlists/albums/directories is possible, but wastes space. But this can be worked around.
The ISO9660 file system contains for each file just the start sector and a length. This means that we could use hard links: two filenames pointing to the same data. After some searching, it seems that mkisofs supports this with the -cache-inodes option.
Since I like to change the music I take with me regularly, it should be easy to re-burn the CD with small changes to the content. I accomplished this by making symlinks to the files I wanted on the CD. Multiple symlinks to the same file are detected correctly using this command line:
mkisofs -cache-inodes -f -l -iso-level 2 -J -r -o "$output_file" -V "$volume_name" -v \ "$content_directory"
The above command works with files, hardlinks and symlinks; not with MacOSX aliases. These are only usable by using the Carbon or Cocoa APIs, not via the normal POSIX-interface. This little perl script, stolen from here, tries to dereference an alias. Combined with this bash script, it will convert a directory containing aliases to symlinks.
Normally I just collect a bunch of aliases using finder in directories/playlists. Right before I run the mkisofs command, I convert all aliases to symlinks.