无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 21319|回复: 90
打印 上一主题 下一主题

[讨论] UEFI下关于USB设备的默认引导文件

  [复制链接]
1#
发表于 2020-4-26 17:26:22 | 显示全部楼层
UEFI Spec 里面,好像只是规定了 可移动设备 的启动路径是 /EFI/BOOT/BOOT${ARCH}.EFI,而对于其他设备好像没有规定。我也记不清了,有兴趣可以看一下 UEFI Spec。

点评

https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf 2484页,好长啊,都是英文版的,很多是专业术语,看起来好费劲啊。没有中文版的吗。  详情 回复 发表于 2020-4-26 17:37
回复

使用道具 举报

2#
发表于 2020-4-26 17:48:02 | 显示全部楼层
An EFI system partition that is present on a hard disk must contain an EFI defined directory in the root
directory. This directory is named EFI. All OS loaders and applications will be stored in subdirectories
below EFI. Applications that are loaded by other applications or drivers are not required to be stored in
any specific location in the EFI system partition. The choice of the subdirectory name is up to the vendor,
but all vendors must pick names that do not collide with any other vendor’s subdirectory name.
This
applies to system manufacturers, operating system vendors, BIOS vendors, and third party tool vendors,
or any other vendor that wishes to install files on an EFI system partition. There must also only be one
executable EFI image for each supported processor architecture in each vendor subdirectory. This
guarantees that there is only one image that can be loaded from a vendor subdirectory by the EFI Boot
Manager. If more than one executable EFI image is present, then the boot behavior for the system will
not be deterministic. There may also be an optional vendor subdirectory called BOOT.
This directory contains EFI images that aide in recovery if the boot selections for the software installed on
the EFI system partition are ever lost. Any additional UEFI-compliant executables must be in
subdirectories below the vendor subdirectory. The following is a sample directory structure for an EFI
system partition present on a hard disk.

For removable media devices there must be only one UEFI-compliant system partition, and that partition
must contain an UEFI-defined directory in the root directory. The directory will be named EFI. All OS
loaders and applications will be stored in a subdirectory below EFI called BOOT. There must only be one
executable EFI image for each supported processor architecture in the BOOT directory. For removable
media to be bootable under EFI, it must be built in accordance with the rules laid out in Section 3.5.1.1.

This guarantees that there is only one image that can be automatically loaded from a removable media
device by the EFI Boot Manager. Any additional EFI executables must be in directories other than BOOT.
回复

使用道具 举报

3#
发表于 2020-4-26 17:51:29 | 显示全部楼层
注意上文,硬盘 和 可移动设备 遵循的标准是不一样的。
对于 硬盘, 必须(must) 包含 EFI 文件夹,不同 OS 的 Loader 必须(must) 都在各自的子文件夹下,但是子文件夹名称是由 Vendor 决定的。

回复

使用道具 举报

4#
发表于 2020-4-26 19:09:02 | 显示全部楼层
这个标准的意思是 硬盘启动 的默认路径必须形如
/EFI/<vendor dir>/<vendor image>
vendor (供应商) 既包括 bios vendor,也包括 os vendor (如 Microsoft,Fedora)
bios vendor 从众多 供应商中选一个最常见的来支持,就满足 uefi 标准了。


回复

使用道具 举报

5#
发表于 2020-4-26 19:14:16 | 显示全部楼层
hilsonma 发表于 2020-4-26 19:10
按上面英文表达,规范是

硬盘盘优先vendor引导,即 \efi\vendor_dir\vendor_ldr.efi

是的。
当然 固件也 可以 支持 移动设备上的 /EFI/Microsoft/xxx,这个不在标准之中。

点评

有几个疑问: 1、这么多vendor不知道是怎么排序的,微软排永远排老大吗? 2、grub2对应的vendor是什么? 3、论坛的资料上面似乎都是让大家拿efi\Boot\bootx64.efi开刀,事实上似乎拿微软\EFI\Microsoft\Boot\boot  详情 回复 发表于 2020-4-26 19:38
回复

使用道具 举报

6#
发表于 2020-4-26 19:44:54 | 显示全部楼层
liuzhaoyzz 发表于 2020-4-26 19:38
有几个疑问:
1、这么多vendor不知道是怎么排序的,微软永远排老大吗?
2、grub2对应的vendor是什么?
...

你没看懂。
固件只需要支持其中之一即可。

点评

我知道只要有\EFI\Microsoft\Boot\bootmgfw.efi一个就可以启动。我的问题是,如果想让主板自动添加grub2x64.efi,按照UEFI规范,这个vendor需要怎么命名?  详情 回复 发表于 2020-4-26 19:49
回复

使用道具 举报

7#
发表于 2020-6-1 20:21:12 | 显示全部楼层
liuzhaoyzz 发表于 2020-6-1 20:00
那按照你说的这个结论,固态优盘和移动硬盘应该归到哪一类呢?

我的移动硬盘没有\EFI\Microsoft\Boot\ ...

我以前用的 Surface 就是只能 /EFI/Microsoft/Boot/bootmgfw.efi。
所以,最佳解決方案:
所有的磁盘,bootx64.efi 和 bootmgfw.efi 各放一份。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-6 10:40

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表