I needed to disable my internal keyboard for a while. What I did was try this:
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
Though that showed an error:
(kernel) Can't unload kext com.apple.driver.AppleUSBTCKeyboard; classes have instances: (kernel) Kext com.apple.driver.AppleUSBTCKeyboard class AppleUSBTCKeyboard has 6 instances. Failed to unload com.apple.driver.AppleUSBTCKeyboard - (libkern/kext) kext is in use or retained (cannot unload).
The way I tried to deal with it was to drag it out. I then dragged it in when I wanted to re-enable the keyboard. So I dragged it in, and issued:
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
And the following error showed up:
TopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext failed to load - (libkern/kext) authentication failure (file ownership/permissions); check the system/kernel logs for errors or try kextutil(8).
I noticed that when I dragged it to the desktop, I gained privileges to the kext. So I tried this to stop the above error:
sudo chown root /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
That had no success in fixing the error and the keyboard did not show up. I know that there is kextutil which might be the new kextload and kextunload as described here. It is a similar question, though the answer is not what I wanted.
If it is possible to reload the keyboard kext with kextutil, I would like a tutorial on that and an explanation to why the authentication failure shows.