Host (PC) side of
the USB DFU (Universal Serial Bus Device Firmware Upgrade) protocol.
This commit is contained in:
parent
6f81053e44
commit
b591fc0138
9 changed files with 100 additions and 0 deletions
2
dfu-util/DESCR
Normal file
2
dfu-util/DESCR
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Host (PC) side of
|
||||||
|
the USB DFU (Universal Serial Bus Device Firmware Upgrade) protocol.
|
34
dfu-util/Makefile
Normal file
34
dfu-util/Makefile
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# $NetBSD: Makefile,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
#
|
||||||
|
|
||||||
|
DISTNAME= dfu-util-3230
|
||||||
|
CATEGORIES= wip
|
||||||
|
MASTER_SITES= http://wiki.openmoko.org/
|
||||||
|
SVN_REPOSITORY= https://svn.openmoko.org/trunk/src/host/dfu-util/
|
||||||
|
NO_CHECKSUM= yes
|
||||||
|
|
||||||
|
MAINTAINER= noud4@home.nl
|
||||||
|
HOMEPAGE= http://wiki.openmoko.org/wiki/Dfu-util
|
||||||
|
COMMENT= Host side of the USB DFU protocol
|
||||||
|
|
||||||
|
SUBDIR= ${PKGNAME}
|
||||||
|
WRKSRC= ${WRKDIR}/${SUBDIR}
|
||||||
|
USE_TOOLS+= autoconf automake tar
|
||||||
|
HAS_CONFIGURE= YES
|
||||||
|
CONFIGURE_ARGS+= -prefix=${PREFIX}
|
||||||
|
CFLAGS+= -lusb
|
||||||
|
|
||||||
|
do-fetch:
|
||||||
|
if [ ! -f ${DISTDIR}/${SUBDIR:Q}.tar.gz ]; then \
|
||||||
|
cd ${DISTDIR:Q}; \
|
||||||
|
svn export -r ${PKGVERSION} ${SVN_REPOSITORY} ${SUBDIR:Q}; \
|
||||||
|
tar -czf ${SUBDIR:Q}.tar.gz ${SUBDIR:Q}; \
|
||||||
|
${RM} -r ${DISTDIR}/${SUBDIR:Q}; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
pre-configure:
|
||||||
|
${CHMOD} u+x ${WRKSRC}/autogen.sh
|
||||||
|
cd ${WRKSRC} && ./autogen.sh
|
||||||
|
|
||||||
|
.include "../../devel/libusb/buildlink3.mk"
|
||||||
|
.include "../../mk/bsd.pkg.mk"
|
3
dfu-util/PLIST
Normal file
3
dfu-util/PLIST
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
@comment $NetBSD: PLIST,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
bin/dfu-util
|
||||||
|
bin/dfu-util_static
|
1
dfu-util/TODO
Normal file
1
dfu-util/TODO
Normal file
|
@ -0,0 +1 @@
|
||||||
|
configure lib usb integration i.s.o. outcommenting w/ patch-aa.
|
7
dfu-util/distinfo
Normal file
7
dfu-util/distinfo
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$NetBSD: distinfo,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
|
||||||
|
SHA1 (dfu-util-3230.tar.gz) = d0d5f1464bceab018b1b666fcecc67f0d9eb5002
|
||||||
|
RMD160 (dfu-util-3230.tar.gz) = 1487caebbfa8d29ee6a64ce2fa1ebc4d889a06d7
|
||||||
|
Size (dfu-util-3230.tar.gz) = 20420 bytes
|
||||||
|
SHA1 (patch-aa) = e11ccf4df2585c0974599b60d46b5267d0a7b955
|
||||||
|
SHA1 (patch-ab) = 04e17fab6b3dd8e466152275dbfc53b097dfe1e4
|
2
dfu-util/distinfo.15087
Normal file
2
dfu-util/distinfo.15087
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
$NetBSD: distinfo.15087,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
|
2
dfu-util/distinfo.28697
Normal file
2
dfu-util/distinfo.28697
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
$NetBSD: distinfo.28697,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
|
18
dfu-util/patches/patch-aa
Normal file
18
dfu-util/patches/patch-aa
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
$NetBSD: patch-aa,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
|
||||||
|
--- configure.ac.orig 2007-10-08 03:26:48.000000000 +0200
|
||||||
|
+++ configure.ac 2007-10-20 15:15:19.000000000 +0200
|
||||||
|
@@ -15,13 +15,6 @@
|
||||||
|
|
||||||
|
# Checks for libraries.
|
||||||
|
|
||||||
|
-PKG_CHECK_MODULES(USB, libusb >= 0.1.4,,
|
||||||
|
- AC_MSG_ERROR([*** Required libusb >= 0.1.4 not installed ***]))
|
||||||
|
-AC_CHECK_LIB([usbpath],[usb_path2devnum],,,-lusb)
|
||||||
|
-
|
||||||
|
-LIBS="$LIBS $USB_LIBS"
|
||||||
|
-CFLAGS="$CFLAGS $USB_CFLAGS"
|
||||||
|
-
|
||||||
|
# Checks for header files.
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_CHECK_HEADERS([stdlib.h string.h stdio.h usbpath.h])
|
31
dfu-util/patches/patch-ab
Normal file
31
dfu-util/patches/patch-ab
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
$NetBSD: patch-ab,v 1.1.1.1 2007/10/20 13:03:04 noud4 Exp $
|
||||||
|
|
||||||
|
--- src/main.c.orig 2007-09-01 13:18:10.000000000 +0200
|
||||||
|
+++ src/main.c 2007-09-01 13:19:37.000000000 +0200
|
||||||
|
@@ -26,8 +26,13 @@
|
||||||
|
#include <getopt.h>
|
||||||
|
#include <usb.h>
|
||||||
|
#include <errno.h>
|
||||||
|
+#if __NetBSD__
|
||||||
|
+#include <machine/bswap.h>
|
||||||
|
+#include <sys/endian.h>
|
||||||
|
+#else
|
||||||
|
#include <byteswap.h>
|
||||||
|
#include <endian.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "dfu.h"
|
||||||
|
#include "usb_dfu.h"
|
||||||
|
@@ -660,8 +665,12 @@
|
||||||
|
transfer_size = page_size;
|
||||||
|
} else {
|
||||||
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
+#if __NetBSD__
|
||||||
|
+ func_dfu.wTransferSize = bswap16(func_dfu.wTransferSize);
|
||||||
|
+#else
|
||||||
|
func_dfu.wTransferSize = bswap_16(func_dfu.wTransferSize);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
transfer_size = func_dfu.wTransferSize;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue