forked from raspberrypi/noobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILDME.sh
executable file
·56 lines (44 loc) · 1.68 KB
/
BUILDME.sh
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
#!/bin/bash
# Bash script to rebuild recovery
set -e
cd buildroot
# Delete buildroot build directory to force rebuild
if [ -e output/build ]; then
rm -rf output/build/recovery* || true
fi
for i in $*; do
# Redownload firmware from raspberrypi/firmware master HEAD to update to latest
if [ $i = "update-firmware" ]; then
rm -rf output/build/rpi-firmware-master
rm -rf dl/rpi-firmware-master.tar.gz
fi
# Redownload userland from raspberrypi/userland master HEAD to update to latest
if [ $i = "update-userland" ]; then
rm -rf output/build/rpi-userland-master
rm -rf dl/rpi-userland-master.tar.gz
fi
done
# Let buildroot build everything
make
# Create output dir and copy files
mkdir -p ../output
mkdir -p ../output/os
cp -r ../sdcontent/* ../output
cp output/images/zImage ../output/recovery.img
cp output/images/rootfs.cpio.lzo ../output/recovery.rfs
# Ensure that output dir contains files necessary to boot
cp output/images/rpi-firmware/start_cd.elf ../output/recovery.elf
cp output/images/rpi-firmware/bootcode.bin ../output
cp output/images/cmdline.txt ../output/recovery.cmdline
touch ../output/RECOVERY_FILES_DO_NOT_EDIT
# Create build-date timestamp file containing Git HEAD info for build
rm -f ../output/BUILT* || true
BUILD_INFO="../output/BUILD-DATA"
echo "Build-date: $(date +"%Y-%m-%d")" > "$BUILD_INFO"
echo "NOOBS Version: "`git describe` >> "$BUILD_INFO"
echo "NOOBS Git HEAD @ "`git rev-parse --verify HEAD` >> "$BUILD_INFO"
cat dl/rpi-userland-head.version >> "$BUILD_INFO"
cat dl/rpi-firmware-head.version >> "$BUILD_INFO"
cd ..
clear
echo "Build complete. Copy files in 'output' directory onto a clean FAT formatted SD card to use."