forked from scorp2kk/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 23
/
make.sh
executable file
·53 lines (48 loc) · 1.59 KB
/
make.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
#!/bin/sh
BOARD=$1
DIR=${BOARD#*-}
DSTDIR=rockdev/${DIR}
TOOLCHAIN=arm-linux-gnueabi-
JOB=`sed -n "N;/processor/p" /proc/cpuinfo|wc -l`
select_toolchain()
{
local dst path
if grep -q '^CONFIG_ARM64=y' ${DSTDIR}/out/.config ; then
TOOLCHAIN=aarch64-linux-gnu-
dst=../prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
if [ -d ${dst} ]; then
path=$(cd `dirname ${dst}`; pwd)
TOOLCHAIN=${path}/bin/aarch64-linux-android-
fi
else
dst=../prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin
if [ -d ${dst} ]; then
path=$(cd `dirname ${dst}`; pwd)
TOOLCHAIN=${path}/bin/arm-linux-androideabi-
fi
fi
echo toolchain: ${TOOLCHAIN}
}
pack_images()
{
local sys_text_base dst
dst=../rkbin/tools
if [ -d ${dst} ]; then
path=$(cd `dirname ${dst}`; pwd)
else
echo "\nCan't find '../rkbin/' or '../rkbin/tools/' Responsity, please download it before pack image!"
echo "How to obtain, 3 ways:"
echo " 1. Login your gerrit account: \"Projects\" -> \"List\" -> search rkbin Responsity"
echo " 2. Github Responsity: https://github.com/rockchip-linux/rkbin"
echo " 3. Download full release SDK Responsity\n"
exit 1
fi
sys_text_base=`sed -n "/CONFIG_SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" ${DSTDIR}/out/include/autoconf.mk|tr -d '\r'`
echo U-Boot entry point address: ${sys_text_base}
${path}/tools/loaderimage --pack --uboot ${DSTDIR}/out/u-boot.bin uboot.img ${sys_text_base}
}
echo "make for ${BOARD}_defconfig by -j${JOB}"
make ${BOARD}_defconfig O=${DSTDIR}/out
select_toolchain
make CROSS_COMPILE=${TOOLCHAIN} all --jobs=${JOB} O=${DSTDIR}/out
pack_images