Fix #166: pmbootstrap shutdown: umount deep folder levels first (#274)

* Refactored `umount_all` to get the list of folders to be umounted from
  `umount_all_list`, so we can test that function in a test case.
* Adjusted `umount_all_list` to return the deep folder levels first
* Added a testcase for that
* Remove redundant calls to `umount_all()` (which were from a time before
  `pmbootstrap` was released, in which failing commands did not cause
  `pmbootstrap` to raise an exception)
This commit is contained in:
Oliver Smith 2017-07-27 18:14:02 +00:00 committed by GitHub
parent 3be2fce72f
commit 10bf08dca1
3 changed files with 73 additions and 14 deletions

View file

@ -56,8 +56,6 @@ def shutdown(args, only_install_related=False):
pmb.chroot.distccd.stop(args)
# Umount installation-related paths (order is important!)
pmb.helpers.mount.umount_all(args, args.work +
"/chroot_native/mnt/install/boot")
pmb.helpers.mount.umount_all(args, args.work +
"/chroot_native/mnt/install")
shutdown_cryptsetup_device(args, "pm_crypt")
@ -73,7 +71,6 @@ def shutdown(args, only_install_related=False):
if not only_install_related:
# Clean up the rest
pmb.helpers.mount.umount_all(args, args.work)
pmb.helpers.mount.umount_all(args, args.work)
arch = args.deviceinfo["arch"]
if pmb.parse.arch.cpu_emulation_required(args, arch):
pmb.chroot.binfmt.unregister(args, arch)