diff options
-rwxr-xr-x | util/signer/create_released_image.sh | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/util/signer/create_released_image.sh b/util/signer/create_released_image.sh index 9dccd02aba..c584cc5392 100755 --- a/util/signer/create_released_image.sh +++ b/util/signer/create_released_image.sh @@ -184,17 +184,31 @@ set -e FLAGS_HELP="usage: ${ME} [flags] <blobs> blobs are: - <prod RO A>.hex <prod RO B>.hex <RW.elf> <RW_B.elf>" + <prod RO A>.hex <prod RO B>.hex <RW.elf> <RW_B.elf> + or + <prod RO A>.hex <prod RO B>.hex <dir> + where <dir> contains files named ec.RW.elf and ec.RW_B.elf +" # Parse command line. FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" -if [ "${#*}" != "4" ]; then + +if [[ $# == 3 && -d "${3}" ]]; then + rw_a="${3}/ec.RW.elf" + rw_b="${3}/ec.RW_B.elf" +elif [[ $# == 4 ]]; then + rw_a="${3}" + rw_b="${4}" +else flags_help exit 1 fi +prod_ro_a="${1}" +prod_ro_b="${2}" + dd if=/dev/zero bs="${IMAGE_SIZE}" count=1 2>/dev/null | tr \\000 \\377 > "${RESULT_FILE}" if [ "$(stat -c '%s' "${RESULT_FILE}")" != "${IMAGE_SIZE}" ]; then @@ -202,11 +216,6 @@ if [ "$(stat -c '%s' "${RESULT_FILE}")" != "${IMAGE_SIZE}" ]; then exit 1 fi -prod_ro_a="${1}" -prod_ro_b="${2}" -rw_a="${3}" -rw_b="${4}" - # Used by the bs script. export CR50_BOARD_ID="${FLAGS_cr50_board_id}" |