]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_autoscript.c
MVBC_P: fix compile problem
[karo-tx-uboot.git] / common / cmd_autoscript.c
index 5163d57cc4d9f3ce994f6ca6ad337791ae70fa9b..13af93ec85ebc31d322a5eda0c439df441b7f556 100644 (file)
@@ -52,7 +52,7 @@
 int
 autoscript (ulong addr, const char *fit_uname)
 {
-       ulong           len;
+       ulong           len;
        image_header_t  *hdr;
        ulong           *data;
        char            *cmd;
@@ -65,7 +65,7 @@ autoscript (ulong addr, const char *fit_uname)
        size_t          fit_len;
 #endif
 
-       verify = getenv_verify ();
+       verify = getenv_yesno ("verify");
 
        switch (genimg_get_format ((void *)addr)) {
        case IMAGE_FORMAT_LEGACY:
@@ -100,6 +100,13 @@ autoscript (ulong addr, const char *fit_uname)
                        puts ("Empty Script\n");
                        return 1;
                }
+
+               /*
+                * scripts are just multi-image files with one component, seek
+                * past the zero-terminated sequence of image lengths to get
+                * to the actual image data
+                */
+               while (*data++);
                break;
 #if defined(CONFIG_FIT)
        case IMAGE_FORMAT_FIT:
@@ -155,8 +162,6 @@ autoscript (ulong addr, const char *fit_uname)
                return 1;
        }
 
-       while (*data++);
-
        /* make sure cmd is null terminated */
        memmove (cmd, (char *)data, len);
        *(cmd + len) = 0;