forked from sarafs1926/ZCU216-PYNQ
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_ZCU216.sh
93 lines (43 loc) · 1.22 KB
/
build_ZCU216.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
#!/bin/bash
set -e
set -x
echo `date` > runtime.txt
# Load the local config
source config.sh
# Run PYNQ build prequisites from: https://pynq.readthedocs.io/en/latest/pynq_sd_card.html#building-the-image
source $vitisPath
source $PetaLinuxPath
petalinux-util --webtalk off
# (2020.2) tools
#source 2020.2.sh
export buildroot=`pwd`
if [ ! -e "$prebuilt" ]; then
echo "$prebuilt DNE"
exit
fi
if [ ! -d "ZCU216-PYNQ" ]; then
git clone --recursive https://github.com/UniHD-CEG/ZCU216-PYNQ
fi
pushd ZCU216-PYNQ/ZCU216
ln -s $bsp
popd
# git build.sh so that other boards are not rebuilt
pushd ZCU216-PYNQ/PYNQ
echo "" > build.sh
git commit -a -m "clean out build.sh"
popd
# move tics files to proper directory
cp -a ZCU216-PYNQ/tics/. ZCU216-PYNQ/PYNQ/sdbuild/packages/xrfclk/package/xrfclk/
pushd ZCU216-PYNQ/PYNQ/sdbuild
make BOARDDIR=$buildroot/ZCU216-PYNQ PREBUILT=$prebuilt
BOARD=ZCU216
VERSION=2.7.0
boardname=$(echo ${BOARD} | tr '[:upper:]' '[:lower:]' | tr - _)
timestamp=$(date +'%Y_%m_%d')
imagefile=${boardname}_${timestamp}.img
zipfile=${boardname}_${timestamp}.zip
mv output/${BOARD}-${VERSION}.img $imagefile
zip -j $zipfile $imagefile
popd
echo `date` >> runtime.txt
cat runtime.txt