-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·51 lines (42 loc) · 1.05 KB
/
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
#
# Build wrapper to create a release of the given board in the first argument
SCRIPT_DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
print-board-names() {
echo "Available board configurations:"
for file in $SCRIPT_DIR/buildroot-external/configs/*_defconfig; do
[ -e "$file" ] || continue
local f="$(basename -- $file)"
echo "- ${f%_defconfig}"
done
}
usage() {
cat << EOF
Usage:
$0 BOARD
Builds the given BOARD configuration and stores the build output
in a timestamped logile.
EOF
print-board-names
exit 1
}
#------------------------------------------------------------------------------
# Start of script
#------------------------------------------------------------------------------
# check command line arguments
while getopts "h" opt; do
case ${opt} in
h )
usage
;;
\? )
usage
;;
esac
done
if [ -z "$1" ]; then
echo "Missing board configuration!"
print-board-names
exit 1
fi
make $1 2>&1 | tee $1_build_$(date +"%Y%m%d_%H%M%S").log