Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Disable IR port on new Macs via a startup script System 10.4
Tiger only hintHaving searched high and low for a way to disable the Infrared Port on new Macs, I decided to go ahead and write my own Preference Pane to do so. No sooner had I finished writing it and telling everyone about it, someone pointed out that -- well -- this feature already existed in the Security section of System Preferences. Oops.

However, the general technique is still a useful hint to consider. We simply unload the appropriate kernel driver. In some cases, this might be the only way you can disable a particular device (e.g. the keyboard) or a useful way of disabling a device so a non-Unix savvy user would have trouble re-enabling it.

Let's look at the IR controller as an example. All we need to do is unload the AppleIRController kernel extension, and make sure it stays unloaded. Directly on the command line, this can be done like so:
kextunload /System/Library/Extensions/AppleIRController.kext
Now we just want to persist this across reboots. We can do this with a simple StartupItems script. Finally, we control whether this StartupItems script actually takes any action by adding the following line to /etc/hostconfig. This also provides an easy way of toggling the change on and off:
DISABLEIR=-YES-
To trigger the StartupItems script without needing to reboot, you can just use the SystemStarter tool:
sudo SystemStarter start DisableIR
Of course it's worth being very careful when it comes to messing with kernel drivers. You might disable some critical part of the system that requires you to force reboot, or you might kernel panic your machine. Tread with caution.
    •    
  • Currently 3.50 / 5
  You rated: 5 / 5 (6 votes cast)
 
[15,895 views]  

10.4: Disable IR port on new Macs via a startup script | 7 comments | Create New Account
Click here to return to the '10.4: Disable IR port on new Macs via a startup script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Disable IR port on new Macs via a startup script
Authored by: brw3sbc on Mar 27, '06 10:28:22AM

Hi,

I am unfamiliar with what is being defined as "new Macs", but my old Pismo (PowerBook 500 Firewire) has an IR port. It is disabled by unchecking its listing in my Network Port Configurations in my Network System Preferences. Some long time ago, I reduced the number of odd networking issues by ensuring that I had enabled only the ports associated with the specific "location."



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: Eric3 on Mar 27, '06 11:11:19AM

You're talking about a different class of IR port. The early PowerPC PowerBooks, as well as the original iMac, had built-in IR ports for data transfer / newtorking. These new Macs (MacBook Pro, Intel Mini, Intel iMac) have ports which are used for control of the machine, much like the Performa 5000 and 6000 series.

---
---
Eric3



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: neuralstatic on Mar 27, '06 04:30:52PM

this makes me curious.

i've been removing things i don't want running from the Extensions folder, into an Extensionsoff folder... is there a downside to this kind of thing?

bluetooth and airport are the primary targets, for security at my work location.



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: rdbrown on Mar 27, '06 07:40:05PM

Does this do something different then the "Disable remote control infrared receiver" checkbox in Security Settings in the System Preferences?



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: hagus on Mar 28, '06 09:48:53PM

If you read the hint again, you'll see that no it doesn't. It does, however, serve as an example of those wanting to disable other types of devices via kernel extensions.



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: thoughton on Mar 29, '06 01:17:36AM

Did you even read the hint before subitting your snide comment? Your question was answered in the first sentence.



[ Reply to This | # ]
10.4: Disable IR port on new Macs via a startup script
Authored by: proinsias on Mar 22, '07 09:10:13AM

Two questions:

First of all, I'm assuming that turning off the IR receiver would reduce the power consumption of a MacBook Pro? When I'm running on battery, I turn off everything that I can think of using LocationX, so I would like to add this to my list, but ...

When I run:
sudo /sbin/kextunload /System/Library/Extensions/AppleIRController.kext
I get:
kextunload: unload kext /System/Library/Extensions/AppleIRController.kext failed

Any ideas why?



[ Reply to This | # ]