-
Notifications
You must be signed in to change notification settings - Fork 5
/
install_dfu-util.sh
executable file
·73 lines (56 loc) · 2.53 KB
/
install_dfu-util.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#"***************************************************************************************************"
# common initialization
#"***************************************************************************************************"
# select master or some GitHub hash version, and whether or not to force a clean
THIS_CHECKOUT=master
THIS_CLEAN=true
# perform some version control checks on this file
./gitcheck.sh $0
# initialize some environment variables and perform some sanity checks (optional 1 keyowrd)
. ./init.sh
# we don't want tee to capture exit codes
set -o pipefail
#"***************************************************************************************************"
# install the dfu-util form from ulx3s.
#
# normally installed with:
#
# apt-get install dfutil
#
# this code is here if you want to dig futher
#"***************************************************************************************************"
echo "***************************************************************************************************"
echo " dfu-util. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
# Call the common github checkout:
pushd .
cd "$WORKSPACE"
$SAVED_CURRENT_PATH/fetch_github.sh https://github.com/ulx3s/dfu-util.git dfu-util $THIS_CHECKOUT 2>&1 | tee -a "$THIS_LOG"
$SAVED_CURRENT_PATH/check_for_error.sh $? "$THIS_LOG"
cd "$WORKSPACE"/dfu-util
# See INSTALL file for building
# we'll install the apt-get version for now...
dfu-util --version > /dev/null 2>&1
if [ "$?" != "0" ]; then
if [ "$APTGET" == 1 ]; then
echo "installing dfu-util ..."
sudo apt-get install dfu-util --assume-yes 2>&1 | tee -a "$THIS_LOG"
fi
else
echo "Skipping install of dfu-util. Already installed." 2>&1 | tee -a "$THIS_LOG"
fi
echo "" 2>&1 | tee -a "$THIS_LOG"
dfu-util --version 2>&1 | tee -a "$THIS_LOG"
$SAVED_CURRENT_PATH/check_for_error.sh $? "$THIS_LOG"
# Generate build system files (requires autoconf from autotools)
# ./autogen.sh
# Generate makefiles
# ./configure
# Build executables
# make
# Install executables and manual pages (optional)
# sudo make install
popd
echo "Completed $0 " | tee -a "$THIS_LOG"
echo "----------------------------------"