Help - Search - Members - Calendar
Full Version: Prelinked Kernel Generator
Project OS X Forums > Previous Releases > Mac OS X Leopard 10.5 > Leopard Guides & Tutorials > Tools
realityiswhere
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 smile.gif

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:

*EDIT* New uploaded script now asks which kernel you'd like to prelink if you have multiple smile.gif

New! http://localhostr.com/files/8619d0/prelink-new.py.zip
Original : 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:
CODE
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:

CODE
kextcache -a i386 -K  /mach_kernel -c /tmp/mach_kernel.prelinked /System/Library/Extensions


Then you just need to repair permissions the normal way:

CODE
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:
CODE
testkernel -v


And that's it, any questions feel free to ask.
Azimutz
Hi.. My first post on this forum.
So, i gave a try to this prelinked kernel and the conclusion are as folows...
I used "manual method" and the resulting prelinked kernel gave me a kp about AppleTyMCEDriver and some dependencies.
I'm using mainly XPC as bootloader so, i tryed to boot with Chameleon with same result.
Next i tryed to cache some more kexts like this:
CODE
kextcache -a i386 -K  /mach_kernel -s -l -n -c /tmp/mach_kernel.prelinked /System/Library/Extensions

With the resulting prelinked kernel i was able to boot with XPC but not with Chameleon 2.0RC1.. it hanged at a certain point. XPC goes all the way but, after login i don't have audio and network, both patched devices (dependencies problem, i think?!). All my patches live in USB stick (except for kernel) and work fine from there. Both network and audio patches have dependencies added to USB stick.
Also, the last kp screwed system time, setting it to a very old time and date. Had to set it back in machine bios (first time ever).
Anyway, it was i a nice exercice smile.gif i have never heard of this and everything that gets me to use Terminal it's wellcome.
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.