forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpi.sh
61 lines (51 loc) · 1.24 KB
/
rpi.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
mkdir -p ${WORKINGDIR}
STOSVERSION="stos-host-2.2"
TOOLCHAIN_URL=https://movian.tv/static/${STOSVERSION}.tar.bz2
TOOLCHAIN="${WORKINGDIR}/${STOSVERSION}"
cleanup() {
echo "Cleaning up"
rm -rf "${TOOLCHAIN}"
exit 1
}
echo "Toolchain from: '${TOOLCHAIN_URL}' Local install in: ${TOOLCHAIN}"
if [ -d "${TOOLCHAIN}" ]; then
echo "Toolchain seems to exist"
else
set +e
trap cleanup SIGINT
(
set -eu
cd "${WORKINGDIR}"
mkdir -p "${STOSVERSION}"
cd "${STOSVERSION}"
curl -L "${TOOLCHAIN_URL}" | tar xfj -
)
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "Unable to stage toolchain"
cleanup
fi
trap SIGINT
set -e
fi
set +e
which ccache >/dev/null
if [ $? -eq 0 ]; then
echo "Using ccache"
ccache -s
USE_CCACHE="--ccache"
else
USE_CCACHE=""
fi
set -e
set -x
./configure.rpi --build=${TARGET} \
--toolchain="${TOOLCHAIN}/host/usr/bin/arm-buildroot-linux-gnueabihf-" \
--sysroot="${TOOLCHAIN}/host/usr/arm-buildroot-linux-gnueabihf/sysroot" \
${RELEASE} \
--cleanbuild \
${USE_CCACHE} \
--downloadcache="${WORKINGDIR}/downloadcache"
set +x
make ${JARGS} BUILD=${TARGET} squashfs
artifact build.${TARGET}/showtime.sqfs sqfs application/octet-stream showtime.sqfs