1
- #! /bin/sh
1
+ #! /bin/bash
2
2
3
3
# Bash script to rebuild recovery
4
4
@@ -11,11 +11,21 @@ if [ -e output/build ]; then
11
11
rm -rf output/build/recovery* || true
12
12
fi
13
13
14
- # Redownload firmware from raspberrypi/firmware master HEAD to update to latest
15
- if [ $1 = " update-firmware" ]; then
16
- rm -rf output/build/rpi-firmware-master
17
- rm -rf dl/rpi-firmware-master.tar.gz
18
- fi
14
+ for i in $* ; do
15
+ # Redownload firmware from raspberrypi/firmware master HEAD to update to latest
16
+ if [ $i = " update-firmware" ]; then
17
+ rm -rf output/build/rpi-firmware-master
18
+ rm -rf dl/rpi-firmware-master.tar.gz
19
+ echo " rpi-firmware Git HEAD @ " ` git ls-remote --heads https://github.com/raspberrypi/firmware | sed -n 2p` > rpi-firmware-head &
20
+ fi
21
+
22
+ # Redownload userland from raspberrypi/userland master HEAD to update to latest
23
+ if [ $i = " update-userland" ]; then
24
+ rm -rf output/build/rpi-userland-master
25
+ rm -rf dl/rpi-userland-master.tar.gz
26
+ echo " rpi-userland Git HEAD @ " ` git ls-remote --heads https://github.com/raspberrypi/firmware | sed -n 2p` > rpi-userland-head &
27
+ fi
28
+ done
19
29
20
30
# Let buildroot build everything
21
31
make
@@ -28,12 +38,13 @@ cp output/images/rootfs.cpio.lzo ../output/recovery.rfs
28
38
cp output/images/rpi-firmware/start_cd.elf ../output/recovery.elf
29
39
cp output/images/rpi-firmware/bootcode.bin ../output
30
40
31
- # Add build-date timestamp to files$
32
-
33
- rm ../output/BUILT* || true
34
- touch ../output/" BUILT-" $( date +" %Y-%m-%d" )
41
+ # Create build-date timestamp file containing Git HEAD info for build
42
+ rm -f ../output/BUILT* || true
43
+ echo " NOOBS Git HEAD @ " ` git rev-parse --verify HEAD` > " ../output/" BUILT-" $( date +" %Y-%m-%d" ) "
44
+ cat rpi-userland-head >> " ../output/" BUILT-" $( date +" %Y-%m-%d" ) "
45
+ cat rpi-firmware-head >> " ../output/" BUILT-" $( date +" %Y-%m-%d" ) "
35
46
36
47
cd ..
37
48
38
49
clear
39
- echo Build complete. Copy files in \ ' output\ ' directory onto a clean FAT formatted SD card to use.
50
+ echo " Build complete. Copy files in 'output' directory onto a clean FAT formatted SD card to use."
0 commit comments