.. | .. |
---|
3 | 3 | BOARD_CONFIG_DIR=longan/device/config/chips/ |
---|
4 | 4 | BOARD_CONFIG_FILE=longan/device/.BoardConfig.mk |
---|
5 | 5 | |
---|
6 | | -function build_lunch() |
---|
7 | | -{ |
---|
8 | | - TARGET_BOARD_PATH_ARRAY=( $(find $BOARD_CONFIG_DIR -name "BoardConfig-a133*.mk" | sort) ) |
---|
9 | | - TARGET_BOARD_ARRAY=( $(find $BOARD_CONFIG_DIR -name "BoardConfig-a133*.mk" | sed 's#.*/##' | sort) ) |
---|
10 | | - echo "======you are building a133 android======" |
---|
11 | | - echo "${TARGET_BOARD_ARRAY[@]}" |xargs -n 1 | sed "=" | sed "N;s/\n/. /" |
---|
| 6 | +function build_lunch() { |
---|
| 7 | + TARGET_BOARD_PATH_ARRAY=($(find $BOARD_CONFIG_DIR -name "BoardConfig-a133*.mk" | sort)) |
---|
| 8 | + TARGET_BOARD_ARRAY=($(find $BOARD_CONFIG_DIR -name "BoardConfig-a133*.mk" | sed 's#.*/##' | sort)) |
---|
| 9 | + echo "======you are building a133 android======" |
---|
| 10 | + echo "${TARGET_BOARD_ARRAY[@]}" | xargs -n 1 | sed "=" | sed "N;s/\n/. /" |
---|
12 | 11 | |
---|
13 | | - while true; do |
---|
14 | | - read -p "which board would you like (1-${#TARGET_BOARD_ARRAY[@]}): " INDEX |
---|
15 | | - if [[ "$INDEX" =~ ^[0-9]+$ ]] && ((INDEX >= 1 && INDEX <= ${#TARGET_BOARD_ARRAY[@]})); then |
---|
16 | | - INDEX=$(($INDEX - 1)) |
---|
17 | | - BUILD_TARGET_BOARD="${TARGET_BOARD_PATH_ARRAY[$INDEX]}" |
---|
| 12 | + while true; do |
---|
| 13 | + read -p "which board would you like (1-${#TARGET_BOARD_ARRAY[@]}): " INDEX |
---|
| 14 | + if [[ "$INDEX" =~ ^[0-9]+$ ]] && ((INDEX >= 1 && INDEX <= ${#TARGET_BOARD_ARRAY[@]})); then |
---|
| 15 | + INDEX=$(($INDEX - 1)) |
---|
| 16 | + BUILD_TARGET_BOARD="${TARGET_BOARD_PATH_ARRAY[$INDEX]}" |
---|
18 | 17 | |
---|
19 | | - break |
---|
20 | | - else |
---|
21 | | - echo "Invalid input. Please enter a number between 1 and ${#TARGET_BOARD_ARRAY[@]}." |
---|
22 | | - fi |
---|
23 | | - done |
---|
| 18 | + break |
---|
| 19 | + else |
---|
| 20 | + echo "Invalid input. Please enter a number between 1 and ${#TARGET_BOARD_ARRAY[@]}." |
---|
| 21 | + fi |
---|
| 22 | + done |
---|
24 | 23 | |
---|
25 | | - cp -f $BUILD_TARGET_BOARD $BOARD_CONFIG_FILE |
---|
| 24 | + cp -f $BUILD_TARGET_BOARD $BOARD_CONFIG_FILE |
---|
26 | 25 | |
---|
27 | | - echo -e "build target board configuration: $BUILD_TARGET_BOARD\n" |
---|
28 | | - #select partition table |
---|
29 | | - source $BOARD_CONFIG_FILE |
---|
30 | | - echo "you board is ${DTS_NAME}" |
---|
| 26 | + echo -e "build target board configuration: $BUILD_TARGET_BOARD\n" |
---|
| 27 | + #select partition table |
---|
| 28 | + source $BOARD_CONFIG_FILE |
---|
| 29 | + echo "you board is ${DTS_NAME}" |
---|
31 | 30 | |
---|
32 | | - source $BOARD_CONFIG_FILE |
---|
33 | | - longan/build/mkcommon.sh autoconfig -i a133 -o android -b c3 |
---|
| 31 | + echo "Start clean kerenl" |
---|
| 32 | + cd longan/kernel/linux-4.9 && make clean -j32 && cd - |
---|
| 33 | + source $BOARD_CONFIG_FILE |
---|
| 34 | + longan/build/mkcommon.sh autoconfig -i a133 -o android -b c3 |
---|
34 | 35 | } |
---|
35 | 36 | |
---|
36 | | -if [ "x$1" == "xlunch" ];then |
---|
| 37 | +if [ "x$1" == "xlunch" ]; then |
---|
37 | 38 | build_lunch && exit 0 |
---|
38 | 39 | else |
---|
39 | 40 | source $BOARD_CONFIG_FILE |
---|
40 | | - if [ x"$1" == "xuboot" ] || [ x"$1" == "xu" ] || [ x"$1" == "x" ] ;then |
---|
41 | | - echo "Start build uboot" |
---|
42 | | - cd longan/brandy/brandy-2.0 && ./build.sh -p sun50iw10p1 && cd - |
---|
43 | | - if [ $? -eq 0 ]; then |
---|
44 | | - echo "Build uboot ok!" |
---|
45 | | - else |
---|
46 | | - echo "Build uboot failed!" |
---|
47 | | - exit 1 |
---|
48 | | - fi |
---|
| 41 | + if [ x"$1" == "xuboot" ] || [ x"$1" == "xu" ] || [ x"$1" == "x" ]; then |
---|
| 42 | + echo "Start build uboot" |
---|
| 43 | + cd longan/brandy/brandy-2.0 |
---|
| 44 | + ./build.sh -p sun50iw10p1 |
---|
| 45 | + if [ $? -eq 0 ]; then |
---|
| 46 | + echo "Build uboot ok!" |
---|
| 47 | + else |
---|
| 48 | + echo "Build uboot failed!" |
---|
| 49 | + cd - |
---|
| 50 | + exit 1 |
---|
| 51 | + fi |
---|
| 52 | + cd - |
---|
49 | 53 | fi |
---|
50 | 54 | |
---|
51 | | - if [ x"$1" == "xkernel" ] || [ x"$1" == "xk" ] || [ x"$1" == "x" ] ;then |
---|
52 | | - echo "Start build kernel" |
---|
53 | | - cd longan && ./build.sh autoconfig -o android -i a133 -b c3 && ./build.sh && cd - |
---|
54 | | - if [ $? -eq 0 ]; then |
---|
55 | | - echo "Build kernel ok!" |
---|
56 | | - else |
---|
57 | | - echo "Build kernel failed!" |
---|
58 | | - exit 1 |
---|
59 | | - fi |
---|
| 55 | + if [ x"$1" == "xkernel" ] || [ x"$1" == "xk" ] || [ x"$1" == "x" ]; then |
---|
| 56 | + echo "Start build kernel" |
---|
| 57 | + cd longan |
---|
| 58 | + ./build.sh autoconfig -o android -i a133 -b c3 |
---|
| 59 | + ./build.sh |
---|
| 60 | + if [ $? -eq 0 ]; then |
---|
| 61 | + echo "Build kernel ok!" |
---|
| 62 | + else |
---|
| 63 | + echo "Build kernel failed!" |
---|
| 64 | + cd - |
---|
| 65 | + exit 1 |
---|
| 66 | + fi |
---|
| 67 | + cd - |
---|
60 | 68 | fi |
---|
61 | 69 | |
---|
62 | 70 | # android envsetup |
---|
.. | .. |
---|
66 | 74 | extract-bsp |
---|
67 | 75 | cd - |
---|
68 | 76 | |
---|
69 | | - if [ x"$1" == "xandroid" ] || [ x"$1" == "xa" ] || [ x"$1" == "x" ] ;then |
---|
70 | | - echo "Start build Android" |
---|
71 | | - cd android |
---|
72 | | - make installclean |
---|
73 | | - make BUILD_NUMBER=ido-a133 -j32 |
---|
74 | | - cd - |
---|
| 77 | + if [ x"$1" == "xandroid" ] || [ x"$1" == "xa" ] || [ x"$1" == "x" ]; then |
---|
| 78 | + echo "Start build Android" |
---|
| 79 | + cd android |
---|
| 80 | + make installclean |
---|
| 81 | + make BUILD_NUMBER=ido-a133 -j32 |
---|
| 82 | + if [ $? -eq 0 ]; then |
---|
| 83 | + echo "Build android ok!" |
---|
| 84 | + else |
---|
| 85 | + echo "Build android failed!" |
---|
| 86 | + cd - |
---|
| 87 | + exit 1 |
---|
| 88 | + fi |
---|
| 89 | + cd - |
---|
75 | 90 | fi |
---|
76 | 91 | |
---|
77 | 92 | # pack image |
---|
.. | .. |
---|
80 | 95 | pack |
---|
81 | 96 | cd - |
---|
82 | 97 | |
---|
83 | | -fi |
---|
| 98 | +fi |
---|