aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mkimage/src/mkimage.c
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2007-05-23 09:42:45 +0000
committerImre Kaloz <kaloz@openwrt.org>2007-05-23 09:42:45 +0000
commit89897bd2ab532637ad16b3d857ed4d07963c991c (patch)
tree73e69196930051dc2391f1a5f8954d8a9eba1dbb /tools/mkimage/src/mkimage.c
parentbedf56bac76985a754d134097fedae2d246171a1 (diff)
downloadupstream-89897bd2ab532637ad16b3d857ed4d07963c991c.tar.gz
upstream-89897bd2ab532637ad16b3d857ed4d07963c991c.tar.bz2
upstream-89897bd2ab532637ad16b3d857ed4d07963c991c.zip
upgrade mkimage the current git version
SVN-Revision: 7306
Diffstat (limited to 'tools/mkimage/src/mkimage.c')
-rw-r--r--tools/mkimage/src/mkimage.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/mkimage/src/mkimage.c b/tools/mkimage/src/mkimage.c
index 136075c50a..67123d9344 100644
--- a/tools/mkimage/src/mkimage.c
+++ b/tools/mkimage/src/mkimage.c
@@ -93,6 +93,8 @@ table_entry_t arch_name[] = {
{ IH_CPU_SH, "sh", "SuperH", },
{ IH_CPU_SPARC, "sparc", "SPARC", },
{ IH_CPU_SPARC64, "sparc64", "SPARC 64 Bit", },
+ { IH_CPU_BLACKFIN, "blackfin", "Blackfin", },
+ { IH_CPU_AVR32, "avr32", "AVR32", },
{ -1, "", "", },
};
@@ -129,6 +131,7 @@ table_entry_t type_name[] = {
{ IH_TYPE_RAMDISK, "ramdisk", "RAMDisk Image", },
{ IH_TYPE_SCRIPT, "script", "Script", },
{ IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
+ { IH_TYPE_FLATDT, "flat_dt", "Flat Device Tree", },
{ -1, "", "", },
};
@@ -276,7 +279,8 @@ NXTARG: ;
*/
if (xflag) {
if (ep != addr + sizeof(image_header_t)) {
- fprintf (stderr, "%s: For XIP, the entry point must be the load addr + %lu\n",
+ fprintf (stderr,
+ "%s: For XIP, the entry point must be the load addr + %lu\n",
cmdname,
(unsigned long)sizeof(image_header_t));
exit (EXIT_FAILURE);
@@ -346,8 +350,9 @@ NXTARG: ;
if (crc32 (0, data, len) != checksum) {
fprintf (stderr,
- "*** Warning: \"%s\" has bad header checksum!\n",
- imagefile);
+ "%s: ERROR: \"%s\" has bad header checksum!\n",
+ cmdname, imagefile);
+ exit (EXIT_FAILURE);
}
data = (char *)(ptr + sizeof(image_header_t));
@@ -355,8 +360,9 @@ NXTARG: ;
if (crc32 (0, data, len) != ntohl(hdr->ih_dcrc)) {
fprintf (stderr,
- "*** Warning: \"%s\" has corrupted data!\n",
- imagefile);
+ "%s: ERROR: \"%s\" has corrupted data!\n",
+ cmdname, imagefile);
+ exit (EXIT_FAILURE);
}
/* for multi-file images we need the data part, too */
@@ -383,7 +389,7 @@ NXTARG: ;
if (opt_type == IH_TYPE_MULTI || opt_type == IH_TYPE_SCRIPT) {
char *file = datafile;
- unsigned long size;
+ uint32_t size;
for (;;) {
char *sep = NULL;
@@ -440,7 +446,7 @@ NXTARG: ;
}
/* We're a bit of paranoid */
-#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
+#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
(void) fdatasync (ifd);
#else
(void) fsync (ifd);
@@ -490,7 +496,7 @@ NXTARG: ;
(void) munmap((void *)ptr, sbuf.st_size);
/* We're a bit of paranoid */
-#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
+#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
(void) fdatasync (ifd);
#else
(void) fsync (ifd);
@@ -628,7 +634,7 @@ print_header (image_header_t *hdr)
if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
int i, ptrs;
uint32_t pos;
- unsigned long *len_ptr = (unsigned long *) (
+ uint32_t *len_ptr = (uint32_t *) (
(unsigned long)hdr + sizeof(image_header_t)
);