blob: c0f3b8e077b6ad04724b28b93f168ee0a2d1f67a [file] [log] [blame]
Xiaobo Gu059502e2017-01-12 21:20:39 +08001#!/bin/bash
2#
3# author: xiaobo.gu@amlogic.com
4# 2016.09.28
5# 2016.12.01-2016.12.20 Update for bootloader repo
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +08006# 2017.05.20-2017.05.26 Update for txlx and ATF1.3
Xiaobo Gu059502e2017-01-12 21:20:39 +08007
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +08008# include compile check script
9source fip/check_compile.sh
xiaobo gue6c46862018-01-10 18:58:09 +080010source fip/variables.sh
11source fip/lib.sh
12source fip/build_bl2.sh
13source fip/build_bl30.sh
14source fip/build_bl31.sh
15source fip/build_bl32.sh
16source fip/build_bl33.sh
17source fip/build_bl40.sh
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +080018
Xiaobo Gu059502e2017-01-12 21:20:39 +080019
xiaobo gue6c46862018-01-10 18:58:09 +080020function init_variable_early() {
21 # source uboot pre-build configs
22 if [ ! -e ${SOURCE_FILE} ]; then
23 echo "${SOURCE_FILE} doesn't exist!"
24 cd ${MAIN_FOLDER}
25 exit -1
26 else
27 source ${SOURCE_FILE} &> /dev/null # ignore warning/error
28 fi
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +080029
xiaobo gue6c46862018-01-10 18:58:09 +080030 CUR_SOC=${CONFIG_SYS_SOC}
Xiaobo Gu059502e2017-01-12 21:20:39 +080031
xiaobo gue6c46862018-01-10 18:58:09 +080032 if [ "y" == "${CONFIG_NEED_BL32}" ]; then
33 BLX_NEEDFUL[3]="true"
34 fi
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +080035
xiaobo gue6c46862018-01-10 18:58:09 +080036 # export variables
37 #export FIP_BUILD_FOLDER
38 #export CUR_SOC
Xiaobo Gu059502e2017-01-12 21:20:39 +080039
xiaobo gue6c46862018-01-10 18:58:09 +080040 export_variables
Xiaobo Gu059502e2017-01-12 21:20:39 +080041}
42
xiaobo gue6c46862018-01-10 18:58:09 +080043function init_variable_late() {
44 # after uboot build, source configs
xiaobo gua64f93c2018-07-31 21:27:43 +080045 local CONFIG_FILE_TMP="${MAIN_FOLDER}/autoconf"
46 local STR_INVALID="option"
47 if [ ! -e ${CONFIG_FILE} ]; then
48 echo "${CONFIG_FILE} doesn't exist!"
49 cd ${MAIN_FOLDER}
50 exit -1
51 else
52 # workaround for source file error
53 while read LINE
54 do
55 #echo $LINE
56 # ignore "*(option)*" lines
57 if [[ ${LINE} =~ ${STR_INVALID} ]]; then
58 echo "ignore: $LINE"
59 else
60 #echo "LINE: ${LINE}"
61 echo "$LINE" >> "${CONFIG_FILE_TMP}"
62 fi
63 done < ${CONFIG_FILE}
64 source "${CONFIG_FILE_TMP}" &> /dev/null
65 rm ${CONFIG_FILE_TMP}
66 fi
xiaobo gue6c46862018-01-10 18:58:09 +080067 if [ "y" == "${CONFIG_SUPPORT_CUSOTMER_BOARD}" ]; then
68 BOARD_DIR="customer/board/${CONFIG_SYS_BOARD}"
69 else
70 BOARD_DIR="${CONFIG_BOARDDIR}"
71 fi
xiaobo gua64f93c2018-07-31 21:27:43 +080072 export BOARD_DIR
Xiaobo Gu059502e2017-01-12 21:20:39 +080073}
74
75function build_blx_src() {
xiaobo gue6c46862018-01-10 18:58:09 +080076 # compile $name $src_folder $bin_folder $soc
77 local name=$1
78 local src_folder=$2
79 local bin_folder=$3
80 local soc=$4
81 #dbg "compile - name: ${name}, src_folder: ${src_folder}, bin_folder: ${bin_folder}, soc: ${soc}"
xiaobo gu8a3907e2019-05-22 11:46:49 +080082 if [ $name == ${BLX_NAME_GLB[0]} ]; then
xiaobo gue6c46862018-01-10 18:58:09 +080083 # bl2
84 build_bl2 $src_folder $bin_folder $soc
xiaobo gu8a3907e2019-05-22 11:46:49 +080085 elif [ $name == ${BLX_NAME_GLB[1]} ]; then
xiaobo gue6c46862018-01-10 18:58:09 +080086 # bl30
87 build_bl30 $src_folder $bin_folder $soc
xiaobo gu8a3907e2019-05-22 11:46:49 +080088 elif [ $name == ${BLX_NAME_GLB[2]} ]; then
xiaobo gue6c46862018-01-10 18:58:09 +080089 # bl31
90 # some soc use v1.3
91 check_bl31_ver $soc
92 if [ $? != 0 ]; then
93 echo "check bl31 ver: use v1.3"
94 build_bl31_v1_3 $src_folder $bin_folder $soc
95 else
96 echo "check bl31 ver: use v1.0"
97 build_bl31 $src_folder $bin_folder $soc
98 fi
xiaobo gu8a3907e2019-05-22 11:46:49 +080099 elif [ $name == ${BLX_NAME_GLB[3]} ]; then
xiaobo gue8bf44f2019-03-18 14:23:36 +0800100 # control flow for jenkins patchbuild
101 if [ "$BUILD_TYPE" != "AOSP" ]; then
102 # bl32
103 if [ "y" == "${CONFIG_NEED_BL32}" ]; then
104 build_bl32 $src_folder $bin_folder $soc
105 fi
xiaobo gue6c46862018-01-10 18:58:09 +0800106 fi
107 fi
Xiaobo Gu059502e2017-01-12 21:20:39 +0800108}
109
110function build_blx() {
xiaobo gue6c46862018-01-10 18:58:09 +0800111 # build each blx
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +0800112
xiaobo gue6c46862018-01-10 18:58:09 +0800113 # switch bl31 version
114 switch_bl31 ${CUR_SOC}
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +0800115
xiaobo gue6c46862018-01-10 18:58:09 +0800116 # get version of each blx
117 get_versions
Xiaobo Gu9dd3f3f2017-05-26 17:58:57 +0800118
xiaobo gue6c46862018-01-10 18:58:09 +0800119 # build loop
120 for loop in ${!BLX_NAME[@]}; do
Honglin Zhang805bd102020-02-14 18:23:23 +0800121 dbg "BIN_PATH[${loop}]: ${BIN_PATH[$loop]}"
122 if [ "null" == ${BIN_PATH[$loop]} ]; then
xiaobo gue6c46862018-01-10 18:58:09 +0800123 get_blx_bin ${loop}
Honglin Zhang805bd102020-02-14 18:23:23 +0800124 elif [ "source" == ${BIN_PATH[$loop]} ]; then
xiaobo gue6c46862018-01-10 18:58:09 +0800125 dbg "Build blx source code..."
Honglin Zhang805bd102020-02-14 18:23:23 +0800126 build_blx_src ${BLX_NAME[$loop]} ${BLX_SRC_FOLDER[$loop]} ${FIP_BUILD_FOLDER} ${CUR_SOC}
xiaobo gue6c46862018-01-10 18:58:09 +0800127 else
Honglin Zhang805bd102020-02-14 18:23:23 +0800128 if [ ! -e ${BIN_PATH[$loop]} ]; then
129 echo "Error: ${BIN_PATH[$loop]} doesn't exist... abort"
xiaobo gue6c46862018-01-10 18:58:09 +0800130 exit -1
131 else
Honglin Zhanga5041212020-03-05 21:11:31 +0800132 if [ "y" == "${CONFIG_FIP_IMG_SUPPORT}" ] && \
133 [ -n "${BLX_IMG_NAME[$loop]}" ] && \
134 [ "NULL" != "${BLX_IMG_NAME[$loop]}" ]; then
135 cp ${BIN_PATH[$loop]} ${FIP_BUILD_FOLDER}/${BLX_IMG_NAME[$loop]} -f
136 elif [[ -n "${BLX_IMG_NAME[$loop]}" && "NULL" != "${BLX_BIN_NAME[$loop]}" ]]; then
137 cp ${BIN_PATH[$loop]} ${FIP_BUILD_FOLDER}/${BLX_BIN_NAME[$loop]} -f
138 else
139 cp ${BIN_PATH[$loop]} ${FIP_BUILD_FOLDER} -f
140 fi
141
Honglin Zhang805bd102020-02-14 18:23:23 +0800142 echo "Get ${BLX_NAME[$loop]} from ${BIN_PATH[$loop]}... done"
143 fi
144 fi
145
146 # start to check the blx firmware
147 if [ "bl32" == "${BLX_NAME[$loop]}" ]; then
Honglin Zhanga5041212020-03-05 21:11:31 +0800148 # no bl32/bin are exported for users
Honglin Zhang805bd102020-02-14 18:23:23 +0800149 check_bypass=y
150 else
151 check_bypass=n
152 fi
153
154 if [ "y" != "${check_bypass}" ]; then
155 if [ "NULL" != "${BLX_BIN_NAME[$loop]}" ] && \
Honglin Zhanga5041212020-03-05 21:11:31 +0800156 [ -n "${BLX_BIN_NAME[$loop]}" ] && \
Honglin Zhang0b81ed72020-03-07 10:38:35 +0800157 [ "NULL" == "${BLX_IMG_NAME[$loop]}" ] && \
Honglin Zhang805bd102020-02-14 18:23:23 +0800158 [ ! -f ${FIP_BUILD_FOLDER}/${BLX_BIN_NAME[$loop]} ]; then
Honglin Zhanga5041212020-03-05 21:11:31 +0800159 echo "Error ${BLX_NAME[$loop]}: ${FIP_BUILD_FOLDER}/${BLX_BIN_NAME[$loop]} doesn't exit... abort"
Honglin Zhang805bd102020-02-14 18:23:23 +0800160 exit -1
161 fi
162 if [ "y" == "${CONFIG_FIP_IMG_SUPPORT}" ] && \
163 [ -n "${BLX_IMG_NAME[$loop]}" ] && \
164 [ "NULL" != "${BLX_IMG_NAME[$loop]}" ] && \
165 [ ! -f ${FIP_BUILD_FOLDER}/${BLX_IMG_NAME[$loop]} ]; then
Honglin Zhanga5041212020-03-05 21:11:31 +0800166 echo "Error ${BLX_NAME[$loop]}: ${FIP_BUILD_FOLDER}/${BLX_IMG_NAME[$loop]} doesn't exit... abort"
Honglin Zhang805bd102020-02-14 18:23:23 +0800167 exit -1
xiaobo gue6c46862018-01-10 18:58:09 +0800168 fi
169 fi
170 done
171 return
Xiaobo Gu059502e2017-01-12 21:20:39 +0800172}
173
174copy_bootloader() {
xiaobo gue6c46862018-01-10 18:58:09 +0800175 mkdir -p ${BUILD_FOLDER}
Haixiang Baof008dc12019-05-23 18:47:15 +0800176 cp ${FIP_BUILD_FOLDER}u-boot.bin* ${BUILD_FOLDER}
xiaobo gue6c46862018-01-10 18:58:09 +0800177 if [ "y" == "${CONFIG_AML_CRYPTO_IMG}" ]; then
178 cp ${FIP_BUILD_FOLDER}boot.img.encrypt ${BUILD_FOLDER}boot.img.encrypt
179 fi
Xiaobo Gu059502e2017-01-12 21:20:39 +0800180}
181
182function update_bin_path() {
xiaobo gu8a3907e2019-05-22 11:46:49 +0800183 for loop in ${!BLX_NAME[@]}; do
184 if [ "${BLX_NAME[$loop]}" == "${BLX_NAME_GLB[$1]}" ]; then
Honglin Zhangcd8a9fc2019-11-22 17:52:55 +0800185 dbg "Update BIN_PATH[$loop]=$2"
xiaobo gu8a3907e2019-05-22 11:46:49 +0800186 BIN_PATH[$loop]=$2
Honglin Zhangcd8a9fc2019-11-22 17:52:55 +0800187 break
xiaobo gu8a3907e2019-05-22 11:46:49 +0800188 fi
189 done
190}
Xiaobo Gu059502e2017-01-12 21:20:39 +0800191
192function clean() {
xiaobo gue6c46862018-01-10 18:58:09 +0800193 echo "Clean up"
xiaobo gu0c2598b2019-06-28 11:22:17 +0800194 if [ -e ${BL33_PATH1} ]; then
195 cd ${MAIN_FOLDER}
196 cd ${BL33_PATH1}
197 make distclean
198 fi
199 if [ -e ${BL33_PATH2} ]; then
200 cd ${MAIN_FOLDER}
201 cd ${BL33_PATH2}
202 make distclean
203 fi
xiaobo gue6c46862018-01-10 18:58:09 +0800204 cd ${MAIN_FOLDER}
205 rm ${FIP_BUILD_FOLDER} -rf
xiaobo gu3ce64072018-03-06 17:20:44 +0800206 rm ${BUILD_FOLDER}/* -rf
Haixiang Baof008dc12019-05-23 18:47:15 +0800207 mkdir -p ${BUILD_FOLDER}
xiaobo gue6c46862018-01-10 18:58:09 +0800208 return
Xiaobo Gu059502e2017-01-12 21:20:39 +0800209}
210
211function build() {
xiaobo gue6c46862018-01-10 18:58:09 +0800212 # *************************************************
213 # IMPORTANT!!!!
214 # don't change sequence of following function call
215 # *************************************************
216 clean
217
218 # pre-build, get .config defines
219 pre_build_uboot $@
220
221 # variable init depends on uboot .config
222 init_variable_early $@
223
224 # must source under main function, all sub function can use these variables
225 # but if source in sub-function, only sub-function(or sub-sub..) can use them
226 source ${FIP_FOLDER}${CUR_SOC}/variable_soc.sh
227
Honglin Zhang694f5342019-12-09 14:54:40 +0800228 # compile fip tools for ddr_parse and map_tool
229 prepare_tools
230
xiaobo gue6c46862018-01-10 18:58:09 +0800231 # source soc package script
232 source ${FIP_FOLDER}${CUR_SOC}/build.sh
233
234 # update bin path, use bin.git or user defined or source code
235 bin_path_parser $@
xiaobo gude8a46a2018-03-05 21:41:54 +0800236 #bin_path_update $@
xiaobo gue6c46862018-01-10 18:58:09 +0800237
238 # build bl33/bl301..etc
Liang Ji51eee082019-05-20 14:01:24 +0800239 if [ ! $CONFIG_SYSTEM_AS_ROOT ]; then
Xindong Xu33eda2d2018-09-25 18:52:38 +0800240 CONFIG_SYSTEM_AS_ROOT=null
241 fi
Liang Ji51eee082019-05-20 14:01:24 +0800242 if [ ! $CONFIG_AVB2 ]; then
Xindong Xu33eda2d2018-09-25 18:52:38 +0800243 CONFIG_AVB2=null
244 fi
Xindong Xua75ab9b2020-05-25 15:54:01 +0800245 if [ ! $CONFIG_CMD_BOOTCTOL_R ]; then
246 CONFIG_CMD_BOOTCTOL_R=null
247 fi
248 build_uboot ${CONFIG_SYSTEM_AS_ROOT} ${CONFIG_AVB2} ${CONFIG_CMD_BOOTCTOL_R}
xiaobo gue6c46862018-01-10 18:58:09 +0800249
250 # source other configs after uboot compile
251 init_variable_late
252
253 # bl2/bl30/bl31..etc, build or copy from bin.git
254 build_blx $@
255
256 # cp bl33(uboot)
257 copy_bl33
258
259 # cp other firmwares(soc related)
260 copy_other_soc
261
Zhongfu Luo6c2587f2019-05-15 16:27:50 +0800262 # make build directory
263 mkdir -p ${BUILD_FOLDER}
264
xiaobo gue6c46862018-01-10 18:58:09 +0800265 # package final bootloader
266 package
267
Zhongfu Luofd0ea3e2018-11-30 14:15:16 +0800268 if [ "y" != "${CONFIG_AML_SIGNED_UBOOT}" ]; then
269 # copy bootloader to main folder
270 copy_bootloader
271 fi
Xiaobo Gu059502e2017-01-12 21:20:39 +0800272}
273
274function usage() {
275 cat << EOF
276 Usage:
277 $(basename $0) --help
278
xiaobo gue6c46862018-01-10 18:58:09 +0800279 Bootloader build script.
Xiaobo Gu059502e2017-01-12 21:20:39 +0800280
281 command list:
Xiaobo Gu059502e2017-01-12 21:20:39 +0800282 1. build default uboot:
283 ./$(basename $0) [config_name]
Xiaobo Gu059502e2017-01-12 21:20:39 +0800284
xiaobo gue6c46862018-01-10 18:58:09 +0800285 2. build uboot with specified bl[x].bin
286 ./$(basename $0) [config_name] --bl[x] [path]
Xiaobo Gu059502e2017-01-12 21:20:39 +0800287
xiaobo gue6c46862018-01-10 18:58:09 +0800288 3. build uboot with bl[x]/src source code
Xiaobo Gu059502e2017-01-12 21:20:39 +0800289 ./$(basename $0) [config_name] --update-bl[x]
Xiaobo Gu059502e2017-01-12 21:20:39 +0800290
xiaobo gue6c46862018-01-10 18:58:09 +0800291 4. print config list
292 ./$(basename $0) --config
293
294 5. check compile status with filter(optional)
295 ./$(basename $0) --check-compile [filter]
296
xiaobo gu6368ebe2018-03-29 21:49:25 +0800297 6. update aml ddr fw by source code (for g12a and later use)
298 ./$(basename $0) [config_name] --update-bl2 --ddrfw
299
xiaobo gue6c46862018-01-10 18:58:09 +0800300
301 Example:
302 1) ./$(basename $0) gxb_p200_v1
303 build gxb_p200_v1 config
304
305 2) ./$(basename $0) gxb_p200_v1 --bl2 fip/bl2.bin --bl30 fip/bl30.bin
306 build gxb_p200_v1 with specified bl2.bin and bl30.bin
307
308 3) ./$(basename $0) gxb_p200_v1 --update-bl31 --update-bl2
309 build gxb_p200_v1 with bl31/bl2 source code
310
311 4) ./$(basename $0) --config
312 print config list
313
314 5) ./$(basename $0) --check-compile skt
315 check all skt board compile status
316
317 Remark:
318 bl[x].bin/img priority:
319 1. uboot will use binaries under bl[x]/bin/ folder by default, bl[x] version specified in .repo/manifest.xml
320 2. if you want use your own bl[x].bin, specify path by add "--bl[x] [path]" parameter
321 3. if you want use bl[x].bin by compile source code, please add "--update-bl[x]" parameter
322
Xiaobo Gu059502e2017-01-12 21:20:39 +0800323
324EOF
325 exit 1
326}
327
xiaobo gue6c46862018-01-10 18:58:09 +0800328function print_config() {
329 cat << EOF
330 Usable configs:
331`uboot_config_list`
332EOF
333 exit 1
334}
335
Xiaobo Gu059502e2017-01-12 21:20:39 +0800336function parser() {
xiaobo gue6c46862018-01-10 18:58:09 +0800337 local i=0
338 local argv=()
339 for arg in "$@" ; do
340 argv[$i]="$arg"
341 i=$((i + 1))
342 done
343 i=0
344 while [ $i -lt $# ]; do
345 arg="${argv[$i]}"
xiaobo gu3ce64072018-03-06 17:20:44 +0800346 i=$((i + 1)) # must place here
xiaobo gue6c46862018-01-10 18:58:09 +0800347 case "$arg" in
348 -h|--help|help)
349 usage
350 exit ;;
351 --config)
352 print_config
xiaobo gu3ce64072018-03-06 17:20:44 +0800353 return ;;
xiaobo gue6c46862018-01-10 18:58:09 +0800354 --check-compile)
xiaobo gu66f95292018-01-11 13:38:13 +0800355 check_compile "${argv[@]:$((i))}"
xiaobo gue6c46862018-01-10 18:58:09 +0800356 exit ;;
357 clean|distclean|-distclean|--distclean)
358 clean
359 exit ;;
360 *)
361 esac
362 done
363}
364
xiaobo gude8a46a2018-03-05 21:41:54 +0800365function bin_path_update() {
366 # overwrite path in case some git repository doesn't exist
367 for loop in ${!BLX_BIN_FOLDER[@]}; do
368 if [ -ne ${BLX_BIN_FOLDER[$loop]} ]; then
369 dbg "BLX_BIN_FOLDER[$loop] doesn't exist, use src code"
370 update_bin_path $loop "source"
371 fi
372 done
373
374 for loop in ${!BLX_SRC_FOLDER[@]}; do
375 echo ""
376 done
377}
378
xiaobo gue6c46862018-01-10 18:58:09 +0800379function bin_path_parser() {
380 local i=0
381 local argv=()
382 for arg in "$@" ; do
383 argv[$i]="$arg"
384 i=$((i + 1))
385 done
386 i=0
xiaobo gu6368ebe2018-03-29 21:49:25 +0800387 # ddr fw define, co-work with bl2 build script
388 export CONFIG_DDR_FW
xiaobo gue6c46862018-01-10 18:58:09 +0800389 while [ $i -lt $# ]; do
390 arg="${argv[$i]}"
391 i=$((i + 1)) # must pleace here
392 case "$arg" in
393 --bl2)
394 update_bin_path 0 "${argv[@]:$((i))}"
395 continue ;;
396 --bl30)
397 update_bin_path 1 "${argv[@]:$((i))}"
398 continue ;;
399 --bl31)
400 update_bin_path 2 "${argv[@]:$((i))}"
401 continue ;;
402 --bl32)
403 update_bin_path 3 "${argv[@]:$((i))}"
404 continue ;;
Zhongfu Luo3e54c6f2020-02-15 21:30:50 +0800405 --bl40)
406 update_bin_path 4 "${argv[@]:$((i))}"
407 continue ;;
408 --sign-bl40)
409 update_bin_path 4 "${argv[@]:$((i))}"
410 CONFIG_SIGN_BL40=1
411 continue ;;
xiaobo gue6c46862018-01-10 18:58:09 +0800412 --update-bl2)
413 update_bin_path 0 "source"
414 continue ;;
415 --update-bl30)
416 update_bin_path 1 "source"
417 continue ;;
418 --update-bl31)
419 update_bin_path 2 "source"
420 continue ;;
421 --update-bl32)
422 update_bin_path 3 "source"
423 continue ;;
xiaobo gu6368ebe2018-03-29 21:49:25 +0800424 --ddrfw)
425 CONFIG_DDR_FW=1
426 export CONFIG_DDR_FW
427 continue ;;
Honglin Zhang8fa9d152020-02-10 12:29:27 +0800428 --cas)
429 cas="${argv[$i]}"
430 #limit the "--cas xxx" only works for g12a
Lawrence Mok762306e2020-05-13 20:38:08 -0700431 if [ "${CUR_SOC}" == "g12a" ] ||
432 ( [ "${cas}" == "vmx" ] && [ "${CUR_SOC}" == "gxl" ] ); then
Honglin Zhang8fa9d152020-02-10 12:29:27 +0800433 CONFIG_CAS=${cas}
434 fi
435 if [[ "${CONFIG_CAS}" == "irdeto" || \
436 "${CONFIG_CAS}" == "vmx" || \
437 "${CONFIG_CAS}" == "nagra" ]]; then
438 CONFIG_AML_SIGNED_UBOOT=y
439 export CONFIG_AML_SIGNED_UBOOT
440 fi
Lawrence Mok048be0f2020-02-24 18:03:43 -0800441 if [ "${CONFIG_CAS}" == "vmx" ]; then
442 dbg "Loading CAS VMX config"
443 source fip/config_cas_vmx.sh
444 fi
Honglin Zhang8fa9d152020-02-10 12:29:27 +0800445 echo "CAS: ${cas},${CONFIG_CAS}"
446 export CONFIG_CAS
447 continue ;;
Xindong Xuad0d2832018-07-30 19:15:52 +0800448 --systemroot)
449 CONFIG_SYSTEM_AS_ROOT=systemroot
450 echo "export CONFIG_SYSTEM_AS_ROOT"
451 export CONFIG_SYSTEM_AS_ROOT=systemroot
452 continue ;;
Xindong Xu33eda2d2018-09-25 18:52:38 +0800453 --avb2)
454 CONFIG_AVB2=avb2
455 echo "export CONFIG_AVB2"
456 export CONFIG_AVB2=avb2
457 continue ;;
Xindong Xua75ab9b2020-05-25 15:54:01 +0800458 --bootctrlR)
459 CONFIG_CMD_BOOTCTOL_R=1
460 echo "export CONFIG_CMD_BOOTCTOL_R"
461 export CONFIG_CMD_BOOTCTOL_R=1
462 continue ;;
Matthew Shyu4a863712020-02-19 17:58:17 +0800463 --avb2-fipkey)
464 CONFIG_AVB2_KPUB_FROM_FIP=1
465 echo "export CONFIG_AVB2_KPUB_FROM_FIP"
466 export CONFIG_AVB2_KPUB_FROM_FIP=1
467 continue ;;
xiaobo gue6c46862018-01-10 18:58:09 +0800468 *)
469 esac
470 done
Xiaobo Gu059502e2017-01-12 21:20:39 +0800471}
472
473function main() {
xiaobo gue6c46862018-01-10 18:58:09 +0800474 if [ -z $1 ]
475 then
476 usage
477 return
478 fi
Xiaobo Gu059502e2017-01-12 21:20:39 +0800479
xiaobo gue6c46862018-01-10 18:58:09 +0800480 MAIN_FOLDER=`pwd`
481 parser $@
482 build $@
Xiaobo Gu059502e2017-01-12 21:20:39 +0800483}
484
485main $@ # parse all paras to function