Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

12 hours ago, Sherlocks said:

@Slice @vector sigma @savvas @Zenith432

I'm committing on Windows
If i commit the postinstall file in Windows, when you receive the source from sf on a Mac, the postinstall file does not work(exec feature was lost)

 and you are currently experiencing a package problem.
Currently I can not commit on the Mac. Please commit the postinstall file in the AppleUiSupport folder inside the package folder templete folder to the file I uploaded now.

 

I discovered this problem while debugging. Other files have never had a problem before. This problem occurred when only the postinstall file was committed in Windows.

 

contents of postinstall are same like before, i don't know why this issue happen. just need to remove and commit postinstall again. 

just found that postinstall committed in windows has white icon, postinstall commited in mac has black icon.

 

AppleUiSupport.zip

 

EDIT

between r4684 and r4685, i tried to delete postinstall and commit it again. but still postinstall file has white icon.

postinstall file needs to be commit in mac os.

189974135_2018-09-306_01_06.png.87c24b39633ac4313e359570a3d4fa53.png

509648450_2018-09-306_01_54.png.0bb517335f3027dd5008d21c1302a051.png

 

Hi Sherlocks, in Windows probably the difference is in the carriage return/line feed ('\r' vs '\n') as line separator.

I'm going to fix it

  • Like 1
Link to comment
Share on other sites

40 minutes ago, vector sigma said:

Hi Sherlocks, in Windows probably the difference is in the carriage return/line feed ('\r' vs '\n') as line separator.

I'm going to fix it

 

@vector sigma

still it's not unix version. very strange in r4686. package still is broken.

1456567135_2018-09-3011_19_56.png.d512748821651c6c1080c2f417aec775.png

895678690_2018-09-3011_20_01.png.9e50c4d940b747bb15f85cc08d4aca88.png

 

i attached AppleUiSupport.zip file above. this is unix version. but in sf, postinstall has white icon.

1251169730_2018-09-3011_21_26.png.6b6131bb544fe657e6c74fe5f7455d29.png

 

 

Edited by Sherlocks
Link to comment
Share on other sites

1 hour ago, Sherlocks said:

 

@vector sigma

still it's not unix version. very strange in r4686. package still is broken.

1456567135_2018-09-3011_19_56.png.d512748821651c6c1080c2f417aec775.png

895678690_2018-09-3011_20_01.png.9e50c4d940b747bb15f85cc08d4aca88.png

 

i attached AppleUiSupport.zip file above. this is unix version. but in sf, postinstall has white icon.

1251169730_2018-09-3011_21_26.png.6b6131bb544fe657e6c74fe5f7455d29.png

 

 

It is ok here. But to be honest your file will be no longer needed since I'm making al FV2 drivers optionals and all of them will use a common preinstall script (MarkChoice) already in use for all optional drivers..

  • Like 2
Link to comment
Share on other sites

On 9/26/2018 at 3:13 PM, Sherlocks said:

seems your acpipatcher.c has downsteam parts compared to clover acpipatcher.c in github. because i took only latest acpipatcher.c file from your github. please check your file.

나의 LG-F800S 의 Tapatalk에서 보냄
 

The AcpiPatcher.c in svn has two problems:

- function PatchAllTables, initialization of Patched is misplaced (init inside loop, not outside)

- function PatchAllTables, should be using Len + 4096 not Len + 19 (for case of patches that Replace is larger than Find)

 

So, this code in my version of AcpiPatcher.c:


VOID PatchAllTables()
{
  UINT32 Count = XsdtTableCount();
  UINT64* Ptr = XsdtEntryPtrFromIndex(0);
  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
  for (; Ptr < EndPtr; Ptr++) {
    BOOLEAN Patched = FALSE;

...

 

Should replace the code in svn:


VOID PatchAllTables()
{
  UINT32 Count = XsdtTableCount();
  UINT64* Ptr = XsdtEntryPtrFromIndex(0);
  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
  BOOLEAN Patched = FALSE;
  for (; Ptr < EndPtr; Ptr++) {

...

 

If you really prefer declaring all locals at the top of the function (a bad habit, IMHO), you must do so without changing the logic:


VOID PatchAllTables()
{
  UINT32 Count = XsdtTableCount();
  UINT64* Ptr = XsdtEntryPtrFromIndex(0);
  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
  BOOLEAN Patched;
  for (; Ptr < EndPtr; Ptr++) {

    Patched = FALSE;

...

 

And then related to the memory allocation +19 vs. +4096:

This:


    EFI_STATUS Status = gBS->AllocatePages(AllocateMaxAddress,
                                           EfiACPIReclaimMemory,
                                           EFI_SIZE_TO_PAGES(Len + 4096),
                                           &BufferPtr);

 

Instead of this:


    EFI_STATUS Status = gBS->AllocatePages(AllocateMaxAddress,
                                           EfiACPIReclaimMemory,
                                           EFI_SIZE_TO_PAGES(Len + 19),
                                           &BufferPtr);

 

And this:


      gBS->FreePages(BufferPtr, EFI_SIZE_TO_PAGES(Len + 4096));

 

Instead of this:


      gBS->FreePages(BufferPtr, EFI_SIZE_TO_PAGES(Len + 19));

  • Like 1
Link to comment
Share on other sites

2 minutes ago, Slice said:

+19 is necessary and enough. Isn't it?

Not enough.

 

Personally, I don't use Find/Replace where Replace is larger than Find. But as an example, if you had a find/replace where Replace was larger than Find by 4 bytes, it would only take 5 matches to overrun the buffer.

Link to comment
Share on other sites

1 hour ago, vector sigma said:

I'm making al FV2 drivers optionals

Done in r4687, now FileVault2 drivers are stored in CloverV2/drivers-Off/drivers6*/FileVault2. In the installer, they are now in separate groups and are totally optionals.

Of course they are recordered but this is a change that cause users to do a check for the drivers when installing the first time with the new modified installer due to the fact that choices previously selected cannot be the same since now have a new identifier. 

Please let me know.

 

P.S. added also translations for the new groups and corrected/completed the Italian translation, may you want to do the same for your languages!

Link to comment
Share on other sites

59 minutes ago, vector sigma said:

I'm a little worried if this really can be done. which exceded bytes Clover are going to override?

You need to study the ACPI patching code a bit more.

Link to comment
Share on other sites

7 minutes ago, RehabMan said:

You need to study the ACPI patching code a bit more.

Sure Sir but this isn't an answere (and yes, I never watched to the Clover's ACPI patching method... nor else). Just guessing that search and replace function isn't the same patching kexts Lol.

P.S. I'm referring to the ability to patch the tables by search/replace in config

Edited by vector sigma
Link to comment
Share on other sites

Done in r4687, now FileVault2 drivers are stored in CloverV2/drivers-Off/drivers6*/FileVault2. In the installer, they are now in separate groups and are totally optionals.
Of course they are recordered but this is a change that cause users to do a check for the drivers when installing the first time with the new modified installer due to the fact that choices previously selected cannot be the same since now have a new identifier. 
Please let me know.
 
P.S. added also translations for the new groups and corrected/completed the Italian translation, may you want to do the same for your languages!
postinstall was removed. does it be add as unix script?


나의 LG-F800S 의 Tapatalk에서 보냄

The AcpiPatcher.c in svn has two problems:
- function PatchAllTables, initialization of Patched is misplaced (init inside loop, not outside)
- function PatchAllTables, should be using Len + 4096 not Len + 19 (for case of patches that Replace is larger than Find)
 
So, this code in my version of AcpiPatcher.c:

VOID PatchAllTables(){  UINT32 Count = XsdtTableCount();  UINT64* Ptr = XsdtEntryPtrFromIndex(0);  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);  for (; Ptr     BOOLEAN Patched = FALSE;...


 
Should replace the code in svn:

VOID PatchAllTables(){  UINT32 Count = XsdtTableCount();  UINT64* Ptr = XsdtEntryPtrFromIndex(0);  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);  BOOLEAN Patched = FALSE;  for (; Ptr ...


 
If you really prefer declaring all locals at the top of the function (a bad habit, IMHO), you must do so without changing the logic:

VOID PatchAllTables(){  UINT32 Count = XsdtTableCount();  UINT64* Ptr = XsdtEntryPtrFromIndex(0);  UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);  BOOLEAN Patched;  for (; Ptr     Patched = FALSE;...


 
And then related to the memory allocation +19 vs. +4096:
This:

    EFI_STATUS Status = gBS->AllocatePages(AllocateMaxAddress,                                           EfiACPIReclaimMemory,                                           EFI_SIZE_TO_PAGES(Len + 4096),                                           &BufferPtr);


 
Instead of this:

    EFI_STATUS Status = gBS->AllocatePages(AllocateMaxAddress,                                           EfiACPIReclaimMemory,                                           EFI_SIZE_TO_PAGES(Len + 19),                                           &BufferPtr);


 
And this:

      gBS->FreePages(BufferPtr, EFI_SIZE_TO_PAGES(Len + 4096));


 
Instead of this:

      gBS->FreePages(BufferPtr, EFI_SIZE_TO_PAGES(Len + 19));


how about r4682? i returned acpipatcher file to original. i lefted only 2 changed parts that you first mentioned previously.

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

9 minutes ago, vector sigma said:

Just guessing that search and replace function isn't the same patching kexts

Your guess is a good one, as Find/Replace via config.plist/ACPI/DSDT/Patches is much more complex than a simple binary find/replace.  The code does actually make an attempt to deal with mismatched find/replace lengths.  The extra complexity (and likely resulting bugs) is why I avoid such mismatched length patching.

 

  • Like 1
Link to comment
Share on other sites

9 minutes ago, Sherlocks said:

how about r4682? i returned acpipatcher file to original. i lefted only 2 changed parts that you first mentioned previously.
 

My comments apply to the current AcpiPatcher.c on sourceforge, r4687.

If you look at the current code, you will see the exact bugs I described.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Sherlocks said:

postinstall was removed. does it be add as unix script?

Sure as I told you today. It is automatically added as for all other optional drivers. Take a look at:

Clover/CloverPackage/package/Scripts.templates/MarkChoice/preinstall

..so that you don't need to add a specific one since this is common for all

Link to comment
Share on other sites

Sherloks sorry, that was to remove a driver when AppleUiSupport get installed. Didn't notice the difference since both script are very similar. 

Going to fix it sorry again.

Anyway you want to remove AppleUiSupport

# Add postinstall script for old FileVault2 drivers to remove it if AppleUiSupport driver exists
        elif [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* || 
                "$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then

when AppleImageCodec, AppleKeyAggregator, AppleUITheme, FirmwareVolume and HashServiceFix are installed + the opposite? 

Edited by vector sigma
Link to comment
Share on other sites

Sherloks sorry, that was to remove a driver when AppleUiSupport get installed. Didn't notice the difference since both script are very similar.  Going to fix it sorry again. Anyway you want to remove AppleUiSupport       

 

 

# Add postinstall script for old FileVault2 drivers to remove it if AppleUiSupport driver exists       elif [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* ||                "$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then

when AppleImageCodec, AppleKeyAggregator, AppleUITheme, FirmwareVolume and HashServiceFix are installed + the opposite? 

 

 

 

 

 

 

 

 

 

 

yes. i want to remove it(old filevault2 drivers) if AppleUiSupport exists. i just want that Clover package AppleUiSupport kept without old FileVault2 drivers. i already tested all with attached zip file above without not touched original rule of package installation from postinstall.it's similar like vboxhfs file case.AppleKeyAggregator, AppleUITheme, FirewareVolume, SMCHelper were kept for long time ago in r4658 and older. there was no problems. therefore i think slice kept these drivers. recent savvas developed new filevault2 drivr(AppleUISupport). so i need to think needs for avoid duflication of filevault drivers. after install clover, user have to remove old filevault2 drivers if use default 64driver in package. so i made postinstall and edited buildpkg.sh.recent AppleKeyFeeder causes issues(Boot/GUI performance). so i excluded it. to avoid problem between old FileVault2 and AppleUiSupport, i just added postinstall like vbokfhs case. it's simple.  r4687 changed a rule compared before in package. i checked some missing and etc in the morning. i will report it in detail later atfer finished at job. i have to go to the job. EDIT1.

I also think VirtualSMC.efi module case.

now SMCHelper.efi is default. so we need to consider that if VirtualSMC.efi exists, Clover package check it and remove SMCHelper by using postinstall script like vboxhfs. no more need to manually delete SMCHelper.

 

sorry for my bad english

 

 

 나의 LG-F800S 의 Tapatalk에서 보냄

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

52 minutes ago, Sherlocks said:

no. i want to remove it(old filevault2 drivers) if AppleUiSupport exists.

Ok but also I said "+ opposite", i.e if you don't want to use AppleUiSupport and use stock drivers and so ensure AppleUiSupport get deleted. For coerence I think you want the same for the reverse case.

Let me know, I can make all those drivers auto enable or disable by itself if one or another get selected by the user.

Anyway r4689 does what you want.

Link to comment
Share on other sites

1 hour ago, Sherlocks said:

I also think VirtualSMC.efi module case.

now SMCHelper.efi is default. so we need to consider that if VirtualSMC.efi exists, Clover package check it and remove SMCHelper by using postinstall script like vboxhfs. no more need to manually delete SMCHelper.

Now I wonder why we have to copy some drivers in the CloverV2 directory that will be delete later in the package. Should not be simpler to let ebuild.sh to not copying conflicting drivers?

Link to comment
Share on other sites

Now I wonder why we have to copy some drivers in the CloverV2 directory that will be delete later in the package. Should not be simpler to let ebuild.sh to not copying conflicting drivers?
to avoid coflict drivers between appleuisupport and old filevault2 drivers.
i think that no need to consider ebuild.sh in old rules.
it's simple like vboxhfs case.
just first copy vboxhfs file and buildpkg check vboxhfs status(check or not) then checked. go postinstall in Vboxhfs folder. then confirm hfsplus file in folder. and if it exists, postinstall script remove vboxhfs.

i just consider old filevault2 drivers if appleuisupport. in this process, it was happen if postinstall was commited in windows, it lost unix command.

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

2 minutes ago, Sherlocks said:

it's simple like vboxhfs case.
just first copy vboxhfs file and buildpkg check vboxhfs status(check or not) then checked. go postinstall in Vboxhfs folder. then confirm hfsplus file in folder. and if it exists, postinstall script remove vboxhfs.

Imho this is horrible Lol. Users may ask (ok also ignoring the reason) why can select more then one drivers .... that will be delete during the install process w/o know why. If a choice is limited to what is adviced to use (i.e. only cool drivers to use) then is much clear.

Good night

Link to comment
Share on other sites

13 hours ago, vector sigma said:

Imho this is horrible Lol. Users may ask (ok also ignoring the reason) why can select more then one drivers .... that will be delete during the install process w/o know why. If a choice is limited to what is adviced to use (i.e. only cool drivers to use) then is much clear.

Good night

 

back from job. r4690 is good. postinstall has unix.

i suggest that consider SMCHelper.efi(mandatory) and VirtualSMC.efi that user manually added it..

if user already have VirtualSMC.efi, postinstall will remove SMCHelper.efi. it means that no need to remove SMChelper.efi as manual after install clover.

this process is same like VboxHFS.efi.

 

here is log

 

Backing up /Volumes/Macintosh HD/EFIROOTDIR/EFI folder to /Volumes/Macintosh HD/EFI-Backups/r4690/2018-10-01-21h06/EFI
======================================================
Installing BootSectors/BootLoader

Stage 0 - Don't write any of boot0af, boot0md, boot0ss to /
Stage 1 - Don't write any of boot1h2, boot1f32alt, boot1xalt to /

Removing drivers64UEFI/SMCHelper-64.efi driver because VirtualSMC driver present

Removing drivers64UEFI/VBoxHfs-64.efi driver because HFSPlus driver present

 

VirtualSMC tested it.zip

 

EDIT1.

description was broken.

https://sourceforge.net/p/cloverefiboot/code/4687/tree/CloverPackage/package/po/en.po#l507

https://sourceforge.net/p/cloverefiboot/code/4687/tree/CloverPackage/package/po/en.po#l514

https://sourceforge.net/p/cloverefiboot/code/4687/tree/CloverPackage/package/po/en.po#l647

https://sourceforge.net/p/cloverefiboot/code/4687/tree/CloverPackage/package/po/en.po#l654

#, fuzzy, no-wrap

to

#, no-wrap

 

ofc, other lang file too.

Edited by Sherlocks
Link to comment
Share on other sites

Now would be a good time to commit my suggested change (previous post in this thread) to kext_patcher.c to handle InjectKexts="Detect" properly when VirtualSMC.kext is used.


VOID CheckForFakeSMC(CHAR8 *InfoPlist, LOADER_ENTRY *Entry)
{
  if (OSFLAG_ISSET(Entry->Flags, OSFLAG_CHECKFAKESMC) &&
      OSFLAG_ISSET(Entry->Flags, OSFLAG_WITHKEXTS)) {
    if (AsciiStrStr(InfoPlist, "<string>org.netkas.driver.FakeSMC</string>") != NULL
        || AsciiStrStr(InfoPlist, "<string>org.netkas.FakeSMC</string>") != NULL
        || AsciiStrStr(InfoPlist, "<string>as.vit9696.VirtualSMC</string>") != NULL)
    {
      Entry->Flags = OSFLAG_UNSET(Entry->Flags, OSFLAG_WITHKEXTS);
      if (Entry->KernelAndKextPatches->KPDebug) {
        DBG_RT(Entry, "\nFakeSMC or VirtualSMC found, UNSET WITHKEXTS\n");
        gBS->Stall(5000000);
      }
    }
  }
}

  • Like 2
Link to comment
Share on other sites

3 hours ago, Sherlocks said:

i suggest that consider SMCHelper.efi(mandatory) and VirtualSMC.efi that user manually added it..

Ok, but also I want to see if we can checkout and compile it... require some tests

3 hours ago, Sherlocks said:

Italian translation here is ok, I used Poedit. Should I do a manual replace to fix it? And just to ensure this not will happen again should I set some preference in that program I miss?

Link to comment
Share on other sites

Ok, but also I want to see if we can checkout and compile it... require some tests

i tested it by myself enough with log. you can test that just added attached zip file in clover package like AppleUISupport folder and edited buildpkg. i still prefer to commit in windows. therefore, i can' commit postinstall file like previously experienced issue that postinstall lost unix feature. so i request this file for commit 

 

EDIT1.

in POT part, i just found issue for description. and correct wrong part in ko.po as manual w/o tools

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

 

 

 

 

 

Link to comment
Share on other sites

7 minutes ago, Sherlocks said:

i tested it by myself enough with log. you can test that just added attached zip file in clover package like AppleUISupport folder and edited buildpkg.

 

 

Ok for that: will be done. But I'm saying that I want Clover to be able to checkout the VirtualSMC repository and then compile it.

7 minutes ago, Sherlocks said:

in POT part, i just found issue for description. and correct wrong part in ko.po as manual w/o tools

Ok I'll do the same!

Edited by vector sigma
Link to comment
Share on other sites

×
×
  • Create New...