Using extra kexts and skipping kernelcache
Rev 1351 - Changes regarding kext injection once again. FSInject is also changed and needs to be updated.
- big change: no kext injection of extra kexts by default any more (extra kexts are kexts from kexts/10.8 or kext/other or kexts/xxx)
- removed NoKexts and added WithKexts
- if you want to boot OSX (or installer or Recovery) with additional kexts from kexts/xxx then you must specify WithKexts option in boot-args (config.plist or type it in Clover GUI) or just choose "Boot Mac OS X with extra kexts" in OSX submenu (press SPACE in main GUI to get it)
- changed FSInject so that is allows some kext patching when boot.efi refuses to load kernelcache for some reason
- fixed RemoveLoadOption() function which was not working
- fixed debugging of kext patching (config.plist: KernelAndKextPatches/Debug=Yes) when refit.conf "quiet" option is used
So, once more about kext injection ...
There are two methods of injection:
1. in-memory injection - can inject kexts into kernelcache (ML, Lion) and also when booting kernel+kexts. it's built into CloverX64.efi. it patches kernel on-the-fly to enable kext injection into kernelcache. that depends on kernel version and boot args, meaning: it can stop working in some future OSX version until somebody fixes it again
2. file system level injection - requires FSInject.efi driver which fools boot.efi into thinking that kexts/xxx/*.kext are inside /S/L/E. works only when booting kernel+kexts. works with any OSX version, but requires blocking caches (kernelcache or mkext). this FSInject driver additionally can force loading of certain kexts by changing their OSBundleRequired=Safe Boot into OSBundleRequired=Root on the fly when those kexts are needed for patching.
You can control this injection process and blocking of caches (kernelcache, mkext) by adding WithKext and/or NoCaches into boot args (config.plist or editing in Clover GUI), or by pressing SPACE in Clover GUI and selecting appropriate subentry booting option.
Works like this:
- if WithKext and NoCaches are not specified (default) - kexts from kexts/xxx/ will not be injected and kernelcache will normally be used
- if WithKexts is specified (or "Boot Mac OS X with extra kexts" subentry is selected) - then kexts from kexts/xxx/ will be injected. either in-memory injection into kernelcache or file system level injection, depending on how boot.efi will load the system
- if NoCaches is specified (or "Boot Mac OS X without caches" is selected) - FSInject driver will be used to block kernelcache (or mkext) and will force boot.efi to load kernel+kexts. kexts from kexts/xxx/ will not be injected.
- if NoCaches and WithKexts are specified - then it's the same as above (NoCache), but kexts from kexts/xxx/ will be injected
Once more, but in a different way:
Put your extra kexts needed for booting OSX into kexts/other for example (/efi/clover/kexts/other).
Case 1: users who have all needed kexts installed into /S/L/E
- do not put WithKext and NoCaches into config.plist boot args, because you normally do not need extra kext injection
- if you need to boot installer or recovery partition, then select it in Clover GUI, press SPACE to get additional options and choose "Boot Mac OS X with extra kexts" to boot them - this will inject extra kexts
Case 2: users who prefer not to install extra kexts into /S/L/E
- add WithKexts into config.plist boot-args and your extra kexts will always be injected
- you can boot installer and recovery with this same option