BIN_TO_FIND=$1
TAR_DIR=$2
- cd "${DATA_DIR}"/${TAR_DIR}
- TAR_LIST=`ls *.tar *.tar.gz *.tgz *.tar.md5 2>/dev/null`
- cd "${CUR_DIR}"
+ TAR_LIST=$(cd "${DATA_DIR}/${TAR_DIR}" && ls ./*.tar ./*.tar.gz ./*.tgz ./*.tar.md5 2>/dev/null)
#--- find which tar contains the binary ---
for tar_file in ${TAR_LIST}
result=`tar -tvf ${DATA_DIR}/${TAR_DIR}/${tar_file} | grep " ${BIN_TO_FIND}$"`
if [ "$?" = "0" ]; then
TAR_FILE_FOUND=${tar_file}
- break
+ return 0
fi
done
+ return 1
}
#------------------------------------------------------------------------------
fn_extract_files_from_partition()
{
IMAGE=$1
- CUR_DIR=${PWD}
MNT_PNT="TMP_MNT"
mkdir -p ${MNT_PNT}
if [ ! -r "${HAL_TARG_NAME}" ]; then
- fn_extract_files_from_partition hal.img
+ # Check if there is hal.img provided
+ # If not then ok, just the update-info.ini file will not contain model_name information
+ if fn_get_tar_file_names hal.img "${OLD_TAR_DIR}"; then
+ fn_extract_files_from_partition hal.img
+ fi
fi
fn_build_update_info
rootfs_set = generate_rootfs_model_config_set(args.full_type)
tizen_set = generate_tizen_build_set(args.full_type)
- if hal_set:
+ # hal.img is not required. On the other hand, if it is available, the
+ # resulting update-info.cfg file will also contain information from hal.img
+ if hal_set and os.path.exists(args.hal_model_config_path):
hal_dict = get_dict_from_xml_file(args.hal_model_config_path, hal_set)
if not hal_dict:
print(f'{args.hal_model_config_path}: error parsing file', file=sys.stderr)
if os.path.exists(args.output_file):
parser.error(f'{args.output_file} already exists!')
- for file in [args.hal_model_config_path, args.rootfs_model_config_path, args.tizen_build_config_path]:
+ for file in [args.rootfs_model_config_path, args.tizen_build_config_path]:
if not (os.path.exists(file) and os.path.isfile(file)):
parser.error(f'{file} is not a valid path!')
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()