core: 修复 azure win2016 下无法添加 efi 启动项

fixes #35, fixes #43
This commit is contained in:
bin456789 2023-12-22 23:42:12 +08:00
parent 5ce4929a9c
commit af99a3a70f
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -938,6 +938,13 @@ add_efi_entry_in_windows() {
mkdir -p $dist_dir
cp -f "$source" "$dist_dir/$basename"
# 如果 {fwbootmgr} displayorder 为空
# 执行 bcdedit /copy '{bootmgr}' 会报错
# 例如 azure windows 2016 模板
# 要先设置默认的 {fwbootmgr} displayorder
# https://github.com/hakuna-m/wubiuefi/issues/286
bcdedit /set '{fwbootmgr}' displayorder '{bootmgr}' /addfirst
# 添加启动项
id=$(bcdedit /copy '{bootmgr}' /d "$(get_entry_name)" | grep -o '{.*}')
bcdedit /set $id device partition=$x: