forked from friendlyarm/h3_lichee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_android_img.sh
executable file
·58 lines (52 loc) · 1.13 KB
/
gen_android_img.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
57
58
#!/bin/bash
function pt_error()
{
echo -e "\033[1;31mERROR: $*\033[0m"
}
function pt_warn()
{
echo -e "\033[1;31mWARN: $*\033[0m"
}
function pt_info()
{
echo -e "\033[1;32mINFO: $*\033[0m"
}
function parse_arg()
{
if [ $# -lt 2 ]; then
pt_warn "Usage:`basename $0` -b board -t target"
exit 1
fi
while getopts "b:t:" opt
do
case $opt in
b )
BOARD=$OPTARG
if [ "x${BOARD}" != "xnanopi-m1" \
-a "x${BOARD}" != "xnanopi-m1-plus" ]; then
pt_error "${BOARD} not support Android"
exit 1
fi
;;
t )
TARGET=${OPTARG};;
? )
pt_warn "Usage:`basename $0` -b board"
exit 1;;
esac
done
}
parse_arg $@
pt_info "This script is only for ANDROID."
echo -e "2\n" | ./build.sh lunch ${BOARD}
cd ../android
export PATH=/usr/lib/jvm/jdk1.6.0_45/bin:$PATH
source ./build/envsetup.sh
lunch nanopi_h3-eng
extract-bsp
if [ "x${TARGET}" = "xboot.img" ]; then
make bootimage
else
make -j8
fi
pack