-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·54 lines (34 loc) · 1019 Bytes
/
build.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
#!/bin/bash
set -x
# get current script path and use it as the base directory
SCRIPT=$(readlink -f "$0")
export BASE_DIR=$(dirname "$SCRIPT")
# export BUILD_DIR=$BASE_DIR/build
export RPI_ROOT=$BASE_DIR/rpi
export BUILD_DIR=$RPI_ROOT/build
# clean raspberry root?
if true; then
rm -Rf $RPI_ROOT
mkdir -p $RPI_ROOT
cd $RPI_ROOT
qemu-debootstrap --foreign --arch armhf jessie $RPI_ROOT http://ftp.debian.org/debian
chroot $RPI_ROOT apt -q -y --force-yes install build-essential
chroot $RPI_ROOT apt -q -y --force-yes install cmake coreutils
fi
# clean build?
if true; then
rm -Rf $BUILD_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR
git clone https://github.com/jcurl/SerialPortStream.git sps
cd sps
git checkout release/2.1.2.0
git submodule update --init --recursive
fi
cd $BUILD_DIR/sps
if true; then
echo "todo"
cp $BASE_DIR/do_build.sh $RPI_ROOT/build/sps/dll/serialunix
chroot $RPI_ROOT /build/sps/dll/serialunix/do_build.sh
fi
echo Built.