Allow creating chroots on a loopback device.

If the new --useimage flag is passed, instead of creating the chroot
inside a directory, create a loopback device containing an LVM thin LV
and mount it onto the chroot.  This will enable a subsequent CL to set
up snapshots of the chroot state.

BUG=chromium:730144
TEST=Created/deleted/replaced a bunch of chroots with cros_sdk and a
local cbuildbot.

Change-Id: Ia79a944d2848c3e1ed00346b389b9f66fd5be4b7
Reviewed-on: https://chromium-review.googlesource.com/553404
Commit-Ready: Benjamin Gordon <bmgordon@chromium.org>
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
3 files changed