Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

But this capability was already in the code. No changes were required.

Nice to hear the original functionality was restored.

 

No, it was not existing.

Try old version and put in debug mode you'll see what was happening -> many try to patch to not wanted kext defined in your config.plist -> exit don't pathed because data to patch not found.

 

Try to patch IOBluetoothFamily : Handoff 

 

post-509660-0-68713400-1481351734_thumb.jpg

 

 

Now it works great with bin name or full Bundle identifier.

 

Fred

  • Like 1
Link to comment
Share on other sites

No, it was not existing.

Try old version and put in debug mode you'll see what was happening -> many try to patch to not wanted kext defined in your config.plist -> exit don't pathed because data to patch not found.

 

Try to patch IOBluetoothFamily : Handoff 

 

attachicon.gifIMG_0252.JPG

 

 

Now it works great with bin name or full Bundle identifier.

 

Fred

It seems that this is patching the dependencies of the kext you want to patch. But they don't contain the code you want to change.

Link to comment
Share on other sites

It seems that this is patching the dependencies of the kext you want to patch. But they don't contain the code you want to change.

 

Yes that was the case before rev 3956, it's the reason why we needed more strict kext_patcher, that's the case with rev 3960.  :)

 

Fred

Link to comment
Share on other sites

Yes that was the case before rev 3956, it's the reason why we needed more strict kext_patcher, that's the case with rev 3960.  :)

 

Fred

But... It seems that in previous version if use bundle id and then will only match this kext itself... But raw name not. Used bundle id for about 2 years.

Link to comment
Share on other sites

But... It seems that in previous version if use bundle id and then will only match this kext itself... But raw name not. Used bundle id for about 2 years.

 

Maybe was working before, but when I made screenshot with rev 3955 it wasn't.

 

Fred

Link to comment
Share on other sites

No, it was not existing.

Try old version and put in debug mode you'll see what was happening -> many try to patch to not wanted kext defined in your config.plist -> exit don't pathed because data to patch not found.

 

Try to patch IOBluetoothFamily : Handoff 

 

attachicon.gifIMG_0252.JPG

 

 

Now it works great with bin name or full Bundle identifier.

 

Fred

It is because the old code was doing a StrStr for the text specified in Name through the entire Info.plist text.

The new code does an exact StrCmp if Name contains a '.' character.

 

Specifying a complete bundle-id with the old code restricts the search somewhat, but not as completely as the new code. I suspect you find it trying to patch kexts you might not expect (with the old code) due to OSBundleLibraries content in the Info.plist.

 

The code as written now is fine, as it doesn't generally break typical config.plist files...

  • Like 1
Link to comment
Share on other sites

Rename folder "cloverefiboot-code" to "Clover". There is name dependencies.

I compiled Clover and in the first try I added 

DBG("patch table gSettings.ProductName %s\n", gSettings.ProductName);

in PatchTableType17() in smbios.c(right?), then gives me 

5:171  0:021  === [ PatchSmbios ] =======================================
5:171  0:000  insert table 9 for dev 0:0
5:172  0:000  patch table gSettings.ProductName Mcok,,
5:172  0:000  Trusting SMBIOS...
5:172  0:000  Detected alternating SMBIOS channel banks
5:172  0:000  Channels: 2
5:172  0:000  Interleave: 0 2 1 3 4 6 5 7 8 10 9 11 12 14 13 15 16 18 17 19 20 22 21 23
5:172  0:000   partNum=MT52L1G32D4PG-107 
5:172  0:000  SMBIOS Type 17 Index = 0 => 0 0:
5:172  0:000  BANK0 DIMM0 1867MHz 8192MB
5:172  0:000   partNum=MT52L1G32D4PG-107 
5:172  0:000  SMBIOS Type 17 Index = 1 => 1 2:
5:172  0:000  BANK1 DIMM0 1867MHz 8192MB
5:172  0:000  mTotalSystemMemory = 16384
5:172  0:000  NumberOfMemoryDevices = 2
5:172  0:000  Type20[0]->End = 0x7FFFFF, Type17[0] = 0x2000
5:172  0:000  Type20[1]->End = 0xFFFFFF, Type17[1] = 0x6000
5:172  0:000  Table 131 is present, CPUType=31
5:172  0:000  Change to: 705
5:172  0:000  === [ PatchACPI ] =========================================

I will try to print out more places to see where the ProductName has been cut.

 

Any other place you want me to add the code @Slice?

Now change my smbios to MacBookPro12,1, and gives me this:

0:608  0:000  PluginType: 1
0:608  0:000  ResetAddr: 0xB2
0:608  0:000  Calc ResetVal: 0x0
0:608  0:000  ResetVal: 0x73
0:608  0:000  ParseSMBIOSSettings Stage
0:608  0:000  Before AsciiStrCpy gSettings.ProductName = 1678072576
0:608  0:000  After copy gSettings.ProductName 1678072576, Prop->string 1974628776

and

4:192  0:021  === [ PatchSmbios ] =======================================
4:192  0:000  insert table 9 for dev 0:0
4:193  0:001  patch table gSettings.ProductName Mcokr1,
4:193  0:000  Trusting SMBIOS...

syscl

Hi. Try Micky's script. May help. (http://www.insanelymac.com/forum/topic/313240-build-clovercommand-another-script-to-build-standard-clover-or-customized/)

And also you can use `svn co -r 3960 svn://svn.code.sf.net/p/cloverefiboot/code ~/src/edk2/Clover` to download Clover's source code.

Tips:

1. You can run `svn info svn://svn.code.sf.net/p/cloverefiboot/code | grep "Revision" | awk '{print $2;}'` to get the current latest version.

2. Also. You can try `svn co -r $(svn info svn://svn.code.sf.net/p/cloverefiboot/code | grep "Revision" | awk '{print $2;}'svn://svn.code.sf.net/p/cloverefiboot/code ~/src/edk2/Clover` to download Clover's latest version. LOL

3. ~/src/edk2/Clover is for me. You may change this.

 

PMheart

Why... If you use bundle name then will only patch the kext itself. A more precise and speed-up way...

 

PMheart

Thanks, but I prefer official way to compile it and finally figure out the way to compile it without any other third party script..

 

syscl

Link to comment
Share on other sites

Hello Slice,

 

there are two issues with setting `efi-boot-device`.

 

- First the function SetStartupDiskVolume removes the "efi-boot-device" and "efi-boot-device-data" and won't set them, if key in the config file "Boot->DefaultVolume" is set to anything but "LastBootedVolume". For example for everyone who set their "DefaultVolume" to "Macintosh HD" or "Recovery HD" or even set the key "IgnoreNVRAMBoot" to true are getting their "efi-boot-device" and "efi-boot-device-data" removed from the NVRAM. This causes issues for commands like "bless --info --getBoot". Maybe those keys are also needed for future macOS updates as well.

 

- Second the "efi-boot-device" and "efi-boot-device-data" values in NVRAM that get set from clover are not valid. The bless command complains again with following error:

Boot option does not match XML representation
XML representation doesn't match true boot preference

Here are the values from clover (invalid):

efi-boot-device	<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key><string>IOMedia</string><key>IOPropertyMatch</key><dict><key>UUID</key><string>B57A582D-7326-4AE5-94A8-033F4DED338C</string></dict></dict></dict></array>
efi-boot-device-data	%02%01%0c%00%d0A%08%0a%00%00%00%00%01%01%06%00%02%1f%03%12%0a%00%00%00%00%00%00%00%04%01*%00%03%00%00%00h%ec%e5%0d%00%00%00%00 _%13%00%00%00%00%00-Xz%b5&s%e5J%94%a8%03?M%ed3%8c%02%02%7f%ff%04%00

Here are the correct values with setting from macOS settings->Startup Disk:

efi-boot-device	<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key><string>IOMedia</string><key>IOPropertyMatch</key><dict><key>UUID</key><string>B57A582D-7326-4AE5-94A8-033F4DED338C</string></dict></dict><key>BLLastBSDName</key><string>disk2s3</string></dict></array>
efi-boot-device-data	%02%01%0c%00%d0A%03%0a%00%00%00%00%01%01%06%00%02%1f%03%12%0a%00%00%00%00%00%00%00%04%01*%00%03%00%00%00h%ec%e5%0d%00%00%00%00 _%13%00%00%00%00%00-Xz%b5&s%e5J%94%a8%03?M%ed3%8c%02%02%7f%ff%04%00

Can you please take a look on it? There is an ongoing discussion in the ticket #311.

 

Thanks

 

Edit: maybe I should mention, I have file vault2 on, so my boot device is a core storage device.

  • Like 1
Link to comment
Share on other sites

I compiled Clover and in the first try I added 

DBG("patch table gSettings.ProductName %s\n", gSettings.ProductName);

in PatchTableType17() in smbios.c(right?), then gives me 

5:171  0:021  === [ PatchSmbios ] =======================================
5:171  0:000  insert table 9 for dev 0:0
5:172  0:000  patch table gSettings.ProductName Mcok,,
5:172  0:000  Trusting SMBIOS...
5:172  0:000  Detected alternating SMBIOS channel banks
5:172  0:000  Channels: 2
5:172  0:000  Interleave: 0 2 1 3 4 6 5 7 8 10 9 11 12 14 13 15 16 18 17 19 20 22 21 23
5:172  0:000   partNum=MT52L1G32D4PG-107 
5:172  0:000  SMBIOS Type 17 Index = 0 => 0 0:
5:172  0:000  BANK0 DIMM0 1867MHz 8192MB
5:172  0:000   partNum=MT52L1G32D4PG-107 
5:172  0:000  SMBIOS Type 17 Index = 1 => 1 2:
5:172  0:000  BANK1 DIMM0 1867MHz 8192MB
5:172  0:000  mTotalSystemMemory = 16384
5:172  0:000  NumberOfMemoryDevices = 2
5:172  0:000  Type20[0]->End = 0x7FFFFF, Type17[0] = 0x2000
5:172  0:000  Type20[1]->End = 0xFFFFFF, Type17[1] = 0x6000
5:172  0:000  Table 131 is present, CPUType=31
5:172  0:000  Change to: 705
5:172  0:000  === [ PatchACPI ] =========================================

I will try to print out more places to see where the ProductName has been cut.

 

Any other place you want me to add the code @Slice?

Now change my smbios to MacBookPro12,1, and gives me this:

0:608  0:000  PluginType: 1
0:608  0:000  ResetAddr: 0xB2
0:608  0:000  Calc ResetVal: 0x0
0:608  0:000  ResetVal: 0x73
0:608  0:000  ParseSMBIOSSettings Stage
0:608  0:000  Before AsciiStrCpy gSettings.ProductName = 1678072576
0:608  0:000  After copy gSettings.ProductName 1678072576, Prop->string 1974628776

and

4:192  0:021  === [ PatchSmbios ] =======================================
4:192  0:000  insert table 9 for dev 0:0
4:193  0:001  patch table gSettings.ProductName Mcokr1,
4:193  0:000  Trusting SMBIOS...

syscl

Thanks, but I prefer official way to compile it and finally figure out the way to compile it without any other third party script..

 

syscl

But it's too terrible to mess with args...

Link to comment
Share on other sites

I compiled Clover and in the first try I added 

DBG("patch table gSettings.ProductName %s\n", gSettings.ProductName);
in PatchTableType17() in smbios.c(right?), then gives me 

5:171 0:021 === [ PatchSmbios ] =======================================
5:171 0:000 insert table 9 for dev 0:0
5:172 0:000 patch table gSettings.ProductName Mcok,,

 

"Mcok,," shows every second character being printed which happens when you use %s instead of %a. In EFI, %s is for unicode strings (16 bit characters) and %a is for ASCII strings (8 bit characters). The original string was probably like "MacBook#,#", and the second comma is from beyond the end of the string in memory...

 

Unicode and ASCII strings use different string functions so make sure the correct functions are being used.

 

Now change my smbios to MacBookPro12,1, and gives me this:

0:608 0:000 Before AsciiStrCpy gSettings.ProductName = 1678072576
0:608 0:000 After copy gSettings.ProductName 1678072576, Prop->string 1974628776
...
4:193 0:001 patch table gSettings.ProductName Mcokr1,

 

1678072576 and 1974628776 are string addresses? Not useful. Did you mean to print something else?
  • Like 1
Link to comment
Share on other sites

"Mcok,," shows every second character being printed which happens when you use %s instead of %a. In EFI, %s is for unicode strings (16 bit characters) and %a is for ASCII strings (8 bit characters). The original string was probably like "MacBook#,#", and the second comma is from beyond the end of the string in memory...

 

Unicode and ASCII strings use different string functions so make sure the correct functions are being used.

 

1678072576 and 1974628776 are string addresses? Not useful. Did you mean to print something else?

Thanks, will try and reply then

 

syscl

Link to comment
Share on other sites

@Slice here's the output of the gSettings in different stage:

0:549  0:000  === [ GetUserSettings ] ===================================
...
0:549  0:000  gSettings.ProductName MacBookPro11,1, Prop->string MacBookPro12,1
0:549  0:000  gSettings.ProductName MacBookPro12,1, Prop->string MacBookPro12,1
3:800  0:021  === [ PatchSmbios ] =======================================
...
3:801  0:000  gSettings.ProductName MacBookPro12,1
3:836  0:000  === [ RestSetup macOS ] ===================================
...
3:841  0:005  SetupDataForOSX(...)
3:841  0:000  gSettings.ProductName MacBookPro12,1
3:841  0:000  Before !EFI_ERROR(Status) condition gSettings.ProductName MacBookPro12,1
3:841  0:000  In !EFI_ERROR(Status) condition gSettings.ProductName MacBookPro12,1 ProductName 
3:841  0:000  In !EFI_ERROR(Status) after U2Str gSettings.ProductName MacBookPro12,1 ProductName MacBookPro12,1

Will print out more information to see where's the problem.

 

syscl

Link to comment
Share on other sites

@Slice here's the output of the gSettings in different stage:

0:549  0:000  === [ GetUserSettings ] ===================================
...
0:549  0:000  gSettings.ProductName MacBookPro11,1, Prop->string MacBookPro12,1
0:549  0:000  gSettings.ProductName MacBookPro12,1, Prop->string MacBookPro12,1
3:800  0:021  === [ PatchSmbios ] =======================================
...
3:801  0:000  gSettings.ProductName MacBookPro12,1
3:836  0:000  === [ RestSetup macOS ] ===================================
...
3:841  0:005  SetupDataForOSX(...)
3:841  0:000  gSettings.ProductName MacBookPro12,1
3:841  0:000  Before !EFI_ERROR(Status) condition gSettings.ProductName MacBookPro12,1
3:841  0:000  In !EFI_ERROR(Status) condition gSettings.ProductName MacBookPro12,1 ProductName 
3:841  0:000  In !EFI_ERROR(Status) after U2Str gSettings.ProductName MacBookPro12,1 ProductName MacBookPro12,1

Will print out more information to see where's the problem.

 

syscl

Can see nothing about 'MacBookPro1'... Now the problem is after attaching SMBios to 'MacBookPro12,1' and why it got changed to 'MacBookPro1'...

Link to comment
Share on other sites

As well see DataHubCpu.c: line 399

    ProductName         = AllocateZeroPool(64);
    AsciiStrToUnicodeStr(gSettings.ProductName, ProductName);
...
    LogDataHub(&gEfiMiscSubClassGuid,      L"Model",  ProductName, (UINT32)StrSize(ProductName));

No matter of SMBIOS is good or not here we can see what was gSettings.ProductName.

Link to comment
Share on other sites

As well see DataHubCpu.c: line 399

    ProductName         = AllocateZeroPool(64);
    AsciiStrToUnicodeStr(gSettings.ProductName, ProductName);
...
    LogDataHub(&gEfiMiscSubClassGuid,      L"Model",  ProductName, (UINT32)StrSize(ProductName));

No matter of SMBIOS is good or not here we can see what was gSettings.ProductName.

OK,  is there a way to print this out? I saw that gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID*)SmbiosEpsNew); install the Smbios to a EfiSmbiosTableGuid, is that the case that cause the issue(size limitation)?

 

Thanks,

syscl

Link to comment
Share on other sites

OK,  is there a way to print this out? I saw that gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID*)SmbiosEpsNew); install the Smbios to a EfiSmbiosTableGuid, is that the case that cause the issue(size limitation)?

 

Thanks,

syscl

You can print this as well as other prints. And I already see this in your previous report.

There is no any size limitation.

  • Like 1
Link to comment
Share on other sites

You can print this as well as other prints. And I already see this in your previous report.

There is no any size limitation.

@Slice, 

sorry, the compile fail... How to print out the &gEfiSmbiosTableGuid 's content?

 

Thanks,

syscl

  • Like 1
Link to comment
Share on other sites

DarwinDumper do this.

 

Hello,slice,here is my SMBIOS.txt by DarwinDumper.

Handle 0x0001, DMI type 1, 27 bytes
0000: 01 1b 01 00 01 02 05 04 44 45 4c 4c 31 00 10 36 
0010: 80 44 b7 c0 4f 52 37 32 06 03 06 

System Information
	Manufacturer: Apple Inc.
	Product Name: MacBookPro1   
	Version: 1.0
	Serial Number: C02SHAAUGTDY
	UUID: 44454C4C-3100-1036-8044-B7C04F523732
	Wake-up Type: Power Switch
	SKU Number: Mac-A5C67F7         
	Family: MacBook Pro
Handle 0x0002, DMI type 2, 16 bytes
0000: 02 10 02 00 01 02 03 04 00 09 05 03 00 0a 00 00 
0010: 

Base Board Information
	Manufacturer: Apple Inc.
	Product Name: Mac-A5C67F76ED83108C
	Version: MacBookPro13,3
	Serial Number: C02SHAAUGTDYD2F59
	Asset Tag: Not Specified
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Part Component
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

My laptop is XPS 15 9550 by DELL

SMBIOS.txt

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...