Skip to content

Commit

Permalink
Merge pull request #932 from jahkeup/arm-amiize-for-arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jahkeup authored May 22, 2020
2 parents 85d09a8 + b586832 commit 13bef9e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/amiize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Required:
--ssh-keypair The SSH keypair name that's registered with EC2, to connect to worker instance
--instance-type Instance type launched for worker instance
--name The name under which to register the AMI
--arch The machine architecture of the AMI, e.g. x86_64
--arch The machine architecture of the AMI, e.g. x86_64, arm64
Optional:
--description The description attached to the registered AMI (defaults to name)
Expand Down Expand Up @@ -187,6 +187,20 @@ parse_args() {
required_arg "--name" "${NAME}"
required_arg "--arch" "${ARCH}"

# Validate and canonicalize architecture identifier.
case "${ARCH,,}" in
arm64|aarch64)
ARCH=arm64
;;
x86_64|amd64)
ARCH=x86_64
;;
*)
echo "ERROR: Unsupported EC2 machine architecture: $ARCH" >&2
usage
exit 2
esac

# Other argument checks
if [ ! -r "${ROOT_IMAGE}" ] ; then
echo "ERROR: cannot read ${ROOT_IMAGE}" >&2
Expand Down

0 comments on commit 13bef9e

Please sign in to comment.