-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-nightly-bootloader-package
executable file
·68 lines (53 loc) · 1.94 KB
/
build-nightly-bootloader-package
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
{
flock 200
#!/bin/bash -ev
BASEDIR=`pwd`
cd firmwarebase
git fetch
cd ..
cd linuxbase
git fetch
cd ..
rm -rf firmware
git clone --reference firmwarebase https://github.com/raspberrypi/firmware firmware
cd firmware
FOUNDATIONHEAD=`git rev-parse origin/master`
git config user.email "[email protected]"
git config user.name "rpf automated nightly builder"
export DEBEMAIL="rpf automated nightly builder <[email protected]>"
COMMITDATE=$(date -d @`git show -s --format=%ct origin/master` -u +%Y%m%d~%H%M%S)
DEBVERSION=1.${COMMITDATE}~nightly
#sanity check, commit datetime must be lower than current datetime
DATENOW=$(date -u +%Y%m%d~%H%M%S)
dpkg --compare-versions $COMMITDATE le $DATENOW
echo ${DEBVERSION} > ../firmwareversion
if [[ -f /usr/share/nginx/www/nightlyfirmware/pool/main/r/raspberrypi-firmware/raspberrypi-firmware_${DEBVERSION}.dsc ]]; then
echo Package already built
exit 0
fi
#merge asb's Debian packaging
git remote add asb https://github.com/asb/firmware
git remote update
git merge --no-edit asb/debian
#add changelog entry
dch -v ${DEBVERSION} -p "Firmware as of ${FOUNDATIONHEAD}"
#source format 3.0 has misfeatures that screw us, use 1.0
echo 1.0 > debian/source/format
#get kernel source code
git clone --reference ../linuxbase https://github.com/raspberrypi/linux linux
cd linux
git checkout `cat ../extra/git_hash`
cd ..
#remove git metadata
rm -rf .git linux/.git
#build package
dpkg-buildpackage -aarmhf -us -uc
#add to repo
DIR=`pwd`
cd /usr/share/nginx/www/nightlyfirmware
debsign -k5EE21256 $BASEDIR/raspberrypi-firmware_${DEBVERSION}_armhf.changes
reprepro --ignore=wrongdistribution --keepunreferencedfiles include wheezy $BASEDIR/raspberrypi-firmware_${DEBVERSION}_armhf.changes
#keep the changes file as well, it's useful for manual downgrades
cp $BASEDIR/raspberrypi-firmware_${DEBVERSION}_armhf.changes pool/main/r/raspberrypi-firmware
dcmd rm $BASEDIR/raspberrypi-firmware_${DEBVERSION}_armhf.changes
} 200>firmwarelock