Browse Source

Add a workaround for setting the boot variables on some devices.

Joe Clarke 2 years ago
parent
commit
9b7d1b46a5
1 changed files with 24 additions and 4 deletions
  1. 24 4
      eem/tm_sw_autoconf.tcl

+ 24 - 4
eem/tm_sw_autoconf.tcl

@@ -153,7 +153,7 @@ if { $image != {} } {
     }
 
     if { [catch {cli_exec $cli(fd) "end"} result] } {
-        error $result $errorInfo
+	error $result $errorInfo
     }
 
     if { [catch {cli_exec $cli(fd) "copy $TFTP_URL/$image $fstype"} result] } {
@@ -167,6 +167,24 @@ if { $image != {} } {
         error $result $errorInfo
     }
 
+    # Workaround busted boot variable setting on 9300 switches.
+    set fd [open "${fstype}boot_hack.txt" w]
+    puts $fd "\nboot system $fstype$image\nend"
+    close $fd
+
+    if { [catch {cli_exec $cli(fd) "end"} result] } {
+
+        error $result $errorInfo
+    }
+
+    if { [catch {cli_exec $cli(fd) "copy ${fstype}boot_hack.txt start"} result] } {
+	error $result $errorInfo
+    }
+
+    if { [catch {cli_exec $cli(fd) "config t"} result] } {
+        error $result $errorInfo
+    }
+
     if { [catch {cli_exec $cli(fd) "boot system $fstype$image"} result] } {
         error $result $errorInfo
     }
@@ -183,6 +201,8 @@ if { $image != {} } {
         error $result $errorInfo
     }
 
+    file delete -force ${fstype}boot_hack.txt
+
     if { [regexp {packages.conf} $imagepath] } {
 	      if { [catch {cli_exec $cli(fd) "del /force ${fstype}*.pkg"} result] } {
 	          error $result $errorInfo
@@ -298,9 +318,9 @@ if { $config != {} || $image != {} } {
 
     if { $config != {} } {
 	# XXX: This seems weird, but it's required to make sure the VLAN database
-	# is properly updated upon reboot.  By loading the startup config into
-	# running before rebooting, this reliable ensures the VLAN database is
-	# consistent.
+        # is properly updated upon reboot.  By loading the startup config into
+        # running before rebooting, this reliable ensures the VLAN database is
+        # consistent.
         if { [catch {cli_exec $cli(fd) "config mem"} result] } {
             error $result $errorInfo
     	  }