[Feature][ZXW-130]merge P50U02 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I4f29ec5bb7c59385f23738d2b7ca84e67c100f69
diff --git a/allbins/tools/mtd-utils/ubinize-static.sh b/allbins/tools/mtd-utils/ubinize-static.sh
new file mode 100755
index 0000000..84f6aaf
--- /dev/null
+++ b/allbins/tools/mtd-utils/ubinize-static.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [ $# -ne 4 ]; then
+ echo "$0 error"
+ echo "Usage:"
+ echo " $0 mtd_name outfile image_file ubinize_para"
+ exit -1
+fi
+
+mtdname=$1
+outfile=$2
+imgfile=$3
+ubinize_para=$4
+
+filesize="$(stat -c%s $imgfile)"
+
+cfg_file_name=$mtdname.cfg
+
+echo "[$mtdname]" > $cfg_file_name
+echo "mode=ubi" >> $cfg_file_name
+echo "image=$imgfile" >> $cfg_file_name
+echo "vol_id=0" >> $cfg_file_name
+echo "vol_size=${filesize}" >> $cfg_file_name
+echo "vol_type=dynamic" >> $cfg_file_name
+echo "vol_name=$mtdname" >> $cfg_file_name
+
+cat $cfg_file_name
+
+ubinize -o $outfile $ubinize_para $cfg_file_name
+if [ $? -ne 0 ]; then
+ echo "ubinize error"
+ exit -2
+else
+ echo "ubinize ok"
+fi
+
+rm -v $cfg_file_name