forked from hifiberry/hifiberry-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-buildroot
executable file
·44 lines (34 loc) · 888 Bytes
/
get-buildroot
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
#!/bin/bash
if [ "$1" == "" ]; then
# TAG=2021.05
TAG=2021.11
else
TAG=$1
fi
cd `dirname $0`
BRDIR=buildroot-${TAG}
cd `dirname $0`
cd ..
if [ -d $BRDIR ]; then
echo "Saving current buildroot"
rm -rf $BRDIR.bak
mv $BRDIR $BRDIR.bak
fi
echo "Checking out buildoot tag ${TAG} from Github"
git clone https://github.com/buildroot/buildroot $BRDIR
echo "Checking out a known-good release"
pushd $BRDIR
git checkout $TAG
if [ -f ../hifiberry-os/buildroot/buildroot-${TAG}.patch ]; then
echo "Applying patch"
patch -p1 < ../hifiberry-os/buildroot/buildroot-${TAG}.patch
else
ls ../hifiberry-os/buildroot/buildroot-${TAG}.patch
echo "No patch found - is this correct?"
fi
popd
echo "Copying genimage configurations"
cp -v hifiberry-os/buildroot/board/raspberrypi/genimage*cfg $BRDIR/board/raspberrypi
echo "Symlinking to buildroot"
rm buildroot
ln -s $BRDIR buildroot