diff --git a/platform/mellanox/onie-fw-update b/platform/mellanox/onie-fw-update index 1ffafc45c5ac..314f4ed70268 100755 --- a/platform/mellanox/onie-fw-update +++ b/platform/mellanox/onie-fw-update @@ -10,7 +10,6 @@ this_script=${ONIE_FWPKG_PROGRAM_NAME:-$(basename $(realpath $0))} onie_mount=/mnt/onie-boot os_boot=/host onie_partition= -onie_entry=0 export ONIE_FWPKG_PROGRAM_NAME=$(basename $(realpath $0)) @@ -45,28 +44,9 @@ clean_onie_access() umount $onie_partition } -# ONIE entry must exist in grub config -find_onie_menuentry() -{ - onie_entry="$(cat $os_boot/grub/grub.cfg | grep -e 'menuentry' | cat -n | awk '$0~/ONIE/ {print $1-1}')" - entries_num="$(echo "$onie_entry" | grep -E '^[0-9]+$' | wc -l)" - if [ $entries_num -eq 1 ] && [ $onie_entry -ge 1 ]; then - return 0 - fi - return 1 -} - change_grub_boot_order() { - find_onie_menuentry - rc=$? - if [ $rc -eq 0 ]; then - grub-editenv $os_boot/grub/grubenv set onie_entry=ONIE - else - echo "ERROR: ONIE entry wasn't found in grub config" - return 1 - fi - + grub-editenv $os_boot/grub/grubenv set onie_entry=ONIE grub-editenv $onie_mount/grub/grubenv set onie_mode=update return 0 }