1- #! /bin/sh
1+ #! /bin/bash
22
33# Bash script to rebuild recovery
44
@@ -11,11 +11,21 @@ if [ -e output/build ]; then
1111 rm -rf output/build/recovery* || true
1212fi
1313
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
1929
2030# Let buildroot build everything
2131make
@@ -28,12 +38,13 @@ cp output/images/rootfs.cpio.lzo ../output/recovery.rfs
2838cp output/images/rpi-firmware/start_cd.elf ../output/recovery.elf
2939cp output/images/rpi-firmware/bootcode.bin ../output
3040
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" ) "
3546
3647cd ..
3748
3849clear
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