Refactor deploy_termina script to add building of packages and image

This CL switches to use common.sh to provide 'die' and shflags over getops.
It also adds building packages and image to deploy_termin with '-p' and '-i'.

There is also a small patch to allow the user to use "-d=<ip>" or "-d <ip>" to
specify the device ip (which would previously fail to deploy) and makes
deploying optional (for testing build without a device).

Also fixes a bug in usage of "${IMAGE}" vs "${image}".

BUG=None
TEST=./deploy_termina -d device_ip
Change-Id: I57c44c350262789f57af0a2fb70610379f38e066
Reviewed-on: https://chromium-review.googlesource.com/1192663
Commit-Ready: Josh Pratt <jopra@chromium.org>
Tested-by: Josh Pratt <jopra@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed