Enable TRIM support for SSD under Mac OS X Lion

YOUR ARE ON YOUR OWN. DO NOT ASK FOR HELP FROM ANYONE!!

1. Patch IOAHCIFamily kernel extensions.

sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

2. Rebuild kernel caches.

touch /System/Library/Caches

3. Reboot. Then About This Mac → More Info → System Report → Serial-ATA. Your SSD should show "TRIM Support: Yes"