forked from hifiberry/hifiberry-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile
executable file
·49 lines (40 loc) · 985 Bytes
/
compile
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
#!/bin/bash
if [ "$BRSRCDIR" == "" ]; then
BRSRCDIR=../buildroot
fi
cd `dirname $0`
MYDIR=`pwd`
TS=`date +%Y%m%d`
echo $TS > buildroot/VERSION
if [ "$1" == "" ]; then
VERSION=`cat .piversion`
echo No version given, assuming Pi$VERSION
else
VERSION=$1
fi
KNOWNVERSION=`echo "3 4 0w" | grep $VERSION`
if [ "$KNOWNVERSION" == "" ]; then
echo "Unsupported version $VERSION, aborting"
exit 1
fi
BRDIR=`./brdir $VERSION`
echo "Building in $BRDIR"
if [ -f $MYDIR/notify ]; then
$MYDIR/notify begin
fi
# Remove some packages
if [ "$2" != "" ]; then
echo Removing $BRDIR/build/$2* $BRDIR/build/host-$2*
rm -rf $BRDIR/build/$2* $BRDIR/build/host-$2*
fi
if [ "$3" != "" ]; then
echo Removing $BRDIR/build/$3* $BRDIR/build/host-$3*
rm -rf $BRDIR/build/$3* $BRDIR/build/host-$3*
fi
cd $BRSRCDIR
mkdir -p $BRDIR/target/etc
echo $VERSION > $BRDIR/target/etc/piversion
make O=$BRDIR BR2_EXTERNAL=../hifiberry-os/buildroot
if [ -f $MYDIR/notify ]; then
$MYDIR/notify finish
fi