Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Use efibootmgr for supported device on fwutil #19407

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions platform/mellanox/mlnx-onie-fw-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ enable_onie_fw_update_mode() {
fi

register_terminate_handler

grub-editenv ${os_boot}/grub/grubenv set onie_entry="ONIE" || return $?
if [ -d /sys/firmware/efi/efivars ]; then
onie_boot_num=$(efibootmgr | grep "ONIE:" | awk '{ print $1 }' | cut -b 5-8 )
efibootmgr -n $onie_boot_num
else
grub-editenv ${os_boot}/grub/grubenv set onie_entry="ONIE" || return $?
fi
grub-editenv ${onie_mount}/grub/grubenv set onie_mode="update" || return $?

return 0
Expand All @@ -80,7 +84,12 @@ disable_onie_fw_update_mode() {
return 1
fi

grub-editenv ${os_boot}/grub/grubenv unset onie_entry || return $?
if [ -d /sys/firmware/efi/efivars ]; then
sonic_boot_num=$(efibootmgr | grep "SONiC-OS" | awk '{ print $1 }' | cut -b 5-8 )
efibootmgr -n $sonic_boot_num
else
grub-editenv ${os_boot}/grub/grubenv unset onie_entry || return $?
fi
grub-editenv ${onie_mount}/grub/grubenv set onie_mode="install" || return $?

return 0
Expand All @@ -106,7 +115,7 @@ system_reboot() {
sleep 5s

# Use SONiC reboot scenario
/usr/local/bin/reboot
/usr/local/bin/reboot -f
exit $?
}

Expand Down
Loading