4

使用 uefibootmgr 在 Linux 中编辑 UEFI 启动项

 3 years ago
source link: https://ralf.ren/uefibootmgr/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用 uefibootmgr 在 Linux 中编辑 UEFI 启动项 – PlayerCatboy跳至内容

如何在 Linux 中使用 uefibootmgr 修复 Clover 引导项。

我曾写过一篇文章,介绍如何在 Windows PE 环境中修复 Clover 与 Windows 的 UEFI 启动项。本文将讲述,如何在 Linux 中,进行这一操作。

以 Clover 为例,我的 Clover 引导保存在第一块硬盘,的 EFI 分区中。EFI 分区是第一个分区,Clover 的 UEFI 程序位于 EFI 分区的这里:

EFI/CLOVER/CLOVERX64.efi

下面的命令可以创建新的启动项:

efibootmgr --create --disk /dev/sda --part 1 --label Clover -loader "\EFI\CLOVER\CLOVERX64.efi"
  • --create:创建 UEFI 启动项;
  • --disk /dev/sda:EFI 程序所在磁盘为 /dev/sda
  • --part 1:EFI 程序在磁盘的第一分区;
  • --label Clover:启动项名称为 “Clover”;
  • label Clover -loader "\EFI\CLOVER\CLOVERX64.efi":路径为 \EFI\CLOVER\CLOVERX64.efi

或者,简短些,也可以这么写:

efibootmgr -c -d /dev/sda -p 1 -L Clover -l "\EFI\CLOVER\CLOVERX64.efi"

创建完成后,执行 efibootmgr -v,可以看到,新建了编号为 0001 的 Clover 启动项,启动顺序 BootOrder 中,也自动将 0001 启动项放在了第一个。

catboy@gacchina:~$ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* ubuntu	HD(1,GPT,e1dfa827-f07b-4f50-8708-517976397711,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* Clover	HD(1,GPT,b367a12f-b783-42aa-8826-db2b2aa3a3df,0x28,0x64000)/File(\EFI\CLOVER\CLOVERX64.efi)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK