self.res_dir = os.path.join(self.output, "res_file") #待打包目录路径, 如果仅删除则填None,此时是打包res_file目录下的所有文件
self.res_index = os.path.join(self.output, "res_index.bin") #生成的索引文件路径
self.res_data = os.path.join(self.output, "res_data.bin") #生成的数据文件路径, 仅删除时此参数无效
- self.res_delfile = [ "/user/exc/exc_info.bin"] #待删除文件列表,删除/user/exc/目录下的exc_info.bin文件
- self.res_rmdir = ["/user/test","/user/test1"] #删除/user/test/,/user/test1两个目录
+ self.res_delfile = [] # [ "/user/exc/exc_info.bin"] #待删除文件列表,删除/user/exc/目录下的exc_info.bin文件
+ # self.res_delfile = [ "/user/exc/exc_info.bin"] #待删除文件列表,删除/user/exc/目录下的exc_info.bin文件
+ self.res_rmdir = [] # ["/user/test","/user/test1"] #删除/user/test/,/user/test1两个目录
# 差分升级时,以下路径配置为上一个版本的镜像路径 (此处路径仅为参考,需要根据实际使用的target修改)
# 要升级的image列表,需根据升级的实际情况进行增删
image_list = []
#image_list.append("=".join([info.ssb_bin, "ssb"]))
- #image_list.append("=".join([info.recovery_bin, "recovery"]))
+ # image_list.append("=".join([info.recovery_bin, "recovery"]))
image_list.append("=".join([info.app_bin, "application"]))
#image_list.append("=".join([info.bt_bin, "bt"]))
#image_list.append("=".join([info.dsp_main_bin, "dsp_main"]))
#image_list.append("=".join([info.dsp_overlay_bin, "dsp_overlay"]))
# image_list.append("=".join([info.nv_bin, "nv"]))
-
- # 资源文件
- # info.res_delfile = []
- # 多个文件删除例子
- # info.res_delfile = ["/user/userdata/ConfigModel.json","/user/res/APPLIST_COMPASS_IMAGE.bin"]
-
- # info.res_rmdir = []
- # 删除路径例子
- # info.res_rmdir = ["/user/res/dials"]
- # if os.path.exists(info.res_dir) :
- # result = res_pack(info.res_dir, info.res_index, info.res_data,info.res_delfile,info.res_rmdir)
- # if not result:
- # sys.exit("[ERROR] resource file pack failed!!!")
- # image_list.append("=".join([info.res_index, "res_index"]))
- # image_list.append("=".join([info.res_data, "res_data"]))
+ if os.path.exists(info.res_dir) :
+ print("res dir exist "+ info.res_dir)
+ result = res_pack(info.res_dir, info.res_index, info.res_data,info.res_delfile,info.res_rmdir)
+ if not result:
+ sys.exit("[ERROR] resource file pack failed!!!")
+ if os.path.exists(info.res_data):
+ image_list.append("=".join([info.res_index, "res_index"]))
+ image_list.append("=".join([info.res_data, "res_data"]))
+ else:
+ print("res dir not exist " + info.res_dir)
+ info.res_dir = None #仅删除
+ result = res_pack(info.res_dir, info.res_index, info.res_data,info.res_delfile,info.res_rmdir)
+ if os.path.exists(info.res_data):
+ image_list.append("=".join([info.res_index, "res_index"]))
+ image_list.append("=".join([info.res_data, "res_data"]))
+
# 镜像签名
# image_list.append("=".join([info.ssb_sign, "ssb_sign"]))
DATE=$(date +%Y%m%d.%H%M%S)
HOMEDIR=$PWD
TMPDIR=/tmp/${USER}_${DATE}
-FSDATADIR=code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs
+FSDATADIR=code/sdk/build/config/target_config/brandy/mk_fs_image/fd230
mkdir -p $TMPDIR
cd $TARGETDIR/$FSDATADIR
git config core.filemode false
-git diff $version --name-status . |awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\/fs\//,"") ;print $0 }' > $tmpfile_changelist
+git diff $version --name-status . |awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\//,"") ;print $0 }' > $tmpfile_changelist
export count=`wc $tmpfile_changelist -l|awk '{print $1}'`
echo $TARGETDIR $count
if [ "$count" == "0" ] ; then
echo $version >$tmpfile_git_commit_file
- git diff $version --name-status . |awk ' ($1 != "D" ) {print $2 }'|awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\/fs\//,"") ;print $0 }' >$tmpfile_modified_or_new_files
- git diff $version --name-status . |awk ' ($1 == "D" ) {print $2 }'|awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\/fs\//,"") ;print $0 }' >$tmpfile_removedfiles
+ git diff $version --name-status . |awk ' ($1 != "D" ) {print $2 }'|awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\//,"") ;print $0 }' >$tmpfile_modified_or_new_files
+ git diff $version --name-status . |awk ' ($1 == "D" ) {print $2 }'|awk '{gsub(/code\/sdk\/build\/config\/target_config\/brandy\/mk_fs_image\/fd230\//,"") ;print $0 }' >$tmpfile_removedfiles
mkdir -p $BACKUPDIR
mkdir -p $BACKUPDIR_DIFF
#!/bin/bash
-if [ "$#" == "2" ] ; then
+if [ "$#" == "2" ] || [ "$#" == "3" ] ; then
SOURCE_DIR=$1
SOURCE_VERSION=`basename $SOURCE_DIR`
TARGET_DIR=$2
TARGET_VERSION=`basename $TARGET_DIR`
+RES_DIR=$3
+
if [ ! -d "$SOURCE_DIR" ] ; then
echo "$SOURCE_DIR not exist , skip create ota package"
echo ""
cp -r $SOURCE_DIR code/sdk/output/brandy/TestOTA/oldsoftware
cp -r $TARGET_DIR code/sdk/output/brandy/TestOTA/newsoftware
+if [ -d "$RES_DIR" ] ; then
+cp -r $RES_DIR/fs code/sdk/output/brandy/TestOTA/res_file
+fi
+
cd code/sdk/
./build/config/target_config/brandy/build_brandy_update.py
cd -