如何使用Linux Foundation的PreLoader?

我读到除了使用shim并使用Linux Foundation的PreLoaderLinux Foundation的安全启动系统签署GRUB二进制文件进行安全启动之外,还有另一种方法,但我该如何使用它?

来自https://askubuntu.com/a/520351/40581

设置PreLoader

  • 查找并装入EFI系统分区并备份其内容。 某些文件可能是制造商特定的,无法通过重新安装Windows进行恢复。
    • 在正在运行的UEFI Ubuntu安装中,它以/boot/efi/挂载,并且至少包含名为EFI的文件夹。 从平台角度(您的计算机),此文件夹在引导阶段为\EFI\ 。 ( /media/my_efi_system_partition/EFI = \EFI\
  • 将要使用的EFI加载程序复制或重命名为\EFI\BOOT\loader.efi 。 像gummiboot这样的一些装载机需要正确配置。
  • 将PreLoader.efi复制到\EFI\BOOT\bootx64.efiHashTool.efi到同一目录。

您可以在Rod Smith的网站上找到更详细的解释。

使用HashTool

如果您仔细按照说明操作并启用了安全启动,则下次启动时应该会看到以下屏幕,这将引导您注册未签名加载程序的哈希值,否则会破坏信任链。

 ┌──────────────────────────────────────────────────────────────────────────────┐ │ Failed to start loader │ │ │ │ It should be called loader.efi (in the current directory) │ │ Please enrol its hash and try again │ │ │ │ I will now execute HashTool for you to do this │ │ │ │ │ │ ┌────┐ │ │ │ OK │ │ │ └────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Select Binary │ │ │ │ The Selected Binary will have its hash Enrolled │ │ This means it will Subsequently Boot with no prompting │ │ Remember to make sure it is a genuine binary before Enroling its hash │ │ │ │ │ │ ┌─────────────────────┐ │ │ │ Enroll Hash │ │ │ │ Reboot to UEFI Menu │ │ │ │ Reboot System │ │ │ │ Exit │ │ │ └─────────────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Select Binary │ │ │ │ The Selected Binary will have its hash Enrolled │ │ This means it will Subsequently Boot with no prompting │ │ Remember to make sure it is a genuine binary before Enroling its hash │ │ │ │ │ │ ┌──────────────┐ │ │ │ ../ │ │ │ │ loader.efi │ │ │ │ HashTool.efi │ │ │ │ bootx64.efi │ │ │ └──────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Enroll this hash into MOK database? │ │ │ │ File: \loader.efi │ │ Hash: 8D1B74227CB2EE6B23B829595B761BAA34D171337F70D44ABF542D5318BDBA08 │ │ │ │ │ │ │ │ │ │ ┌─────┐ │ │ │ No │ │ │ │ Yes │ │ │ └─────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘