int
autoscript (ulong addr, const char *fit_uname)
{
- ulong len;
+ ulong len;
image_header_t *hdr;
ulong *data;
char *cmd;
size_t fit_len;
#endif
- verify = getenv_verify ();
+ verify = getenv_yesno ("verify");
switch (genimg_get_format ((void *)addr)) {
case IMAGE_FORMAT_LEGACY:
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:
return 1;
}
- while (*data++);
-
/* make sure cmd is null terminated */
memmove (cmd, (char *)data, len);
*(cmd + len) = 0;