Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active March 16, 2022 21:13
Show Gist options
  • Save gregjhogan/f807492f2eda82075161c99e253db7d1 to your computer and use it in GitHub Desktop.
Save gregjhogan/f807492f2eda82075161c99e253db7d1 to your computer and use it in GitHub Desktop.
clover USB boot drive that boots another drive (for example on a NVME drive)
USB_DEV=/dev/sdX # replace X with correct number
USB_MNT=/mnt/usb
sudo mkdir -p /mnt/usb
sudo wipefs -a --force $USB_DEV
sudo dd if=/dev/zero of=${USB_DEV} bs=1M count=100
(
echo n # new partition
echo 1 # partition number 1
echo 2048 # first sector 2048
echo +100M # size
echo ef00 # type code EFI
echo w # write
echo y # yes
) | sudo gdisk $USB_DEV
sudo mkfs.vfat -F 32 ${USB_DEV}1
sudo mount ${USB_DEV}1 ${USB_MNT}
wget https://github.com/CloverHackyColor/CloverBootloader/releases/download/5145/CloverV2-5145.zip
unzip CloverV2-5145.zip
sudo cp -R ./CloverV2/EFI $USB_MNT
sudo cp $USB_MNT/EFI/CLOVER/drivers/off/UEFI/Other/NvmExpressDxe.efi $USB_MNT/EFI/CLOVER/drivers/UEFI/
cat << EOF | sudo tee $USB_MNT/EFI/CLOVER/config.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GUI</key>
<dict>
<key>EmbeddedThemeType</key>
<string>Dark</string>
<key>TextOnly</key>
<true/>
<key>Scan</key>
<dict>
<key>Entries</key>
<true/>
</dict>
</dict>
<key>Boot</key>
<dict>
<key>Timeout</key>
<integer>5</integer>
<key>DefaultVolume</key>
<string>ubuntu</string>
</dict>
</dict>
</plist>
EOF
sudo umount $USB_MNT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment