image_to_usb.sh: disallow --yes/-y without an explicit target (--to)

This should prevent situations where a wrongfully detected target device
(e.g. a hard drive) is being written to without any prompt. With this
change, the semantics of --yes changes to "don't ask me if I'm sure,
just write to the target device in --to". The help line was changed to
reflect this semantics.

Minor changes:

- Replaced die calls with die_notrace.

- Changed the default value for --to into an empty string (why should it
  be /dev/sdX anyway?).

- Fixed an unmount warning message so it's more descriptive (and fits in
  80 columns).

- Check that --install is only used inside the chroot earlier in the
  script.

BUG=None
TEST=Ran the script with different combinations of -y and --to.

Change-Id: I7a4d6eac9697f25d7e1eddb6c34f3c1725a83ef4
Reviewed-on: https://gerrit.chromium.org/gerrit/25404
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
1 file changed