PDA

View Full Version : Why do some kexts refuse to load?


DocShadow
08-22-2009, 04:32 PM
Playing around trying to optimize my system. I've noticed that sometimes a kext will not load if it's in E/E but will is it's in S/LE. Other times a kext will not load no matter which directory you place it in.

I move a kext to E/E or intall to S/LE and then run Kext Utility and Disk Utility.

Any ideas why and how to fix?

lanceomni
08-22-2009, 06:00 PM
Kexts - Kernel Extensions

1. Should reside in the /System/Library/Extensions folder
2. Should have permissions set to 755
3. Should have the User & Group set to Root & Wheel
4. Should be updated in the Extensions.mkext
5. KextHelper
6. Backing up

2. Permissions
Permissions can be set by running the following in Terminal:sudo su
chmod -R 755 /System/Library/Extensions/insertkextnamehere.kextsudo su grants you privileges to make these changes. Kext are actually folders with files inside so -R applies these permissions recursively.

3. Ownerships
Ownerships can be set by running the following in Terminal:sudo su
chown -R root:wheel /System/Library/Extensions/insertkextnamehere.kextsudo su grants you privileges to make these changes.

4. Extensions.mkext (/System/Library/Extensions.mkext)
OSX builds a cache of all the required kexts for your system to boot. This shortens the boot process. This cache needs to be rebuilt with the new kext.

Some kexts will start effecting the system before a reboot. This depends on the kext and also that there was not an existing one of the same name or one which causes conflict. OSX should see that the Extensions folder had been modified and should rebuild the cache.

You can rebuild the cache on restart by:1. Running the touch command on all the extensions in the /S/L/E folder. This resets the timestamp of the files and OSX should see this and prompt a rebuilding.sudo su
touch /system/Library/Extensions2. Alternatively you could use the -f boot-flag on startup as this also prompt a rebuild.
3. The simplest way to have the cache rebuilt is to remove Extensions.mkext and restart. You can simply drag it into the trash or run: rm -Rf /System/Library/Extensions.mkextI prefer to do all three. Redundancy!

5. Kext Helper
If you hit the Advanced checkbox you will see all of the above actions take place. I prefer to do them manually as then I know for sure I have installed them properly.

6. Backing Up
The most important thing to remember is that you should always keep a backup of your working system. At a bare minimum keep a backup of your extensions folder and your kernel.1. Make a backup copy of your kexts. First we will make a directory called "backup" in our root directory to store them. Open Terminal and type:
mkdir /backup2. Change directories to /System/Library This will shorten some of the commands we have to type in.
cd /System/Library3. Copy your kexts to the new "backup" folder.
cp -r Extensions/ /backup/4. Make a backup copy of your existing kernel and name it mach_kernel.backup
cp -r /mach_kernel /mach_kernel.backup