core: 修复 efi 条目 inactive 时 (没有*符号) 报错

https://manpages.debian.org/unstable/efibootmgr/efibootmgr.8.en.html#Displaying_the_current_settings_(must_be_root):
This commit is contained in:
bin456789 2025-03-23 10:15:48 +08:00
parent 0da940b2a7
commit dd1b3abbfd
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 3 additions and 1 deletions

View File

@ -2588,6 +2588,7 @@ grep_efi_entry() {
grep -E '^Boot[0-9a-fA-F]{4}'
}
# trans.sh 有同名方法
grep_efi_index() {
awk '{print $1}' | sed -e 's/Boot//' -e 's/\*//'
}

View File

@ -822,8 +822,9 @@ del_invalid_efi_entry() {
done < <(efibootmgr | grep 'HD(.*,GPT,')
}
# reinstall.sh 有同名方法
grep_efi_index() {
awk -F '*' '{print $1}' | sed 's/Boot//'
awk '{print $1}' | sed -e 's/Boot//' -e 's/\*//'
}
# 某些机器可能不会回落到 bootx64.efi