Skip to content

Commit 201e809

Browse files
jgillickfpistm
authored andcommitted
[linux] Create dfu-util script to select correct program (32/64-bit) (#46)
* Add dfu-util script to use correct arch program. * Add i386 binaries from official distribution.
1 parent eb1037c commit 201e809

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

linux/dfu-util.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#
3+
# Use the correct dfu-util program based on the architecture
4+
#
5+
6+
# Get the directory where the script is running.
7+
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
8+
9+
# Choose dfu program by arch
10+
if [ `uname -m` == "x86_64" ]; then
11+
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
12+
else
13+
DFU_UTIL=${DIR}/dfu-util/dfu-util
14+
fi
15+
16+
# Not found!
17+
if [ ! -x "${DFU_UTIL}" ]; then
18+
echo "$0: error: cannot find ${DFU_UTIL}" >&2
19+
exit 2
20+
fi
21+
22+
# Pass all parameters through
23+
"${DFU_UTIL}" "$@"

linux/dfu-util/dfu-prefix

-15.4 KB
Binary file not shown.

linux/dfu-util/dfu-suffix

-15.2 KB
Binary file not shown.

linux/dfu-util/dfu-util

-32.5 KB
Binary file not shown.

linux/maple_upload

+1-12
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
2626

2727
"${DIR}/upload-reset" ${dummy_port_fullpath} 750
2828

29-
if [ `uname -m` == "x86_64" ]; then
30-
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
31-
else
32-
DFU_UTIL=${DIR}/dfu-util/dfu-util
33-
fi
34-
35-
if [ ! -x "${DFU_UTIL}" ]; then
36-
echo "$0: error: cannot find ${DFU_UTIL}" >&2
37-
exit 2
38-
fi
39-
40-
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
29+
"${DIR}/dfu-util.sh" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
4130

4231
echo -n Waiting for ${dummy_port_fullpath} serial...
4332

0 commit comments

Comments
 (0)