b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Get version. |
| 4 | versionFile='mbtk/include/mbtk_device_info.h' |
| 5 | version=`cat $versionFile | grep -w 'MBTK_DEVICES_REVISION' | cut -d '"' -f 2 ` |
| 6 | BUILD_PROJECT=`cat build_version | grep PROJECT | cut -d '=' -f 2` |
| 7 | # CUSTOM_MODEL=`cat build_version | grep CUSTOM_MODEL | cut -d '=' -f 2` |
| 8 | BUILD_PARTITION=`cat build_version | grep PARTITION | cut -d '=' -f 2` |
| 9 | BUILD_CUSTOM=`cat build_version | grep CUSTOM | cut -d '=' -f 2` |
| 10 | SEC_SUPPORT=`cat build_version | grep SEC_SUPPORT | cut -d '=' -f 2` |
b.liu | 4fb1230 | 2025-05-22 11:36:09 +0800 | [diff] [blame] | 11 | DEV_INFO_RESET=`cat build_version | grep DEV_INFO_RESET | cut -d '=' -f 2` |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 12 | |
| 13 | if [ -f mbtk/mbtk_version ];then |
| 14 | PATCH_INDEX=`cat mbtk/mbtk_version | grep PATCH_INDEX | cut -d '=' -f 2` |
| 15 | if [ -z $PATCH_INDEX ];then |
| 16 | PATCH_INDEX=0 |
| 17 | fi |
| 18 | if [ $PATCH_INDEX -lt 10 ];then |
| 19 | PATCH_INDEX=00"$PATCH_INDEX" |
| 20 | else |
| 21 | if [ $PATCH_INDEX -lt 100 ];then |
| 22 | PATCH_INDEX=0"$PATCH_INDEX" |
| 23 | fi |
| 24 | fi |
| 25 | |
| 26 | # T108v05.02b01_YX.00 |
| 27 | MBTK_M1901_VERSION=${version#*:= } |
| 28 | MBTK_M1901_VERSION_1=`echo $MBTK_M1901_VERSION | cut -d '.' -f 1` |
| 29 | MBTK_M1901_VERSION_2=`echo $MBTK_M1901_VERSION | cut -d '.' -f 2` |
| 30 | MBTK_M1901_VERSION_3=`echo $MBTK_M1901_VERSION | cut -d '.' -f 3` |
| 31 | if [[ $MBTK_M1901_VERSION_3 == *_* ]];then # 有 '_' |
| 32 | MBTK_M1901_VERSION_3_1=`echo $MBTK_M1901_VERSION_3 | cut -d '_' -f 1` |
| 33 | MBTK_M1901_VERSION_3_2=`echo $MBTK_M1901_VERSION_3 | cut -d '_' -f 2` |
| 34 | |
| 35 | MBTK_M1901_VERSION=$MBTK_M1901_VERSION_1.$MBTK_M1901_VERSION_2."$PATCH_INDEX"_$MBTK_M1901_VERSION_3_2 |
| 36 | else |
| 37 | MBTK_M1901_VERSION=$MBTK_M1901_VERSION_1.$MBTK_M1901_VERSION_2.$PATCH_INDEX |
| 38 | fi |
| 39 | else |
| 40 | MBTK_M1901_VERSION=${version#*:= } |
| 41 | fi |
| 42 | |
| 43 | MBTK_M1901_VERSION_DIR=out/$MBTK_M1901_VERSION |
| 44 | MBTK_M1901_MDB_DIR=$MBTK_M1901_VERSION_DIR/MDB |
| 45 | |
b.liu | 31f8a36 | 2025-05-26 09:52:45 +0800 | [diff] [blame] | 46 | BIN_LIC=-glibc |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 47 | |
| 48 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 49 | CUSTOM_MODEL="$BUILD_PROJECT"_AB_V2 |
| 50 | else |
| 51 | CUSTOM_MODEL="$BUILD_PROJECT"_A_V2 |
| 52 | fi |
| 53 | |
| 54 | if [ ! -z $BUILD_CUSTOM ];then |
| 55 | CUSTOM_MODEL="$CUSTOM_MODEL"_$BUILD_CUSTOM |
| 56 | fi |
| 57 | |
| 58 | if [ "$BUILD_PROJECT" == "L901CD-L" ];then |
| 59 | BUILD_TARGAT=asr1903 |
| 60 | BUILD_FLAG=p501 |
| 61 | if [ "$SEC_SUPPORT" == "Y" ];then |
| 62 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG"sec"$BIN_LIC"/swd |
| 63 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 64 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_AB |
| 65 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_AB_OTA_BLF |
| 66 | else |
| 67 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2 |
| 68 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_OTA_BLF |
| 69 | fi |
| 70 | else |
| 71 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG""$BIN_LIC"/swd |
| 72 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 73 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB |
| 74 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB_OTA_BLF |
| 75 | else |
| 76 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2 |
| 77 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_OTA_BLF |
| 78 | fi |
| 79 | fi |
| 80 | elif [ "$BUILD_PROJECT" == "T108" -o "$BUILD_PROJECT" == "L508_X6" -o "$BUILD_PROJECT" == "T108-2" ];then |
| 81 | BUILD_TARGAT=asr1806 |
| 82 | BUILD_FLAG=p301 |
| 83 | if [ "$SEC_SUPPORT" == "Y" ];then |
| 84 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG"sec"$BIN_LIC"/swd |
| 85 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 86 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_AB |
hong.liu | f241688 | 2025-05-23 20:41:06 -0700 | [diff] [blame] | 87 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_AB_MBTK_OTA_BLF |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 88 | else |
| 89 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2 |
| 90 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_SDTIM_LPDDR2_OTA_BLF |
| 91 | fi |
| 92 | else |
| 93 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG""$BIN_LIC"/swd |
| 94 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 95 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB |
hong.liu | 0d54259 | 2025-06-05 16:21:58 +0800 | [diff] [blame] | 96 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB_MBTK_OTA_BLF |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 97 | else |
| 98 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2 |
| 99 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_OTA_BLF |
| 100 | fi |
| 101 | fi |
b.liu | 4fb1230 | 2025-05-22 11:36:09 +0800 | [diff] [blame] | 102 | |
| 103 | if [ "$DEV_INFO_RESET" == "Y" ];then |
hong.liu | 50f43ab | 2025-06-14 19:53:41 +0800 | [diff] [blame] | 104 | BIN_BLF="$BIN_BLF"_DEV_INFO |
b.liu | 4fb1230 | 2025-05-22 11:36:09 +0800 | [diff] [blame] | 105 | fi |
hong.liu | 50f43ab | 2025-06-14 19:53:41 +0800 | [diff] [blame] | 106 | echo $BIN_OTA_BLF |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 107 | else |
| 108 | BUILD_TARGAT=asr1803 |
| 109 | BUILD_FLAG=p401 |
| 110 | if [ "$SEC_SUPPORT" == "Y" ];then |
| 111 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG"sec/swd |
| 112 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 113 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_CMCC_LPDDR2_AB |
| 114 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_CMCC_LPDDR2_AB_OTA_BLF |
| 115 | else |
| 116 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_CMCC_LPDDR2 |
| 117 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_TOS_CMCC_LPDDR2_OTA_BLF |
| 118 | fi |
| 119 | else |
| 120 | OUT_DIR=bin/"$BUILD_TARGAT""$BUILD_FLAG""$BIN_LIC"/swd |
| 121 | if [ "$BUILD_PARTITION" == "ab" ];then |
| 122 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_CMCC_LPDDR2_AB |
| 123 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_CMCC_LPDDR2_AB_OTA_BLF |
| 124 | else |
| 125 | BIN_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_CMCC_LPDDR2 |
| 126 | BIN_OTA_BLF="$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_CMCC_LPDDR2_OTA_BLF |
| 127 | fi |
| 128 | fi |
| 129 | fi |
| 130 | |
| 131 | |
| 132 | |
| 133 | echo "PROJECT = $BUILD_PROJECT" |
| 134 | echo $MBTK_M1901_VERSION : $BUILD_PARTITION : $1 |
| 135 | echo "CUSTOM_MODEL=$CUSTOM_MODEL" |
| 136 | |
| 137 | function excmd() |
| 138 | { |
| 139 | echo -e "\e[32mExcmd:\e[0m $@ " && sleep 0.05 |
| 140 | $@ |
| 141 | } |
| 142 | |
| 143 | function copy() |
| 144 | { |
| 145 | excmd cp $OUT_DIR/$1 $MBTK_M1901_VERSION_DIR |
| 146 | } |
| 147 | |
| 148 | function mk_dir() |
| 149 | { |
| 150 | if [ -d $MBTK_M1901_VERSION_DIR ]; then |
| 151 | excmd rm -rf $MBTK_M1901_VERSION_DIR |
| 152 | fi |
| 153 | |
| 154 | if [ -f $MBTK_M1901_VERSION_DIR.zip ]; then |
| 155 | excmd rm -f $MBTK_M1901_VERSION_DIR.zip |
| 156 | fi |
| 157 | |
| 158 | excmd mkdir -p $MBTK_M1901_VERSION_DIR |
| 159 | excmd mkdir -p $MBTK_M1901_MDB_DIR |
| 160 | |
| 161 | if [ "$BUILD_TARGAT" == "asr1903" ];then |
| 162 | excmd mkdir -p $MBTK_M1901_VERSION_DIR/LAPW |
| 163 | elif [ "$BUILD_TARGAT" == "asr1806" ];then |
| 164 | excmd mkdir -p $MBTK_M1901_VERSION_DIR/FACT |
| 165 | else |
| 166 | excmd mkdir -p $MBTK_M1901_VERSION_DIR/FLCN |
| 167 | fi |
| 168 | } |
| 169 | |
| 170 | function generate_version_bin() |
| 171 | { |
| 172 | if [ -d $VERSION_STR_CN ];then |
| 173 | rm -rf $VERSION_STR_CN |
| 174 | fi |
| 175 | if [ -d $VERSION_STR_EU ];then |
| 176 | rm -rf $VERSION_STR_EU |
| 177 | fi |
| 178 | if [ -d $VERSION_STR_LA ];then |
| 179 | rm -rf $VERSION_STR_LA |
| 180 | fi |
| 181 | |
| 182 | cp -r $MBTK_M1901_VERSION $VERSION_STR_CN |
| 183 | cd $VERSION_STR_CN |
| 184 | rm "DEF(全擦).blf" |
| 185 | rm "EU(全擦).blf" |
| 186 | rm "LA(全擦).blf" |
| 187 | cd .. |
| 188 | zip -q -r $VERSION_STR_CN.zip $VERSION_STR_CN |
| 189 | |
| 190 | cp -r $MBTK_M1901_VERSION $VERSION_STR_EU |
| 191 | cd $VERSION_STR_EU |
| 192 | rm "DEF(全擦).blf" |
| 193 | rm "CN(全擦).blf" |
| 194 | rm "LA(全擦).blf" |
| 195 | cd .. |
| 196 | zip -q -r $VERSION_STR_EU.zip $VERSION_STR_EU |
| 197 | |
| 198 | cp -r $MBTK_M1901_VERSION $VERSION_STR_LA |
| 199 | cd $VERSION_STR_LA |
| 200 | rm "DEF(全擦).blf" |
| 201 | rm "EU(全擦).blf" |
| 202 | rm "CN(全擦).blf" |
| 203 | cd .. |
| 204 | zip -q -r $VERSION_STR_LA.zip $VERSION_STR_LA |
| 205 | } |
| 206 | |
| 207 | function copy_bin_1806() |
| 208 | { |
| 209 | excmd cp $OUT_DIR/../fota/$BIN_OTA_BLF $MBTK_M1901_VERSION_DIR/"$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_OTA_BLF |
| 210 | if [ -n "$1" -a "$1" == "mobiletek" ] ;then |
| 211 | copy $BIN_BLF.blf |
| 212 | echo $MBTK_M1901_VERSION | grep DEMO |
| 213 | if [ $? -eq 0 ];then |
| 214 | copy "$BIN_BLF"_MBTK.blf |
| 215 | fi |
| 216 | else |
hong.liu | 50f43ab | 2025-06-14 19:53:41 +0800 | [diff] [blame] | 217 | copy "$BIN_BLF"_MBTK.blf |
| 218 | #copy "$BIN_BLF".blf |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 219 | fi |
| 220 | |
| 221 | # 修改版本号 |
| 222 | # T108v05.02b01_YX.00 or T108v05.02b01_YX.001 |
| 223 | VERSION_STR_1=`echo $MBTK_M1901_VERSION | cut -d '.' -f 1` |
| 224 | VERSION_STR_2=`echo $MBTK_M1901_VERSION | cut -d '.' -f 2` |
| 225 | VERSION_STR_3=`echo $MBTK_M1901_VERSION | cut -d '.' -f 3` |
| 226 | if [[ $VERSION_STR_2 == *_* ]];then # 有 '_' |
| 227 | VERSION_STR_2_1=`echo $VERSION_STR_2 | cut -d '_' -f 1` |
| 228 | VERSION_STR_2_2=`echo $VERSION_STR_2 | cut -d '_' -f 2` |
| 229 | VERSION_STR_CN=$VERSION_STR_1."$VERSION_STR_2_1"CN_$VERSION_STR_2_2.$VERSION_STR_3 |
| 230 | VERSION_STR_EU=$VERSION_STR_1."$VERSION_STR_2_1"EU_$VERSION_STR_2_2.$VERSION_STR_3 |
| 231 | VERSION_STR_LA=$VERSION_STR_1."$VERSION_STR_2_1"LA_$VERSION_STR_2_2.$VERSION_STR_3 |
| 232 | else |
| 233 | VERSION_STR_CN=$VERSION_STR_1."$VERSION_STR_2"CN.$VERSION_STR_3 |
| 234 | VERSION_STR_EU=$VERSION_STR_1."$VERSION_STR_2"EU.$VERSION_STR_3 |
| 235 | VERSION_STR_LA=$VERSION_STR_1."$VERSION_STR_2"LA.$VERSION_STR_3 |
| 236 | fi |
| 237 | |
| 238 | # echo "CN : $VERSION_STR_CN" |
| 239 | # echo "EU : $VERSION_STR_EU" |
| 240 | # echo "LA : $VERSION_STR_LA" |
| 241 | # echo "DEF : $MBTK_M1901_VERSION" |
| 242 | |
| 243 | if [ -n "$1" -a "$1" == "mobiletek" ] ;then |
| 244 | date_str=`date "+%Y/%m/%d %H:%M:%S"` |
| 245 | asr_baseline=`cat $OUT_DIR/mversion` |
| 246 | echo $date_str |
| 247 | if [ "$BUILD_TARGAT" == "asr1903" ];then |
| 248 | # 支持4G、5G |
| 249 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_CN -d $BUILD_PROJECT -e $CUSTOM_MODEL -f cn -g "$date_str" -h 19 -i 12 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_cn.bin |
| 250 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_EU -d $BUILD_PROJECT -e $CUSTOM_MODEL -f eu -g "$date_str" -h 19 -i 12 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_eu.bin |
| 251 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_LA -d $BUILD_PROJECT -e $CUSTOM_MODEL -f sa -g "$date_str" -h 19 -i 12 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_la.bin |
| 252 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $MBTK_M1901_VERSION -d $BUILD_PROJECT -e $CUSTOM_MODEL -g "$date_str" -h 19 -i 12 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_def.bin |
| 253 | else |
| 254 | # 支持2G、3G、4G |
| 255 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_CN -d $BUILD_PROJECT -e $CUSTOM_MODEL -f cn -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_cn.bin |
| 256 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_EU -d $BUILD_PROJECT -e $CUSTOM_MODEL -f eu -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_eu.bin |
| 257 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_LA -d $BUILD_PROJECT -e $CUSTOM_MODEL -f sa -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_la.bin |
| 258 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $MBTK_M1901_VERSION -d $BUILD_PROJECT -e $CUSTOM_MODEL -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_def.bin |
| 259 | fi |
| 260 | |
| 261 | if [ -f $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf ];then |
| 262 | cp $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf $MBTK_M1901_VERSION_DIR/"CN(全擦)".blf |
| 263 | cp $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf $MBTK_M1901_VERSION_DIR/"EU(全擦)".blf |
| 264 | cp $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf $MBTK_M1901_VERSION_DIR/"LA(全擦)".blf |
| 265 | cp $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf $MBTK_M1901_VERSION_DIR/"DEF(全擦)".blf |
| 266 | rm $MBTK_M1901_VERSION_DIR/$BIN_BLF.blf |
| 267 | |
| 268 | sed -i "s/dev_info.bin/dev_info_cn.bin/" $MBTK_M1901_VERSION_DIR/"CN(全擦)".blf |
| 269 | sed -i "s/dev_info.bin/dev_info_eu.bin/" $MBTK_M1901_VERSION_DIR/"EU(全擦)".blf |
| 270 | sed -i "s/dev_info.bin/dev_info_la.bin/" $MBTK_M1901_VERSION_DIR/"LA(全擦)".blf |
| 271 | sed -i "s/dev_info.bin/dev_info_def.bin/" $MBTK_M1901_VERSION_DIR/"DEF(全擦)".blf |
| 272 | fi |
| 273 | if [ -f $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf ];then |
| 274 | cp $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf $MBTK_M1901_VERSION_DIR/MBTK_CN.blf |
| 275 | cp $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf $MBTK_M1901_VERSION_DIR/MBTK_EU.blf |
| 276 | cp $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf $MBTK_M1901_VERSION_DIR/MBTK_LA.blf |
| 277 | cp $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf $MBTK_M1901_VERSION_DIR/MBTK_DEF.blf |
| 278 | rm $MBTK_M1901_VERSION_DIR/"$BIN_BLF"_MBTK.blf |
| 279 | |
| 280 | sed -i "s/dev_info.bin/dev_info_cn.bin/" $MBTK_M1901_VERSION_DIR/MBTK_CN.blf |
| 281 | sed -i "s/dev_info.bin/dev_info_eu.bin/" $MBTK_M1901_VERSION_DIR/MBTK_EU.blf |
| 282 | sed -i "s/dev_info.bin/dev_info_la.bin/" $MBTK_M1901_VERSION_DIR/MBTK_LA.blf |
| 283 | sed -i "s/dev_info.bin/dev_info_def.bin/" $MBTK_M1901_VERSION_DIR/MBTK_DEF.blf |
| 284 | fi |
| 285 | |
| 286 | copy "$BUILD_TARGAT"_CP_ReliableData_CMCC.bin |
b.liu | 4fb1230 | 2025-05-22 11:36:09 +0800 | [diff] [blame] | 287 | else |
| 288 | if [ "$DEV_INFO_RESET" == "Y" ];then |
| 289 | date_str=`date "+%Y/%m/%d %H:%M:%S"` |
| 290 | asr_baseline=`cat $OUT_DIR/mversion` |
| 291 | echo $date_str |
| 292 | |
| 293 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_CN -d $BUILD_PROJECT -e $CUSTOM_MODEL -f cn -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_cn.bin |
| 294 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_EU -d $BUILD_PROJECT -e $CUSTOM_MODEL -f eu -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_eu.bin |
| 295 | [ -f mbtk/device_info_generate ] && mbtk/device_info_generate -a ab -b $VERSION_STR_LA -d $BUILD_PROJECT -e $CUSTOM_MODEL -f sa -g "$date_str" -h 15 -i 7 -j $asr_baseline -o $MBTK_M1901_VERSION_DIR/dev_info_la.bin |
| 296 | fi |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 297 | fi |
| 298 | |
| 299 | copy "$BUILD_TARGAT"_AP_ReliableData.bin |
| 300 | copy "$BUILD_TARGAT"_TLoader_QSPINAND.bin |
| 301 | if [ "$BUILD_TARGAT" == "asr1903" ];then |
| 302 | excmd cp $OUT_DIR/LAPW/hotfix.bin $MBTK_M1901_VERSION_DIR/LAPW/ |
| 303 | copy tim_lapw_qspinand.bin |
| 304 | copy tim_lapw_qspinand2.bin |
| 305 | copy "$BUILD_TARGAT"_TUpdater_QSPINAND.bin |
| 306 | copy "$BUILD_TARGAT"_BX2.bin |
| 307 | elif [ "$BUILD_TARGAT" == "asr1806" ];then |
| 308 | excmd cp $OUT_DIR/FACT/hotfix.bin $MBTK_M1901_VERSION_DIR/FACT/ |
| 309 | copy tim_fact_qspinand.bin |
| 310 | copy tim_fact_qspinand2.bin |
| 311 | copy "$BUILD_TARGAT"_TUpdater_QSPINAND.bin |
| 312 | copy "$BUILD_TARGAT"_MSA.bin |
| 313 | else |
| 314 | excmd cp $OUT_DIR/FLCN/hotfix.bin $MBTK_M1901_VERSION_DIR/FLCN/ |
| 315 | copy "$BUILD_TARGAT"_MSA.bin |
| 316 | fi |
| 317 | copy "$BUILD_TARGAT"_TLoader_QSPINAND_ProductBuild.bin |
| 318 | |
| 319 | copy "$BUILD_TARGAT"_ARBEL.bin |
| 320 | copy "$BUILD_TARGAT"_RFPLUGIN.bin |
| 321 | copy openwrt-mmp-"$BUILD_TARGAT"-u-boot.bin |
| 322 | copy openwrt-mmp-"$BUILD_TARGAT"-zImage |
| 323 | copy openwrt-mmp-"$BUILD_TARGAT"-root.squashfs |
hong.liu | 33e3095 | 2025-06-17 20:27:16 +0800 | [diff] [blame] | 324 | copy oemapp.ubi |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 325 | copy DTim.Primary |
| 326 | copy DTim.PPsetting |
| 327 | copy DTim.PPsetting2 |
| 328 | copy DTim.Recovery |
| 329 | copy mversion |
| 330 | copy SWDownloader.exe |
b.liu | de66b44 | 2025-05-15 15:17:48 +0800 | [diff] [blame] | 331 | copy swdl_linux |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 332 | if [ "$SEC_SUPPORT" == "Y" ];then |
| 333 | copy "$BUILD_TARGAT"_tos.bin |
b.liu | 75eaa06 | 2025-05-26 20:19:48 +0800 | [diff] [blame] | 334 | copy DDR_* |
| 335 | copy DKB_timheader.bin |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 336 | fi |
| 337 | if [ -f marvell/swd/FALCON/logo.img ];then |
| 338 | cp marvell/swd/FALCON/logo.img $MBTK_M1901_VERSION_DIR |
| 339 | fi |
| 340 | |
| 341 | excmd cp $OUT_DIR/Boerne_DIAG.mdb.txt $MBTK_M1901_MDB_DIR/AP_MDB.txt |
| 342 | excmd cp $OUT_DIR/MDB.txt $MBTK_M1901_MDB_DIR/CP_MDB.txt |
| 343 | # excmd cp $OUT_DIR/vmlinux.bin $MBTK_M1901_MDB_DIR/vmlinux.bin |
| 344 | |
| 345 | CUR_PWD=`pwd` |
| 346 | cd out |
| 347 | |
| 348 | # 生成各地区的固件 |
| 349 | if [ -n "$1" -a "$1" == "mobiletek" ] ;then |
| 350 | generate_version_bin |
b.liu | 4fb1230 | 2025-05-22 11:36:09 +0800 | [diff] [blame] | 351 | else |
| 352 | if [ "$DEV_INFO_RESET" == "Y" ];then |
| 353 | cp $MBTK_M1901_VERSION/$BIN_BLF.blf $MBTK_M1901_VERSION/"$BIN_BLF"_CN.blf |
| 354 | sed -i "s/dev_info.bin/dev_info_cn.bin/" $MBTK_M1901_VERSION/"$BIN_BLF"_CN.blf |
| 355 | |
| 356 | cp $MBTK_M1901_VERSION/$BIN_BLF.blf $MBTK_M1901_VERSION/"$BIN_BLF"_EU.blf |
| 357 | sed -i "s/dev_info.bin/dev_info_eu.bin/" $MBTK_M1901_VERSION/"$BIN_BLF"_EU.blf |
| 358 | |
| 359 | cp $MBTK_M1901_VERSION/$BIN_BLF.blf $MBTK_M1901_VERSION/"$BIN_BLF"_LA.blf |
| 360 | sed -i "s/dev_info.bin/dev_info_la.bin/" $MBTK_M1901_VERSION/"$BIN_BLF"_LA.blf |
| 361 | |
| 362 | rm -f $MBTK_M1901_VERSION/$BIN_BLF.blf |
| 363 | fi |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 364 | fi |
hong.liu | ff5293c | 2025-06-20 21:32:29 +0800 | [diff] [blame] | 365 | if [ "$SEC_SUPPORT" == "N" ];then |
| 366 | sed -i 's/Number_of_Images = 15/Number_of_Images = 14/g' ../$MBTK_M1901_VERSION_DIR/"$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_OTA_BLF |
| 367 | sed -i 's/23_Image_Enable = 0/23_Image_Enable = 1/g' ../$MBTK_M1901_VERSION_DIR/"$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB_MBTK.blf |
hong.liu | 83fdf66 | 2025-07-15 02:20:56 -0700 | [diff] [blame^] | 368 | else |
| 369 | sed -i 's/Number_of_Images = 16/Number_of_Images = 15/g' ../$MBTK_M1901_VERSION_DIR/"$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_OTA_BLF |
| 370 | sed -i 's/25_Image_Enable = 0/25_Image_Enable = 1/g' ../$MBTK_M1901_VERSION_DIR/"$BUILD_TARGAT"_"$BUILD_FLAG"_QSPINAND_Trusted_SDTIM_LPDDR2_AB_MBTK.blf |
hong.liu | ff5293c | 2025-06-20 21:32:29 +0800 | [diff] [blame] | 371 | fi |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 372 | zip -q -r $MBTK_M1901_VERSION.zip $MBTK_M1901_VERSION |
| 373 | cd $CUR_PWD |
| 374 | } |
| 375 | |
| 376 | mk_dir |
| 377 | if [ -n "$1" ];then |
| 378 | copy_bin_1806 $1 |
| 379 | else |
| 380 | copy_bin_1806 |
| 381 | fi |