Jump to content
ErmaC

Clover v.2 Instructions

54 posts in this topic

Recommended Posts

Deprecated features

 

Since Clover v2.4k some technologies will be deprecated, no more supported and will be excluded in future releases.

1. Clover 32bit.   Good bye Clover-32 

2. LegacyBoot. (PBR, PBRTest, PBRSata etc). This is a technology to boot Windows XP from CloverGUI.

It's a pity it rarely works. For my observation the success was only on PATA controllers at ICH7 chipset.

I will recommend to update your Windows  to UEFI one. At least Windows 7-64bit which successfully works on Core2Duo computers 10years old.

I don't think I should bother about more ancient one.

As well the good solution in using Chameleon which boots Windows XP very well.

- install boot1f32alt bootsector which wait 2sec for key press.

- install boot as Clover and boot1 as Chameleon.

- press "1" during boot to switch to Chameleon and boot WindowsXP from him.

3. Installation on Fdisk Partitioning Scheme HDD (also known as MBR table).

I will recommend always format your drive to Guid Partitioning Sheme (also known as GPT). You can install here Windows in UEFI mode even if your computer is PC BIOS based using legacy CloverEFI. (see comp#4 in my signature).

Instructions Post#46 How to install Windows UEFI

4. ATIConnectors patch.

It's a pity this patch can't be OS dependent.

See, for example, connectors for 10.11

Personality: Pithecia
ConnectorInfo count in decimal: 3
Disk offset in decimal 176512
00040000040300000001000021030204 - Dp
04000000140200000001000000000403 - DVI
10000000100000000001000000000001 - VGA

and for 10.12

Pithecia (2) @ 0x1b54e0
DP, DDVI
000400000403000000010000000000002103020400000000
040000001402000000010000000000000000040300000000

So, you should migrate your existing patch from the old form

		<key>#ATIConnectorsController</key>
		<string>6000</string>
		<key>#ATIConnectorsData</key>
		<string>000400000403000000010000210302040400000014020000000100000000040310000000100000000001000000000001</string>
		<key>#ATIConnectorsPatch</key>
		<string>040000001402000000010000000004040004000004030000000100001102010500000000000000000000000000000000</string>

To new form KextPatches

Screen Shot 2017-02-27 at 10.59.44.png

This way you can create several patches for different OSes.

10.6-10.7  ATI6000Controller

10.8-10.12 AMD6000Controller

And different find/replace strings for 10.12

 

5. OldWay DSDT patches.

Since rev4006 the parameter NewWay is excluded.  #52 

It is always NewWay now.

Share this post


Link to post
Share on other sites
Advertisement

Using  UDK2018

 

We can compile Clover with UDK2018 and not bother about EDK2 beta updates.

Step by step from clear.

1. Install macOS. Preferably 10.13.x at this moment

2. Install Xcode. I am using Xcode 9.3.1 now. Install Command Line Tools. Xcode 10.1 in 10.13.6 is better.

3. Download NASM https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/macosx/nasm-2.13.03-macosx.zip, unpack  and copy to     /opt/local/bin

The folder may be invisible then

sudo chflags nohidden /opt

or it may not exists then

sudo mkdir -p /opt/local/bin

then

sudo cp ~/Downloads/nasm-2.13.03/nasm /opt/local/bin

4. Prepare sources

cd ~
mkdir src
cd src
git clone https://github.com/tianocore/edk2 -b UDK2018 --depth 1 UDK2018
cd UDK2018
svn co svn://svn.code.sf.net/p/cloverefiboot/code/ Clover
make -C BaseTools/Source/C
./edksetup.sh
cd Clover
./buildgettext.sh
./buildmtoc.sh
cp -R Patches_for_UDK2018/* ../
./ebuild.sh -fr

 

Patches_for_EDK2 revision 4472 is compatible with UDK2018, but there is own patch set.

Since 4486 we should use Patches_for_UDK2018.

 

5. And finally create installer

cd ~/src/UDK2018/Clover/CloverPackage/
./makepkg

 

 

Share this post


Link to post
Share on other sites

Device Properties

This is Apple's protocol since many years to provide information from AppleEFI to macOS about used deviced. It is obligatory and present in all hackintosh bootloaders.

The information can be provided also by _DSM methods since OSX 10.5. But ACPI method will work after kernel started and after AppleACPIPlatform started and so may depend on its version. DPProtocol works before kernel and inject properties at boot.efi time.

 

Historically Clover has several methods to fill the database of Device Properties.

1. There is just hex-string injection that can be manually constructed by gfx-util. Not convenience.

2. There are automatic injections or Graphics card, LAN, Sound and USB devices. It is very convenient but very questionable by final results. There are many properties that should be injected or no and we are not sure what values must be injected versus Clover choice.

3. To resolve these question two setting added "NoDefaultProperties" and "AddProperties". This way smart people can cancel all automatically injected properties and inject own properties. This way is not very good as devices chosen by nickname "ATI", "Nvidia", "LAN" etc. which not assumed present of two different videocard, for example, or similar videocards but required different properties.

4. More advanced way is "Arbitrary" properties when you can inject all properties you want for a device chosen by its PCI address. The address of the device is set as 08:00:00. But this is the fault of the method. The bus number (08 in this example) may changed with BIOS changed or with new device inserted. As well this is hard to set device address of device at second bridge (bridge after bridge).

5. More correct way is introduced in Clover since 4497 revision. This is XML dictionary as it created by gfx-util.

Example

    <key>Properties</key>
    <dict>
      <key>PciRoot(0x0)/Pci(0x14,0x0)</key>
      <dict>
        <key>AAPL,clock-id</key>
        <data>AA==</data>
        <key>AAPL,current-available</key>
        <data>sAQ=</data>
        <key>AAPL,current-extra</key>
        <data>vAI=</data>
        <key>AAPL,current-in-sleep</key>
        <data>6AM=</data>
        <key>built-in</key>
        <data>AA==</data>
        <key>device_type</key>
        <string>XHCI</string>
      </dict>
      <key>PciRoot(0x0)/Pci(0x19,0x0)</key>
      <dict>
        <key>built-in</key>
        <data>AQ==</data>
      </dict>

Compared to old and buggy gfxutil Clover also accepted <integer> and </true> </false> types of values. As well you may see <data> array when you know there is <string>.

This method allows you to use properties found in DarwinDumps of real Macs just by copy/paste into your config.plist

 

How to convert your old config.plist to new method of injection?

 

1. Boot macOS with your old Clover and old config.plist.  Assumed there is full success.

2. Use clover-genconfig utility (rev >4508) to produce config-imprint.plist with all properties you previously use by methods 1-4.

$ clover-genconfig > config-imprint.plist

3. Use any editor to copy data from imprint to you working config.plist to make your new config.plist. You have to find

Device->Properties dictionary and make a full copy of it.

4. Then you should switch off any other injection by methods 1-4.

Graphics->Inject->ATI,NVIDIA,Intel=NO

Devices->USB->Inject=NO

Devices->LANInjection=NO

Devices->HDAInjection=NO

Devices->HDMIInjection=NO

AddProperties -> #AddProperties

Arbitrary -> #Arbitrary

5. Install Clover 4497 or up.

6. You may also add new properties to this array by the given sample.

7. Reboot.

8 During reboot you can enter Options menu -> PCI Devices -> Custom and see all properties you may inject. This is good time to enable or disable some of the properties.

 

To temporary disable a property in the config place # sign at the start of the key

<key>#AAPL,clock-id</key>

 

To write a comment to the device you may insert pair

        <key>#Comment</key>
        <string>This is XHCI device</string>

 

There is one special case "ig-platform-id".

To have an ability to change a value of the property Clover gives you an additional setting

  <key>Graphics</key>
  <dict>
    <key>ig-platform-id</key>
    <string>0x01660003</string>

This value will be present in Options menu -> Graphics and changeable here. New value will replace the value from the Properties dictionary.

 

EDITED

Clover-genconfig must be exactly same revision as clover which boot the system. So instructions updated

1. Boot macOS with your old Clover and old config.plist.  Assumed there is full success. ->

1. Install new Clover and boot with old config.plist

 

Share this post


Link to post
Share on other sites

Scalable Themes

 

The purpose of this new feature is to make Clover GUI looks similar with resolutions 800x600, 1920x1080 or 5k. Existing PNG themes will be too large on small screen or too small on large screen.

To do the view scalable I have to propose graphics to be in vector format. The best choice is SVG.

Scalabe Vector Graphics

 

Instructions for user: nothing new. Just choose a theme that is known to be SVG theme. At this moment there is "Clovy" theme present is main Clover repository.

 

Instructions for artists

The whole theme must be drawn as one picture with name "Theme.svg" instead of theme.plist being in PNG themes.

The picture must be designed as theme preview with invisible elements needed to Clover (checkbox for example, or numerous os icons).

Снимок экрана 2018-11-04 в 6.43.49.png

 

SVG file is a text file which you can edit with TextEdit for further improvements.

To create this drawing you have to use one of vector graphics editor on your choice:

1. Adobe Illustrator. Simply the best.

2. Corel Draw in Windows. I have no experience.

3. Inkscape in Windows or in macOS up to 10.10. Officially it is not supported in higher versions.

4. LibreOffice Draw. It is heavy and slow. SVG file contains many dirts.

5. Boxy SVG. Very small application creating very basic SVG file. It can't embed SVG fonts. Anyway it is good and can be recommended.

6. Gravit Designer

7. Or others

https://en.wikipedia.org/wiki/Comparison_of_vector_graphics_editors

If the editor has own graphics format then you have to export graphics as SVG and tune compatibility as

1. SVG 1.1

2. css/style supported, other css features no.

3. embed fonts as SVG fonts.

4. don't export editor specific information if possible

 

Clover requirements (since rev 4730 and up)

The design must consist of separate images gathered into groups with known names.

For example <g id="Banner">

Obligatory group names:
 

Background
Banner
func_about
func_options
func_clover
func_reset
func_shutdown
func_help
tool_shell
pointer
vol_internal
vol_external
vol_optical
vol_internal_hfs
vol_internal_apfs
vol_internal_ntfs
vol_internal_ext3
vol_recovery
selection_small
selection_big
radio_button
radio_button_selected
checkbox
checkbox_checked

As well as OS icons like os_mac, os_win etc

MISC_ICONS OSIconsTable[] = {
  {NULL, "os_mac"},
  {NULL, "os_tiger"},
  {NULL, "os_leo"},
  {NULL, "os_snow"},
  {NULL, "os_lion"},
  {NULL, "os_cougar"},
  {NULL, "os_mav"},
  {NULL, "os_yos"},
  {NULL, "os_cap"},
  {NULL, "os_sierra"},
  {NULL, "os_hsierra"},
  {NULL, "os_moja"},
  {NULL, "os_linux"},
  {NULL, "os_freebsd"},
  {NULL, "os_freedos"},
  {NULL, "os_win"},
  {NULL, "os_vista"},

The design graphics have limited space to draw all of them. So the good trick will be hide most of them using attributes hidden or zero opacity. Samples:

<g id="os_leo" visibility="hidden">

or

<g id="radio_button" opacity=0>

Using these elements Clover automatically make visibility and change opacity to 1.0.

The caveats. visibility may cause the elements not be exported into svg from Illustrator and will not be calculated into final icon size. opacity produces exhasive rendering.

 

Each icons must contain a special invisible element with name "BoundingRect_xxx" example

	<g id="selection_big" transform="translate(528.000000, 320.000000)">
		<rect id="BoundingRect_2_" y="0" class="st0" width="144" height="144"/>
		<g id="icon_5_" transform="translate(8.000000, 8.000000)" class="st15">
			<path id="rrect" class="st6" d="M10,0h108c5.523,0,10,4.477,10,10v108c0,5.523-4.477,10-10,10H10c-5.523,0-10-4.477-10-10V10
				C0,4.477,4.477,0,10,0z"/>
		</g>
	</g>

This <rect> with name containing "BoundingRect" serves to define whole size of the element. In this case it is width=144 and height=144. This rect is invisible because of class="st0" defined as

.st0{fill:none;}

as one of the possibility to hide elements.

NO! All BoundingRect must be visibility="hidden" because it influences on the icon centre. Rev 4733.

 

 

Text support

Although Clover can draw svg text you should not use it. All static text (as "CLOVER" in the picture above) should be converted to pathes. Clover draws dynamic text by itself.

The theme must contain at least one text line with group id="MessageRow". The attributes of the text will be used by Clover to set text size and color and to choose font. So these text must contain such attributes:

	<g id="MessageRow" transform="translate(0.000000, 580.000000)">
		<g class="st5">
			<text transform="matrix(1 0 0 1 494.928 15)" class="st6 st7 st8">Boot macOS from SystemHD</text>
		</g>
	</g>

These text contains styles

	.st6{fill:#FFFFFF;}
	.st7{font-family:Roboto-Medium;}
	.st8{font-size:16px;}

It means Clover will draw text in white color, size=16px and use font "Roboto-Medium"

 

Fonts

Clover may use SVG fonts embedded into theme or external font placed into the same folder.

Embedded font you can see in Clove example.

Font must have attribute horiz-adv-x="2048" or other value. It means maximum char width in virtual space.

font-face must have family, units-per-em, font-style and bbox (bounding box)

<font horiz-adv-x="2048">

<font-face
	font-family="Roboto-Medium"
	units-per-em="2048"
	underline-position="-100"
	underline-thickness="100"
	font-style="normal"
	bbox="0 -100 2048 1948"
	/>

<missing-glyph horiz-adv-x="510"/>

<missing-glyph> is also obligatory.

Without these elements the font will not work.

If a text shows font-family same as embedded font then Clover will render it. Else Clover will search file with the name of font-family. In this case it is "Roboto-Medium.svg".

 

Where to get SVG fonts?

1. Illustrator can export own fonts into your graphics as SVG font. BoxySVG cannot.

2. You may draw own font with FontForge application or others.

3. You may convert your favorite TTF font into SVG using online services. Google will help you.

Anyway be care about font licenses.

 

Special Clover settings

SVG usually don't contain full information needed for Clover to draw GUI so there is a special setting compatible with SVG specification

<svg> element should define clover namespace

<svg version="1.1" id="CloverThemeTemplate2_1_"
	xmlns="http://www.w3.org/2000/svg"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:clover="https://sourceforge.net/projects/cloverefiboot"
	 x="0px" y="0px" viewBox="0 0 1200 768">

These attributes should be accounting as obligatory. Especially "viewBox"!

Clover settings are optional because there are default values

<clover:theme
  SelectionOnTop="0" BadgeOffsetX="0xFFFF" BadgeOffsetY="0xFFFF" NonSelectedGrey="0" CharWidth="16"
  BackgroundDark="1" BackgroundSharp="0x80" Badges="none"
  SelectionColor="0x80808080"
  />

Prefix "clover:" will be checked by other browsers and allowed because we defined xmlns:clover

 

You may safely remove elements with names "inkscape:", "sodipodi:" and others related to vector editor.

 

 

For discussion welcome to Vector Themes thread

Share this post


Link to post
Share on other sites

  • Similar Content

    • By metaphysician
      hi folks! i'm just checking for opinions here on a Clover based install of High Sierra. currently i can't boot directly from the internal drive on my hackbook, an ASUS ROG GL502-VS laptop (with the replaced WiFi card), though i can boot from the USB bootloader/installer

      i installed 10.13.6 fine using a prepared vanilla installer on HFS+ (not APFS), but my configuration is somewhat unusual. i have two drives. the first SSD has the Windows system, the second has two partitions with the 2nd partition holding the macOS system. when i ran Clover installer i could not use the UEFI option to copy to the EFI partition because it couldn't find one on that drive. so it installed the EFI folder on the root of the macOS partition instead.
       
      however, after a bit of tinkering around, i found out that there is an existing EFI partition on the primary drive called SYSTEM. it has a EFI folder and underneath that is a Windows folder, a Boot folder, and one called APPLE. i can mount this partition with Clover Configurator and copy files to it, but i don't know if this is a good or risky solution. i was thinking i would manually copy the CLOVER folder and the uefi64.boot file to this partition , making sure not to overwrite anything existing. using the UEFI setup, i can create a boot path from the SYSTEM partition to the Clover boot file, but i'm just curious if this is a useful solution or not, and i don't want to ruin the existing Windows 10 installation for sure. any advice appreciated!
    • By Slice
      OK, 4988 released.
      Now, @vector sigma, what have we do to update translations?
    • By fusion71au
      Clover r4989 ISO compiled with GCC and minimal config.plist compatible for use in VMWare Workstation.
       
      Tested with unlocked Workstation 15 running OSX 10.9 -->10.15 guest in Windows X64 host.
       
      Installation
      1. Download and unzip "EFI_Clover_r4989 for VMware.zip". Mount Clover-v2.4k-4989-X64.iso by double clicking on it.
      2. Mount your VM's EFI System Partition eg in terminal
      sudo diskutil mount disk0s1   3. Copy EFI folder from step 1 into the EFI partition
      4. Shutdown the VM, add bios.bootDelay = "3000" to your VM's vmx file
      5. Reboot your VM, press <F2> to access the VMware Boot Manager and add CLOVERX64.efi to the boot menu.
       
      Substitute your own unique and valid MLB and ROM variables in the /EFI/CLOVER/config.plist (Rt Variables section) to activate iMessage/Facetime on your VM.
×