mount_gpt_image.sh: fix usage under newer util-linux/mount

Newer versions of util-linux/mount don't like when you create overlapping
loopback files.  Reworking these scripts is possible, but is kind of a
pain.  Lets convert them to use a single loopback file instead.

This has the advantage of letting us delete a lot of offset/size math,
and to be more flexible w/non-512-block sized disks.

BUG=None
TEST=precq passes
TEST=`./mount_gpt_image.sh -i $PWD/chromiumos_base_image.bin` works
TEST=`./mount_gpt_image.sh -u -i $PWD/chromiumos_base_image.bin` works

Change-Id: I82d5573c639a96741d330b4b887374276c2e4476
Reviewed-on: https://chromium-review.googlesource.com/1034229
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
1 file changed