blob: 17ce8d3aab32594f1b8908733523921ddffe9453 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/bin/sh
2
3cd ../../..
4SRC_PATH=`pwd`
5KEYS_PATH=$SRC_PATH/../tools/SignImage
6BIN_PATH=$SRC_PATH/prj/"$chip"/"$board"/bin
7
8cd $SRC_PATH/common/src/uboot
9
10make mrproper
11rm -f ./u-boot*
12rm -fr ./compressed_bin
13
14
15echo "--Configuring [ "$chip"_boot_config ] for [ "$chip" "$board" "$key_path"] board ...";
16
17############################################################
18# project setting
19############################################################
20
21is_ok=0
22
23if
24 make "$chip"_boot_config;
25then
26 if make platform; then
27 if make together; then
28 is_ok=1
29 fi
30 fi
31fi
32
33if [ $is_ok -eq 1 ];then
34 echo "";
35 echo "--Configuring [ "$chip"_boot_config ] for [ "$chip" "$board" "$key_path"] board ...";
36 echo "--Finished build [ u-boot.bin ] ...";
37
38 if
39 cp compressed_bin/compressed.bin $SRC_PATH/common/scripts/tools;
40 cd $SRC_PATH/common/scripts/tools;
41 ./mkimage -A arm -O u-boot -C none -a "$ram_text" -e "$ram_text" \
42 -n ZX297520 -d compressed.bin compressed.bin.head;
43 then
44 echo "Finished add head to [ u-boot.bin.head ] ...";
45
46 rm compressed.bin;
47 mv compressed.bin.head uboot.bin;
48 cp uboot.bin tboot.bin
49 mv tboot.bin $BIN_PATH/tboot.bin
50
51 mkdir -p $KEYS_PATH/Input
52 mkdir -p $KEYS_PATH/Output
53 chmod -R 777 $SRC_PATH/
54 cp uboot.bin $KEYS_PATH/Input/uboot.bin
55 rm uboot.bin;
56 chmod -R a+x $KEYS_PATH/
57 cd $KEYS_PATH/
58 ./SignImage -s ./Input/uboot.bin ./Output/uboot.bin ./test_key/"$key_path"/private.k
59 cp ./Output/uboot.bin $BIN_PATH/uboot.bin
60 cp $BIN_PATH/uboot.bin $BIN_PATH/uboot-mirr.bin
61 rm -rf Input
62 rm -rf Output
63
64 cd $SRC_PATH/common/src/uboot;
65 cp ./u-boot $BIN_PATH
66 cp ./u-boot.map $BIN_PATH
67
68 echo "--Finished build [uboot.bin] ...";
69 echo "...............................................OK....";
70 fi
71fi