blob: 2ba2538ad301e9ee9b0c675433e7619960c2a7a3 [file] [log] [blame]
xiaobo gue6c46862018-01-10 18:58:09 +08001#!/bin/bash
2
3
4function pre_build_uboot() {
5 cd ${UBOOT_SRC_FOLDER}
6 echo -n "Compile config: "
7 echo "$1"
8 make distclean # &> /dev/null
9 make $1'_config' # &> /dev/null
10 if [ $? != 0 ]
11 then
12 echo "Pre-build failed! exit!"
13 cd ${MAIN_FOLDER}
14 exit -1
15 fi
16 cd ${MAIN_FOLDER}
17}
18
19function build_uboot() {
xiaobo gua64f93c2018-07-31 21:27:43 +080020 export CROSS_COMPILE=/opt/gcc-linaro-7.3.1-2018.05-i686_aarch64-elf/bin/aarch64-elf-
Xindong Xu33eda2d2018-09-25 18:52:38 +080021 echo "Build uboot...Please Wait...$1...$2..."
xiaobo gue6c46862018-01-10 18:58:09 +080022 mkdir -p ${FIP_BUILD_FOLDER}
23 cd ${UBOOT_SRC_FOLDER}
Xindong Xu33eda2d2018-09-25 18:52:38 +080024 make -j SYSTEMMODE=$1 AVBMODE=$2 # &> /dev/null
xiaobo gue6c46862018-01-10 18:58:09 +080025 ret=$?
26 cd ${MAIN_FOLDER}
27 if [ 0 -ne $ret ]; then
28 echo "Error: U-boot build failed... abort"
29 exit -1
30 fi
31}
32
33function uboot_config_list() {
34 folder_board="${UBOOT_SRC_FOLDER}/board/amlogic"
35 echo " ******Amlogic Configs******"
36 for file in ${folder_board}/*; do
37 temp_file=`basename $file`
38 #echo "$temp_file"
39 if [ -d ${folder_board}/${temp_file} ] && [ "$temp_file" != "defconfigs" ] && [ "$temp_file" != "configs" ];then
40 echo " ${temp_file}"
41 fi
42 done
43
44 customer_folder="${UBOOT_SRC_FOLDER}/customer/board"
45 if [ -e ${customer_folder} ]; then
46 echo " ******Customer Configs******"
47 for file in ${customer_folder}/*; do
48 temp_file=`basename $file`
49 if [ -d ${customer_folder}/${temp_file} ] && [ "$temp_file" != "defconfigs" ] && [ "$temp_file" != "configs" ];then
50 echo " ${temp_file}"
51 fi
52 done
53 fi
54 echo " ***************************"
55}
56
57function copy_bl33() {
xiaobo gua64f93c2018-07-31 21:27:43 +080058 cp ${BL33_BUILD_FOLDER}/u-boot.bin ${FIP_BUILD_FOLDER}bl33.bin -f
xiaobo gu0c83cb62018-03-19 14:09:38 +080059
60 # remove src link to prevent android "File system loop detected" issue
xiaobo gua64f93c2018-07-31 21:27:43 +080061 #cd ${UBOOT_SRC_FOLDER}/build/
62 #rm source
xiaobo gu0c83cb62018-03-19 14:09:38 +080063 cd ${MAIN_FOLDER}
xiaobo gua64f93c2018-07-31 21:27:43 +080064}