Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

  • For some reason, KBLFramebuffer still gets loaded by the USB stick even though it's not in its prelinkedkernel.

 

Not specified to KBL, but have you tried to check your recovery partition prelinked? There are no framebuffer / applehda in prelinked, but im sure Lilu (plugins) are able to patch loaded kexts (all kexts are become online after BaseSystem.dmg get mounted) by intercepting LoadedKextSummaries so called "trampoline". While Clover limited to patch prelinked only & gone after exitbootservices. Like unable to store complete log (without dirty tricks) to datahub instead debugging on screen ..

 

com.apple.driver.AppleIntelKBLGraphics is also a substring of com.apple.driver.AppleIntelKBLGraphicsFramebuffer ;)

 

Already proposed before, heres from my last mods:

BOOLEAN
IsPatchNameMatch (
  CHAR8   *BundleIdentifier,
  CHAR8   *Name,
  CHAR8   *InfoPlist,
  INT32   *IsBundle
) {
  // Full BundleIdentifier: com.apple.driver.AppleHDA
  *IsBundle = (CountOccurrences (Name, '.') < 2) ? 0 : 1;
  return
    ((InfoPlist != NULL) && (*IsBundle == 0))
      ? (AsciiStrStr (InfoPlist, Name) != NULL)
      : (AsciiStrCmp (BundleIdentifier, Name) == 0);
}

If contain 2 dots or more Clover should search full BundleIdentifier.

 

imo Clover should support '*' as wildcard rather than generally using substrings.

 

Hmm, **noted ^_^

  • Like 1
Link to comment
Share on other sites

@cecekpawon:
I don't have any recovery partitions, and I'm not using BaseSystem.dmg on the fly. It's already expanded onto HFS+ filesystem on the USB stick.
The prelinkedkernel on it did not contain AppleIntelKBLGraphicsFramebuffer. The kext only existed in /System/Library/Extensions in normal form, and yet, after kernel
initialization, it decided to load this kext even though it wasn't prelinked.
Lilu has mechanism to wait for late-load kext to load before patching. Clover can't do this because it's before kernel initialization.
 

Already proposed before, heres from my last mods IsPatchNameMatch...


I see full bundle name is already implemented today (in 4128)

PatchKext
  } else {
    //
    //others
    //
    for (i = 0; i < Entry->KernelAndKextPatches->NrKexts; i++) {
      CHAR8 *Name = Entry->KernelAndKextPatches->KextPatches[i].Name;
      BOOLEAN   isBundle = (AsciiStrStr(Name, ".") != NULL);
      if ((Entry->KernelAndKextPatches->KextPatches[i].DataLen > 0) &&
          isBundle?(AsciiStrCmp(gKextBundleIdentifier, Name) == 0):(AsciiStrStr(InfoPlist, Name) != NULL)) {
      //    (AsciiStrStr(InfoPlist, Entry->KernelAndKextPatches->KextPatches[i].Name) != NULL)) {
        DBG_RT(Entry, "\n\nPatch kext: %a\n", Entry->KernelAndKextPatches->KextPatches[i].Name);
        AnyKextPatch(Driver, DriverSize, InfoPlist, InfoPlistSize, i, Entry);
      }
    }
  }

so what PMHeart suggested in #2391 already works.

  • Like 1
Link to comment
Share on other sites

report one

i try to make usb legacy installer.

post-980913-0-45899300-1501249943_thumb.png

 

There is only 6 message on the screen. stop. i tested my skylake laptop(only use legacy mode on bios to check work or not) and old dell laptop(legacy bios)

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

6 <--- Stop

 

 

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

 

add. old pkg show like

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

b1f: init5 <--- Stop

 

 

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

 

 

 

USB

Format = Fat32, MBR

 

There seems to be a problem.

 

to be sure usb or bios problem, i test chameleon pkg. chameleon was successful when it was tested on the same usb with a chameleon package.

 

this is clover install log

/dev/disk1 (external, physical):   #:                       TYPE NAME                    SIZE       IDENTIFIER   0:     FDisk_partition_scheme                        *15.9 GB    disk1   1:                 DOS_FAT_32 1                       15.9 GB    disk1s1======================================================Backing up EFI filesBacking up stage2 file /Volumes/1/EFIROOTDIR/boot  to /Volumes/1/EFI-Backups/r4128/2017-07-28-23h01/bootBacking up /Volumes/1/EFIROOTDIR/EFI folder to /Volumes/1/EFI-Backups/r4128/2017-07-28-23h01/EFICurrent Active Partition: 1Stage 0 - Writting boot0af to /dev/disk1/Volumes/1/usr/local/bin/fdisk440 -u -f /Volumes/1/usr/standalone/i386/boot0af -y /dev/disk1Stage 1 - Writting boot1f32 to /dev/rdisk1s1dd if=/dev/rdisk1s1 count=1 bs=512 of=/tmp/origbsboot volume format is FAT32cp /tmp/boot1f32 /tmp/newbsdd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notruncdd if=/tmp/newbs of=/dev/rdisk1s1Setup Active Partition to be: 1New Active Partition: 1Stage 2 - Written boot6 (x64) to /Volumes/1/boot================================================================= Clover EFI Installation Finish ===========
chameleon install log
------------------------------------------------------------------------------END - Pre-Install Script==============================================================================Main Standard Post-Install ScriptChameleon installer log - Fri Jul 28 22:59:11 KST 2017Darwin/x86 boot v5.0.132 - Enoch r2889==============================================================================BACKUP CHAMELEON FILES:Backup stage2 file /Volumes/1/boot to /Volumes/1/Chameleon.Backups/2017-07-28-22h59/bootNo Extra folder was found, nothing to be saved.==============================================================================EXTRA FOLDER:Extra not found on /Volumes/1, creating..File Doesn't Exist, Will Create: /Volumes/BOOTRAMDISK/Extra/org.chameleon.Boot.plist==============================================================================First Check Passed (not Fat16)!Windows installation not found on /dev/disk1./dev/disk1s1 is FAT32 formatted==============================================================================WRITING STAGE 0:boot0 written to /dev/disk1==============================================================================WRITING STAGE 1 msdos:boot1f32 (msdos) written to /dev/rdisk1s1.==============================================================================WRITING STAGE 2:Stage 2 (boot) written to /Volumes/1.==============================================================================SET PARTITION ACTIVE:disk1, slice 1 is already set active. No need to change it.============================================================================================================================================================END - Standard Post-Install Script==============================================================================Running Post postinstall scriptTarget volume = /Volumes/1------------------------------------------------------------------------------Moving Extra folder to /Volumes/1------------------------------------------------------------------------------Post postinstall script complete==============================================================================NOTE: any Themes or modules you have must be there since this now      is the boot partition. ACPI tables, SMBios.plist, kernel.plist, kexts.plist and the      org.chameleon.Boot.plist (with custom settings for the target      OSX must be in each partition that contain it.)==============================================================================
thanks in advance.

 

EDIT1. from clover official pkg file.

r3577

shown "b1f: init5"

 

r3811

shown "6"

 

in chameleon

shortly shown "b1f: init" and get chameleon window

 

just changed text?. some system stop this message. can i get some log? only happen legacy case.

very strange. chameleon passed this problem. but clover can't hmm..

 

i search this. some people exprienced this issue. as result, some system can't use clover legacy bios mode. because always stop "b1f: init5" or "6". also if dont have uefi, never use clover.

only way chameleon..

 

EDIT2.

long time ago, micky resolved this issue on Phoenix Tiano Secure Core Bios(my case). link

For Clover:

can install in UEFI only or in Legacy mode (you can choose now the boot0xg instead of boot0af to solve problem described by carbo178 here).

The news for Pandora is the new Clover config Editor:

any chance add this boot0xg in clover? or already include?

  • Like 2
Link to comment
Share on other sites

Hi @Slice

Is it possible to add a specific folder for config.plist because sometimes I find myself with 3 or 4 config in the Clover folder Thanks in advance

Link to comment
Share on other sites

Hi @Slice

Is it possible to add a specific folder for config.plist because sometimes I find myself with 3 or 4 config in the Clover folder Thanks in advance

 

Put them in the \EFI\CLOVER\OEM\SystemProduct folder, SystemProduct is the name that is detected by clover from your original SMBIOS tables. You can get it from the boot.log, it says what folders it will check.

 

EDIT: Notice that SystemProduct changes from system to system, unless you have identical systems (although maybe still not, lol).

  • Like 2
Link to comment
Share on other sites

@apianti @Slice
 
if enable debug of KernelAndKextPatches,
some system can see whole debug log with flow text.
but, other system can't see whole debug log. suddenly force reboot. i can't catch this bug.
i just catched point where force reboot.
 
sandy laptop with phoenix uefi
 - flow text is fast
 - no problem with whole log and boot.
 
skylake laptop with phoenix uefi
- flow text is slow

- has problem after progress some log and force reboot. point here #1 #2

 

code is fine. but Strangely, there is a phenomenon that the SkyLake system reboots if enable debug.

ofc, i tried to boot with same clover files both sandy and skylake, only sandy has luck with boot.

how about your system?

 

thanks in advance

Link to comment
Share on other sites

Put some more debug messages in there. If you still can't determine, put a message then a halt, repeat until you get to the restart. It will be time consuming but it will help you figure out where the bug is.

Link to comment
Share on other sites

Put some more debug messages in there. If you still can't determine, put a message then a halt, repeat until you get to the restart. It will be time consuming but it will help you figure out where the bug is.

Okay. I will debug more. Can i prevent force reboot from clover debug log like osx's debug=0x100?

 

나의 LG-F800S 의 Tapatalk에서 보냄

I went back to 4114 because I kept getting that zip file, I guess I'm not the only one.

There is zip file on internal clover official package r4128 that made by Slice. Its his mistake. So if you install clover, this zip install.

 

If you dont want, make clover package from clover script.

 

Sorry my english

 

나의 LG-F800S 의 Tapatalk에서 보냄

  • Like 1
Link to comment
Share on other sites

Put them in the \EFI\CLOVER\OEM\SystemProduct folder, SystemProduct is the name that is detected by clover from your original SMBIOS tables. You can get it from the boot.log, it says what folders it will check.

 

EDIT: Notice that SystemProduct changes from system to system, unless you have identical systems (although maybe still not, lol).

Its not visible in SystemProduct

Boot Log

 

SelfDirPath = \EFI\CLOVER

Link to comment
Share on other sites

Okay. I will debug more. Can i prevent force reboot from clover debug log like osx's debug=0x100?

 

No, it's restarting because the CPU is irrecoverably excepting, you'll have to put a CpuDeadLoop() after each message that it gets to, that will halt progress. Then move it to the next, and so on, until it restarts. Also are you using the debug target? Cause usually in the debug target it will print out the exception on the screen and halt instead of restart.

 

 

Its not visible in SystemProduct

Boot Log

 

SelfDirPath = \EFI\CLOVER

 

No not SelfDir, it's after that, post your log and I'll show you.

Link to comment
Share on other sites

No, it's restarting because the CPU is irrecoverably excepting, you'll have to put a CpuDeadLoop() after each message that it gets to, that will halt progress. Then move it to the next, and so on, until it restarts. Also are you using the debug target? Cause usually in the debug target it will print out the exception on the screen and halt instead of restart.

 

 

 

No not SelfDir, it's after that, post your log and I'll show you.

Log attaching

Clover bdmesg Log.txt.zip

Link to comment
Share on other sites

Here is your SystemProduct:

1:954  0:000  Running on: 'OptiPlex 790' with board '0J3C2F'

Choose one of those two and make one of the two folders with config.plist inside:

\EFI\CLOVER\OEM\OptiPlex 790\config.plist
\EFI\CLOVER\OEM\0J3C2F\config.plist

That should do the trick. I'm assuming you have multiple config.plist for different machines, in which case just put them all in their specific SystemProduct OEM folders.

  • Like 3
Link to comment
Share on other sites

 

@apianti @Slice
 
if enable debug of KernelAndKextPatches,
some system can see whole debug log with flow text.
but, other system can't see whole debug log. suddenly force reboot. i can't catch this bug.
i just catched point where force reboot.
 
sandy laptop with phoenix uefi
 - flow text is fast
 - no problem with whole log and boot.
 
skylake laptop with phoenix uefi
- flow text is slow

- has problem after progress some log and force reboot. point here #1 #2

 

code is fine. but Strangely, there is a phenomenon that the SkyLake system reboots if enable debug.

ofc, i tried to boot with same clover files both sandy and skylake, only sandy has luck with boot.

how about your system?

 

thanks in advance

 

Hi Sherlocks,

keep precautions when you do something.

Debug of KernelAndKextPatches was made on screen only because it is only way. Another possible way is on Serial Port if you have one.

Don't account we were just lazy did not print the debug into log. 

  • Like 1
Link to comment
Share on other sites

Hi Sherlocks,

keep precautions when you do something.

Debug of KernelAndKextPatches was made on screen only because it is only way. Another possible way is on Serial Port if you have one.

Don't account we were just lazy did not print the debug into log. 

 

I'll keep in mind your words.
I just wanted to see if there was a new os or patching.
 
I checked all my systems and found
Only Skylake laptops were forced to boot.
SkyLake Desktop and Sandy Bridge laptops did not show this.
Maybe it's a problem with the laptop's BIOS or memory map.
 
Thank you for your reply.
Link to comment
Share on other sites

This patch required for 10.11.6 security update 2017-003.

The XCPM MSR tables have changed slightly (probably due to some small amount of KabyLake support sneaking in):

 

Index: rEFIt_UEFI/Platform/kernel_patcher.c
===================================================================
--- rEFIt_UEFI/Platform/kernel_patcher.c	(revision 4138)
+++ rEFIt_UEFI/Platform/kernel_patcher.c	(working copy)
@@ -689,6 +689,12 @@
       DBG("Kernel power management patch 10.11.1(beta 15B38b)(data3) found and patched\n");
       return TRUE;
     }
+    //rehabman: change for 10.11.6 security update 2017-003 15G1611
+    else if (0x00001b90000000E2ULL == (*((UINT64 *)Ptr))) {
+      (*((UINT64 *)Ptr)) = 0x0000000000000000ULL;
+      DBG("Kernel power management patch 10.11.6(2017-003 15G1611)(data3) found and patched\n");
+      return TRUE;
+    }
     //Sherlocks: change for 10.12 DP1
     else if (0x00003390000000E2ULL == (*((UINT64 *)Ptr))) {
       (*((UINT64 *)Ptr)) = 0x0000000000000000ULL;
Without this change, you have instant reboot for those computers that need KernelPm=true due to locked CPU MSR 0xE2.

 

Also, I would appreciate it if someone with commit access could restore "without caches" option, as previously requested.

 

Index: rEFIt_UEFI/entry_scan/loader.c
===================================================================
--- rEFIt_UEFI/entry_scan/loader.c	(revision 4138)
+++ rEFIt_UEFI/entry_scan/loader.c	(working copy)
@@ -759,7 +759,6 @@
     }
 
     
-//    AddMenuCheck(SubScreen, "Without caches",       OSFLAG_NOCACHES, 69);
 //    AddMenuCheck(SubScreen, "With injected kexts",  OSFLAG_WITHKEXTS, 69);
     AddMenuInfo(SubScreen, L"=== boot-args ===");
     if (!KernelIs64BitOnly) {
@@ -767,6 +766,7 @@
       AddMenuCheck(SubScreen, "macOS 64bit",          OPT_X64,  68);
     }
     AddMenuCheck(SubScreen, "Verbose (-v)",                               OPT_VERBOSE, 68);
+    AddMenuCheck(SubScreen, "Without caches (-f)",       OSFLAG_NOCACHES, 69);
     AddMenuCheck(SubScreen, "Single User (-s)",                           OPT_SINGLE_USER, 68);
     AddMenuCheck(SubScreen, "Safe Mode (-x)",                             OPT_SAFE, 68);
     AddMenuCheck(SubScreen, "Disable KASLR (slide=0)",                    OPT_SLIDE, 68);
  • Like 6
Link to comment
Share on other sites

@RehabMan, thank you. Please tell me, about the flag "KernelPm=true" has the same effect that "AsusAICPUPM=true"?

Please sorry if this is off-topic.

 

EDITED: All is explained here: https://clover-wiki.zetam.org/Configuration/KernelAndKextPatchesPlease sorry.

Seems KernelPM still need to enable manually, at least on XPS 13 9350/9360 and XPS 15 9550/9560. If turn off KernelPM, laptop get stuck at "+++++++++". @gujiangjiang also reported this "bug" as well. KernelPM does not turn on automatically if MSR 0xE2 bit 15 locked. Thus need to refine?

 

Thank you in advance,

syscl

  • Like 1
Link to comment
Share on other sites

Seems KernelPM still need to enable manually, at least on XPS 13 9350/9360 and XPS 15 9550/9560. If turn off KernelPM, laptop get stuck at "+++++++++". @gujiangjiang also reported this "bug" as well. KernelPM does not turn on automatically if MSR 0xE2 bit 15 locked. Thus need to refine?

 

Thank you in advance,

syscl

Are you turning KernelPM off like KernelPM =False? With clover configurator or in Xcode and remove the line?

 

Sent from my SM-G930F using Tapatalk

  • Like 1
Link to comment
Share on other sites

This patch required for 10.11.6 security update 2017-003.

The XCPM MSR tables have changed slightly (probably due to some small amount of KabyLake support sneaking in):

 

Index: rEFIt_UEFI/Platform/kernel_patcher.c
===================================================================
--- rEFIt_UEFI/Platform/kernel_patcher.c	(revision 4138)
+++ rEFIt_UEFI/Platform/kernel_patcher.c	(working copy)
@@ -689,6 +689,12 @@
       DBG("Kernel power management patch 10.11.1(beta 15B38b)(data3) found and patched\n");
       return TRUE;
     }
+    //rehabman: change for 10.11.6 security update 2017-003 15G1611
+    else if (0x00001b90000000E2ULL == (*((UINT64 *)Ptr))) {
+      (*((UINT64 *)Ptr)) = 0x0000000000000000ULL;
+      DBG("Kernel power management patch 10.11.6(2017-003 15G1611)(data3) found and patched\n");
+      return TRUE;
+    }
     //Sherlocks: change for 10.12 DP1
     else if (0x00003390000000E2ULL == (*((UINT64 *)Ptr))) {
       (*((UINT64 *)Ptr)) = 0x0000000000000000ULL;
Without this change, you have instant reboot for those computers that need KernelPm=true due to locked CPU MSR 0xE2.

 

Also, I would appreciate it if someone with commit access could restore "without caches" option, as previously requested.

 

Index: rEFIt_UEFI/entry_scan/loader.c
===================================================================
--- rEFIt_UEFI/entry_scan/loader.c	(revision 4138)
+++ rEFIt_UEFI/entry_scan/loader.c	(working copy)
@@ -759,7 +759,6 @@
     }
 
     
-//    AddMenuCheck(SubScreen, "Without caches",       OSFLAG_NOCACHES, 69);
 //    AddMenuCheck(SubScreen, "With injected kexts",  OSFLAG_WITHKEXTS, 69);
     AddMenuInfo(SubScreen, L"=== boot-args ===");
     if (!KernelIs64BitOnly) {
@@ -767,6 +766,7 @@
       AddMenuCheck(SubScreen, "macOS 64bit",          OPT_X64,  68);
     }
     AddMenuCheck(SubScreen, "Verbose (-v)",                               OPT_VERBOSE, 68);
+    AddMenuCheck(SubScreen, "Without caches (-f)",       OSFLAG_NOCACHES, 69);
     AddMenuCheck(SubScreen, "Single User (-s)",                           OPT_SINGLE_USER, 68);
     AddMenuCheck(SubScreen, "Safe Mode (-x)",                             OPT_SAFE, 68);
     AddMenuCheck(SubScreen, "Disable KASLR (slide=0)",                    OPT_SLIDE, 68);

Great news ! Congrats !

 

Can you share a Compiled version so we can test ?

(I tried r4145 from Clover general discussion thread without success ...)

Link to comment
Share on other sites

Some tips:

- To disable SIP since 10.13 DP3/PB2 entirely, you need to set CsrActiveConfig = 0x3FF

- The name of the new flag is still unknown, but it doesn't really matter, we may change the name after releasing new XNU

Is it backward compatibility?

Link to comment
Share on other sites

×
×
  • Create New...