[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.
This commit is contained in:
Jeremy Gillick 2019-12-19 08:39:49 -08:00 committed by Frederic Pillon
parent eb1037cd99
commit 201e809c72
5 changed files with 24 additions and 12 deletions

23
linux/dfu-util.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
#
# Use the correct dfu-util program based on the architecture
#
# Get the directory where the script is running.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# Choose dfu program by arch
if [ `uname -m` == "x86_64" ]; then
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
else
DFU_UTIL=${DIR}/dfu-util/dfu-util
fi
# Not found!
if [ ! -x "${DFU_UTIL}" ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi
# Pass all parameters through
"${DFU_UTIL}" "$@"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -26,18 +26,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
"${DIR}/upload-reset" ${dummy_port_fullpath} 750
if [ `uname -m` == "x86_64" ]; then
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
else
DFU_UTIL=${DIR}/dfu-util/dfu-util
fi
if [ ! -x "${DFU_UTIL}" ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
"${DIR}/dfu-util.sh" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
echo -n Waiting for ${dummy_port_fullpath} serial...