aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2011-12-25 13:10:28 +0800
committereadler <eadler@FreeBSD.org>2011-12-25 13:10:28 +0800
commit5ec5dc850711d850a339e3a1402e7aed8ca3a327 (patch)
tree0dae617e909818962ef3bb97ec7d83c07c1ab972 /devel
parent50e77a3272a78f454d994ee021cf96fb518d50d6 (diff)
downloadfreebsd-ports-gnome-5ec5dc850711d850a339e3a1402e7aed8ca3a327.tar.gz
freebsd-ports-gnome-5ec5dc850711d850a339e3a1402e7aed8ca3a327.tar.zst
freebsd-ports-gnome-5ec5dc850711d850a339e3a1402e7aed8ca3a327.zip
A collection of utilities to create firmware images for embedded devices,
including many wireless routers from many vendors. The utilities are collected and maintained by the OpenWrt router project. WWW: http://www.openwrt.org/ PR: ports/163537 Submitted by: Stefan Bethke <stb@lassitu.de> Feature safe: yes
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/firmware-utils/Makefile21
-rw-r--r--devel/firmware-utils/distinfo2
-rw-r--r--devel/firmware-utils/files/Makefile59
-rw-r--r--devel/firmware-utils/files/freebsd.h9
-rw-r--r--devel/firmware-utils/files/patch-freebsd.h12
-rw-r--r--devel/firmware-utils/files/patch-mkcasfw.c19
-rw-r--r--devel/firmware-utils/files/patch-mkcsysimg.c19
-rw-r--r--devel/firmware-utils/files/patch-mkedimaximg.c15
-rw-r--r--devel/firmware-utils/files/patch-mkmylofw.c15
-rw-r--r--devel/firmware-utils/files/patch-mkzcfw.c12
-rw-r--r--devel/firmware-utils/files/patch-mkzynfw.c18
-rw-r--r--devel/firmware-utils/files/patch-ptgen.c13
-rw-r--r--devel/firmware-utils/files/patch-trx.c13
-rw-r--r--devel/firmware-utils/files/patch-trx2edips.c13
-rw-r--r--devel/firmware-utils/files/patch-wrt400n.c11
-rw-r--r--devel/firmware-utils/pkg-descr6
-rw-r--r--devel/firmware-utils/pkg-plist38
18 files changed, 296 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 7a0009bd8df4..35d3f4d75b3d 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -385,6 +385,7 @@
SUBDIR += fga
SUBDIR += fhist
SUBDIR += fib
+ SUBDIR += firmware-utils
SUBDIR += fistgen
SUBDIR += flatzebra
SUBDIR += flex-sdk
diff --git a/devel/firmware-utils/Makefile b/devel/firmware-utils/Makefile
new file mode 100644
index 000000000000..10392fc8c136
--- /dev/null
+++ b/devel/firmware-utils/Makefile
@@ -0,0 +1,21 @@
+# New ports collection makefile for: firmware-utils
+# Date created: 2011-12-22
+# Whom: Stefan Bethke <stb@lassitu.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= firmware-utils
+PORTVERSION= 20111222
+CATEGORIES= devel
+MASTER_SITES= http://www.transit.hanse.de/mirror/svn.openwrt.org/firmware-utils/
+
+MAINTAINER= stb@assitu.de
+COMMENT= Create device firmware images
+
+USE_BZIP2= yes
+
+MAKEFILE= ${FILESDIR}/Makefile
+MAKE_ARGS+= INSTALL_PROGRAM="${INSTALL_PROGRAM}" PREFIX=${PREFIX}
+
+.include <bsd.port.mk>
diff --git a/devel/firmware-utils/distinfo b/devel/firmware-utils/distinfo
new file mode 100644
index 000000000000..b3c7768321e5
--- /dev/null
+++ b/devel/firmware-utils/distinfo
@@ -0,0 +1,2 @@
+SHA256 (firmware-utils-20111222.tar.bz2) = 0ff574300b761c902b6ce5fddcf78dc511a32b9aea86d31a3f140aa40aec974a
+SIZE (firmware-utils-20111222.tar.bz2) = 103583
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>
diff --git a/devel/firmware-utils/pkg-descr b/devel/firmware-utils/pkg-descr
new file mode 100644
index 000000000000..51a4f5e65e2b
--- /dev/null
+++ b/devel/firmware-utils/pkg-descr
@@ -0,0 +1,6 @@
+A collection of utilities to create firmware images for embedded devices,
+including many wireless routers from many vendors.
+
+The utilities are collected and maintained by the OpenWrt router project.
+
+WWW: http://www.openwrt.org/
diff --git a/devel/firmware-utils/pkg-plist b/devel/firmware-utils/pkg-plist
new file mode 100644
index 000000000000..c61b9e6de783
--- /dev/null
+++ b/devel/firmware-utils/pkg-plist
@@ -0,0 +1,38 @@
+bin/mkplanexfw
+bin/trx
+bin/osbridge-crc
+bin/mkwrgimg
+bin/add_header
+bin/mktitanimg
+bin/mkzynfw
+bin/xorimage
+bin/mkfwimage
+bin/trx2usr
+bin/mkcasfw
+bin/mkdniimg
+bin/mkfwimage2
+bin/motorola-bin
+bin/nand_ecc
+bin/buffalo-enc
+bin/spw303v
+bin/mkzcfw
+bin/trx2edips
+bin/wndr3700
+bin/mkchkimg
+bin/makeamitbin
+bin/mkcsysimg
+bin/addpattern
+bin/imagetag
+bin/dgfirmware
+bin/encode_crc
+bin/ptgen
+bin/mkmylofw
+bin/airlink
+bin/buffalo-tag
+bin/mktplinkfw
+bin/lzma2eva
+bin/buffalo-tftp
+bin/wrt400n
+bin/mkedimaximg
+bin/pc1crypt
+bin/srec2bin