-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-nightly-image
executable file
·37 lines (33 loc) · 1.13 KB
/
build-nightly-image
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
#!/bin/bash -ev
IMAGEDATE=$(date -u +%Y%m%d-%H%M%S)
#wrap the bulk of the script in a function so we can log the output
main ()
{
./build-nightly-bootloader-package
./cleanup-old-images.py
cd spindlebase
git fetch
cd ..
rm -rf spindle
git clone --reference spindlebase https://github.com/asb/spindle spindle
cp -al spindlework spindle/work
cd spindle
patch -p1 < ../spindle-recent-qemu.diff
patch -p1 < ../spindle-use-nightly-firmware.diff
patch -p1 < ../spindle-cleanup-after-exporting-image.diff
patch -p1 < ../spindle-raspbian-mirror.diff
sudo modprobe nbd max_part=16
./wheezy-stage0
./wheezy-stage1
./wheezy-stage2
./wheezy-stage3
./wheezy-stage4-lxde
./wheezy-stage4-lxde-edu
./helper export_image_for_release out/stage4-lxde-edu.qed nightly.img
xz -9 nightly.img
mv nightly.img.xz /usr/share/nginx/www/nightlyimages/rpf-raspbian-nightly-$IMAGEDATE.img.xz
cd /usr/share/nginx/www/nightlyimages/
gpg -u 5EE21256 --output rpf-raspbian-nightly-$IMAGEDATE.img.xz.sig --detach-sign rpf-raspbian-nightly-$IMAGEDATE.img.xz
}
#log output
main "$@" 2>&1 | tee /usr/share/nginx/www/nightlyimages/rpf-raspbian-nightly-$IMAGEDATE.log