🐞 fix:TSG-18861:查找onie启动项缺少参数-v ,导致查找boot number 为空

This commit is contained in:
linxin
2024-01-29 14:12:37 +08:00
committed by 林鑫
parent 8ee198a337
commit c345f02b22

View File

@@ -23,7 +23,7 @@ set_onie_next_boot()
# select ONIE as the next OS to boot. The "BootNext" variable # select ONIE as the next OS to boot. The "BootNext" variable
# is only used once by the firmware, after which the permanent # is only used once by the firmware, after which the permanent
# "BootOrder" variable is used. # "BootOrder" variable is used.
local boot_num=$(efibootmgr | grep "ONIE:" | grep "HD" | awk '{ print $1 }') local boot_num=$(efibootmgr -v| grep "ONIE:" | grep "HD" | awk '{ print $1 }')
boot_num=${boot_num#Boot} boot_num=${boot_num#Boot}
# Remove trailing '*' # Remove trailing '*'
boot_num=${boot_num%\*} boot_num=${boot_num%\*}