cmdshft
02-03-2009, 03:00 AM
This guide is verbatim copied from InsanelyMac, written by realityiswhere. (http://forum.insanelymac.com/index.php?showtopic=150713)
Prelinked kernels have been around for a while, but not used a whole lot by the general public.
This python script has been made to allow anyone to generate their own prelinked kernel(s) very easily.
Currently it only works for the current system volume you're on, not other /Volumes/ , but I'll work on it :)
Concept:
Prelinked kernels are generated once your system is up and running, and they are pretty much a cache of all your extensions/your current kernel rolled into one.
The upshot/benefit of this is that once it's generated, if you hose your current install/any of your extensions, you have a perfect working copy of your extensions/kernel when they *were* working (ie: when you generate it) to fall back on to boot into so you can fix any errors you may have made.
You can make as many as you want/need, the only caveat for booting them is that they must be placed in the root directory.
Script method:
1. Download the script from: http://localhostr.com/files/c19811/prelink.py.zip
2. I will assume it downloads to your "Downloads" folder (the one to the left of the trash in the dock, the absolute path being /Users/<username>/Downloads/)
3. Open a terminal, and type: sudo python ~/Downloads/prelink.py
4. It will prompt you and go through the naming/placement of the new kernel, in order to be able to boot off of the kernel it must be at root, aka: /
Manual method:
Anyone who wishes to do it manually without the python script, the code is as follows:
kextcache -a i386 -K /mach_kernel -c /tmp/mach_kernel.prelinked /System/Library/Extensions
Then you just need to repair permissions the normal way:
sudo chown 0:0 /kernelname
sudo chmod 644 /kernelname
Utilization:
At the f8 boot prompt, just type the kernelname when it's in your root directory, so say you named it testkernel, and you wanted to boot it in verbose mode, with -v.
At the f8 boot prompt you would type: testkernel -v
And that's it, any questions feel free to ask.
Prelinked kernels have been around for a while, but not used a whole lot by the general public.
This python script has been made to allow anyone to generate their own prelinked kernel(s) very easily.
Currently it only works for the current system volume you're on, not other /Volumes/ , but I'll work on it :)
Concept:
Prelinked kernels are generated once your system is up and running, and they are pretty much a cache of all your extensions/your current kernel rolled into one.
The upshot/benefit of this is that once it's generated, if you hose your current install/any of your extensions, you have a perfect working copy of your extensions/kernel when they *were* working (ie: when you generate it) to fall back on to boot into so you can fix any errors you may have made.
You can make as many as you want/need, the only caveat for booting them is that they must be placed in the root directory.
Script method:
1. Download the script from: http://localhostr.com/files/c19811/prelink.py.zip
2. I will assume it downloads to your "Downloads" folder (the one to the left of the trash in the dock, the absolute path being /Users/<username>/Downloads/)
3. Open a terminal, and type: sudo python ~/Downloads/prelink.py
4. It will prompt you and go through the naming/placement of the new kernel, in order to be able to boot off of the kernel it must be at root, aka: /
Manual method:
Anyone who wishes to do it manually without the python script, the code is as follows:
kextcache -a i386 -K /mach_kernel -c /tmp/mach_kernel.prelinked /System/Library/Extensions
Then you just need to repair permissions the normal way:
sudo chown 0:0 /kernelname
sudo chmod 644 /kernelname
Utilization:
At the f8 boot prompt, just type the kernelname when it's in your root directory, so say you named it testkernel, and you wanted to boot it in verbose mode, with -v.
At the f8 boot prompt you would type: testkernel -v
And that's it, any questions feel free to ask.