diff options
Diffstat (limited to 'devel/firmware-utils/files')
-rw-r--r-- | devel/firmware-utils/files/Makefile | 59 | ||||
-rw-r--r-- | devel/firmware-utils/files/freebsd.h | 9 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-freebsd.h | 12 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkcasfw.c | 19 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkcsysimg.c | 19 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkedimaximg.c | 15 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkmylofw.c | 15 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkzcfw.c | 12 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-mkzynfw.c | 18 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-ptgen.c | 13 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-trx.c | 13 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-trx2edips.c | 13 | ||||
-rw-r--r-- | devel/firmware-utils/files/patch-wrt400n.c | 11 |
13 files changed, 228 insertions, 0 deletions
diff --git a/devel/firmware-utils/files/Makefile b/devel/firmware-utils/files/Makefile new file mode 100644 index 000000000000..7e2b5044fa46 --- /dev/null +++ b/devel/firmware-utils/files/Makefile @@ -0,0 +1,59 @@ +# Custom Makefile to build all firmware utilities. OpenWrt has its own build +# system for these which would be overkill to replicate here. +# +# $FreeBSD$ +# + +SIMPLES= add_header addpattern airlink dgfirmware encode_crc \ + lzma2eva makeamitbin mkcasfw mkchkimg mkcsysimg mkdniimg \ + mkedimaximg mkfwimage mkfwimage2 mkmylofw mktitanimg mktplinkfw \ + mkwrgimg mkzynfw motorola-bin nand_ecc osbridge-crc pc1crypt \ + ptgen spw303v srec2bin trx trx2edips trx2usr wndr3700 xorimage + +ALL= ${SIMPLES} buffalo-enc buffalo-tag buffalo-tftp \ + imagetag mkplanexfw mkzcfw wrt400n + +OBJS+= buffalo-lib.o buffalo-enc.o buffalo-tag.o \ + buffalo-tftp.o +OBJS+= imagetag.o imagetag_cmdline.o +OBJS+= mkplanexfw.o sha1.o +OBJS+= mkzcfw.o +OBJS+= wrt400n.o cyg_crc32.o + +LDFLAGS+= -lmd -lssl -lz + +INSTALL_PROGRAM?= echo /usr/bin/install -C -o root -g bin -m 0644 +PREFIX?= /usr/local + +all: ${ALL} + +install: ${ALL} + ${INSTALL_PROGRAM} ${ALL} ${PREFIX}/bin + +clean: + rm -f ${ALL} ${OBJS} + +.for i in ${SIMPLES} +${i}: ${i}.c +.endfor + +buffalo-enc: buffalo-enc.o buffalo-lib.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +buffalo-tag: buffalo-tag.o buffalo-lib.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +buffalo-tftp: buffalo-tftp.o buffalo-lib.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +imagetag: imagetag.o imagetag_cmdline.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +mkplanexfw: mkplanexfw.o sha1.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +mkzcfw: mkzcfw.o cyg_crc32.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} + +wrt400n: wrt400n.o cyg_crc32.o + ${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC} diff --git a/devel/firmware-utils/files/freebsd.h b/devel/firmware-utils/files/freebsd.h new file mode 100644 index 000000000000..a333b7930056 --- /dev/null +++ b/devel/firmware-utils/files/freebsd.h @@ -0,0 +1,9 @@ +/* + * + */ + +#define bswap_8(x) ((x) & 0xff) +#define bswap_16(x) ((bswap_8(x) << 8) | bswap_8((x) >> 8)) +#define bswap_32(x) ((bswap_16(x) << 16) | bswap_16((x) >> 16)) +#define bswap_64(x) ((bswap_32(x) << 32) | bswap_32((x) >> 32)) + diff --git a/devel/firmware-utils/files/patch-freebsd.h b/devel/firmware-utils/files/patch-freebsd.h new file mode 100644 index 000000000000..c3bd2af7b5fe --- /dev/null +++ b/devel/firmware-utils/files/patch-freebsd.h @@ -0,0 +1,12 @@ +--- /dev/null 2011-12-22 15:12:10.000000000 +0100 ++++ freebsd.h 2011-12-22 15:09:36.970404879 +0100 +@@ -0,0 +1,9 @@ ++/* ++ * ++ */ ++ ++#define bswap_8(x) ((x) & 0xff) ++#define bswap_16(x) ((bswap_8(x) << 8) | bswap_8((x) >> 8)) ++#define bswap_32(x) ((bswap_16(x) << 16) | bswap_16((x) >> 16)) ++#define bswap_64(x) ((bswap_32(x) << 32) | bswap_32((x) >> 32)) ++ diff --git a/devel/firmware-utils/files/patch-mkcasfw.c b/devel/firmware-utils/files/patch-mkcasfw.c new file mode 100644 index 000000000000..51b4aa3a78f5 --- /dev/null +++ b/devel/firmware-utils/files/patch-mkcasfw.c @@ -0,0 +1,19 @@ +diff --git a/mkcasfw.c b/mkcasfw.c +index 626e77d..fe9f122 100644 +--- mkcasfw.c ++++ mkcasfw.c +@@ -19,11 +19,13 @@ + #include <stdarg.h> + #include <errno.h> + #include <sys/stat.h> +-#include <endian.h> /* for __BYTE_ORDER */ ++#include <sys/endian.h> /* for __BYTE_ORDER */ + #if defined(__CYGWIN__) + # include <byteswap.h> + #endif + ++#include "freebsd.h" ++ + #if (__BYTE_ORDER == __LITTLE_ENDIAN) + # define HOST_TO_LE16(x) (x) + # define HOST_TO_LE32(x) (x) diff --git a/devel/firmware-utils/files/patch-mkcsysimg.c b/devel/firmware-utils/files/patch-mkcsysimg.c new file mode 100644 index 000000000000..f78a72e8f92c --- /dev/null +++ b/devel/firmware-utils/files/patch-mkcsysimg.c @@ -0,0 +1,19 @@ +diff --git a/mkcsysimg.c b/mkcsysimg.c +index 4f2352a..b0c16c6 100644 +--- mkcsysimg.c ++++ mkcsysimg.c +@@ -32,11 +32,13 @@ + #include <stdarg.h> + #include <errno.h> + #include <sys/stat.h> +-#include <endian.h> /* for __BYTE_ORDER */ ++#include <sys/endian.h> /* for __BYTE_ORDER */ + #if defined(__CYGWIN__) + # include <byteswap.h> + #endif + ++#include "freebsd.h" ++ + #include "csysimg.h" + + #if (__BYTE_ORDER == __LITTLE_ENDIAN) diff --git a/devel/firmware-utils/files/patch-mkedimaximg.c b/devel/firmware-utils/files/patch-mkedimaximg.c new file mode 100644 index 000000000000..4145286e452e --- /dev/null +++ b/devel/firmware-utils/files/patch-mkedimaximg.c @@ -0,0 +1,15 @@ +diff --git a/mkedimaximg.c b/mkedimaximg.c +index d8a017e..6d504e5 100644 +--- mkedimaximg.c ++++ mkedimaximg.c +@@ -15,7 +15,9 @@ + #include <getopt.h> + #include <errno.h> + #include <sys/stat.h> +-#include <endian.h> /* for __BYTE_ORDER */ ++#include <sys/endian.h> /* for __BYTE_ORDER */ ++ ++#include "freebsd.h" + + #if (__BYTE_ORDER == __LITTLE_ENDIAN) + # define HOST_TO_LE16(x) (x) diff --git a/devel/firmware-utils/files/patch-mkmylofw.c b/devel/firmware-utils/files/patch-mkmylofw.c new file mode 100644 index 000000000000..b217ec0e5cf1 --- /dev/null +++ b/devel/firmware-utils/files/patch-mkmylofw.c @@ -0,0 +1,15 @@ +diff --git a/mkmylofw.c b/mkmylofw.c +index 585a9f9..927a0f7 100644 +--- mkmylofw.c ++++ mkmylofw.c +@@ -28,7 +28,9 @@ + #include <stdarg.h> + #include <errno.h> + #include <sys/stat.h> +-#include <endian.h> /* for __BYTE_ORDER */ ++#include <sys/endian.h> /* for __BYTE_ORDER */ ++ ++#include "freebsd.h" + + #if defined(__CYGWIN__) + # include <byteswap.h> diff --git a/devel/firmware-utils/files/patch-mkzcfw.c b/devel/firmware-utils/files/patch-mkzcfw.c new file mode 100644 index 000000000000..baaab712f4cd --- /dev/null +++ b/devel/firmware-utils/files/patch-mkzcfw.c @@ -0,0 +1,12 @@ +diff --git a/mkzcfw.c b/mkzcfw.c +index 7674e70..c60fc6f 100644 +--- mkzcfw.c ++++ mkzcfw.c +@@ -18,6 +18,7 @@ + #include <errno.h> + #include <sys/stat.h> + ++#include "freebsd.h" + #include "cyg_crc.h" + + #if (__BYTE_ORDER == __BIG_ENDIAN) diff --git a/devel/firmware-utils/files/patch-mkzynfw.c b/devel/firmware-utils/files/patch-mkzynfw.c new file mode 100644 index 000000000000..3b206fbd1baf --- /dev/null +++ b/devel/firmware-utils/files/patch-mkzynfw.c @@ -0,0 +1,18 @@ +diff --git a/mkzynfw.c b/mkzynfw.c +index 36c176f..22d8bd3 100644 +--- mkzynfw.c ++++ mkzynfw.c +@@ -23,11 +23,12 @@ + #include <stdarg.h> + #include <errno.h> + #include <sys/stat.h> +-#include <endian.h> /* for __BYTE_ORDER */ ++#include <sys/endian.h> /* for __BYTE_ORDER */ + #if defined(__CYGWIN__) + # include <byteswap.h> + #endif + ++#include "freebsd.h" + #include "zynos.h" + + #if (__BYTE_ORDER == __LITTLE_ENDIAN) diff --git a/devel/firmware-utils/files/patch-ptgen.c b/devel/firmware-utils/files/patch-ptgen.c new file mode 100644 index 000000000000..36ee333fc8da --- /dev/null +++ b/devel/firmware-utils/files/patch-ptgen.c @@ -0,0 +1,13 @@ +diff --git a/ptgen.c b/ptgen.c +index d94aabb..4733311 100644 +--- ptgen.c ++++ ptgen.c +@@ -29,6 +29,8 @@ + #include <ctype.h> + #include <fcntl.h> + ++#include "freebsd.h" ++ + #if __BYTE_ORDER == __BIG_ENDIAN + #define cpu_to_le16(x) bswap_16(x) + #elif __BYTE_ORDER == __LITTLE_ENDIAN diff --git a/devel/firmware-utils/files/patch-trx.c b/devel/firmware-utils/files/patch-trx.c new file mode 100644 index 000000000000..7d764a9438cc --- /dev/null +++ b/devel/firmware-utils/files/patch-trx.c @@ -0,0 +1,13 @@ +diff --git a/trx.c b/trx.c +index 8e95d98..765f83c 100644 +--- trx.c ++++ trx.c +@@ -51,6 +51,8 @@ + #include <errno.h> + #include <unistd.h> + ++#include "freebsd.h" ++ + #if __BYTE_ORDER == __BIG_ENDIAN + #define STORE32_LE(X) bswap_32(X) + #define LOAD32_LE(X) bswap_32(X) diff --git a/devel/firmware-utils/files/patch-trx2edips.c b/devel/firmware-utils/files/patch-trx2edips.c new file mode 100644 index 000000000000..0c941a01932e --- /dev/null +++ b/devel/firmware-utils/files/patch-trx2edips.c @@ -0,0 +1,13 @@ +diff --git a/trx2edips.c b/trx2edips.c +index f8d068d..224bc12 100644 +--- trx2edips.c ++++ trx2edips.c +@@ -6,6 +6,8 @@ + #include <errno.h> + #include <unistd.h> + ++#include "freebsd.h" ++ + #if __BYTE_ORDER == __BIG_ENDIAN + #define STORE32_LE(X) bswap_32(X) + #define LOAD32_LE(X) bswap_32(X) diff --git a/devel/firmware-utils/files/patch-wrt400n.c b/devel/firmware-utils/files/patch-wrt400n.c new file mode 100644 index 000000000000..9c6fd1843714 --- /dev/null +++ b/devel/firmware-utils/files/patch-wrt400n.c @@ -0,0 +1,11 @@ +diff --git a/wrt400n.c b/wrt400n.c +index a9a4908..f3c53db 100644 +--- wrt400n.c ++++ wrt400n.c +@@ -11,6 +11,7 @@ + #include <stdio.h> + #include <stdint.h> + #include <string.h> ++#include <unistd.h> + #include <sys/types.h> + #include <sys/stat.h> |