如何使用 Linux Foundation 的 PreLoader?

Liv*_*eBT 2 uefi secure-boot

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

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

Liv*_*eBT 7

设置预加载器

  • 查找并挂载您的 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 的网站上找到更详细的解释。

使用哈希工具

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

????????????????????????????????????????????????????????????????????????????????
?                            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 ?                                  ?
?                                     ???????                                  ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
?                                                                              ?
????????????????????????????????????????????????????????????????????????????????
Run Code Online (Sandbox Code Playgroud)