Jump to content
ErmaC

Clover Problems and Solutions

2,988 posts in this topic

Recommended Posts

This patch looks reasonable. Will it cause side effect?

 

Hope no. From comment:

// Correct OSVersion if it was not found
// This should happen only for 10.7-10.9 OSTYPE_OSX_INSTALLER
// For these cases, take OSVersion from loaded boot.efi image in memory

No need to take OSVersion from loaded boot.efi if we already have valid OSVersion grabbed from plist.

We can apply OSVersion value from loaded boot.efi to all OSTYPE_OSX (not just installer) with no OSVersion as a last attempt.

Share this post


Link to post
Share on other sites
Advertisement

Nah, Boot Script Table cannot be written to during PEI and full SMM Foundation is init via a DXE driver. iirc SMM is locked at EndOfDxe

 

It can only be written during PEI and also is SMM locked before DXE phase. The Boot Script Executor is the first and only module to execute in DXE when resumed.

S3Resume PEIM performs the below-listed major actions:
 Restore all LockBox to its original place.
 Call SMM entry point to restore processor configuration.
 Lock SMM. This must be done to maintain SMM integrity.
 Call Boot Script Executor to restore chipset configuration.
 Signal EndOfPei, to notify other PEIMs.
 Find FACS OS waking vector to resume.

Share this post


Link to post
Share on other sites

 

It can only be written during PEI and also is SMM locked before DXE phase. The Boot Script Executor is the first and only module to execute in DXE when resumed.

 

You don't write something when you are restoring from it. :D

https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Library/PiDxeS3BootScriptLib

Share this post


Link to post
Share on other sites

That's restoring from SMRAM but I was just showing you that it can only be written in PEI. S3 SMM driver runs in PEI, and DXE must dispatch SMM call to save it. You can see that from the code you just linked, it uses SMM lock box. Look at the code for SMM lock box, the service instance runs in PEI (and obviously SMM).

Share this post


Link to post
Share on other sites

That's restoring from SMRAM but I was just showing you that it can only be written in PEI. S3 SMM driver runs in PEI, and DXE must dispatch SMM call to save it. You can see that from the code you just linked, it uses SMM lock box. Look at the code for SMM lock box, the service instance runs in PEI (and obviously SMM).

 

Well, of course it uses the LockBox...

DXE driver writes a Boot Script -> BootScriptLib saves the data to LockBox -> reset -> PEIM retrieves lock box -> DXE executes Boot Scripts and resumes.

Share this post


Link to post
Share on other sites

Well, of course it uses the LockBox...

DXE driver writes a Boot Script -> BootScriptLib saves the data to LockBox -> reset -> PEIM retrieves lock box -> DXE executes Boot Scripts and resumes.

 

I guess I am not being clear enough or something. That's only valid for EDK2 based firmware. You don't know how the firmware actually performs this, maybe it doesn't use SMM and instead uses some internal stuff in NVRAM/ROM. Since you don't know how the firmware actually stores the boot script table, you using that code means you have to change the DXE driver for S3 so that you do know how it's stored - in an SMM lock box. You changing that S3 DXE driver means you also have to change the S3 PEI driver because you can't be sure the method that is being used store/retrieve the boot script table otherwise. If you store in an SMM lock box and the PEI driver doesn't read from there to restore then it's useless. Is that clearer for what I'm trying to say?

Share this post


Link to post
Share on other sites

In Clover's Kext Patcher, there is an option to patch a kext's Info.plist with

<key>InfoPlistPatch</key>
<true/>
 

Unfortunately, for kexts packed in prelinkedkernel this feature is nearly useless.  Because the Info.Plist used is the one placed inside __PRELINK_INFO segment of the prelinked kernel.

For example, here's the full Info.plist for AppleHDAController

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BuildMachineOSBuild</key>
	<string>16B2657</string>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>AppleHDAController</string>
	<key>CFBundleGetInfoString</key>
	<string>AppleHDAController 280.12, Copyright © 2000-2017 Apple Inc. All rights reserved.</string>
	<key>CFBundleIdentifier</key>
	<string>com.apple.driver.AppleHDAController</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>HDA Controller Driver</string>
	<key>CFBundlePackageType</key>
	<string>KEXT</string>
	<key>CFBundleShortVersionString</key>
	<string>280.12</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleSupportedPlatforms</key>
	<array>
		<string>MacOSX</string>
	</array>
	<key>CFBundleVersion</key>
	<string>280.12</string>
	<key>DTCompiler</key>
	<string>com.apple.compilers.llvm.clang.1_0</string>
	<key>DTPlatformBuild</key>
	<string>9M189u</string>
	<key>DTPlatformVersion</key>
	<string>GM</string>
	<key>DTSDKBuild</key>
	<string>17A356</string>
	<key>DTSDKName</key>
	<string>macosx10.13internal</string>
	<key>DTXcode</key>
	<string>0900</string>
	<key>DTXcodeBuild</key>
	<string>9M189u</string>
	<key>IOKitPersonalities</key>
	<dict>
		<key>BuiltInHDA</key>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.apple.driver.AppleHDAController</string>
			<key>CodecAddressFilterArray</key>
			<array>
				<dict>
					<key>CodecAddressMask</key>
					<data>
					AQAAAA==
					</data>
					<key>LayoutID</key>
					<integer>16392</integer>
					<key>PCIVendorDeviceID</key>
					<integer>282987200</integer>
				</dict>
				<dict>
					<key>CodecAddressMask</key>
					<data>
					AQAAAA==
					</data>
					<key>LayoutID</key>
					<integer>0</integer>
					<key>PCIVendorDeviceID</key>
					<integer>282987200</integer>
				</dict>
				<dict>
					<key>CodecAddressMask</key>
					<data>
					CQAAAA==
					</data>
					<key>LayoutID</key>
					<integer>65</integer>
					<key>PCIVendorDeviceID</key>
					<integer>282987200</integer>
				</dict>
				<dict>
					<key>CodecAddressMask</key>
					<data>
					AQAAAA==
					</data>
					<key>LayoutID</key>
					<integer>73</integer>
					<key>PCIVendorDeviceID</key>
					<integer>282987200</integer>
				</dict>
			</array>
			<key>DPAlwaysDisplayRouting</key>
			<array>
				<integer>3</integer>
				<integer>33</integer>
				<integer>35</integer>
				<integer>88</integer>
			</array>
			<key>DPAudioDeviceExclusion</key>
			<array>
				<dict>
					<key>ManufacturerID</key>
					<integer>1552</integer>
					<key>ProductID</key>
					<integer>10130</integer>
				</dict>
			</array>
			<key>HighFIFOLimitSupport</key>
			<array/>
			<key>HwFactoryPrefixTranslation</key>
			<array>
				<dict>
					<key>LayoutID</key>
					<integer>78</integer>
					<key>SourceDID</key>
					<integer>43584</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>78</integer>
					<key>SourceDID</key>
					<integer>43576</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>79</integer>
					<key>SourceDID</key>
					<integer>43584</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>79</integer>
					<key>SourceDID</key>
					<integer>43576</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
			</array>
			<key>IOClass</key>
			<string>AppleHDAController</string>
			<key>IOPCIClassMatch</key>
			<string>0x04010000&0xFFFD0000</string>
			<key>IOProviderClass</key>
			<string>IOPCIDevice</string>
			<key>RequireMaxBusStall</key>
			<array>
				<dict>
					<key>Layouts</key>
					<array/>
					<key>MaxBusStall</key>
					<integer>15000</integer>
				</dict>
			</array>
		</dict>
		<key>BuiltInHDA9D70</key>
		<dict>
			<key>CFBundleIdentifier</key>
			<string>com.apple.driver.AppleHDAController</string>
			<key>DPAlwaysDisplayRouting</key>
			<array>
				<integer>3</integer>
				<integer>33</integer>
				<integer>35</integer>
				<integer>88</integer>
			</array>
			<key>DPAudioDeviceExclusion</key>
			<array>
				<dict>
					<key>ManufacturerID</key>
					<integer>1552</integer>
					<key>ProductID</key>
					<integer>10130</integer>
				</dict>
			</array>
			<key>HighFIFOLimitSupport</key>
			<array/>
			<key>HwFactoryPrefixTranslation</key>
			<array>
				<dict>
					<key>LayoutID</key>
					<integer>78</integer>
					<key>SourceDID</key>
					<integer>43584</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>78</integer>
					<key>SourceDID</key>
					<integer>43576</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>79</integer>
					<key>SourceDID</key>
					<integer>43584</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
				<dict>
					<key>LayoutID</key>
					<integer>79</integer>
					<key>SourceDID</key>
					<integer>43576</integer>
					<key>StandInDID</key>
					<integer>43568</integer>
					<key>VID</key>
					<integer>4098</integer>
				</dict>
			</array>
			<key>IOClass</key>
			<string>AppleHDA8086_9D70Controller</string>
			<key>IONameMatch</key>
			<array>
				<string>pci8086,9d70</string>
			</array>
			<key>IOProbeScore</key>
			<integer>2</integer>
			<key>IOProviderClass</key>
			<string>IOPCIDevice</string>
			<key>RequireMaxBusStall</key>
			<array>
				<dict>
					<key>Layouts</key>
					<array/>
					<key>MaxBusStall</key>
					<integer>15000</integer>
				</dict>
			</array>
		</dict>
	</dict>
	<key>NSHumanReadableCopyright</key>
	<string>AppleHDAController 280.12, Copyright © 2000-2017 Apple Inc. All rights reserved.</string>
	<key>OSBundleCompatibleVersion</key>
	<string>1.0.0d1</string>
	<key>OSBundleLibraries</key>
	<dict>
		<key>com.apple.iokit.IOAudioFamily</key>
		<string>200.5</string>
		<key>com.apple.iokit.IOGraphicsFamily</key>
		<string>2.0</string>
		<key>com.apple.iokit.IOHDAFamily</key>
		<string>265.88</string>
		<key>com.apple.iokit.IOPCIFamily</key>
		<string>1.1</string>
		<key>com.apple.kpi.bsd</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.iokit</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.libkern</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.mach</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.private</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.unsupported</key>
		<string>12.0</string>
	</dict>
</dict>
</plist>

 

 

and here's what's found inside __PRELINK_INFO

 

 

<dict>
	<key>CFBundleName</key>
	<string>HDA Controller Driver</string>
	<key>DTXcode</key>
	<string>0900</string>
	<key>DTSDKName</key>
	<string>macosx10.13internal</string>
	<key>NSHumanReadableCopyright</key>
	<string>AppleHDAController 280.12, Copyright © 2000-2017 Apple Inc. All rights reserved.</string>
	<key>_PrelinkExecutableLoadAddr</key>
	<integer size="64">0xffffff7f82739000</integer>
	<key>_PrelinkKmodInfo</key>
	<integer size="64">0xffffff7f8274ec80</integer>
	<key>DTSDKBuild</key>
	<string>17A356</string>
	<key>_PrelinkExecutableSize</key>
	<integer IDREF="133"/>
	<key>CFBundleDevelopmentRegion</key>
	<string IDREF="1"/>
	<key>CFBundleVersion</key>
	<string>280.12</string>
	<key>BuildMachineOSBuild</key>
	<string>16B2657</string>
	<key>_PrelinkExecutableSourceAddr</key>
	<integer size="64">0xffffff80029ce000</integer>
	<key>CFBundlePackageType</key>
	<string>KEXT</string>
	<key>CFBundleShortVersionString</key>
	<string>280.12</string>
	<key>CFBundleSupportedPlatforms</key>
	<array>
		<string>MacOSX</string>
	</array>
	<key>OSBundleCompatibleVersion</key>
	<string>1.0.0d1</string>
	<key>_PrelinkExecutableRelativePath</key>
	<string>Contents/MacOS/AppleHDAController</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string IDREF="2"/>
	<key>CFBundleExecutable</key>
	<string>AppleHDAController</string>
	<key>DTCompiler</key>
	<string IDREF="9"/>
	<key>CFBundleIdentifier</key>
	<string>com.apple.driver.AppleHDAController</string>
	<key>DTPlatformVersion</key>
	<string IDREF="10"/>
	<key>DTXcodeBuild</key>
	<string>9M189u</string>
	<key>CFBundleSignature</key>
	<string IDREF="3"/>
	<key>OSBundleLibraries</key>
	<dict>
		<key>com.apple.kpi.bsd</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.libkern</key>
		<string>8.0.0</string>
		<key>com.apple.kpi.mach</key>
		<string>8.0.0</string>
		<key>com.apple.iokit.IOPCIFamily</key>
		<string>1.1</string>
		<key>com.apple.kpi.iokit</key>
		<string>8.0.0</string>
		<key>com.apple.iokit.IOAudioFamily</key>
		<string>200.5</string>
		<key>com.apple.iokit.IOHDAFamily</key>
		<string>265.88</string>
		<key>com.apple.iokit.IOGraphicsFamily</key>
		<string IDREF="30"/>
		<key>com.apple.kpi.unsupported</key>
		<string>12.0</string>
		<key>com.apple.kpi.private</key>
		<string>8.0.0</string>
	</dict>
	<key>CFBundleGetInfoString</key>
	<string>AppleHDAController 280.12, Copyright © 2000-2017 Apple Inc. All rights reserved.</string>
	<key>_PrelinkBundlePath</key>
	<string>/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext</string>
	<key>DTPlatformBuild</key>
	<string>9M189u</string></dict>
</dict>

 

 

The section IOKitPersonalities is missing, which is the most useful part to patch.

The personalities for kexts are cached in

/System/Library/Caches/com.apple.kext.caches/Startup/IOKitPersonalities_x86_64.ioplist.gz

which is only loaded by the kernel after starting.

Share this post


Link to post
Share on other sites

Hi, a bit off-topic:

In this line: https://sourceforge.net/p/cloverefiboot/code/4256/tree//rEFIt_UEFI/Platform/kernel_patcher.c#l1879

Better to use DBG_RT() for consistency...

 

And also. The code somehow doesn't look healthy to me. Under "switch (gCPUStructure.Model)" branch, if a "stupid" (no offense) user enable "KernelXCPM" by accident and his/her CPU is supported natively (e.g. Haswell/Broadwell, etc), then HaswellLowEndXCPM patch will get applied...

Share this post


Link to post
Share on other sites

Hi, a bit off-topic:

In this line: https://sourceforge.net/p/cloverefiboot/code/4256/tree//rEFIt_UEFI/Platform/kernel_patcher.c#l1879

Better to use DBG_RT() for consistency...

 

And also. The code somehow doesn't look healthy to me. Under "switch (gCPUStructure.Model)" branch, if a "stupid" (no offense) user enable "KernelXCPM" by accident and his/her CPU is supported natively (e.g. Haswell/Broadwell, etc), then HaswellLowEndXCPM patch will get applied...

Agree about DBG_RT, fixed.

      switch (gCPUStructure.Model) {
...
          default:
            if (gCPUStructure.Model >= CPU_MODEL_HASWELL &&
               (AsciiStrStr(gCPUStructure.BrandString, "Celeron") || AsciiStrStr(gCPUStructure.BrandString, "Pentium"))) {
              // Haswell+ low-end CPU
              EnableExtCpuXCPM = HaswellLowEndXCPM;
            }
            break;

It will be for Haswell Celeron of higher Celeron.

Else EnableExtCpuXCPM == NULL (? - I wish duplicate it)

Share this post


Link to post
Share on other sites

The commit for r4242 breaks InjectKexts=Detect.

 

When InjectKexts=Detect and FakeSMC.kext is in the kernel cache, no kexts from EFI/Clover/kexts should be injected.

 

And there's more.

Even with that fixed (reverted), still kexts are being injected with Detect and FakeSMC.kext installed.

I'll try to figure out why (probably this new "kext management" stuff is the problem).

 

But yeah, InjectKexts=Detect is broken.

Share this post


Link to post
Share on other sites

Slice, unsure why you removed that search for FakeSMC. There was always ability to disable kext injection, now each kext can be disabled individually. The behavior by the Detect value was that kexts are injected if there is no FakeSMC in the cache. This is to provide different behavior for installers and system volumes with no kexts installed, and system volumes with kexts installed. This is to prevent having to use multiple instances of clover, one that has injection and one that doesn't, say if you have an install already but want to create another.

 

EDIT: I guess what you're saying is go through, disable all of them and it's the same behavior? That seems like a lot more work though...
EDIT2: Also that code is atrocious... -1 and -2 offsets? Why wouldn't it just find every "<" and then check if it ended with "dict>" or "/dict>"... lol

EDIT3: @RehabMan, You need to revert multiple sources to fix it: https://sourceforge.net/p/cloverefiboot/code/4242/

Share this post


Link to post
Share on other sites

EDIT3: @RehabMan, You need to revert multiple sources to fix it: https://sourceforge.net/p/cloverefiboot/code/4242/

I know. But even with both changes, not enough. New code for "kext management" stuff is interfering I think.

I was going to work on it, but then I got caught in a quagmire of trying to make the Esc key do the right thing (that one has bugged me for a long time).

 

Are we having fun yet?

Share this post


Link to post
Share on other sites

Entirely possible that it's broken because of that, I'm not exactly sure why it was even necessary to provide such detailed kext injection disabling... Who's injecting that many kexts? I have FakeSMC and that's it... I install the rest I want after the OS. I think they don't understand that the injection is meant to be used in situations where you can't install kexts... But eh. As for trying to figure out anything with the GUI, good luck with that. There's so many random loops inside of each other because the GUI (rEFIt) was badly designed from the start (sorry Christoph!)... Granted, I think Clover has pushed it beyond the breaking point. But GUIs should have only one loop that draws, handles input and dispatches it accordingly.. A single task GUI can be easily implemented with a stack of "screens" that are drawn so the loop just walks down the stack until it reaches a fullscreen "screen" then walks back up the stack drawing each "screen". Entering a menu just pushes that menu onto the top of the stack and exiting means popping from the stack. Multitasking is a little harder but really only involves using a list of "windows" instead of a stack, only updating the screen when you know something changes (invalidation), and directing input towards the active "window" (or sometimes switching the active "window" or directing the input to a inactive window, like scroll wheel). Though I digress, lol.

Share this post


Link to post
Share on other sites

Entirely possible that it's broken because of that, I'm not exactly sure why it was even necessary to provide such detailed kext injection disabling... Who's injecting that many kexts? I have FakeSMC and that's it... I install the rest I want after the OS. I think they don't understand that the injection is meant to be used in situations where you can't install kexts... But eh. As for trying to figure out anything with the GUI, good luck with that. There's so many random loops inside of each other because the GUI (rEFIt) was badly designed from the start (sorry Christoph!)... Granted I think Clover has pushed it beyond the breaking point. But GUIs should have only one loop that draws, handles input and dispatches it accordingly.. A single task GUI can be easily implemented with a stack of "screens" that are drawn so the loop just walks down the stack until it reaches a fullscreen "screen" then walks back up the stack drawing each "screen". Entering a menu just pushes that menu onto the top of the stack and exiting means popping from the stack. Multitasking is a little harder but really only involves using a list of "windows" instead of a stack, only updating the screen when you know something changes (invalidation), and directing input towards the active "window" (or sometimes switching the active "window" or directing the input to a inactive window, like scroll wheel). Though I digress, lol.

Agree 100% on the questionable need for this kext management feature.

And also 100% on injection vs. installing... I usually explain to people several times per day that they should be installing kexts, not injecting and that injection is only for essential kexts needed by the installer or recovery.

But I'll work out the issue of InjectKexts=Detect, it is just a matter of time.

 

And now I have the Esc key and space key working correctly.

 

And yes, the menu handling code in there could use a redesign (like you mention), but it is workable if you're careful. As always, rushed code is buggy code.

Share this post


Link to post
Share on other sites

But I'll work out the issue of InjectKexts=Detect, it is just a matter of time.

Got it.

I think I was running the wrong build when initially testing (then got sidetracked on the other things I mentioned).

 

That said, now that InjectKexts=Detect is working again, things are little strange with that kext management menu.

For example, with Detect and FakeSMC.kext installed, you would expect that all the kexts would be marked for exclusion when you enter that menu, but that is not the case... they are unchecked in that scenario which might lead one to believe they'll be injected, which is not going to happen. This is probably what prompted the other changes that broke InjectKexts. But we can't break InjectKexts=Detect for this GUI feature.

 

So, two things need to happen:

- the initial checkmarks should represent the current state of whether the system will inject or not (depending on InjectKexts setting and FakeSMC status)

- once changes are made to the status of those checkmarks, it should be honored regardless of InjectKexts setting

 

I'll see if I can work that out (probably won't be today, and all this is happening in my github fork anyway).

 

Edit: The trick will be how to determine the status of FakeSMC relative to the prelinked kernel when the prelinked kernel hasn't been loaded yet!

Share this post


Link to post
Share on other sites

I need kexts injection from EFI for a testing purpose. If the testing kexts leads to panic then I can disable it through GUI.

Moreover I can remove it by Shell or place good one instead of it. For example PS2Keyboard. I need the working kext and can't boot with bad one.

 

About "Detect". What if FakeSMC presents in both places, in SLE and in Other/ ? I think it will work.

Share this post


Link to post
Share on other sites

I need kexts injection from EFI for a testing purpose. If the testing kexts leads to panic then I can disable it through GUI.

Moreover I can remove it by Shell or place good one instead of it. For example PS2Keyboard. I need the working kext and can't boot with bad one.

And I think this gets to the real purpose of this feature.

It really isn't a "kext management" feature at all. It is purely an "injected kext disabler" feature.

And I think it's going to stay that way.

So, for the case that kexts weren't going to be injected anyway, fiddling in this menu will have no effect. And I think that's fine.

 

But what we really need is a way to force kext injection when it is disabled (eg. due to InjectKexts=No, or InjectKexts=Detect+FakeSMC.kext in cache).

Or to force kext injection off when it is enabled (due to InjectKexts=Yes, or InjectKexts=Detect + FakeSMC.kext NOT in cache).

We used to have these options, but they were removed. I will add them back (to the spacebar menu).

 

About "Detect". What if FakeSMC presents in both places, in SLE and in Other/ ? I think it will work.

That is the normal configuration.

InjectKexts=Detect

FakeSMC.kext installed to /L/E (or /S/L/E, if you want)

FakeSMC.kext at EFI/Clover/kexts/Other

 

When you boot recovery or an installer, Clover detects no FakeSMC in cache, so injects the kexts from Clover/kexts.

When you boot your system partition, Clover detects FakeSMC in cache, and ignores all kexts in Clover/kexts.

It is the perfect setup as you get to install kexts where you can, but still have kext injection when you need it.

Share this post


Link to post
Share on other sites

That is the normal configuration.

InjectKexts=Detect

FakeSMC.kext installed to /L/E (or /S/L/E, if you want)

FakeSMC.kext at EFI/Clover/kexts/Other

 

When you boot recovery or an installer, Clover detects no FakeSMC in cache, so injects the kexts from Clover/kexts.

When you boot your system partition, Clover detects FakeSMC in cache, and ignores all kexts in Clover/kexts.

It is the perfect setup as you get to install kexts where you can, but still have kext injection when you need it.

 

Agree. for me, this has been the ideal mechanism for a long time. sorry to jump in here, but i am casting a vote to preserve this model.

Share this post


Link to post
Share on other sites

@Slice
i arranged source. why suddenly shown "The metadata for this repository is missing. To fix, please try a refresh."
i committed "cleanup kernelAndKextPatches options" like before. can browse commits but strange.
just sf issue?

EDIT1.
build also is no problem.


EDIT2.
Sf is back.

Share this post


Link to post
Share on other sites

so if you have all kexts in some OS/library/extensions how do you boot recovery if you do not use other? that would mean you need kexts in 2 places anyway no? why use LE at all unless there are apple audio kext or some other kext that has SLE dependence you do not need that in recovery or because it take a few milliseconds longer to inject it? or maybe optifix issue with a minority of certain boards?

my point is why are people not supposed to use clovers inject feature and get slapped on the wrist if they say they do. makes no sense.

Share this post


Link to post
Share on other sites

They have enough kexts (mainly fakesmc) in clover folder to load recovery/install.

In this case, clover will inject the kext because it's not in kextcache.

 

If loading all kext from clover working for you, I wouldn't bother using /Library/Extensions.

I don't and everything is working fine.

 

Sent from my ONEPLUS A5000 using Tapatalk

Share this post


Link to post
Share on other sites

That is the normal configuration.

InjectKexts=Detect

FakeSMC.kext installed to /L/E (or /S/L/E, if you want)

FakeSMC.kext at EFI/Clover/kexts/Other

 

When you boot recovery or an installer, Clover detects no FakeSMC in cache, so injects the kexts from Clover/kexts.

When you boot your system partition, Clover detects FakeSMC in cache, and ignores all kexts in Clover/kexts.

It is the perfect setup as you get to install kexts where you can, but still have kext injection when you need it.

Anyway. Why not inject FakeSMC from Other even if it presents in kernelcache? Is it dangerous conflict?

Or just for perfect looking?

Recovery also needs LAN kext and Keyboard kext if PS2 for example.

 

"Detect" mode is not working? I was not going to exclude it. Will look carefully.

    Prop = GetProperty (DictPointer, "InjectKexts");
    if (Prop != NULL) {
      if (Prop->type == kTagTypeTrue) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else if ((Prop->type == kTagTypeString) &&
                 (AsciiStriCmp (Prop->string, "Yes") == 0)) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else if ((Prop->type == kTagTypeString) &&
                 (AsciiStriCmp (Prop->string, "Detect") == 0)) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_CHECKFAKESMC);
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else {
        DBG ("** Warning: unknown custom entry InjectKexts value '%a'\n", Prop->string);
      }

Hey Sherlocks,

if you removed one field from Settings structure then you have to add padding the same size

--- a/rEFIt_UEFI/Platform/Platform.h
+++ b/rEFIt_UEFI/Platform/Platform.h
@@ -1089,7 +1089,6 @@
   UINT64                  DoubleClickTime;
   BOOLEAN                 PointerMirror;
 
-  BOOLEAN                 KernelXCPMAllowed;
   UINT8                   pad7[1];
   UINT8                   CustomBoot;
   EG_IMAGE                *CustomLogo;

So pad7[1] will be pad7[2]

 

EDITED.

Moreover it should be pad7[6] because of 8 byte alignment

Share this post


Link to post
Share on other sites

Anyway. Why not inject FakeSMC from Other even if it presents in kernelcache? Is it dangerous conflict?

Or just for perfect looking?

Recovery also needs LAN kext and Keyboard kext if PS2 for example.

 

"Detect" mode is not working? I was not going to exclude it. Will look carefully.

    Prop = GetProperty (DictPointer, "InjectKexts");
    if (Prop != NULL) {
      if (Prop->type == kTagTypeTrue) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else if ((Prop->type == kTagTypeString) &&
                 (AsciiStriCmp (Prop->string, "Yes") == 0)) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else if ((Prop->type == kTagTypeString) &&
                 (AsciiStriCmp (Prop->string, "Detect") == 0)) {
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_CHECKFAKESMC);
        Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
      } else {
        DBG ("** Warning: unknown custom entry InjectKexts value '%a'\n", Prop->string);
      }

Hey Sherlocks,

if you removed one field from Settings structure then you have to add padding the same size

--- a/rEFIt_UEFI/Platform/Platform.h
+++ b/rEFIt_UEFI/Platform/Platform.h
@@ -1089,7 +1089,6 @@
   UINT64                  DoubleClickTime;
   BOOLEAN                 PointerMirror;
 
-  BOOLEAN                 KernelXCPMAllowed;
   UINT8                   pad7[1];
   UINT8                   CustomBoot;
   EG_IMAGE                *CustomLogo;
So pad7[1] will be pad7[2]

 

EDITED.

Moreover it should be pad7[6] because of 8 byte alignment

Okay i will. Thanks

 

나의 LG-F800S 의 Tapatalk에서 보냄

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Slice
      OK, 4988 released.
      Now, @vector sigma, what have we do to update translations?
    • By fusion71au
      Clover r4989 ISO compiled with GCC and minimal config.plist compatible for use in VMWare Workstation.
       
      Tested with unlocked Workstation 15 running OSX 10.9 -->10.15 guest in Windows X64 host.
       
      Installation
      1. Download and unzip "EFI_Clover_r4989 for VMware.zip". Mount Clover-v2.4k-4989-X64.iso by double clicking on it.
      2. Mount your VM's EFI System Partition eg in terminal
      sudo diskutil mount disk0s1   3. Copy EFI folder from step 1 into the EFI partition
      4. Shutdown the VM, add bios.bootDelay = "3000" to your VM's vmx file
      5. Reboot your VM, press <F2> to access the VMware Boot Manager and add CLOVERX64.efi to the boot menu.
       
      Substitute your own unique and valid MLB and ROM variables in the /EFI/CLOVER/config.plist (Rt Variables section) to activate iMessage/Facetime on your VM.
    • By fusion71au
      Run Vanilla OS X El Capitan, Sierra, High Sierra or Mojave in VirtualBox 5.x.x on a Windows Host
      Following on from my previous guide on how to create a VMware virtual machine running Vanilla OS X El Capitan in Windows, I’ve decided to write a similar guide for creating a VirtualBox El Capitan VM. 
       
      The virtual machine should be useful for testing El Capitan and also for creating installers for use on a real machine/hackintosh.
       
      There are other tutorials and videos on the net about running OS X on Windows machines using pre-made VMDK disk images but you can never guarantee what else is in there….
       
      I’ve gathered info for this guide from several threads in the Multibooting and Virtualisation section of this forum and also the wider internet eg
       
      @colt2 HOW TO: Create a bootable El Capitan ISO for VMware
      @dsmccombs comment on faking Ivybridge Processor
      @E:V:A http://forum.xda-developers.com/showpost.php?p=55572430&postcount=6
      @Tech Reviews video tutorial https://www.youtube.com/watch?v=t7X07U63lwg.
      VirtualBox Forum: Status of OSX on OSX
       
      Requirements
         Intel PC with four or more CPU cores running Windows 7 X64 or later OS (2 or more cores needed for OS X)    4GB or more RAM (2GB or more will be needed for OS X)    Hard Disk with at least 40GB free for Virtual Machine    Oracle VM VirtualBox v 5.0.34    Install OS X El Capitan app and Mac or Hack to prepare installation iso <-- Now, no longer necessary to have previous access to a Mac or Hack by building the Installer.app from scratch - see post#75    16GB or larger exFAT formatted USB stick to transfer El Capitan iso from Mac/Hack to Host PC  
      Prepare Installation ISO on your Mac or Hack
      1.  On your Mac or Hack, download "Install OS X El Capitan.app" from the App Store into your Applications folder.
      2.  Download and unzip the CECI.tool (attached to this post) into your ~/Downloads folder. The commands in this executable script are shown below for informational purposes.  Note: you will need approx 16GB of free space on your hard disk for the script to complete.
       
       
       
      3.  Open OS X terminal, then run the following commands to execute the script:
      cd downloads chmod +x CECI.tool ./CECI.tool 4.  At the end of the process, you will have an El Capitan iso on your desktop - copy this onto an exFAT formatted USB for use on the PC Host later.
       
       
      Create an El Capitan Virtual Machine in VirtualBox
      1.  Open the VirtualBox program and click the "New" button to create a new VM.
       

       
      2.  Select Mac OS X and Mac OS X 10.11 El Capitan (64 -bit) for Operating System type and version.  I named my Virtual Machine "El_Capitan", then clicked next...
       

       
      3.  Leave the Memory size at the recommended 2048 MB, then click next.
       

       
      4.  Choose to "Create a virtual hard disk now", then click the create button.
       

       
      5.  For the hard disk file type, the default is VDI (VirtualBox Disk Image) but I have selected VMDK for inter-operability with VMWare.  Click next...
       

       
      6.  For Storage on physical hard disk, I have chosen the default Dynamically allocated (grows larger to a set limit as you need more disk space).
       

       
      7.  On the File location and size screen, you can set the location of the new virtual hard disk and its size - I recommend changing disk size to 40GB or larger.  When you click the create button, you will now see your new VM in the VirtualBox main GUI.
       

       
      8.  Click the settings button on the Main Menu to tweak a few settings....
         a.  On the System/Motherboard tab in Boot Order, you can uncheck the Floppy Drive (who has these now?)
       

       
         b.  On the System/Processor tab, you can increase the allocated CPU cores to 2
       

       
         c.  On the Display tab, you can increase the allocated Video Memory to 128MB
       

       
         d.  On the Storage tab, click on the icon of the Optical Drive and select "Choose Virtual Optical Disk File". 
       

       
      Navigate and select the El Capitan ISO we created earlier...
       

       
         e.  Click the OK button to finalise the VM settings.
       
       
      Patch El Capitan vbox configuration file with DMI Settings from a Mac
      1.  From the start menu, type cmd and click run as administrator to open an administrative command prompt. 
       

       
      2.  Choose a Mac Model similar to your host system, then type the following lines, followed by <enter>  after each line.  Make sure you first close all VirtualBox Windows and the VirtualBox program, otherwise any changes you make won't stick...
       
      Eg iMac11,3
      cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F2238BAE" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 MacBookPro11,3
      cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983FE1663" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 Macmini6,2
      cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "Macmini6,2" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F65AE981FFA204ED" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 3.  Optional- For some host systems eg those with Haswell and newer CPUs, you might have to spoof an older CPU to avoid VirtualBox errors.  You can try from one of the following if this happens:

      To spoof Lynnfield i5 750 CPU
      VBoxManage.exe modifyvm "El_Capitan" --cpuidset 00000001 000106e5 06100800 0098e3fd bfebfbff To spoof IvyBridge CPU
      VBoxManage.exe modifyvm "El_Capitan" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff or
      VBoxManage.exe modifyvm "El_Capitan" --cpuidset 00000001 000306a9 00020800 80000201 178bfbff 4.  Close the command prompt window.
       
       
      Installation of El Capitan
      We are now ready to start the El_Capitan Virtual Machine....
       



       
      Installation should be relatively straight forward, just following the prompts of the OS X installer:
      1.  Select language, agree to legal terms
       

       
      2.  Use Disk Utility from the Utilities Menu to erase and format the virtual hard drive as a single partition GUID Mac OS X Extended.  I named my drive "Macintosh HD" but you can enter whatever you like eg El_Capitan.
       

       
      3.  Quit DU and choose Macintosh HD to install El Capitan on.
      4.  After 20-30 min (depending on how fast your system is), the installation will complete.  At this point, unmount the El Capitan ISO by clicking the Devices menu from the VM window, click Optical Drives, then choose Remove disk from virtual drive.  The VM is now ready to reboot into OS X from the virtual hard drive.
      5.  At the welcome screen, choose your country and keyboard layout.  You can skip transfer information, location services and logging in with your Apple ID if you wish…
      6.  Create a User Account and select your Time Zone.  You can skip sending diagnostics and usage data to Apple….
      7.  Finally, you will arrive at the El Capitan Desktop.
       

       
      8.  Network/internet and audio should work OOB but on my system, the sounds were distorted.  Unfortunately, there is no QE/CI and the VM resolution will be fixed without the ability to dynamically resize the VM window (no VirtualBox additions for OS X guests atm). 
       
       
      Customization with VBoxManage
      1.  You can change the default resolution of 1024*768 (after shutting down the VM) with the VBoxManage command from the Windows Administrative Command Prompt:
      cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage setextradata "El_Capitan" VBoxInternal2/EfiGopMode N (Where N can be one of 0,1,2,3,4,5) referring to the 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200 screen resolution respectively.
       
      Update:  For VirtualBox 5.2.x, the command for changing screen resolution has changed...
       
      VBoxManage setextradata "<MyVM>" VBoxInternal2/EfiGraphicsResolution XxY (where X=Horizontal screen resolution, Y=Vertical screen resolution)
      eg
      VBoxManage setextradata "<MyVM>" VBoxInternal2/EfiGraphicsResolution 1280x1024 2.  Adding serials and other SMBIOS details for the System Information Screen
      VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "W8#######B6" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiBoardSerial" "W8#########1A" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemVendor" "Apple Inc." VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiSystemFamily" "iMac" VBoxManage setextradata "El_Capitan" "VBoxInternal/Devices/efi/0/Config/DmiBIOSVersion" "IM112.0057.03B" A listing of known issues with Mac OS X guests can be found in the VirtualBox Manual - link https://www.virtualbox.org/manual/ch14.html.
       
      Vanilla Mavericks and Yosemite, Snow Leopard from Retail DVD
      The same VM settings for El Capitan will also boot and run vanilla installations of OS X Mavericks and Yosemite .  Attached to this post are installer scripts to create bootable Mavericks (CMI.tool) and Yosemite (CYI.tool) ISOs for VirtualBox and VMware.
       
      With the respective OS X installer apps in the Applications folder, download and run the installer tools using terminal ie
       
      To create a Mavericks ISO on your desktop
      cd downloads chmod +x CMI.tool ./CMI.tool To create a Yosemite ISO on your desktop
      cd downloads chmod +x CYI.tool ./CYI.tool Here is a screenshot of the VM running Mavericks 10.9.5...
       

       
      Finally, those without a Mac/Hack to prepare the install media can purchase a retail Snow Leopard DVD directly from Apple and install OSX 10.6.3 on their virtual machines (Snow Leopard, Lion and Mountain Lion run quite happily in VirtualBox with 1 CPU, 1-2 GB of RAM and the rest of the settings unchanged from above).  Once you update by combo update to SL 10.6.8, you can directly download El Capitan from the App Store for free .
       

       
      UPDATE macOS Sierra 10.12 to 10.12.6: For macOS Sierra, use CSI.tool in post#51.
      UPDATE macOS High Sierra 17A365:  For macOS High Sierra, use CHSI.tool in post#73.
      UPDATE macOS Mojave 18A391:  For macOS Mojave or High Sierra, use macOS_iso_creator.tool on page 4 of thread.
      UPDATE macOS Catalina Beta DP3_19A501i:  For Catalina, @jpz4085 has made an automated batch file to create a Catalina VM in Windows with iMac 14,2 SMBIOS.  You can still use my macOS_iso_creator.tool on page 5 to make an installer ISO to attach to the VM.
       
       
       
      Good luck and enjoy
      CECI.tool.zip
      CYI.tool.zip
      CMI.tool.zip
    • By JackBauer24
      Hello,
       
      I have installed OSx86 10.11 (El Capitan) on April 2016 on my Asus Z170 Deluxe system.
       
      For installation I used this Thread.
       
      I used it a lot and it worked well. Meanwhile I switched to Linux and I use Win10 time to time. So OSX was forgotten. Also it did not boot correctly anymore.
       
      Now I wanted to start with a fresh installation and use OSX more often again. I want to use OSX 10.13 High Sierra. Is it working on my Asus Z170 Deluxe? I have the same Hardware as of April 2016 only the graphics card was updated to a Nvidia GTX1080.
       
      My Hardware in detail: Asus Z-170-Deluxe (Bios 3801), i7-6700k, EVGA GeForce GTX 1080 SC GAMING ACX 3.0, Samsung 950 Pro/M2 NVME 512MB, HDD 4 TB)
      Can I use some of support files from the old thread for the installation (see attachment)? Can I still use  Clover 2.3k r3292 Special Edition v2 ? Or do I need a newer version?
       
      Has someone installed High Sierra successfully on the Asus Z170 Deluxe ?
       
      About some hints where to start I would be thankful.
       
      regards
      JackBauer24
       
      Z170DeluxeFiles.zip
    • By ThatsMatt
      Salve, sono nuovo nel forum e mi serviva una mano nell'installazione dell' ultima versione di MacOs sul mio notebook HP Pavilion 15-ak112nl.
      Specifiche Tecniche: 
      CPU: Intel Core i7-6700HQ (2.60 / 3.50 GHz, 4 core, 6 MB CACHE L3). 
      Scheda Grafica: Intel HD Graphics 530 + NVIDIA GeForce GTX 950M 4 GB DDR3.
      Hard Disk: 1 TB SATA 5400 rpm.
      Ram: 8 GB DDR3L-1600.
      Audio: altoparlanti stereo Bang & Olufsen PLAY. 
      Rete: LAN 10/100, WLAN 802.11b/g/n, bluetooth 4.0 (Miracast).
      Grazie in Anticipo a chi mi risponderà
×