chroot/abstract: initialize(): if nothing is mounted at /, bind-mount over itself
This commit is contained in:
parent
9c77e2ffe3
commit
9e1348cbce
1 changed files with 5 additions and 1 deletions
|
@ -123,7 +123,11 @@ class Chroot(AbstractChroot):
|
|||
|
||||
active_previously = self.active
|
||||
self.deactivate(fail_if_inactive=False, ignore_rootfs=True)
|
||||
|
||||
if not (os.path.ismount(self.path) or check_findmnt(self.path)):
|
||||
makedir(os.path.dirname(self.path))
|
||||
root_makedir(self.path)
|
||||
logging.debug(f"Bind-mounting {self.name} ({self.uuid}) over itself") # needed for pacman space calculation
|
||||
self.mount(self.path, '/', options=['rbind'])
|
||||
self.create_rootfs(reset, pacman_conf_target, active_previously)
|
||||
|
||||
def get_path(self, *joins: str) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue