I want to keep the original kext where it is so future system updates don't have issues if Apple decides to update the system kext, but I also want to automatically load Daniel's improved driver every boot, so I wrote a StartupItem to take care of it for me.
These instructions require a working knowledge of using Terminal and CLI editors like vi or emacs.
- open Terminal and make a new directory called TwoFingerScrolling.
- Use your favorite editor to create a new shell script in the new directory, also called TwoFingerScrolling. Paste the following content into the script:
# Load Daniel Becker's modified Trackpad Driver on recent PowerBooks and iBooks
# This is released under a BSD license.
# By J. P. Block <firstname.lastname@example.org>
# When you are done testing, comment out the line above this, and uncomment the next line
# Check to make sure we have a patched driver to load, or bad things will happen when we unload
# the original driver and can't find the patched driver to replace it.
f [ ! -d $TFSKEXT ]; then
ConsoleMessage "No patched AppleADBMouse.kext found."
case "$1" in
ConsoleMessage "Loading Two Finger Scrolling"
# make sure the permissions are correct on it before we load it
chown -R root:wheel $TFSKEXT
kextunload -b com.apple.driver.AppleADBMouse && kextload $TFSKEXT
ConsoleMessage "Stopping Two Finger Scrolling"
/usr/bin/logger "Stopping Two Finger Scrolling"
kextunload $TFSKEXT && kextload /System/Library/Extensions/AppleADBMouse.kext
- StartupItems also need a plist file to work. Create a file in the directory you created called StartupParameters.plist and paste the following contents into it:
Description = "Two Finger Scrolling";
Provides = ("TwoFingerScrolling");
Requires = ("Network");
OrderPreference = "Last";
start = "Starting Two Finger Scrolling";
stop = "Stopping Two Finger Scrolling";
restart = "Restarting Two Finger Scrolling";
- chown +rx TwoFingerScrolling/TwoFingerScrolling We have to mark the script as executable, or it won't work.
- Copy the AppleADBMouse.kext you downloaded from Daniel's site into the TwoFingerScrolling directory.
- sudo chown -R root:wheel ./AppleADBMouse.kext
Do NOT move this into /Library/StartupItems yet! We want to make sure it is working and you have all your permissions correct before trying to boot with the new StartupItem, or it will kernel panic your system every time you boot.
To test it, close all your applications except Terminal, then, in Terminal, cd into the TwoFingerScrolling directory you've been working in and do sudo ./TwoFingerScrolling start
If you have done everything right, you should now be able to do two finger scrolling. If you haven't, your computer just crashed, and you should be glad you didn't set it up to load the broken StartupItem every boot.
Presuming it worked, you can now install it as a boot item.
- In Terminal, type ls /Library/StartupItems. If it tells you there is no such file or directory, do sudo mkdir /Library/StartupItems
- cd to the directory containing the TwoFingerScrolling directory you made and filled in the previous set of instructions.
- type sudo mv TwoFingerScrolling /Library/StartupItems/TwoFingerScrolling
- UPDATE: edit the script per comments so TFSKEXT is set to the correct directory, /Library/StartupItems/TwoFingerScrolling to find the modified kext. If you do not edit the script, it will not load your new driver.
- Finally, we have to get LoginWindow to wait for the new kext to load, or you're going to have a kernel panic if you touch the trackpad as the switchout takes place. To do this, edit /System/Library/StartupItems/LoginWindow/StartupParameters.plist and change the line Requires = ("Disks", "SecurityServer"); to Requires = ("Disks", "SecurityServer", "TwoFingerScrolling");
Your system is now set up to automatically load the new driver every boot.
Post a Comment