-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·69 lines (54 loc) · 1.75 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·69 lines (54 loc) · 1.75 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# You only need to run this script if it has not been run for you in the demo
# environment. If it has, there is nothing to do here.
UBUNTU_DEPS="gcc build-essential pkg-config gdb-multiarch virtualenv python3-pip python3-virtualenv libcap-dev libpixman-1-dev libglib2.0-dev python3-ipdb python3-prctl"
# locate this script:
SCRIPT="${BASH_SOURCE[0]}"
SCRIPTDIR=""
if [ -z "$SCRIPT" ]; then
SCRIPT=$(readlink -f $0)
SCRIPTDIR=$(dirname $SCRIPT)
else
SCRIPTDIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
fi
# Identify Distro
PIP=pip
if ! command -v lsb_release >/dev/null 2>&1; then
echo "No lsb_release command installed.";
exit -1
else
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
fi
if [[ "$DISTRO" == "ubuntu" || "$DISTRO" == "debian" ]]; then
sudo apt-get install $UBUNTU_DEPS
PIP=pip3
elif [[ "$DISTRO" == "fedora" ]]; then
echo "We currently do not support installing dependencies on Fedora! Make sure that the necessary dependencies are installed."
exit
fi
# Initialize submodules and pull latest releases
git submodule init
git submodule update
pushd $SCRIPTDIR/sw/
mkdir -p avatar-qemu-build
cd avatar-qemu-build
# This builds avatar-qemu
../avatar-qemu/configure --disable-sdl --target-list=arm-softmmu,avr-softmmu --enable-debug --prefix=$HOME/qemu/
make -j $(nproc)
make install
popd
# make a virtualenv
virtualenv -p python3 halenv
source halenv/bin/activate
# copy the right config file for global halucinator use
cd $SCRIPTDIR
mkdir -p halenv/etc/halucinator/
cp sw/halucinator-ubuntu-config.yaml halenv/etc/halucinator/config.yaml
pushd sw/avatar2
$PIP install .
popd
$PIP install python-prctl ipdb
pushd sw/halucinator
$PIP install -r requirements.txt
$PIP install -e .
popd