Clover: Difference between revisions

From ArchWiki
No edit summary
m (Change OS X to macOS)
 
(40 intermediate revisions by 20 users not shown)
Line 1: Line 1:
[[Category:Boot loaders]]
[[Category:Boot loaders]]
[[ja:Clover]]
[[ja:Clover]]
[[zh-CN:Clover]]
[[pt:Clover]]
[[zh-hans:Clover]]
{{Related articles start}}
{{Related articles start}}
{{Related|Arch boot process}}
{{Related|Arch boot process}}
{{Related|Boot loaders}}
{{Related|Unified Extensible Firmware Interface}}
{{Related|Unified Extensible Firmware Interface}}
{{Related|EFISTUB}}
{{Related|EFISTUB}}
{{Related articles end}}
{{Related articles end}}


Clover is a UEFI bootloader developed for booting Hackintosh and multiboot with other operating systems. It can be used to boot Linux kernels with [[EFISTUB]] support. The advantage of Clover to other bootloaders is it supports native resolution GUI on wide screens people commonly use today.
[https://github.com/CloverHackyColor/CloverBootloader Clover EFI] is a boot loader developed to boot macOS ([[Wikipedia:en:Hackintosh|Hackintoshes]]), Windows and Linux in legacy or UEFI mode.


== Installation ==
The main advantages of Clover are:
* Emulate UEFI on legacy BIOS systems
* Boot Linux kernels with [[EFISTUB]] support
* Supports native resolution GUI on wide screens people commonly use today
* Easy to use
* Easily customizable


Download Clover Bootable ISO from [http://sourceforge.net/projects/cloverefiboot/files/Bootable_ISO/ here]
== Installation ==


extract archive and find the {{ic|Clover-*-X64.iso}} file, mount it.
As Clover emulates a UEFI environment on BIOS systems, the steps for each type of system are similar.


copy everything in {{ic|EFI}} folder to your UEFI partition.
=== UEFI Systems ===
 
Mount [[EFI system partition]] to {{ic|/boot}}. This is the preferred method when directly booting an [[EFISTUB]] kernel from UEFI.
 
Generate initial ramdisk environment with [[mkinitcpio]]
 
Download Clover Bootable ISO from [https://github.com/CloverHackyColor/CloverBootloader/releases here].
 
Extract the archive {{ic|Clover-*-X64.iso.7z}} and find the {{ic|Clover-*-X64.iso}} file, mount it to a directory like {{ic|/mnt/iso}}. It should be noted all file/folder names will be displayed in lower case in Linux, which is different from Windows and Mac OS.
 
Copy the whole {{ic|/mnt/iso/efi}} folder to your [[EFI system partition]]. The tree for {{ic|/boot}} should look likes the following
 
/boot/EFI
/boot/EFI/BOOT
/boot/EFI/CLOVER
/boot/initramfs-linux-fallback.img
/boot/initramfs-linux.img
/boot/vmlinuz-linux
 
=== BIOS Systems ===
 
{{Note|Even though this is Legacy BIOS, the [[Partitioning#UEFI/GPT layout example|UEFI/GPT]] partitioning layout is required. The only difference is the "Legacy BIOS bootable" flag needs to be set on the [[EFI system partition]].}}
 
Download the [https://github.com/CloverHackyColor/CloverBootloader/releases Clover Bootable ISO].
 
Extract the archive {{ic|Clover-*-X64.iso.7z}} and find the {{ic|Clover-*-X64.iso}} file, mount it to directory like {{ic|/mnt/iso}}.
 
Merge Clover code with current Master and ''P''artition ''B''oot ''R''ecords (assuming ESP is partition 1 of {{ic|/dev/sda}}, change if necessary):
 
{{bc|1=
# dd if=/dev/sda1 of=/tmp/''original_PBR'' bs=512 count=1 conv=notrunc
# cp /mnt/iso/usr/standalone/i386/boot1f32 /tmp/''new_PBR''
# dd if=/tmp/''original_PBR'' of=/tmp/''new_PBR'' skip=3 seek=3 bs=1 count=87 conv=notrunc
# dd if=/tmp/''new_PBR'' of=/dev/sda1 bs=512 count=1 conv=notrunc
# dd if=/mnt/iso/usr/standalone/i386/boot0ss of=/dev/sda bs=440 count=1 conv=notrunc
}}
 
Mount the [[EFI system partition]] to {{ic|/boot}}.
 
Copy the whole {{ic|/mnt/iso/efi}} folder to your [[EFI system partition]].
 
Copy the legacy bootloader to the [[EFI system partition]]:
 
{{bc|# cp /mnt/iso/usr/standalone/i386/x64/boot6 /boot/boot}}


== Configuration ==
== Configuration ==


Configuration is done through an xml file {{ic|config.plist}} under path {{ic|EFI/CLOVER}} from the UEFI partition. For details please reference [http://clover-wiki.zetam.org/Home their wiki], for the Linux kernel EFISTUB boot entry and native resolution GUI, add following code to the relevent place.
Configuration is done through an XML file {{ic|config.plist}} under path {{ic|EFI/CLOVER}} from the [[EFI system partition]].
 
A tool is now available to easily edit your {{ic|config.plist}} in any OS: [https://cloudclovereditor.altervista.org/cce/index.php Cloud Clover Editor (CCE)]


{{ic|/initramfs-linux.img}} and {{ic|vmlinuz-linux}} are relative to the root of the UEFI partition. In this example, the initramfs and kernel files have to be at the root of the EFI partition, at the same level as the {{ic|EFI}} directory.
For the meaning of each key, please reference [https://sourceforge.net/p/cloverefiboot/wiki/GUI/#custom-entries their wiki for custom entries]. The key {{ic|Volume}} should be the [[PARTUUID]] of the EFI system partition and must be in uppercase. The minimal initramfs {{ic|initramfs-linux.img}} in {{ic|Arguments}}and the Linux kernel executable {{ic|vmlinuz-linux}} in {{ic|Path}} are relative to the EFI system partition. Backslashes should be used in accordance with EFI standards. For other arguments in {{ic|Arguments}}, please reference [[EFISTUB]] and [[Kernel parameters#Parameter list]].


<key>GUI</key>
In this example, the initramfs and kernel files are placed at the root of the EFI system partition, at the same level as the {{ic|efi}} directory. The EFI system partition is mounted at {{ic|/boot}}
<dict>
 
{{hc|/boot/EFI/CLOVER/config.plist|2=
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>GUI</key>
  <dict>
     <key>Custom</key>
     <key>Custom</key>
     <dict>
     <dict>
      <key>Entries</key>
      <key>Entries</key>
      <array>
      <array>
          <dict>
        <dict>
            <key>AddArguments</key>
          <key>Arguments</key>
            <string>root=UUID=d4f1e3b7-b466-4c1b-991c-90fa99cafbc6 rw add_efi_memmap initrd=/initramfs-linux.img</string>
          <string>initrd=\initramfs-linux.img root=PARTUUID=d5d0fceb-c58e-c745-a7ff-f2f1b2824e66 rw add_efi_memmap</string>
            <key>Disabled</key>
          <key>Path</key>
            <false/>
          <string>\vmlinuz-linux</string>
            <key>FullTitle</key>
          <key>Title</key>
            <string>Arch Linux</string>
          <string>Arch Linux</string>
            <key>Hidden</key>
          <key>Type</key>
            <false/>
          <string>Linux</string>
            <key>Ignore</key>
          <key>Volume</key>
            <false/>
          <string>33BA6C23-4772-294D-9053-72A49FCAEF39</string>
            <key>Path</key>
          <key>VolumeType</key>
            <string>vmlinuz-linux</string>
          <string>Internal</string>
            <key>Type</key>
        </dict>
            <string>Linux</string>
        <dict>
            <key>Volume</key>
          <key>Arguments</key>
            <string>EFI</string>
          <string>initrd=\initramfs-linux-fallback.img root=PARTUUID=d5d0fceb-c58e-c745-a7ff-f2f1b2824e66 rw debug add_efi_memmap</string>
            <key>VolumeType</key>
          <key>Path</key>
            <string>Internal</string>
          <string>\vmlinuz-linux</string>
          </dict>
          <key>Title</key>
      </array>
          <string>Arch Linux Rescue Mode</string>
          <key>Type</key>
          <string>Linux</string>
          <key>Volume</key>
          <string>33BA6C23-4772-294D-9053-72A49FCAEF39</string>
          <key>VolumeType</key>
          <string>Internal</string>
        </dict>
      </array>
     </dict>
     </dict>
    <key>ScreenResolution</key>
  </dict>
    <string>2560x1080</string>
</dict>
    <key>Theme</key>
</plist>}}
    <string>bootcamp</string>
 
</dict>
=== chainload systemd-boot ===
 
If you need a bootloader for BIOS systems that follows [https://uapi-group.org/specifications/specs/boot_loader_specification/ The Boot Loader Specification], then systemd-boot can be pressed into service on BIOS systems. This is the configuration file needed make [[Clover]] chainload systemd-boot.
 
{{hc|/boot/EFI/CLOVER/config.plist|2=
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Boot</key>
<dict>
<key>DefaultVolume</key>
<string>EFI</string>
<key>DefaultLoader</key>
<string>\EFI\systemd\systemd-bootx64.efi</string>
<key>Fast</key>
<true/>
</dict>
<key>GUI</key>
<dict>
<key>Custom</key>
<dict>
<key>Entries</key>
<array>
<dict>
<key>Hidden</key>
<false/>
<key>Disabled</key>
<false/>
<key>Image</key>
<string>os_arch</string>
<key>Volume</key>
<string>EFI</string>
<key>Path</key>
<string>\EFI\systemd\systemd-bootx64.efi</string>
<key>Title</key>
<string>Arch Linux</string>
<key>Type</key>
<string>Linux</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>}}


== See also ==
== See also ==


* http://sourceforge.net/projects/cloverefiboot/
* [https://sourceforge.net/projects/cloverefiboot/ Project homepage]
* [https://sourceforge.net/p/cloverefiboot/wiki/Home/ Clover Wiki]

Latest revision as of 23:01, 2 November 2023

Clover EFI is a boot loader developed to boot macOS (Hackintoshes), Windows and Linux in legacy or UEFI mode.

The main advantages of Clover are:

  • Emulate UEFI on legacy BIOS systems
  • Boot Linux kernels with EFISTUB support
  • Supports native resolution GUI on wide screens people commonly use today
  • Easy to use
  • Easily customizable

Installation

As Clover emulates a UEFI environment on BIOS systems, the steps for each type of system are similar.

UEFI Systems

Mount EFI system partition to /boot. This is the preferred method when directly booting an EFISTUB kernel from UEFI.

Generate initial ramdisk environment with mkinitcpio

Download Clover Bootable ISO from here.

Extract the archive Clover-*-X64.iso.7z and find the Clover-*-X64.iso file, mount it to a directory like /mnt/iso. It should be noted all file/folder names will be displayed in lower case in Linux, which is different from Windows and Mac OS.

Copy the whole /mnt/iso/efi folder to your EFI system partition. The tree for /boot should look likes the following

/boot/EFI
/boot/EFI/BOOT
/boot/EFI/CLOVER
/boot/initramfs-linux-fallback.img
/boot/initramfs-linux.img
/boot/vmlinuz-linux

BIOS Systems

Note: Even though this is Legacy BIOS, the UEFI/GPT partitioning layout is required. The only difference is the "Legacy BIOS bootable" flag needs to be set on the EFI system partition.

Download the Clover Bootable ISO.

Extract the archive Clover-*-X64.iso.7z and find the Clover-*-X64.iso file, mount it to directory like /mnt/iso.

Merge Clover code with current Master and Partition Boot Records (assuming ESP is partition 1 of /dev/sda, change if necessary):

# dd if=/dev/sda1 of=/tmp/original_PBR bs=512 count=1 conv=notrunc
# cp /mnt/iso/usr/standalone/i386/boot1f32 /tmp/new_PBR
# dd if=/tmp/original_PBR of=/tmp/new_PBR skip=3 seek=3 bs=1 count=87 conv=notrunc
# dd if=/tmp/new_PBR of=/dev/sda1 bs=512 count=1 conv=notrunc
# dd if=/mnt/iso/usr/standalone/i386/boot0ss of=/dev/sda bs=440 count=1 conv=notrunc

Mount the EFI system partition to /boot.

Copy the whole /mnt/iso/efi folder to your EFI system partition.

Copy the legacy bootloader to the EFI system partition:

# cp /mnt/iso/usr/standalone/i386/x64/boot6 /boot/boot

Configuration

Configuration is done through an XML file config.plist under path EFI/CLOVER from the EFI system partition.

A tool is now available to easily edit your config.plist in any OS: Cloud Clover Editor (CCE)

For the meaning of each key, please reference their wiki for custom entries. The key Volume should be the PARTUUID of the EFI system partition and must be in uppercase. The minimal initramfs initramfs-linux.img in Argumentsand the Linux kernel executable vmlinuz-linux in Path are relative to the EFI system partition. Backslashes should be used in accordance with EFI standards. For other arguments in Arguments, please reference EFISTUB and Kernel parameters#Parameter list.

In this example, the initramfs and kernel files are placed at the root of the EFI system partition, at the same level as the efi directory. The EFI system partition is mounted at /boot

/boot/EFI/CLOVER/config.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>GUI</key>
  <dict>
    <key>Custom</key>
    <dict>
      <key>Entries</key>
      <array>
        <dict>
          <key>Arguments</key>
          <string>initrd=\initramfs-linux.img root=PARTUUID=d5d0fceb-c58e-c745-a7ff-f2f1b2824e66 rw add_efi_memmap</string>
          <key>Path</key>
          <string>\vmlinuz-linux</string>
          <key>Title</key>
          <string>Arch Linux</string>
          <key>Type</key>
          <string>Linux</string>
          <key>Volume</key>
          <string>33BA6C23-4772-294D-9053-72A49FCAEF39</string>
          <key>VolumeType</key>
          <string>Internal</string>
        </dict>
        <dict>
          <key>Arguments</key>
          <string>initrd=\initramfs-linux-fallback.img root=PARTUUID=d5d0fceb-c58e-c745-a7ff-f2f1b2824e66 rw debug add_efi_memmap</string>
          <key>Path</key>
          <string>\vmlinuz-linux</string>
          <key>Title</key>
          <string>Arch Linux Rescue Mode</string>
          <key>Type</key>
          <string>Linux</string>
          <key>Volume</key>
          <string>33BA6C23-4772-294D-9053-72A49FCAEF39</string>
          <key>VolumeType</key>
          <string>Internal</string>
        </dict>
      </array>
    </dict>
  </dict>
</dict>
</plist>

chainload systemd-boot

If you need a bootloader for BIOS systems that follows The Boot Loader Specification, then systemd-boot can be pressed into service on BIOS systems. This is the configuration file needed make Clover chainload systemd-boot.

/boot/EFI/CLOVER/config.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Boot</key>
	<dict>
		<key>DefaultVolume</key>
		<string>EFI</string>
		<key>DefaultLoader</key>
		<string>\EFI\systemd\systemd-bootx64.efi</string>
		<key>Fast</key>
		<true/>
	</dict>
	<key>GUI</key>
	<dict>
		<key>Custom</key>
		<dict>
			<key>Entries</key>
			<array>
				<dict>
					<key>Hidden</key>
					<false/>
					<key>Disabled</key>
					<false/>
					<key>Image</key>
					<string>os_arch</string>
					<key>Volume</key>
					<string>EFI</string>
					<key>Path</key>
					<string>\EFI\systemd\systemd-bootx64.efi</string>
					<key>Title</key>
					<string>Arch Linux</string>
					<key>Type</key>
					<string>Linux</string>
				</dict>
			</array>
		</dict>
	</dict>
</dict>
</plist>

See also