build_image: make helper scripts more friendly

Often times there is only one image in the output dir, so let the
scripts autodetect the image (first dev, then base).

This makes the user interface slightly better by handling --help and
invalid options/missing images.

For output functions, we generate symlinks using the label name.
This way you can pick out the dir/file based on a `ls`.  Currently,
you have to look at the # and coordinate it with `cgpt show`.  For
newbies, this little trick is not obvious, so symlinks should speed
that up.

For mount/umount options, we run everything in parallel.  This gives
us a minor speed up.

Finally, allow people to do things based purely on the part number or
label.  This lets you mount/pack things much faster.

BUG=None
TEST=`./build_image` and ran {mount,umount}_image and {pack,unpack}_partitions with varying options

Change-Id: I18ef97f15be82401d0e1faa9b518dcd060580345
Reviewed-on: https://gerrit.chromium.org/gerrit/45345
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
1 file changed