Use IH_TYPE_FILESYSTEM for TRAB "disk" images.

This commit is contained in:
wdenk 2003-10-07 20:01:55 +00:00
parent 147031aef1
commit d9a405aaf6
2 changed files with 15 additions and 5 deletions

View file

@ -2,6 +2,8 @@
Changes for U-Boot 1.0.0: Changes for U-Boot 1.0.0:
====================================================================== ======================================================================
* Use IH_TYPE_FILESYSTEM for TRAB "disk" images.
* Fix build problems under FreeBSD * Fix build problems under FreeBSD
* Add generic filesystem image type * Add generic filesystem image type

View file

@ -254,9 +254,11 @@ au_check_valid(int idx, long nbytes)
printf ("Image %s wrong type\n", aufile[idx]); printf ("Image %s wrong type\n", aufile[idx]);
return -1; return -1;
} }
if ((idx == IDX_DISK || idx == IDX_APP) if ((idx == IDX_DISK) && (hdr->ih_type != IH_TYPE_FILESYSTEM)) {
&& (hdr->ih_type != IH_TYPE_RAMDISK)) printf ("Image %s wrong type\n", aufile[idx]);
{ return -1;
}
if ((idx == IDX_APP) && (hdr->ih_type != IH_TYPE_RAMDISK)) {
printf ("Image %s wrong type\n", aufile[idx]); printf ("Image %s wrong type\n", aufile[idx]);
return -1; return -1;
} }
@ -269,8 +271,14 @@ au_check_valid(int idx, long nbytes)
/* special case for prepare.img */ /* special case for prepare.img */
if (idx == IDX_PREPARE) if (idx == IDX_PREPARE)
return 0; return 0;
/* check the size does not exceed space in flash */ /* recycle checksum */
if ((ausize[idx] != 0) && (ausize[idx] < ntohl(hdr->ih_size))) { checksum = ntohl(hdr->ih_size);
/* for kernel and app the image header must also fit into flash */
if (idx != IDX_DISK)
checksum += sizeof(*hdr);
/* check the size does not exceed space in flash. HUSH scripts */
/* all have ausize[] set to 0 */
if ((ausize[idx] != 0) && (ausize[idx] < checksum)) {
printf ("Image %s is bigger than FLASH\n", aufile[idx]); printf ("Image %s is bigger than FLASH\n", aufile[idx]);
return -1; return -1;
} }