-
Notifications
You must be signed in to change notification settings - Fork 133
/
build-berryboot.sh
executable file
·52 lines (42 loc) · 1.31 KB
/
build-berryboot.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
#!/bin/sh
set -e
BUILDROOT=buildroot-2018.08
EXTERNAL="$PWD/external"
cd $BUILDROOT
if [ -n "$1" ]; then
if [ ! -e "../configs/$1" ]; then
echo configs/$1 does not exist
exit 1
fi
support/kconfig/merge_config.sh -m ../configs/berryboot_defconfig ../configs/$1
make BR2_EXTERNAL=$EXTERNAL olddefconfig
fi
if [ ! -e .config ]; then
echo No target device selected yet
echo
echo Run: $0 \<device\>
echo -n "Supported devices: "
(cd ../configs ; ls device*)
echo
exit 1
fi
# Let buildroot build everything
make BR2_EXTERNAL=$EXTERNAL
cd ..
cp -n LICENSE.berryboot output
#cp -f $BUILDROOT/output/images/rootfs.cpio.uboot output/berryboot.img
cp -f $BUILDROOT/output/images/rootfs.cpio.lzo output/berryboot.img
cp -f $BUILDROOT/output/images/bbloader.img output/
cp -f $BUILDROOT/output/images/kernel*.img $BUILDROOT/output/images/shared.img output || true
if [ -e $BUILDROOT/output/images/rpi-firmware ]; then
cp -rf $BUILDROOT/output/images/rpi-firmware/* output
for f in $BUILDROOT/output/images/bcm27*.dtb $BUILDROOT/output/images/broadcom/bcm27*.dtb; do
[ -f "$f" ] && cp -f "$f" output
done
cp -rf $BUILDROOT/output/images/overlays output
rm -f output/start_db.elf output/start4db.elf output/fixup_db.dat output/fixup4db.dat
fi
echo
echo Build finished.
echo Copy contents of "output" folder to SD card.
echo