# 制作USB启动盘

## 创建USB启动盘

必须的东西：

* [OpenCorePkg](https://github.com/acidanthera/OpenCorePkg/releases)，强烈推荐使用DEBUG版来查看更多的调试信息
* [AppleSupportPkg](https://github.com/acidanthera/AppleSupportPkg/releases)
* [ProperTree](https://github.com/corpnewt/ProperTree)或者PlistEdit或者XCode等等，也可以使用最新的OpenCore Configurator
* 重置NVRAM(如果你之前是使用Clover的话，这是一个非常重要的步骤，因为Clover的一些变量会于OC产生冲突。你可以在你的config里面开启`AllowNvramReset`，然后启动OpenCore的时候选择`CleanNvram`)
* 黑苹果运作的基本知识（比如配置网络）
* 如果你想将OpenCore作为你的主力bootloader，那么你应该将Clover备个份然后全部删除。点击这里查看哪些需要删除: [Clover Conversion](https://github.com/khronokernel/Opencore-Vanilla-Desktop-Guide/tree/24c806de76d570693089dc066833d8d5b6683b94/clover-conversion/README.md)

## 制作启动器

* [macOS下制作](https://rmtt.gitbook.io/opencore-vanilla-guide/zhi-zuo-usb-qi-dong-pan/macos-xia-zhi-zuo)
* [Windows下制作](https://rmtt.gitbook.io/opencore-vanilla-guide/zhi-zuo-usb-qi-dong-pan/windows-xia-zhi-zuo)

按照自己的条件选择如上不同安装方式，操作完成后再回到这里。

## 设置EFI

开始之前，你需要将OpenCorePkg中的EFI文件夹复制到U盘的EFI分区，在Windows中是名为`BOOT`的U盘

![](/files/-M0NT3N3s0JwzqtoJZaQ)

现在你会注意到`Drivers`目录和`Tools`目录中有一堆文件，不过我们不是全部都需要：

* **从Drivers目录中移除:**
  * AppleUsbKbDxe.efi
    * 在传统模式的主板（使用DuetPkg）上使用，**不建议使用，甚至会对Ivy Bridge或者更新的平台造成损害。**
  * NvmExpressDxe.efi
    * 对于Haswell或者更老的平台，没有内置的NVME驱动的时候可以使用这个
  * XhciDxe.efi
    * 对于Sandy Bridge或者更老的平台，没有内置的XHCI驱动的时候可以使用这个
* **从Tools中移除:**
  * CleanNvram.efi
    * 我们将使用OpenCore内置的功能，所以不需要这个
  * VerifyMsrE2.efi
    * 用于验证CFG Lock，不过安装的时候不需要

一个干净的EFI：

![](/files/-M0NVCJvSdSXy5mde6ox)

现在你可以将AppleSupportPkg中必须的固件驱动放入Drivers文件夹，并且将 Kexts/ACPI放入对应的文件夹。注意CLOVER中的固件驱动在OpenCore不再支持（(EmuVariableUEFI, AptioMemoryFix, OsxAptioFixDrv, 等等）。请参考 [Clover firmware driver conversion](https://github.com/khronokernel/Opencore-Vanilla-Desktop-Guide/blob/master/clover-conversion/clover-efi.md) 以便查询那些驱动是OpenCore支持或者已经整合到OpenCore中的。

一个主流的EFI文件夹应该是这样：

![](/files/-M0NWNNgG75cXYWz4LVR)

注意：

* SSDT和自定义的DSDT放入ACPI文件夹
* Kext放入Kexts文件夹
* 固件驱动(.efi)放入Drivers文件夹

现在可以跳到 [加入必须的文件](https://rmtt.gitbook.io/opencore-vanilla-guide/jia-ru-bi-xu-de-wen-jian) 部分了。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rmtt.gitbook.io/opencore-vanilla-guide/zhi-zuo-usb-qi-dong-pan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
