forked from beagleboard/librobotcontrol
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·100 lines (80 loc) · 3.01 KB
/
install.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
# Bash script to install supporting software for the Robotics Cape
# This is specifically for Debian Jessie
################################################################################
# Variables collected here for convenience
################################################################################
KERNEL="$(uname -r)"
DEBIAN="$(cat /etc/debian_version)"
echo " "
echo "Detected Linux kernel $KERNEL"
echo "Detected Debian version $DEBIAN"
cat /etc/dogtag
cat /proc/device-tree/model
echo " "
echo " "
################################################################################
# Sanity Checks
################################################################################
# make sure the user is root
if [ `whoami` != 'root' ]; then
echo "You must be root to install this."
exit 1
fi
# make sure the release is really jessie
if ! grep -q "8." /etc/debian_version ; then
echo "ERROR: This is not Debian Jessie."
echo "Flash the latest Jessie image to your BBB"
echo "or use the Wheezy branch of this installer."
exit 1
fi
#check that the remoteproc driver is there
if modprobe -n remoteproc | grep -q "not found" ; then
echo "ERROR: remoteproc module not found"
echo "Use a standard TI kernel with remoteproc instead."
exit 1
fi
# make sure the user really wants to install
echo "This script will install all Robotics Cape supporting software"
read -r -p "Continue? [y/n] " response
case $response in
[yY]) echo " " ;;
*) echo "cancelled"; exit;;
esac
echo " "
#################################################
# Prompt user for desired startup program
#################################################
echo " "
echo "Which program should run on boot?"
echo "Select 'blink' if you are unsure."
echo "Select 'balance' for BeagleMiP"
echo "Select 'none' to start nothing on boot"
echo "Select 'existing' to keep current configuration."
echo "type 1-4 then enter"
select bfn in "blink" "balance" "none" "existing"; do
case $bfn in
blink ) PROG="blink"; break;;
balance ) PROG="balance"; break;;
none ) PROG="bare_minimum"; break;;
existing ) PROG="existing"; break;;
esac
done
################################################################################
# Compile and install library, examples, and services
# This works for Black and Blue
################################################################################
make clean
make install
# now make a link to the right program
# if 'none' was selected then leave default as bare_minimum (does nothing)
if [ "$PROG" == "blink" ]; then
ln -s /usr/bin/blink /etc/roboticscape/link_to_startup_program
elif [ "$PROG" == "balance" ]; then
ln -s /usr/bin/balance /etc/roboticscape/link_to_startup_program
elif [ "$PROG" == "none" ]; then
ln -s /usr/bin/bare_minimum /etc/roboticscape/link_to_startup_program
fi
# normally here we would give a message to the user indicating all is complete
# and tell them to run the balck cape installer script if they are on a black.
# however, this message is now displayed by 'make install' above.