Jump to content

Build_Clover.command, another Script to build standard Clover (or customized)


Micky1979
2,126 posts in this topic

Recommended Posts

2 hours ago, zhangqq said:

Open src/EDK2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf

 

Change this line

#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM AARCH64
 

To

  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM AARCH64
 

Now we can compile AppleSupportPkg.

its is still missing :(

Link to comment
Share on other sites

Sorry. Last time I fogot to clear the cache folder of XCode.

This is the correct method. I have test it.

 

1) Keep src/EDK2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf untouched.

2) Clear the cache folder of XCode, every time you change a *.inf file. 
rm -rf ~/Library/Developer/Xcode/DerivedData/*

3) Open src/edk2/AppleSupportPkg/Platform/ApfsDriverLoader/ApfsDriverLoader.inf 
Change this line
  VALID_ARCHITECTURES           = X64
to 
#  VALID_ARCHITECTURES           = X64

4) Choose "standard X64 only" to compile Clover. 

  • Like 1
Link to comment
Share on other sites

5 hours ago, zhangqq said:

#  VALID_ARCHITECTURES           = X64

4) Choose "standard X64 only" to compile Clover. 

It means EDK2 is no more compatible with 32 bit compilation?

  • Like 2
Link to comment
Share on other sites

6 hours ago, zhangqq said:

Sorry. Last time I fogot to clear the cache folder of XCode.

This is the correct method. I have test it.

 

1) Keep src/EDK2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf untouched.

2) Clear the cache folder of XCode, every time you change a *.inf file. 
rm -rf ~/Library/Developer/Xcode/DerivedData/*

3) Open src/edk2/AppleSupportPkg/Platform/ApfsDriverLoader/ApfsDriverLoader.inf 
Change this line
  VALID_ARCHITECTURES           = X64
to 
#  VALID_ARCHITECTURES           = X64

4) Choose "standard X64 only" to compile Clover. 

 

Good idea :) But I don't understand why is necessary to comment a line in ApfsDriverLoader.inf? ApfsDriverLoader.efi well build with the script. The problem is to add AppleImageLoader.efi

Link to comment
Share on other sites

3 hours ago, Slice said:

It means EDK2 is no more compatible with 32 bit compilation?

I don't think so.

 

3 hours ago, Matgen84 said:

 

Good idea :) But I don't understand why is necessary to comment a line in ApfsDriverLoader.inf? ApfsDriverLoader.efi well build with the script. The problem is to add AppleImageLoader.efi

I can't build ApfsDriverLoader.efi without doing the change.

  • Like 1
Link to comment
Share on other sites

23 minutes ago, zhangqq said:

I don't think so.

 

I can't build ApfsDriverLoader.efi without doing the change.

 

You mean that this driver is not in /src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64; Or is not added to Clover.

Do you use latest Build_Clover.command 4.9.1 (with or without clean src)? Here this version work fine to build  ApfsDriverLoader.efi (without your change)

Edited by Matgen84
Link to comment
Share on other sites

I found AppleImageLoader.efi. It is here.

src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64/AppleImageLoader.efi

 

It seems that it is not pack correctly. It is compiled. 

 

And for the old version ApfsDriverLoader package.

src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64/AppleLoadImage.efi

 

It is not pack correctly also. 

 

We can manually copy AppleImageLoader.efi to EFI/CLOVER/drivers64UEFI.

  • Like 1
Link to comment
Share on other sites

 

2 hours ago, zhangqq said:

I don't think so.

 

I can't build ApfsDriverLoader.efi without doing the change.

 

22 minutes ago, zhangqq said:

I found AppleImageLoader.efi. It is here.

src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64/AppleImageLoader.efi

 

It seems that it is not pack correctly. It is compiled. 

 

And for the old version ApfsDriverLoader package.

src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64/AppleLoadImage.efi

 

It is not pack correctly also. 

 

We can manually copy AppleImageLoader.efi to EFI/CLOVER/drivers64UEFI.

 

I don't understand: you can or you can't build ApfsDriverLoader.efi? You have or not ApfsDriverLoader.efi in Clover installer pkg?

 

AppleLoadImage.efi is deprecated. Right, you can manually copy AppleImageLoader.efi to EFI/CLOVER/drivers64UEFI. Until the script is updated with the release of this driver

Link to comment
Share on other sites

16 minutes ago, Matgen84 said:

AppleLoadImage.efi is deprecated. Right, you can manually copy AppleImageLoader.efi to EFI/CLOVER/drivers64UEFI. Until the script is updated with the release of this driver

 

Wait, so you don't need to add AppleImageLoader.efi and it'll still work fine?

Link to comment
Share on other sites

@ellaosxtry this to patch DxeServicesLib.inf

 

mkdir -p ~/src/edk2/Clover/Patches_for_EDK2/MdePkg/Library/DxeServicesLib/
cat ~/src/edk2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf | sed -e 's/^.*HobLib/#  HobLib/' > ~/src/edk2/Clover/Patches_for_EDK2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf

then build

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@tluck

i now have AppleImageLoader.efi & ApfsDriverLoader.efi in ~/src/edk2/Build/AppleSupportPkg/RELEASE_XCODE8/X64 as per your instruction. 

 

Also, ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/ApfsDriverLoader-64.efi.

 

But AppleImageLoader.efi is not included in ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI. (probably a package build issue i guess)

 

Do we need both?

Edited by ellaosx
  • Like 1
Link to comment
Share on other sites

3 hours ago, tluck said:

@ellaosxtry this to patch DxeServicesLib.inf

 


mkdir -p ~/src/edk2/Clover/Patches_for_EDK2/MdePkg/Library/DxeServicesLib/
cat ~/src/edk2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf | sed -e 's/^.*HobLib/#  HobLib/' > ~/src/edk2/Clover/Patches_for_EDK2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf

then build

 

Great Job :) This patch deserves to be included in the sources

Link to comment
Share on other sites

2 hours ago, ellaosx said:

Do we need both?

 

Some explanation from @fusion71au

 

From the readme for ApfsDriverLoader, it is an
 
Open source apfs.efi loader based on reverse-engineered Apple's ApfsJumpStart driver
Loads apfs.efi from ApfsContainer located on block device.
Apfs driver verbose logging suppressed.
Version system: connects each apfs.efi to the device from which it was retrieved
Supports AppleLoadImage protocol provides EfiBinary signature check
WARNING: Please load AppleImageLoader.efi right before ApfsDriverLoader, or just put it inside drivers64uefi folder of your Clover bootloader

In other words, it is chain loading the apfs.efi driver that is already embedded in the apfs volume, just like Apple's EFI firmware.  Advantages include much smaller file size compared to including apfs.efi in the Clover.pkg, no verbose output and no need to update Clover.pkg with each macOS update (the driver always loads the correct version of apfs.efi that is appropriate to the macOS being loaded).

@savvamitrofanov says AppleImageloader is not yet in release, maybe it's the reason why is not included automatcally in ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI

  • Like 1
Link to comment
Share on other sites

5 minutes ago, cecekpawon said:

You may add some other modules including "AppleUiSupportbelow this line on your local repo @Matgen84

 

Thanks a lot :) Build_Clover.command don't use 'ext_packages' to build and add drivers. In interim solution, I inserted a simple 'copy' command for appleimageloader and now for appleUISupport.

 

There is probably a better solution, but I do not have the skills. Any ideas

Link to comment
Share on other sites

In contrary to 

 

 

both ApfsDriverLoader.efi and AppleLoadImage.efi are in my case in ~/src/edk2/Build/ApfsSupportPkg/RELEASE_XCODE8/X64/ and need to be copied manually to  EFI/CLOVER/drivers64UEFI/...

 

I am not able to find the new file AppleImageLoader.efi and there are no /AppleSupportPkg/RELEASE_XCODE8/X64/ directories under ~/src/edk2/Build/ 

 

There is only a /AppleSupportPkg/ in ~/src/edk2/.. but without /RELEASE_XCODE8/X64/ sub-directories.. 

 

Is it so difficult to update the Build_Clover.command to correctly implement ApfsDriverLoader.efi and AppleImageLoader.efi

 

 

 

Edited by KGP-iMacPro
Link to comment
Share on other sites

1 hour ago, cecekpawon said:

You may add some other modules including "AppleUiSupportbelow this line on your local repo @Matgen84

 

I test on existing UDK2018 src:  I insert line in ebuild.sh but curiously don't add drivers to drivers64UEFI PKG. I don't understand why.

Link to comment
Share on other sites

1 hour ago, cecekpawon said:

0_o @Matgen84 sorry cant help you with those "pkg" problem man, but at least you have now complete AppleSupportPkg binaries in your drivers64UEFI folder right? o_0

Thanks :) I modified all the scripts (UDK2018 and EDK2) to add the drivers to Clover PKG. It seems work

Link to comment
Share on other sites

@Matgen84

 

FYI, I didn't have to make any further mods to ebuild etc to include drivers in the .pkg -- this is the list of UEFI drivers I get for 4657 - drivers-Off of course means they are not installed by default but selectable via the custom mode. (note: i do add apfs.efi copied from my OS)

 

$ find ~/src/edk2/Clover/CloverPackage/CloverV2 -name \*efi|grep UEFI|sort
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/AppleImageCodec-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/AppleKeyAggregator-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/AppleUITheme-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/DataHubDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/FSInject-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/FirmwareVolume-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/SMCHelper-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers64UEFI/VBoxHfs-64.efi

/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/ApfsDriverLoader-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/AptioInputFix-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/AptioMemoryFix-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/CsmVideoDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/EmuVariableUefi-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/EnglishDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/Fat-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/HashServiceFix-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/NvmExpressDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/OsxAptioFix3Drv-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/OsxAptioFixDrv-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/OsxFatBinaryDrv-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/OsxLowMemFixDrv-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/PartitionDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/Ps2MouseDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/UsbKbDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/UsbMouseDxe-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/VBoxExt2-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/VBoxExt4-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/VBoxIso9600-64.efi
/Users/tluck/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI/apfs.efi

 

  • Like 1
Link to comment
Share on other sites

5 minutes ago, tluck said:

@Matgen84

 

FYI, I didn't have to make any further mods to ebuild etc to include drivers in the .pkg -- this is the list of UEFI drivers I get for 4657 - drivers-Off of course means they are not installed by default but selectable via the custom mode. (note: i do add apfs.efi copied from my OS)

 

I have the same list. Take a look AppleImageLoader.efi is missing and now AppleUiSupport.efi ( latest commit of AppleSupportPkg) in the .pkg

Link to comment
Share on other sites

×
×
  • Create New...