echo ./tools/scripts/gen_fs_otapkg.sh $OLD_COMMIT_VERSION $NEW_COMMIT_VERSION F
#./tools/scripts/gen_fs_otapkg_git.sh $OLD_COMMIT_VERSION $NEW_COMMIT_VERSION F
./tools/scripts/gen_fs_otapkg.sh $OLD_COMMIT_VERSION $NEW_COMMIT_VERSION F
+if [ $? != 0 ];
+then
+ echo gen_ota_fs_diff failed!
+ exit 1
+fi
if [ -d "$TMPDIR" ] ; then
RES_DIR=$TMPDIR
fi
cd $PWD/code/sdk/
./build/config/target_config/brandy/build_brandy_update.py
+if [ $? != 0 ];
+then
+ echo create ota file failed!
+ cd -
+ exit 1
+fi
cd -
mkdir release/ota -p
target_fwpkg_filepath=release/ota/${OTA_PKG_HEAD}${SOURCE_VERSION}_2_${TARGET_VERSION}.fwpkg
cp code/sdk/output/brandy/TestOTA/upgrade/update.fwpkg $target_fwpkg_filepath
+if [ $? != 0 ];
+then
+ echo copy firmware failed!
+ exit 1
+fi
fwpkg_filesize=`ls $target_fwpkg_filepath -lh|awk '{print $5}'`
echo create ota file $target_fwpkg_filepath $fwpkg_filesize done
create_dirs(target_dir)
src_file=aPath+of
cmd = "cp " + src_file +" "+target_dir
- os.system(cmd)
- # print(cmd)
+ cmdret = os.system(cmd)
+ if (cmdret != 0):
+ print(cmdret)
+ exit(1)
if len(diffAB) > 0:
create_dirs(target_fs_path)
create_dirs(target_dir)
src_file=aPath+of
cmd = "cp " + src_file +" "+target_dir
- os.system(cmd)
- # print(cmd)
+ cmdret = os.system(cmd)
+ if (cmdret != 0):
+ print(cmdret)
+ exit(1)
if len(onlyInB) >0:
create_dirs(target_path+"/diff")
aPath = sys.argv[1]
bPath = sys.argv[2]
target_tmp_dir = sys.argv[3]
- print("{} {} vs {} to {}".format(os.getcwd(),aPath,bPath,target_tmp_dir))
+ # print("{} {} vs {} to {}".format(os.getcwd(),aPath,bPath,target_tmp_dir))
dirCompare(aPath, bPath)
creat_fs_patch(aPath,bPath,target_tmp_dir)
# print("\ndone!")
echo TMPDIR=$TMPDIR
echo HOMEDIR=$HOMEDIR
-echo get diff $OLDVERSION ... $NEWVERSION to $TMPDIR
+# echo get diff $OLDVERSION ... $NEWVERSION to $TMPDIR
BACKUPDIR_HOME=$HOMEDIR/../PATCHES/$(basename $HOMEDIR)_FSOTA_${DATE}
rm -rf $BACKUPDIR_HOME
mkdir -p $BACKUPDIR_HOME
python $UNYAFFS_SCRIPT $NEWVERSION/bin/file.bin $BACKUPDIR_HOME/new
+if [ $? != 0 ]
+then
+exit 1
+fi
python $UNYAFFS_SCRIPT $OLDVERSION/bin/file.bin $BACKUPDIR_HOME/old
+if [ $? != 0 ]
+then
+exit 2
+fi
python $COMPARE_FOLDER_SCRIPT $BACKUPDIR_HOME/new $BACKUPDIR_HOME/old $BACKUPDIR_HOME
-
+if [ $? != 0 ]
+then
+exit 3
+fi
echo done