cros_sdk: Switch chroot image maintenance to python

The python code to create/mount/delete chroot.img was introduced in
https://crrev.com/c/611156.  This CL uses this to move the chroot.img
setup from make_chroot.sh into cros_sdk.  Having the setup in
make_chroot.sh was originally desirable to keep all the chroot
maintenance together, but the complexity of keeping the outer and inner
mount namespaces synced up had too many problems.

By moving chroot.img setup into cros_sdk, we eliminate:
  1. Tracking the parent namespace and exiting from the child namespace.
  2. Moving mounts between namespaces.
  3. Passing --noudevsync to the lvm commands.
  4. The whole chroot.build temporary directory.

I will send another CL to remove chroot.img setup from make_chroot.sh
once this CL has gone through the CQ.

BUG=chromium:730144, chromium:754014, chromium:752562
TEST=Created and removed a bunch of chroots; trybots.

Change-Id: Ie461def2b9d3dbb3215e844ceb4e281e905d5ff8
Reviewed-on: https://chromium-review.googlesource.com/614761
Commit-Ready: Benjamin Gordon <bmgordon@chromium.org>
Tested-by: David Schneider <dnschneid@chromium.org>
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
1 file changed