Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Dec 2011 15:44:43 
From:      Stefan Bethke <stb@lassitu.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/163537: New port: devel/firmware-utils various utils to create firmware images
Message-ID:  <20111222154443-419101@diesel.lassitu.de>
Resent-Message-ID: <201112221450.pBMEoAoe036368@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163537
>Category:       ports
>Synopsis:       New port: devel/firmware-utils various utils to create firmware images
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 22 14:50:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Bethke
>Release:        FreeBSD 9.0-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD diesel.lassitu.de 9.0-PRERELEASE FreeBSD 9.0-PRERELEASE #21: Sat Nov 26 12:39:06 CET 2011 root@diesel.lassitu.de:/usr/obj/usr/src/sys/DIESEL amd64


>Description:
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.

>How-To-Repeat:
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	firmware-utils
#	firmware-utils/Makefile
#	firmware-utils/diff
#	firmware-utils/distinfo
#	firmware-utils/files
#	firmware-utils/files/Makefile
#	firmware-utils/files/freebsd.h
#	firmware-utils/files/patch-freebsd.h
#	firmware-utils/files/patch-mkcasfw.c
#	firmware-utils/files/patch-mkcsysimg.c
#	firmware-utils/files/patch-mkedimaximg.c
#	firmware-utils/files/patch-mkmylofw.c
#	firmware-utils/files/patch-mkzcfw.c
#	firmware-utils/files/patch-mkzynfw.c
#	firmware-utils/files/patch-ptgen.c
#	firmware-utils/files/patch-trx.c
#	firmware-utils/files/patch-trx2edips.c
#	firmware-utils/files/patch-wrt400n.c
#	firmware-utils/pkg-descr
#
echo c - firmware-utils
mkdir -p firmware-utils > /dev/null 2>&1
echo x - firmware-utils/Makefile
sed 's/^X//' >firmware-utils/Makefile << '09e20066667029d314c62c5ff67ea24b'
X# New ports collection makefile for:	firmware-utils
X# Date created:			December 22, 2011
X# Whom:				Stefan Bethke <stb@lassitu.de>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	firmware-utils
XPORTVERSION=	20111222
XCATEGORIES=	devel
XMASTER_SITES=	http://www.transit.hanse.de/mirror/svn.openwrt.org/firmware-utils/
X
XMAINTAINER=	stb@assitu.de
XCOMMENT=	Create device firmware images
X
XUSE_BZIP2=	yes
X
XMAKEFILE=	${FILESDIR}/Makefile
XMAKE_ARGS+=	INSTALL_PROGRAM="${INSTALL_PROGRAM}" PREFIX=${PREFIX}
X
XPLIST_FILES=	bin/mkplanexfw bin/trx bin/osbridge-crc bin/mkwrgimg \
X		bin/add_header bin/mktitanimg bin/mkzynfw bin/xorimage \
X		bin/srec2bin bin/mkfwimage bin/trx2usr bin/mkcasfw \
X		bin/mkdniimg bin/mkfwimage2 bin/motorola-bin bin/nand_ecc \
X		bin/buffalo-enc bin/spw303v bin/mkzcfw bin/trx2edips \
X		bin/wndr3700 bin/mkchkimg bin/makeamitbin bin/mkcsysimg \
X		bin/addpattern bin/imagetag bin/dgfirmware bin/encode_crc \
X		bin/pc1crypt bin/ptgen bin/mkmylofw bin/airlink \
X		bin/buffalo-tag bin/mktplinkfw bin/lzma2eva \
X		bin/buffalo-tftp bin/wrt400n bin/mkedimaximg
X
X.include <bsd.port.mk>
09e20066667029d314c62c5ff67ea24b
echo x - firmware-utils/diff
sed 's/^X//' >firmware-utils/diff << 'e95edbe6727bb698ae51b6918a4de99b'
Xdiff --git a/mkcasfw.c b/mkcasfw.c
Xindex 626e77d..fe9f122 100644
X--- a/mkcasfw.c
X+++ b/mkcasfw.c
X@@ -19,11 +19,13 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X+
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
X #  define HOST_TO_LE16(x)	(x)
X #  define HOST_TO_LE32(x)	(x)
Xdiff --git a/mkcsysimg.c b/mkcsysimg.c
Xindex 4f2352a..b0c16c6 100644
X--- a/mkcsysimg.c
X+++ b/mkcsysimg.c
X@@ -32,11 +32,13 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X+
X #include "csysimg.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
Xdiff --git a/mkedimaximg.c b/mkedimaximg.c
Xindex d8a017e..6d504e5 100644
X--- a/mkedimaximg.c
X+++ b/mkedimaximg.c
X@@ -15,7 +15,9 @@
X #include <getopt.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>	/* for __BYTE_ORDER */
X+#include <sys/endian.h>	/* for __BYTE_ORDER */
X+
X+#include "freebsd.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
X #  define HOST_TO_LE16(x)	(x)
Xdiff --git a/mkmylofw.c b/mkmylofw.c
Xindex 585a9f9..927a0f7 100644
X--- a/mkmylofw.c
X+++ b/mkmylofw.c
X@@ -28,7 +28,9 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X+
X+#include "freebsd.h"
X 
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
Xdiff --git a/mkzcfw.c b/mkzcfw.c
Xindex 7674e70..c60fc6f 100644
X--- a/mkzcfw.c
X+++ b/mkzcfw.c
X@@ -18,6 +18,7 @@
X #include <errno.h>
X #include <sys/stat.h>
X 
X+#include "freebsd.h"
X #include "cyg_crc.h"
X 
X #if (__BYTE_ORDER == __BIG_ENDIAN)
Xdiff --git a/mkzynfw.c b/mkzynfw.c
Xindex 36c176f..22d8bd3 100644
X--- a/mkzynfw.c
X+++ b/mkzynfw.c
X@@ -23,11 +23,12 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>	/* for __BYTE_ORDER */
X+#include <sys/endian.h>	/* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X #include "zynos.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
Xdiff --git a/ptgen.c b/ptgen.c
Xindex d94aabb..4733311 100644
X--- a/ptgen.c
X+++ b/ptgen.c
X@@ -29,6 +29,8 @@
X #include <ctype.h>
X #include <fcntl.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define cpu_to_le16(x) bswap_16(x)
X #elif __BYTE_ORDER == __LITTLE_ENDIAN
Xdiff --git a/trx.c b/trx.c
Xindex 8e95d98..765f83c 100644
X--- a/trx.c
X+++ b/trx.c
X@@ -51,6 +51,8 @@
X #include <errno.h>
X #include <unistd.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define STORE32_LE(X)		bswap_32(X)
X #define LOAD32_LE(X)		bswap_32(X)
Xdiff --git a/trx2edips.c b/trx2edips.c
Xindex f8d068d..224bc12 100644
X--- a/trx2edips.c
X+++ b/trx2edips.c
X@@ -6,6 +6,8 @@
X #include <errno.h>
X #include <unistd.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define STORE32_LE(X)		bswap_32(X)
X #define LOAD32_LE(X)		bswap_32(X)
Xdiff --git a/wrt400n.c b/wrt400n.c
Xindex a9a4908..f3c53db 100644
X--- a/wrt400n.c
X+++ b/wrt400n.c
X@@ -11,6 +11,7 @@
X #include <stdio.h>
X #include <stdint.h>
X #include <string.h>
X+#include <unistd.h>
X #include <sys/types.h>
X #include <sys/stat.h>
X 
e95edbe6727bb698ae51b6918a4de99b
echo x - firmware-utils/distinfo
sed 's/^X//' >firmware-utils/distinfo << '64a1e02acaabce4c645c5811a0d94aad'
XSHA256 (firmware-utils-20111222.tar.bz2) = 0ff574300b761c902b6ce5fddcf78dc511a32b9aea86d31a3f140aa40aec974a
XSIZE (firmware-utils-20111222.tar.bz2) = 103583
64a1e02acaabce4c645c5811a0d94aad
echo c - firmware-utils/files
mkdir -p firmware-utils/files > /dev/null 2>&1
echo x - firmware-utils/files/Makefile
sed 's/^X//' >firmware-utils/files/Makefile << 'f1429a9b7aba76410157f38bcd308c66'
X# Custom Makefile to build all firmware utilities. OpenWrt has its own build
X# system for these which would be overkill to replicate here.
X#
X# $FreeBSD$
X#
X
XSIMPLES=	add_header addpattern airlink dgfirmware encode_crc \
X	lzma2eva makeamitbin mkcasfw mkchkimg mkcsysimg mkdniimg \
X	mkedimaximg mkfwimage mkfwimage2 mkmylofw mktitanimg mktplinkfw \
X	mkwrgimg mkzynfw motorola-bin nand_ecc osbridge-crc pc1crypt \
X	ptgen spw303v srec2bin trx trx2edips trx2usr wndr3700 xorimage
X
XALL=	${SIMPLES} buffalo-enc buffalo-tag buffalo-tftp \
X	imagetag mkplanexfw mkzcfw wrt400n
X
XOBJS+=	buffalo-lib.o buffalo-enc.o buffalo-tag.o \
X	buffalo-tftp.o
XOBJS+=	imagetag.o imagetag_cmdline.o
XOBJS+=	mkplanexfw.o sha1.o
XOBJS+=	mkzcfw.o
XOBJS+=	wrt400n.o cyg_crc32.o
X
XLDFLAGS+=	-lmd -lssl -lz
X
XINSTALL_PROGRAM?=	echo /usr/bin/install -C -o root -g bin -m 0644
XPREFIX?=	/usr/local
X
Xall: ${ALL}
X
Xinstall: ${ALL}
X	${INSTALL_PROGRAM} ${ALL} ${PREFIX}/bin
X
Xclean:
X	rm -f ${ALL} ${OBJS}
X
X.for i in ${SIMPLES}
X${i}: ${i}.c
X.endfor
X
Xbuffalo-enc: buffalo-enc.o buffalo-lib.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Xbuffalo-tag: buffalo-tag.o buffalo-lib.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Xbuffalo-tftp: buffalo-tftp.o buffalo-lib.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Ximagetag:	imagetag.o imagetag_cmdline.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Xmkplanexfw: mkplanexfw.o sha1.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Xmkzcfw:	mkzcfw.o cyg_crc32.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
X
Xwrt400n:	wrt400n.o cyg_crc32.o
X	${CC} -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
f1429a9b7aba76410157f38bcd308c66
echo x - firmware-utils/files/freebsd.h
sed 's/^X//' >firmware-utils/files/freebsd.h << '336e1c6d40171888919a48d1da893343'
X/*
X *
X */
X
X#define	bswap_8(x)	((x) & 0xff)
X#define bswap_16(x)	((bswap_8(x) << 8) | bswap_8((x) >> 8))
X#define	bswap_32(x)	((bswap_16(x) << 16) | bswap_16((x) >> 16))
X#define bswap_64(x)	((bswap_32(x) << 32) | bswap_32((x) >> 32))
X
336e1c6d40171888919a48d1da893343
echo x - firmware-utils/files/patch-freebsd.h
sed 's/^X//' >firmware-utils/files/patch-freebsd.h << 'c1530f134d0146ce1b34e9870e85fe35'
X--- /dev/null	2011-12-22 15:12:10.000000000 +0100
X+++ freebsd.h	2011-12-22 15:09:36.970404879 +0100
X@@ -0,0 +1,9 @@
X+/*
X+ *
X+ */
X+
X+#define	bswap_8(x)	((x) & 0xff)
X+#define bswap_16(x)	((bswap_8(x) << 8) | bswap_8((x) >> 8))
X+#define	bswap_32(x)	((bswap_16(x) << 16) | bswap_16((x) >> 16))
X+#define bswap_64(x)	((bswap_32(x) << 32) | bswap_32((x) >> 32))
X+
c1530f134d0146ce1b34e9870e85fe35
echo x - firmware-utils/files/patch-mkcasfw.c
sed 's/^X//' >firmware-utils/files/patch-mkcasfw.c << '148f01e693072eb71a94fabafd38d28f'
Xdiff --git a/mkcasfw.c b/mkcasfw.c
Xindex 626e77d..fe9f122 100644
X--- mkcasfw.c
X+++ mkcasfw.c
X@@ -19,11 +19,13 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X+
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
X #  define HOST_TO_LE16(x)	(x)
X #  define HOST_TO_LE32(x)	(x)
148f01e693072eb71a94fabafd38d28f
echo x - firmware-utils/files/patch-mkcsysimg.c
sed 's/^X//' >firmware-utils/files/patch-mkcsysimg.c << '39a75ad8a8b834c3b460e537c2ce9131'
Xdiff --git a/mkcsysimg.c b/mkcsysimg.c
Xindex 4f2352a..b0c16c6 100644
X--- mkcsysimg.c
X+++ mkcsysimg.c
X@@ -32,11 +32,13 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X+
X #include "csysimg.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
39a75ad8a8b834c3b460e537c2ce9131
echo x - firmware-utils/files/patch-mkedimaximg.c
sed 's/^X//' >firmware-utils/files/patch-mkedimaximg.c << '3f29225afda02f348640b3bb1b146505'
Xdiff --git a/mkedimaximg.c b/mkedimaximg.c
Xindex d8a017e..6d504e5 100644
X--- mkedimaximg.c
X+++ mkedimaximg.c
X@@ -15,7 +15,9 @@
X #include <getopt.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>	/* for __BYTE_ORDER */
X+#include <sys/endian.h>	/* for __BYTE_ORDER */
X+
X+#include "freebsd.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
X #  define HOST_TO_LE16(x)	(x)
3f29225afda02f348640b3bb1b146505
echo x - firmware-utils/files/patch-mkmylofw.c
sed 's/^X//' >firmware-utils/files/patch-mkmylofw.c << 'd4c4bc570b18d5f0c654e0699a9386a2'
Xdiff --git a/mkmylofw.c b/mkmylofw.c
Xindex 585a9f9..927a0f7 100644
X--- mkmylofw.c
X+++ mkmylofw.c
X@@ -28,7 +28,9 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>     /* for __BYTE_ORDER */
X+#include <sys/endian.h>     /* for __BYTE_ORDER */
X+
X+#include "freebsd.h"
X 
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
d4c4bc570b18d5f0c654e0699a9386a2
echo x - firmware-utils/files/patch-mkzcfw.c
sed 's/^X//' >firmware-utils/files/patch-mkzcfw.c << 'beda0d0fadccbfe36761e7823bf7be72'
Xdiff --git a/mkzcfw.c b/mkzcfw.c
Xindex 7674e70..c60fc6f 100644
X--- mkzcfw.c
X+++ mkzcfw.c
X@@ -18,6 +18,7 @@
X #include <errno.h>
X #include <sys/stat.h>
X 
X+#include "freebsd.h"
X #include "cyg_crc.h"
X 
X #if (__BYTE_ORDER == __BIG_ENDIAN)
beda0d0fadccbfe36761e7823bf7be72
echo x - firmware-utils/files/patch-mkzynfw.c
sed 's/^X//' >firmware-utils/files/patch-mkzynfw.c << '6d2233278e9fabd9338a2c4770ae9291'
Xdiff --git a/mkzynfw.c b/mkzynfw.c
Xindex 36c176f..22d8bd3 100644
X--- mkzynfw.c
X+++ mkzynfw.c
X@@ -23,11 +23,12 @@
X #include <stdarg.h>
X #include <errno.h>
X #include <sys/stat.h>
X-#include <endian.h>	/* for __BYTE_ORDER */
X+#include <sys/endian.h>	/* for __BYTE_ORDER */
X #if defined(__CYGWIN__)
X #  include <byteswap.h>
X #endif
X 
X+#include "freebsd.h"
X #include "zynos.h"
X 
X #if (__BYTE_ORDER == __LITTLE_ENDIAN)
6d2233278e9fabd9338a2c4770ae9291
echo x - firmware-utils/files/patch-ptgen.c
sed 's/^X//' >firmware-utils/files/patch-ptgen.c << '8992c392df1b401ce81892b2a57daf79'
Xdiff --git a/ptgen.c b/ptgen.c
Xindex d94aabb..4733311 100644
X--- ptgen.c
X+++ ptgen.c
X@@ -29,6 +29,8 @@
X #include <ctype.h>
X #include <fcntl.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define cpu_to_le16(x) bswap_16(x)
X #elif __BYTE_ORDER == __LITTLE_ENDIAN
8992c392df1b401ce81892b2a57daf79
echo x - firmware-utils/files/patch-trx.c
sed 's/^X//' >firmware-utils/files/patch-trx.c << '867ae60b19edbf9c65441bf152756f56'
Xdiff --git a/trx.c b/trx.c
Xindex 8e95d98..765f83c 100644
X--- trx.c
X+++ trx.c
X@@ -51,6 +51,8 @@
X #include <errno.h>
X #include <unistd.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define STORE32_LE(X)		bswap_32(X)
X #define LOAD32_LE(X)		bswap_32(X)
867ae60b19edbf9c65441bf152756f56
echo x - firmware-utils/files/patch-trx2edips.c
sed 's/^X//' >firmware-utils/files/patch-trx2edips.c << 'a1b600a54baa48898d3cb4761aa7185b'
Xdiff --git a/trx2edips.c b/trx2edips.c
Xindex f8d068d..224bc12 100644
X--- trx2edips.c
X+++ trx2edips.c
X@@ -6,6 +6,8 @@
X #include <errno.h>
X #include <unistd.h>
X 
X+#include "freebsd.h"
X+
X #if __BYTE_ORDER == __BIG_ENDIAN
X #define STORE32_LE(X)		bswap_32(X)
X #define LOAD32_LE(X)		bswap_32(X)
a1b600a54baa48898d3cb4761aa7185b
echo x - firmware-utils/files/patch-wrt400n.c
sed 's/^X//' >firmware-utils/files/patch-wrt400n.c << 'dccd0b36028a79a172c79efee5d56ac9'
Xdiff --git a/wrt400n.c b/wrt400n.c
Xindex a9a4908..f3c53db 100644
X--- wrt400n.c
X+++ wrt400n.c
X@@ -11,6 +11,7 @@
X #include <stdio.h>
X #include <stdint.h>
X #include <string.h>
X+#include <unistd.h>
X #include <sys/types.h>
X #include <sys/stat.h>
dccd0b36028a79a172c79efee5d56ac9
echo x - firmware-utils/pkg-descr
sed 's/^X//' >firmware-utils/pkg-descr << '1fb946409dfb10a1bbaf593f9d30ab34'
XA collection of utilities to create firmware images for embedded devices,
Xincluding many wireless routers from many vendors.
X
XThe utilities are collected and maintained by the OpenWrt router project.
X
XWWW: http://www.openwrt.org/
1fb946409dfb10a1bbaf593f9d30ab34
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111222154443-419101>