Ringtones.plist.hold
From AlexWiki
Note: This article has been obsolete for some time now. Adding ringtones to your iPhone is now as easy as renaming a non-protected AAC audio file (.m4a) so it has the extension ".m4r" and dragging it into iTunes. The file itself can be converted any way you like. Ringtones can apparently also be added by other means as well, as evidenced by their abundance in the Cydia repositories. - Hillie 11:57, 11 March 2009 (EDT)
SendSong will allow you to take songs and put them as ringtones on the iPhone.
Only thing is, whenever you resync iTunes will blow away the Ringtones.plist file.
When you make a ringtone with SendSong, the app makes a Ringtones.plist.hold file as well as the Ringtones.plist file. Thanks Erica! With this and a little help from cron you can stop iTunes from blowing away your Ringtones.
This method is much better than my first late-night hack.
keepSong.sh
This script will check to see if Ringtones.plist is a symlink to Ringtones.plist.hold. If it isn't, and only if it isn't, it will remove the file and remake the symlink. Otherwise, it does nothing. This should be very efficient to run every minute in cron. When iTunes replaces the file, this will detect it on the next minute and fix it.
SSH into the iPhone and type:
cat > keepSong.sh
and then paste the following script into the window and press Control-C.
#!/bin/sh
[ ! -L /var/root/Media/iTunes_Control/iTunes/Ringtones.plist ] && {
cd /var/root/Media/iTunes_Control/iTunes
rm -f Ringtones.plist
ln -s Ringtones.plist.hold Ringtones.plist
}
Now make it executable:
chmod 755 keepSong.sh
You'll also want to edit /etc/fstab and take out the noexec text from the second line.
Running from Cron
SSH into the phone (using PuTTY or Terminal), login as root and type this:
EDITOR=nano crontab -e
then it will load up the GNU Nano editor. Type or paste the following into the editor:
* * * * * ~/keepSong.sh
it must ALL BE ONE LINE.
Now press Control-X and press Y to save. It will show you a crazy filename, this is normal! Just press enter to save the file.
Now every minute on the dot it will replace Ringtones.plist with the one from SendSong, effectively making it impossible for iTunes to mess it up.
After a sync you will have to wait at most one minute and at least a second before this happens, depending on when you synced and how much time there is to the next minute.

