Permissions & KEXT Caches
I have written the following utility which simplifies and automates the process of repairing permissions and rebuilding kext caches. It will test for and prevent a number of common errors that may arise if the manual method (Which I have discussed further below) is used incorrectly. I personally suggest that you use this utility (instead of doing this manually) to reduce or eliminate the potential for user error & to save time.
Please consult the downloads page for a link to the latest version of pfix.
Further documentation and how to do this manually:
One of the most common problems with Snow Leopard on PC’s is incorrect permissions and improperly built kext caches. While it may not always be necessary it is a good idea to correct permissions and rebuild kext caches anytime you modify your extensions or install software which adds new kexts to your system.
To do this manually open a terminal and enter the following commands to repair the permissions on your “/Extra” directory:
$ sudo chown -R 0:0 /Extra
$ sudo chmod -R 755 /Extra
You may also need to repair the permissions on your “/System/Library/Extensions” directory:
$ sudo chown -R 0:0 /System/Library/Extensions
$ sudo chmod -R 755 /System/Library/Extensions
Now build the Extensions.mkext for /Extra/Extensions in /Extra with the following command.
$ sudo kextcache -v 1 -a i386 -a x86_64 -m /Extra/Extensions.mkext /Extra/Extensions
You may also need to rebuild the Extensions.mkext for the “/System/Library/Extensions” directory:
$ sudo kextcache -v 1 -a i386 -a x86_64 -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions
Then you may reboot your system. Please note that the above examples are assuming you want to repair permissions on your root volume ( / ) if you are repairing the permissions on another volume in your system make sure to adjust the path accordingly.
IMPORTANT NOTE: If running these commands from Tiger it is necessary to delete all kext caches instead of rebuilding them. The kextcache utility on Tiger is unable to build Snow Leopard compatible kext caches and as a result any Snow Leopard system which has these incompatible kext caches will fail to boot. The pfix utility (v2.0) detects the OS X version and will apply these changes automatically.
NOTE: I was originally using the find command to set directories to 755 and files to 644 instead of just chmod -R 755. While that method actually sets the correct permissions for your extensions according to the “OS X Standards” there were some failures reported due to a few kexts containing non-standard binaries that required executable privileges. You will find that the majority of vanilla kexts inside /S/L/E have their directories set to 755 and the files inside of them are 644. Thus this is the ‘proper’ method to use when correcting permissions for most of them. The few that have executable binaries inside of them however, make it impractical to achieve perfection. While this is not absolutely required for them to ‘work’ it is a good practice to learn how to handle unix permissions properly and to not have files set to executable (755) unless absolutely required for their operation.
With that said I am now advising everyone to use the chmod -R 755 method I have posted above and to use diskutil to repair the permissions on your snow leopard installation once you get it up and running. More information can be found on the pfix2.0 release page linked above and in the comments on this page.
Tags: Hackint0sh, OS X, Snow Leopard, Troubleshooting
This entry was posted on Saturday, September 19th, 2009 at 15:37 by Conti and is filed under Working with OS X, myHack Utilities. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

I also ran into an issue with the “load_smbfs” file set to 644, not 755. I couldn’t figure out why I couldn’t mount any SMB shares, and some searching led me to this page. I actually have been using pfix v2.6, and still ran into this issue. Now that I know what causes it, it’s not a big issue.
Thanks for the utilities (and the myhack installer), as I was able to upgrade my hackintosh to Snow Leopard (w/ the chocolate kernel) on my old P4 3.0GHz box.
Hi Conti,
Thanks for your suggestion. I have finally resolved the issue.
Basically I deleted my kexts (as I suspect the NVEnabler 64.kext that I have installed to be cause of the error) and rebuilt the kext cache :)
Cheers
bryan
bryan: My first impression is that this sounds like you need to setup GraphicsEnabler and ensure that it is using the correct pci root.
Hi Conti,
Thanks to your guide (after innumerous searches on the internet), I have been able to successfully set up a dual boot system for Leopard and Win 7 on my P55/Intel Core i5 system.
What baffles me is everytime I start up my pc and selects Leopard as the system to boot, the pc will immediately cease to send signals to my monitor after the “Taking iSuck out of..”/spinning wheel screen. The hard disk LED continues to blink, indicating that there is hard disk activity but nothing happens on my monitor. Only after a second boot will Leopard load successfully after the spinning wheel screen. This happens all the time.
Any idea what went wrong ??
Regards
Bryan
I wrote a nearly identical script myself and debated for awhile over file permissions for kexts. Indeed I also noticed the Apple provided defaults.
Ultimately I decided that kext developers should be trusted to package their releases correctly. For paranoia reasons I do an ownership check and `chmod -R go-rw`on /Extra but that’s it.
If you really want to idiot proof kext installation, another idea is to use magic numbers to set Mach executables to +x and any other type of file to 644. The risk here is that you’re trying to outsmart the distributor of the .kext who may have set a file executable intentionally.
Directories should always be safe to `find ${extra} -type d -exec chmod 755 {} +`
[...] be sure that the cache was fine, I then followed the steps at http://osx86.sojugarden.com/2009/09/permissions-kext-caches/ . Alternately, you could probably just use KextHelper to put the new kext in – I [...]
Justin: As I stated in the Installer documentation I am not personally well versed in the subtle nuances of getting ATI graphics working in OS X. I am an NVidia man myself. But I do suspect this is your issue. If the posts regarding PC EFI and ATI on netkas blog do not help you I’d suggest you see the IRC channel I mentioned on the home page as there are some other people there using ATI that may be able to help you. Additionally there is a #radeonhd channel on that network for ATI specific questions, it is not as active as the snow leopard channel but someone may be able to help you there.
Good luck, please reply back with a solution when you find one :)
Conti,
Thank you for your response. I will make sure to post comments following your guidelines from now on. I downloaded your pfix v2.1.1 and ran it but got the same kernel panic as before. My hardware is listed below. I know this is probably not the right place to ask questions pertaining to things other than permissions. But perhaps i can explain my situation and you can redirect me. I’ve successfully installed SL using a guide posted on lifehacker.com. However I have not been able to achieve full functionality out of my graphics card. I suspect that i need to customize my com.apple.boot.plist and smbios.plist but am uncertain how to do this. Some people have told me that PC EFI 10.5 should do this for me but Im not sure if im doing what i am supposed to. If you have any advice I would greatly appreciate it.
thanks,
spenceju
GIGABYTE GA-EP45-UD3P Intel P45 ATX Intel Motherboard
Intel Core 2 Quad 3.0GHz LGA 775 95W Quad-Core Processor
VGA GIGABYTE|GV-R489OC-1GD 4890 RT Graphics Card
Intel X25-M Mainstream 2.5″ 80GB SATA II MLC Internal Solid state disk
G.SKILL 8GB (4 x 2GB) 240-Pin DDR2 SDRAM DDR2 800
Pioneer CD/DVD Burner Black SATA Model
10/ 100/ 1000/ 2000Mbps PCI Copper Gigabit Network Adapter
[...] , you could easily fix it by booting into another Snow Leopard installation and by running Conti’s pfix script. But what if you don’t have another Leopard/Snow Leopard installation. Well fear not there is [...]