-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sh
executable file
·54 lines (41 loc) · 985 Bytes
/
build.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
#!/bin/bash
help(){
echo "Usage: $0 board-name [ make-args ... ]"
echo "valid board names: jalapeno habanero"
exit
}
maxsize=0
if [[ $# -lt 1 ]]
then
help
else
case $1 in
jalapeno)
config=$1
maxsize=524288
;;
habanero)
config=$1
maxsize=524288
;;
help|--help|-h|*)
help
;;
esac
fi
echo "Building bootloader using config: '$config'"
shift
if [ -z $CROSS_COMPILE ]; then
CROSS_COMPILE="../buildroot/output/host/usr/bin/arm-linux-"
fi
CROSS_COMPILE=$(realpath $CROSS_COMPILE)
make ipq40xx_"$config"_config
STAGING_DIR="" CROSS_COMPILE=$CROSS_COMPILE make "$@"
cp u-boot u-boot-$config.elf
"$CROSS_COMPILE"strip u-boot-$config.elf
size=$(stat -c%s u-boot-$config.elf)
if [ $size -gt $maxsize ]; then
echo "WARNING: image size too big, do not flash it!"
fi
# Avoid accidentally flashing u-boot.bin
cp u-boot-$config.elf u-boot.bin