diff options
Diffstat (limited to 'kflash.sh')
-rwxr-xr-x | kflash.sh | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -106,13 +106,27 @@ esac target_dir=${target_dir:-${target_root[$arch]}} tftp_dir=${tftp_dir:-$tftp_root/$platform} -if [[ -r "$kbuild_root/images/$image.sh" ]] ; then - source "${kbuild_root}/images/$image.sh" || exit 1 - eval make_${image}_image +# +# Determine the image source and destination file names +# + +_image_type=${image/:*/} + +if [[ -r "$kbuild_root/images/${_image_type}.sh" ]] ; then + source "${kbuild_root}/images/${_image_type}.sh" || exit 1 + eval make_${_image_type}_image else - image_file=$output_dir/arch/$arch/boot/$image + _image_file=${_image_type} fi +if echo "${image}" | grep -q ':' ; then + _image_name=${image/*:/} +else + _image_name=${_image_file} +fi + +_image_file="$output_dir/arch/$arch/boot/${_image_file}" + # # Validate the partition names and paths # @@ -316,7 +330,7 @@ for part_name in ${partitions[@]} ; do $flash_cmd "${dev}${part_idx}" "${part_path}/${_dtb_dst}" "${_dtb_src}" ;; kernel) - $flash_cmd "${dev}${part_idx}" "${part_path}/" "${image_file}" + $flash_cmd "${dev}${part_idx}" "${part_path}/${_image_name}" "${_image_file}" ;; modules) $flash_cmd "${dev}${part_idx}" "${part_path}/" "${mod_path}" |