Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

Why I never get this log?

This patch is not allowed for booted OS..

Here my bootlog:

 

 

 

0:100  0:100  MemLog inited, TSC freq: 3410017843
0:100  0:000 
0:100  0:000  Now is 5.7.2016,  10:18:7 (GMT+7)
0:100  0:000  Starting Clover rev 3581 on American Megatrends EFI
0:100  0:000  Build with: [Args: ./ebuild.sh -a X64 -t XCLANG | Command: build --conf=/Users/cecekpawon/src/edk2/Clover/Conf -D USE_LOW_EBDA -p Clover/Clover.dsc -a X64 -b RELEASE -t XCLANG -n 5 | OS: 10.12]
...
0:113  0:000  Custom boot CUSTOM_BOOT_DISABLED (0x0)
0:113  0:000  KextsToPatch: 8 requested
0:113  0:000  KextsToPatch 0: AppleHDA (XXX Sleep 2) :: patch disabled, skipped
0:113  0:000  KextsToPatch 1: AppleHDA (XXX ASSERTION) :: patch disabled, skipped
0:113  0:000  KextsToPatch 2: AppleUSBXHCIPCI :: patch disabled, skipped
0:113  0:000  KextsToPatch 3: AppleIntelFramebufferCapri (DP [to] HDMI) :: patch disabled, skipped
0:113  0:000  KextsToPatch 4: AppleHDA (XXX AD1988) :: patch disabled, skipped
0:113  0:000  KextsToPatch 5: IOGraphicsFamily :: patch disabled, skipped
0:113  0:000  KextsToPatch 6: AppleHDA (XXX AD1988 , AD1984)Matched OSes: 10.11.4,10.11.5
0:113  0:000   Kext bin patch, data len: 4
0:113  0:000  KextsToPatch 7: AppleHDA (Zero 892 10.12)Matched OSes: 10.12
0:113  0:000   Kext bin patch, data len: 4
0:113  0:000  Default theme: embedded
0:113  0:000  LoadDrivers() start
...
0:519  0:000  KextsToPatch: 8 requested
0:519  0:000  KextsToPatch 0: AppleHDA (XXX Sleep 2) :: patch disabled, skipped
0:519  0:000  KextsToPatch 1: AppleHDA (XXX ASSERTION) :: patch disabled, skipped
0:519  0:000  KextsToPatch 2: AppleUSBXHCIPCI :: patch disabled, skipped
0:519  0:000  KextsToPatch 3: AppleIntelFramebufferCapri (DP [to] HDMI) :: patch disabled, skipped
0:519  0:000  KextsToPatch 4: AppleHDA (XXX AD1988) :: patch disabled, skipped
0:519  0:000  KextsToPatch 5: IOGraphicsFamily :: patch disabled, skipped
0:519  0:000  KextsToPatch 6: AppleHDA (XXX AD1988 , AD1984)Matched OSes: 10.11.4,10.11.5
0:519  0:000   Kext bin patch, data len: 4
0:519  0:000  KextsToPatch 7: AppleHDA (Zero 892 10.12)Matched OSes: 10.12
0:519  0:000   Kext bin patch, data len: 4
...
0:962  0:033  GUI ready
6:362  5:400  BootOption of the entry is empty
6:362  0:000  StartLoader() start
6:362  0:000  Entry->Settings: <null string>
6:362  0:000  Finally: Bus=100000kHz CPU=3400MHz
6:362  0:000  Kernel and Kext Patches at A97FD9F8:
6:362  0:000    Allowed: y
6:362  0:000    Debug: n
6:362  0:000    KernelCpu: n
6:362  0:000    Lapic: n
6:362  0:000    Haswell-E: n
6:362  0:000    AICPUPM: n
6:362  0:000    AppleRTC: n
6:362  0:000    KernelPm: n
6:362  0:000    FakeCPUID: 0x0
6:362  0:000    ATIController: null
6:362  0:000    ATIDataLength: 0
6:362  0:000    0 Kexts to load
6:362  0:000    2 Kexts to patch
6:362  0:000      KextPatch[0]: 4 bytes, AppleHDA
6:362  0:000      KextPatch[1]: 4 bytes, AppleHDA
6:362  0:000  Loading boot.efi  status=Success
6:442  0:080  GetOSVersion: : 10.12
6:442  0:000  insert table 9 for dev 19:0
6:443  0:000  Channels: 2

 

 

 

In Setting.c, maybe we can skip (no need to append into array) any patches data while it disabled.

 

 

 

STATIC
BOOLEAN
FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
                   TagPtr DictPointer)
{
  CHAR8   *KextPatchLabel;
  
  ...

  Prop = GetProperty (DictPointer, "KextsToPatch");
  if (Prop != NULL) {
    INTN   i, Count = GetTagCount (Prop);
    //delete old and create new
    if (Patches->KextPatches) {
      Patches->NrKexts = 0;
      FreePool (Patches->KextPatches);
    }
    if (Count > 0) {
      UINTN      j = 0;
      TagPtr     Prop2 = NULL;
      TagPtr     Dict;
      KEXT_PATCH *newPatches = AllocateZeroPool ((/*Patches->NrKexts + */Count) * sizeof(KEXT_PATCH));
      CHAR8      *KextPatchLabel;

      // Patches->NrKexts = 0;
      /*      if (Patches->KextPatches != NULL) {
       CopyMem (newPatches, Patches->KextPatches, (Patches->NrKexts * sizeof(KEXT_PATCH)));
       FreePool (Patches->KextPatches);
       } */

      Patches->KextPatches = newPatches;
      DBG ("KextsToPatch: %d requested\n", Count);
      for (i = 0; i < Count; i++) {
        EFI_STATUS Status = GetElement (Prop, i, &Prop2);
        if (EFI_ERROR (Status)) {
          DBG ("error %r getting next element at index %d\n", Status, i);
          continue;
        }

        if (Prop2 == NULL) {
          break;
        }

        DBG ("KextsToPatch %d:", i);

        Dict = GetProperty (Prop2, "Name");
        if (Dict == NULL) {
          DBG(" patch without Name, skipped\n");
          continue;
        }

        KextPatchLabel = AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string);
        
        Dict = GetProperty (Prop2, "Comment");
        if (Dict != NULL) {
          DBG (" %a (%a)", KextPatchLabel, Dict->string);
        } else {
          DBG (" %a", KextPatchLabel);
        }

        Dict = GetProperty (Prop2, "Disabled");
        if ((Dict != NULL) && IsPropertyTrue (Dict)) {
          DBG(" :: patch disabled, skipped\n");
          continue;
        }

        Patches->KextPatches[Patches->NrKexts].Name  = NULL;
        Patches->KextPatches[Patches->NrKexts].Data  = NULL;
        Patches->KextPatches[Patches->NrKexts].Patch = NULL;
        Patches->KextPatches[Patches->NrKexts].Name = AllocateCopyPool (AsciiStrSize (KextPatchLabel), KextPatchLabel);

        FreePool(KextPatchLabel);
        
        // check enable/disabled patch (OS based) by Micky1979
        Dict = GetProperty (Prop2, "MatchOS");
        if ((Dict != NULL) && (Dict->type == kTagTypeString)) {
          Patches->KextPatches[Patches->NrKexts].MatchOS = AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string);
          DBG(" :: Matched OSes: %a\n", Patches->KextPatches[Patches->NrKexts].MatchOS);
        }
        
        // check if this is Info.plist patch or kext binary patch
        Dict = GetProperty (Prop2, "InfoPlistPatch");
        Patches->KextPatches[Patches->NrKexts].IsPlistPatch = IsPropertyTrue (Dict);

 

 

 

Have  I missed something here master?

  • Like 1
Link to comment
Share on other sites

Yes appear to be good less when only one os is given:

else {
    // str contains only one component and it is our string!
    mo->array[0] = str;
  }

when  is only one "token" fails because later we call "FreePool" but  is not allocated by malloc (AllocatePool). We have to use "AllocatePool" also for that otherwise cannot be freed.  

EDIT

 

or skip it if the count == 1

Thanks!

This must be

mo->array[0] = AllocateCopyPool(sizeof(str), str);

Rev 3582

Why I never get this log?

This patch is not allowed for booted OS..

Here my bootlog:

 

Because patches will be disabled only after booting OS when debug.log is already closed.

And yes, if the patch is disabled then no need to look it.

Submitted 3583

Link to comment
Share on other sites

I was just about to post great success with 3582 and now there's another commit!

 

Building 3583 now :)

 

Ok, 3583 also works well. The correct patches are loaded depending on whether I boot into 10.10, 10.11 or 10.12 on the X79.

 

I can't see any difference between 82 and 83 though. It still runs through all the patches and still shows all 21 patches in bdmesg. Or did I misread the commit description?

Link to comment
Share on other sites

I was just about to post great success with 3582 and now there's another commit!

 

Building 3583 now :)

 

Ok, 3583 also works well. The correct patches are loaded depending on whether I boot into 10.10, 10.11 or 10.12 on the X79.

 

I can't see any difference between 82 and 83 though. It still runs through all the patches and still shows all 21 patches in bdmesg. Or did I misread the commit description?

Hello there,

 

Commit [r3583]

 

dont allocate data for disabled patches

 

What does that mean?

 

Well, it's very simple, if the patch has the variable disabled set to true, clover won't allocate memory for the specific patch and the kext won't be patched.

 

Best regards.

Link to comment
Share on other sites

In my case Clover wouldn't be able to patch the kext anyway as the "find" pattern wouldn't match. Most of them differ with OS versions.

 

This is how I've been doing it up until now with all 21 patches for AICPUPM for 10.9-10.12. Clover would run through all of them but would only be able to apply the ones where the find pattern matches. The rest would just fail.

 

Ideally what I'd like would be if Clover would only load the ones that matched and ignored all the others. What we have now is a step up as it doesn't try to apply unmatched patches. I'm not too well versed in the internals, but not allocating memory for patches that won't be applied sounds like a good improvement.

Link to comment
Share on other sites

I was just about to post great success with 3582 and now there's another commit!

 

Building 3583 now :)

 

Ok, 3583 also works well. The correct patches are loaded depending on whether I boot into 10.10, 10.11 or 10.12 on the X79.

 

I can't see any difference between 82 and 83 though. It still runs through all the patches and still shows all 21 patches in bdmesg. Or did I misread the commit description?

It looks for all patches and show then in bdmesg, except patches marked "Disabled".

But decision about is the patch allowed for booted OS will be later.

 

Commit 83 is only for optimize time and reduce memory leaks.

 

 

 

Isn't sizeof(str) always 4 or 8? Maybe it should be AsciiStrLen(str) + 1

 

AsciiStrSize(str) looks better, but you're absolutely right @joevt . :)

Agree. Commit, please, I can't do this now.

  • Like 1
Link to comment
Share on other sites

It looks for all patches and show then in bdmesg, except patches marked "Disabled".

 

I think that's what I was expecting, but it still shows all of the patches in bdmesg. By disabled do you mean patches that don't match the running OS?

 

Any patches that don't match still show the "not allowed" message in debug.

Link to comment
Share on other sites

Now I am at home. Committed 3584.


I think that's what I was expecting, but it still shows all of the patches in bdmesg. By disabled do you mean patches that don't match the running OS?

 

Any patches that don't match still show the "not allowed" message in debug.

No I mean key "Disabled"

		<key>KextsToPatch</key>
		<array>
			<dict>
				<key>Find</key>
				<data>SGVhZHBob25lcwA=</data>
				<key>Name</key>
				<string>VoodooHDA</string>
				<key>Replace</key>
				<data>VGVsZXBob25lcwA=</data>
				<key>Disabled</key>
				<true/>
			</dict>

  • Like 1
Link to comment
Share on other sites

 

@Slice

For bdmesg, why check for Disable instead of MatchOS Key to prevent it from showing?

 

@Mickey1979

All have NO space in between?

<string>10.7.x,10.8.x,10.9.x,10.10.x,10.11.x</string>

I explained this several times. Because OSversion is not known at the time of settings reading.

 

Yes, no spaces.

  • Like 2
Link to comment
Share on other sites

For bdmesg, why check for Disable instead of MatchOS Key to prevent it from showing?

Because your computer might have multiple partitions with different versions of OS X and the version that you want to boot hasn't been chosen at the time of settings reading.
  • Like 1
Link to comment
Share on other sites

Clover 3606

 

 

[DLINK1] OsxLowMemFixDrv
[CC] Mach-O
[MTOC] OsxLowMemFixDrv
[GENFW] OsxLowMemFixDrv
[CC] NVRAMDebug
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4182:42: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
  InputBootArgs->Entry.Title = PoolPrint("%s", L"Theme:");
                                         ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4192:12: error: use of undeclared identifier 'Flags'
  FreePool(Flags);
           ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4232:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Config:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4244:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Boot Args:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4255:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Block kext:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4266:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Set OS version if not:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
6 errors generated.
make: *** [/Users/dropletsboris/src/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/rEFIt_UEFI/refit/OUTPUT/refit/menu.obj] Error 1


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/dropletsboris/src/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/rEFIt_UEFI/refit]


build.py...
 : error F002: Failed to build module
	/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit.inf [X64, XCODE5, RELEASE]

- Failed -
Build end time: 21:07:55, Jul.11 2016
Build total time: 00:00:40

Dropletss-MacBook-Pro:Clover dropletsboris$ 

 

 

Link to comment
Share on other sites

Micky1979! Thank you!

 

 

 







Building process complete!
 --------------------------

 Build info.
 ===========
  Package name: Clover_v2.3k_r3606.pkg
  MD5:          3a95f39f400d2e390ca691b423057470
  Version:      v2.3k
  Stage:        v2.3k
  Date/Time:    2016-07-11 23:32:50
  Built by:     dropletsboris
  Copyright     2012-2016

  adding: Clover_v2.3k_r3606.pkg (deflated 0%)
  adding: Clover_v2.3k_r3606.pkg.md5 (stored 0%)
total 105000
drwxr-xr-x   9 dropletsboris  staff       306 Jul 11 23:35 .
drwxr-xr-x  14 dropletsboris  staff       476 Jul 11 23:35 ..
-rw-r--r--@  1 dropletsboris  staff  26706925 Jul 11 23:35 Clover_v2.3k_r3606.pkg
-rw-r--r--   1 dropletsboris  staff        68 Jul 11 23:35 Clover_v2.3k_r3606.pkg.md5
-rw-r--r--   1 dropletsboris  staff  26661640 Jul 11 23:35 Clover_v2.3k_r3606.zip
drwxr-xr-x   3 dropletsboris  staff       102 Jul 11 23:35 Resources
drwxr-xr-x   7 dropletsboris  staff       238 Jul 11 23:35 build
drwxr-xr-x   3 dropletsboris  staff       102 Jul 11 23:35 package
drwxr-xr-x   7 dropletsboris  staff       238 Jul 11 23:35 utils 

 

 

  • Like 1
Link to comment
Share on other sites

 

Micky1979! Thank you!

 

 

 

Building process complete!

--------------------------

 

Build info.

===========

Package name: Clover_v2.3k_r3606.pkg

MD5: 3a95f39f400d2e390ca691b423057470

Version: v2.3k

Stage: v2.3k

Date/Time: 2016-07-11 23:32:50

Built by: dropletsboris

Copyright 2012-2016

 

adding: Clover_v2.3k_r3606.pkg (deflated 0%)

adding: Clover_v2.3k_r3606.pkg.md5 (stored 0%)

total 105000

drwxr-xr-x 9 dropletsboris staff 306 Jul 11 23:35 .

drwxr-xr-x 14 dropletsboris staff 476 Jul 11 23:35 ..

-rw-r--r--@ 1 dropletsboris staff 26706925 Jul 11 23:35 Clover_v2.3k_r3606.pkg

-rw-r--r-- 1 dropletsboris staff 68 Jul 11 23:35 Clover_v2.3k_r3606.pkg.md5

-rw-r--r-- 1 dropletsboris staff 26661640 Jul 11 23:35 Clover_v2.3k_r3606.zip

drwxr-xr-x 3 dropletsboris staff 102 Jul 11 23:35 Resources

drwxr-xr-x 7 dropletsboris staff 238 Jul 11 23:35 build

drwxr-xr-x 3 dropletsboris staff 102 Jul 11 23:35 package

drwxr-xr-x 7 dropletsboris staff 238 Jul 11 23:35 utils 

 

 

attachicon.gif Log_Compile3606.zip

 

 

tested the boot?

Link to comment
Share on other sites

Clover 3606

 

 

[DLINK1] OsxLowMemFixDrv
[CC] Mach-O
[MTOC] OsxLowMemFixDrv
[GENFW] OsxLowMemFixDrv
[CC] NVRAMDebug
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4182:42: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
  InputBootArgs->Entry.Title = PoolPrint("%s", L"Theme:");
                                         ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4192:12: error: use of undeclared identifier 'Flags'
  FreePool(Flags);
           ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4232:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Config:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4244:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Boot Args:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4255:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Block kext:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit/menu.c:4266:44: error: incompatible pointer types passing 'char [3]' to parameter of type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wincompatible-pointer-types]
    InputBootArgs->Entry.Title = PoolPrint("%s", L"Set OS version if not:");
                                           ^~~~
/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/Platform/../refit/IO.h:115:40: note: passing argument to parameter 'fmt' here
  IN CHAR16                           *fmt,
                                       ^
6 errors generated.
make: *** [/Users/dropletsboris/src/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/rEFIt_UEFI/refit/OUTPUT/refit/menu.obj] Error 1


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/dropletsboris/src/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/rEFIt_UEFI/refit]


build.py...
 : error F002: Failed to build module
	/Users/dropletsboris/src/edk2/Clover/rEFIt_UEFI/refit.inf [X64, XCODE5, RELEASE]

- Failed -
Build end time: 21:07:55, Jul.11 2016
Build total time: 00:00:40

Dropletss-MacBook-Pro:Clover dropletsboris$ 

 

 

Thanks,

corrected in 3607

Link to comment
Share on other sites

is it normal to have this during compilation? compiled success though

cp: /Users/ellaosx/src/edk2/Build/Clover/RELEASE_XCODE5/X64/GrubEXFAT.efi: No such file or directory

It is not normal that compilation scripts don't see the flag NO_GRUB_DRIVERS.

 

Link to comment
Share on other sites

×
×
  • Create New...