Browse Source

Add more error checking to the bootstrap script.

Joe Clarke 4 years ago
parent
commit
6fd35c1cbd
1 changed files with 16 additions and 1 deletions
  1. 16 1
      eem/tm_sw_autoconf.tcl

+ 16 - 1
eem/tm_sw_autoconf.tcl

@@ -160,6 +160,9 @@ if { $image != {} } {
         error $result $errorInfo
     }
 
+    # Log result in case this fails
+    action_syslog msg "Output of copy command: '$result'"
+
     if { [catch {cli_exec $cli(fd) "config t"} result] } {
         error $result $errorInfo
     }
@@ -188,6 +191,15 @@ if { $image != {} } {
             error $result $errorInfo
         }
     }
+
+    if { [catch {cli_exec $cli(fd) "show boot | inc BOOT path-list"} result] } {
+        error $result $errorInfo
+    }
+
+    if { ! [regexp "$fstype$image" $result] } {
+        action_syslog msg "FAILED BOOT: Failed to set boot variable: '$result'"
+        exit 1
+    }
 }
 
 if { $config != {} } {
@@ -253,7 +265,10 @@ if { $image != {} } {
 	      error $result $errorInfo
     }
 
-    regexp {= ([A-Fa-f0-9]+)} $result -> md5
+    if { ! [regexp {= ([A-Fa-f0-9]+)} $result -> md5] } {
+        action_syslog msg "MD5 VALIDATION FAILED: '$result'"
+        exit 1
+    }
     set verify_image [url_encode $image]
 }