-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·54 lines (41 loc) · 945 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
PLATFORM=$1
DISTRO=$2
ONLINE=$3
if [[ "${PLATFORM}" != "pi" ]] && [[ "${PLATFORM}" != "jetson" ]]; then
echo "Usage: ./build.sh pi ONLINE"
echo ""
echo "Target kernels:"
echo ""
ls -1 kernels/
echo ""
exit 1
fi
echo "Youre building for $PLATFORM "
SRC_DIR=$(pwd)
WBC_DIR=$(pwd)/workdir/${PLATFORM}
J_CORES=$(nproc)
PACKAGE_DIR=$(pwd)/package
# load helper scripts
for File in scripts/*.sh; do
source ${File}
echo "LOAD ${File}"
done
# Remove previous build dir and recreate
init
setup_platform_env
cd $WBC_DIR
sudo apt install -y libsodium-dev libpcap-dev git nano build-essential
git clone https://github.com/Consti10/wifibroadcast.git
cd wifibroadcast
make
cp wfb_tx $PACKAGE_DIR/usr/local/bin/
cp wfb_rx $PACKAGE_DIR/usr/local/bin/
cp wfb_keygen $PACKAGE_DIR/usr/local/bin/
package
post_processing
cd $SRC_DIR
rm -Rf package workdir
# Show cache stats
ccache -s
cloudsmith token