From f6dc473cf84fa31321c03d721e4ef1f9b3713ef8 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Thu, 17 Nov 2016 19:25:25 +0000 Subject: [PATCH] - Always set the default boot selection to $saved_entry - Always reset $saved_entry to the NOS boot selection. The purpose of this change is to make transitions to and from ONIE for update purposes more robust. Every boot selection to ONIE is automatically a boot-once choice. --- .../src/python/onl/install/BaseInstall.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py index c5a8b971..5c46f0b9 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py @@ -419,8 +419,17 @@ terminal_input serial terminal_output serial set timeout=5 +# Always boot the saved_entry value +load_env +if [ "${saved_entry}" ] ; then + set default="${saved_entry}" +fi + menuentry %(boot_menu_entry)s { search --no-floppy --label --set=root ONL-BOOT + # Always return to this entry by default. + set saved_entry="0" + save_env saved_entry echo 'Loading %(boot_loading_name)s ...' insmod gzio insmod part_msdos @@ -431,6 +440,9 @@ menuentry %(boot_menu_entry)s { # Menu entry to chainload ONIE menuentry ONIE { search --no-floppy --label --set=root ONIE-BOOT + # Always return to entry 0 by default. + set saved_entry="0" + save_env saved_entry echo 'Loading ONIE ...' chainloader +1 }