Migrate leftovers to CHROOT_PATHS

This commit is contained in:
InsanePrawn 2022-01-26 16:47:36 +01:00
parent 8ead5c9542
commit a0a5a5a677
5 changed files with 23 additions and 14 deletions

View file

@ -422,8 +422,12 @@ class Chroot:
if not os.path.exists(source_path):
raise Exception('Source does not exist')
if not allow_overlay:
if self.active_mounts:
raise Exception(f'{self.name}: Chroot has submounts active: {self.active_mounts}')
really_active = []
for mnt in self.active_mounts:
if check_findmnt(self.get_path(mnt)):
really_active.append(mnt)
if really_active:
raise Exception(f'{self.name}: Chroot has submounts active: {really_active}')
if os.path.ismount(self.path):
raise Exception(f'{self.name}: There is already something mounted at {self.path}, not mounting over it.')
if os.path.exists(os.path.join(self.path, 'usr/bin')):