aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mkimage
diff options
context:
space:
mode:
authorJames <>2013-03-17 12:16:37 +0000
committerJames <>2013-03-17 12:16:37 +0000
commit27b76ab0671089c47506615a796a261e993896a7 (patch)
tree61213d67e7fa87b20356b23798558e2c4212c42f /tools/mkimage
downloadtrunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.gz
trunk-36060-27b76ab0671089c47506615a796a261e993896a7.tar.bz2
trunk-36060-27b76ab0671089c47506615a796a261e993896a7.zip
Diffstat (limited to 'tools/mkimage')
-rw-r--r--tools/mkimage/.svn/entries65
-rw-r--r--tools/mkimage/.svn/text-base/Makefile.svn-base42
-rw-r--r--tools/mkimage/Makefile42
-rw-r--r--tools/mkimage/patches/.svn/entries198
-rw-r--r--tools/mkimage/patches/.svn/text-base/010-freebsd-ulong-fix.patch.svn-base13
-rw-r--r--tools/mkimage/patches/.svn/text-base/020-openbsd_fixes.patch.svn-base18
-rw-r--r--tools/mkimage/patches/.svn/text-base/030-allow-to-use-different-magic.patch.svn-base63
-rw-r--r--tools/mkimage/patches/.svn/text-base/040-include_order.patch.svn-base14
-rw-r--r--tools/mkimage/patches/.svn/text-base/050-image_h_portability.patch.svn-base31
-rw-r--r--tools/mkimage/patches/010-freebsd-ulong-fix.patch13
-rw-r--r--tools/mkimage/patches/020-openbsd_fixes.patch18
-rw-r--r--tools/mkimage/patches/030-allow-to-use-different-magic.patch63
-rw-r--r--tools/mkimage/patches/040-include_order.patch14
-rw-r--r--tools/mkimage/patches/050-image_h_portability.patch31
14 files changed, 625 insertions, 0 deletions
diff --git a/tools/mkimage/.svn/entries b/tools/mkimage/.svn/entries
new file mode 100644
index 0000000..b73acee
--- /dev/null
+++ b/tools/mkimage/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/mkimage
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-09T19:00:39.454125Z
+35909
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+8cbedfcc5a2f0b565070e63e03b8c9cc
+2013-03-08T20:16:11.041117Z
+35905
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+998
+
diff --git a/tools/mkimage/.svn/text-base/Makefile.svn-base b/tools/mkimage/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..7bd7316
--- /dev/null
+++ b/tools/mkimage/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mkimage
+PKG_VERSION:=2013.01.01
+
+PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
+PKG_MD5SUM:=73939f78606f89a1775c7e9acb2ca617
+PKG_CAT:=bzcat
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Prepare
+ $(Host/Prepare/Default)
+ rm -f \
+ $(HOST_BUILD_DIR)/include/errno.h \
+ $(HOST_BUILD_DIR)/include/malloc.h \
+ $(HOST_BUILD_DIR)/tools/.depend
+ touch $(HOST_BUILD_DIR)/include/config.h
+endef
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR) BUILD_DIR= BIN_FILES-y="mkimage" HOSTLDFLAGS="$(HOST_STATIC_LINKING)" tools
+endef
+
+define Host/Install
+ $(CP) $(HOST_BUILD_DIR)/tools/mkimage $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/mkimage
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile
new file mode 100644
index 0000000..7bd7316
--- /dev/null
+++ b/tools/mkimage/Makefile
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mkimage
+PKG_VERSION:=2013.01.01
+
+PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
+PKG_MD5SUM:=73939f78606f89a1775c7e9acb2ca617
+PKG_CAT:=bzcat
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Prepare
+ $(Host/Prepare/Default)
+ rm -f \
+ $(HOST_BUILD_DIR)/include/errno.h \
+ $(HOST_BUILD_DIR)/include/malloc.h \
+ $(HOST_BUILD_DIR)/tools/.depend
+ touch $(HOST_BUILD_DIR)/include/config.h
+endef
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR) BUILD_DIR= BIN_FILES-y="mkimage" HOSTLDFLAGS="$(HOST_STATIC_LINKING)" tools
+endef
+
+define Host/Install
+ $(CP) $(HOST_BUILD_DIR)/tools/mkimage $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/mkimage
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/mkimage/patches/.svn/entries b/tools/mkimage/patches/.svn/entries
new file mode 100644
index 0000000..77f572e
--- /dev/null
+++ b/tools/mkimage/patches/.svn/entries
@@ -0,0 +1,198 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/mkimage/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-09T19:00:39.454125Z
+35909
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+020-openbsd_fixes.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+fde7cea0fc21ee1aeddfeff0c09afc80
+2013-03-08T20:16:11.041117Z
+35905
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+460
+
+030-allow-to-use-different-magic.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+8e42af8f1f959047b31c43848c6b9ea0
+2013-03-08T20:16:11.041117Z
+35905
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1924
+
+050-image_h_portability.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+58233808f33a2aa8bb70257f1dd6a017
+2013-03-09T19:00:39.454125Z
+35909
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1084
+
+010-freebsd-ulong-fix.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+6fb979048ef13ef211b7105e94c26e5a
+2013-03-08T20:16:11.041117Z
+35905
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+210
+
+040-include_order.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+50e4b9b3bef200f18583ebccd2bd6165
+2013-03-08T20:16:11.041117Z
+35905
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+457
+
diff --git a/tools/mkimage/patches/.svn/text-base/010-freebsd-ulong-fix.patch.svn-base b/tools/mkimage/patches/.svn/text-base/010-freebsd-ulong-fix.patch.svn-base
new file mode 100644
index 0000000..7372914
--- /dev/null
+++ b/tools/mkimage/patches/.svn/text-base/010-freebsd-ulong-fix.patch.svn-base
@@ -0,0 +1,13 @@
+--- a/include/image.h
++++ b/include/image.h
+@@ -51,6 +51,10 @@
+
+ #endif /* USE_HOSTCC */
+
++#ifndef ulong
++#define ulong unsigned long
++#endif
++
+ #if defined(CONFIG_FIT)
+ #include <fdt.h>
+ #include <libfdt.h>
diff --git a/tools/mkimage/patches/.svn/text-base/020-openbsd_fixes.patch.svn-base b/tools/mkimage/patches/.svn/text-base/020-openbsd_fixes.patch.svn-base
new file mode 100644
index 0000000..1723236
--- /dev/null
+++ b/tools/mkimage/patches/.svn/text-base/020-openbsd_fixes.patch.svn-base
@@ -0,0 +1,18 @@
+--- a/tools/mkimage.c
++++ b/tools/mkimage.c
+@@ -464,6 +464,7 @@
+ #if defined(_POSIX_SYNCHRONIZED_IO) && \
+ !defined(__sun__) && \
+ !defined(__FreeBSD__) && \
++ !defined(__OpenBSD__) && \
+ !defined(__APPLE__)
+ (void) fdatasync (ifd);
+ #else
+@@ -507,6 +508,7 @@
+ #if defined(_POSIX_SYNCHRONIZED_IO) && \
+ !defined(__sun__) && \
+ !defined(__FreeBSD__) && \
++ !defined(__OpenBSD__) && \
+ !defined(__APPLE__)
+ (void) fdatasync (ifd);
+ #else
diff --git a/tools/mkimage/patches/.svn/text-base/030-allow-to-use-different-magic.patch.svn-base b/tools/mkimage/patches/.svn/text-base/030-allow-to-use-different-magic.patch.svn-base
new file mode 100644
index 0000000..305b834
--- /dev/null
+++ b/tools/mkimage/patches/.svn/text-base/030-allow-to-use-different-magic.patch.svn-base
@@ -0,0 +1,63 @@
+--- a/tools/mkimage.c
++++ b/tools/mkimage.c
+@@ -37,6 +37,7 @@
+ .arch = IH_ARCH_PPC,
+ .type = IH_TYPE_KERNEL,
+ .comp = IH_COMP_GZIP,
++ .magic = IH_MAGIC,
+ .dtc = MKIMAGE_DEFAULT_DTC_OPTIONS,
+ .imagename = "",
+ .imagename2 = "",
+@@ -189,6 +190,16 @@
+ genimg_get_comp_id (*++argv)) < 0)
+ usage ();
+ goto NXTARG;
++ case 'M':
++ if (--argc <=0)
++ usage ();
++ params.magic = strtoul (*++argv, &ptr, 16);
++ if (*ptr) {
++ fprintf (stderr,
++ "%s: invalid magic %s\n",
++ params.cmdname, *argv);
++ }
++ goto NXTARG;
+ case 'D':
+ if (--argc <= 0)
+ usage ();
+@@ -613,12 +624,13 @@
+ fprintf (stderr, "Usage: %s -l image\n"
+ " -l ==> list image header information\n",
+ params.cmdname);
+- fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp "
++ fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp -M magic "
+ "-a addr -e ep -n name -d data_file[:data_file...] image\n"
+ " -A ==> set architecture to 'arch'\n"
+ " -O ==> set operating system to 'os'\n"
+ " -T ==> set image type to 'type'\n"
+ " -C ==> set compression type 'comp'\n"
++ " -M ==> set image magic to 'magic'\n"
+ " -a ==> set load address to 'addr' (hex)\n"
+ " -e ==> set entry point to 'ep' (hex)\n"
+ " -n ==> set image name to 'name'\n"
+--- a/tools/mkimage.h
++++ b/tools/mkimage.h
+@@ -65,6 +65,7 @@
+ int arch;
+ int type;
+ int comp;
++ unsigned int magic;
+ char *dtc;
+ unsigned int addr;
+ unsigned int ep;
+--- a/tools/default_image.c
++++ b/tools/default_image.c
+@@ -111,7 +111,7 @@
+ sbuf->st_size - sizeof(image_header_t));
+
+ /* Build new header */
+- image_set_magic(hdr, IH_MAGIC);
++ image_set_magic(hdr, params->magic);
+ image_set_time(hdr, sbuf->st_mtime);
+ image_set_size(hdr, sbuf->st_size - sizeof(image_header_t));
+ image_set_load(hdr, params->addr);
diff --git a/tools/mkimage/patches/.svn/text-base/040-include_order.patch.svn-base b/tools/mkimage/patches/.svn/text-base/040-include_order.patch.svn-base
new file mode 100644
index 0000000..f94e91d
--- /dev/null
+++ b/tools/mkimage/patches/.svn/text-base/040-include_order.patch.svn-base
@@ -0,0 +1,14 @@
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -162,9 +162,9 @@
+ # Use native tools and options
+ # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
+ #
+-HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
++HOSTCPPFLAGS = -I $(SRCTREE)/include \
+ -idirafter $(OBJTREE)/include2 \
+- -idirafter $(OBJTREE)/include \
++ -I $(OBJTREE)/include \
+ -I $(SRCTREE)/lib/libfdt \
+ -I $(SRCTREE)/tools \
+ -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
diff --git a/tools/mkimage/patches/.svn/text-base/050-image_h_portability.patch.svn-base b/tools/mkimage/patches/.svn/text-base/050-image_h_portability.patch.svn-base
new file mode 100644
index 0000000..1f22237
--- /dev/null
+++ b/tools/mkimage/patches/.svn/text-base/050-image_h_portability.patch.svn-base
@@ -0,0 +1,31 @@
+--- a/include/image.h
++++ b/include/image.h
+@@ -34,7 +34,6 @@
+ #define __IMAGE_H__
+
+ #include "compiler.h"
+-#include <asm/byteorder.h>
+
+ #ifdef USE_HOSTCC
+
+@@ -191,13 +190,13 @@
+ * all data in network byte order (aka natural aka bigendian).
+ */
+ typedef struct image_header {
+- __be32 ih_magic; /* Image Header Magic Number */
+- __be32 ih_hcrc; /* Image Header CRC Checksum */
+- __be32 ih_time; /* Image Creation Timestamp */
+- __be32 ih_size; /* Image Data Size */
+- __be32 ih_load; /* Data Load Address */
+- __be32 ih_ep; /* Entry Point Address */
+- __be32 ih_dcrc; /* Image Data CRC Checksum */
++ uint32_t ih_magic; /* Image Header Magic Number */
++ uint32_t ih_hcrc; /* Image Header CRC Checksum */
++ uint32_t ih_time; /* Image Creation Timestamp */
++ uint32_t ih_size; /* Image Data Size */
++ uint32_t ih_load; /* Data Load Address */
++ uint32_t ih_ep; /* Entry Point Address */
++ uint32_t ih_dcrc; /* Image Data CRC Checksum */
+ uint8_t ih_os; /* Operating System */
+ uint8_t ih_arch; /* CPU architecture */
+ uint8_t ih_type; /* Image Type */
diff --git a/tools/mkimage/patches/010-freebsd-ulong-fix.patch b/tools/mkimage/patches/010-freebsd-ulong-fix.patch
new file mode 100644
index 0000000..7372914
--- /dev/null
+++ b/tools/mkimage/patches/010-freebsd-ulong-fix.patch
@@ -0,0 +1,13 @@
+--- a/include/image.h
++++ b/include/image.h
+@@ -51,6 +51,10 @@
+
+ #endif /* USE_HOSTCC */
+
++#ifndef ulong
++#define ulong unsigned long
++#endif
++
+ #if defined(CONFIG_FIT)
+ #include <fdt.h>
+ #include <libfdt.h>
diff --git a/tools/mkimage/patches/020-openbsd_fixes.patch b/tools/mkimage/patches/020-openbsd_fixes.patch
new file mode 100644
index 0000000..1723236
--- /dev/null
+++ b/tools/mkimage/patches/020-openbsd_fixes.patch
@@ -0,0 +1,18 @@
+--- a/tools/mkimage.c
++++ b/tools/mkimage.c
+@@ -464,6 +464,7 @@
+ #if defined(_POSIX_SYNCHRONIZED_IO) && \
+ !defined(__sun__) && \
+ !defined(__FreeBSD__) && \
++ !defined(__OpenBSD__) && \
+ !defined(__APPLE__)
+ (void) fdatasync (ifd);
+ #else
+@@ -507,6 +508,7 @@
+ #if defined(_POSIX_SYNCHRONIZED_IO) && \
+ !defined(__sun__) && \
+ !defined(__FreeBSD__) && \
++ !defined(__OpenBSD__) && \
+ !defined(__APPLE__)
+ (void) fdatasync (ifd);
+ #else
diff --git a/tools/mkimage/patches/030-allow-to-use-different-magic.patch b/tools/mkimage/patches/030-allow-to-use-different-magic.patch
new file mode 100644
index 0000000..305b834
--- /dev/null
+++ b/tools/mkimage/patches/030-allow-to-use-different-magic.patch
@@ -0,0 +1,63 @@
+--- a/tools/mkimage.c
++++ b/tools/mkimage.c
+@@ -37,6 +37,7 @@
+ .arch = IH_ARCH_PPC,
+ .type = IH_TYPE_KERNEL,
+ .comp = IH_COMP_GZIP,
++ .magic = IH_MAGIC,
+ .dtc = MKIMAGE_DEFAULT_DTC_OPTIONS,
+ .imagename = "",
+ .imagename2 = "",
+@@ -189,6 +190,16 @@
+ genimg_get_comp_id (*++argv)) < 0)
+ usage ();
+ goto NXTARG;
++ case 'M':
++ if (--argc <=0)
++ usage ();
++ params.magic = strtoul (*++argv, &ptr, 16);
++ if (*ptr) {
++ fprintf (stderr,
++ "%s: invalid magic %s\n",
++ params.cmdname, *argv);
++ }
++ goto NXTARG;
+ case 'D':
+ if (--argc <= 0)
+ usage ();
+@@ -613,12 +624,13 @@
+ fprintf (stderr, "Usage: %s -l image\n"
+ " -l ==> list image header information\n",
+ params.cmdname);
+- fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp "
++ fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp -M magic "
+ "-a addr -e ep -n name -d data_file[:data_file...] image\n"
+ " -A ==> set architecture to 'arch'\n"
+ " -O ==> set operating system to 'os'\n"
+ " -T ==> set image type to 'type'\n"
+ " -C ==> set compression type 'comp'\n"
++ " -M ==> set image magic to 'magic'\n"
+ " -a ==> set load address to 'addr' (hex)\n"
+ " -e ==> set entry point to 'ep' (hex)\n"
+ " -n ==> set image name to 'name'\n"
+--- a/tools/mkimage.h
++++ b/tools/mkimage.h
+@@ -65,6 +65,7 @@
+ int arch;
+ int type;
+ int comp;
++ unsigned int magic;
+ char *dtc;
+ unsigned int addr;
+ unsigned int ep;
+--- a/tools/default_image.c
++++ b/tools/default_image.c
+@@ -111,7 +111,7 @@
+ sbuf->st_size - sizeof(image_header_t));
+
+ /* Build new header */
+- image_set_magic(hdr, IH_MAGIC);
++ image_set_magic(hdr, params->magic);
+ image_set_time(hdr, sbuf->st_mtime);
+ image_set_size(hdr, sbuf->st_size - sizeof(image_header_t));
+ image_set_load(hdr, params->addr);
diff --git a/tools/mkimage/patches/040-include_order.patch b/tools/mkimage/patches/040-include_order.patch
new file mode 100644
index 0000000..f94e91d
--- /dev/null
+++ b/tools/mkimage/patches/040-include_order.patch
@@ -0,0 +1,14 @@
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -162,9 +162,9 @@
+ # Use native tools and options
+ # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
+ #
+-HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
++HOSTCPPFLAGS = -I $(SRCTREE)/include \
+ -idirafter $(OBJTREE)/include2 \
+- -idirafter $(OBJTREE)/include \
++ -I $(OBJTREE)/include \
+ -I $(SRCTREE)/lib/libfdt \
+ -I $(SRCTREE)/tools \
+ -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
diff --git a/tools/mkimage/patches/050-image_h_portability.patch b/tools/mkimage/patches/050-image_h_portability.patch
new file mode 100644
index 0000000..1f22237
--- /dev/null
+++ b/tools/mkimage/patches/050-image_h_portability.patch
@@ -0,0 +1,31 @@
+--- a/include/image.h
++++ b/include/image.h
+@@ -34,7 +34,6 @@
+ #define __IMAGE_H__
+
+ #include "compiler.h"
+-#include <asm/byteorder.h>
+
+ #ifdef USE_HOSTCC
+
+@@ -191,13 +190,13 @@
+ * all data in network byte order (aka natural aka bigendian).
+ */
+ typedef struct image_header {
+- __be32 ih_magic; /* Image Header Magic Number */
+- __be32 ih_hcrc; /* Image Header CRC Checksum */
+- __be32 ih_time; /* Image Creation Timestamp */
+- __be32 ih_size; /* Image Data Size */
+- __be32 ih_load; /* Data Load Address */
+- __be32 ih_ep; /* Entry Point Address */
+- __be32 ih_dcrc; /* Image Data CRC Checksum */
++ uint32_t ih_magic; /* Image Header Magic Number */
++ uint32_t ih_hcrc; /* Image Header CRC Checksum */
++ uint32_t ih_time; /* Image Creation Timestamp */
++ uint32_t ih_size; /* Image Data Size */
++ uint32_t ih_load; /* Data Load Address */
++ uint32_t ih_ep; /* Entry Point Address */
++ uint32_t ih_dcrc; /* Image Data CRC Checksum */
+ uint8_t ih_os; /* Operating System */
+ uint8_t ih_arch; /* CPU architecture */
+ uint8_t ih_type; /* Image Type */