-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup
More file actions
executable file
·53 lines (49 loc) · 1.54 KB
/
setup
File metadata and controls
executable file
·53 lines (49 loc) · 1.54 KB
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
#!/bin/bash
echo "Rinobot CodeRelease Setup"
echo ""
if [[ $EUID -eq 0 ]]; then
echo "This script must not be run as root" 1>&2
exit 1
fi
echo "Installing required packages"
sudo apt-get install cmake libnss-mdns avahi-discover avahi-utils sshpass unzip python2.7 python-pip
sudo pip install qibuild
toolchain="rinobot-robot"
if [ "$#" -gt 0 ]; then
toolchain=$1
fi
if [ ! -d ".qi" ]; then
echo ""
echo "Initializing qibuild"
qibuild init
fi
echo ""
echo "Installing SDK's"
if [ ! -d "sdk" ]; then
echo "Creating SDK Folder"
echo "Place a SDK file (ctc-linuxXX-atom-X.X.X.XX.zip) inside the sdk folder and run this script again"
else
count=$(ls -l sdk/ | grep .zip | egrep -c '^-')
if [ $count = 0 ]; then
echo "No SDK found"
echo "Place a SDK file (ctc-linuxXX-atom-X.X.X.XX.zip) inside the sdk folder and run this script again"
exit 1
elif [ $count -gt 1 ]; then
echo "More than one SDK found"
exit 1
else
selected=$(ls -1 sdk/ | grep .zip)
echo "SDK Found: $selected"
echo "Extracting"
unzip -qq -n sdk/$selected -d sdk/
echo "Creating toolchain $toolchain"
filename="${selected%.*}"
qitoolchain create $toolchain sdk/$filename/toolchain.xml
echo "Adding config"
qibuild add-config $toolchain -t $toolchain
echo "Installed as $toolchain"
echo "You are now able to build and sync to the robot as:"
echo "./build $toolchain"
echo "./sync robot-hostname $toolchain"
fi
fi