Compare commits
3 commits
dev
...
prawn/chro
Author | SHA1 | Date | |
---|---|---|---|
|
21bf0cf293 | ||
|
9e1348cbce | ||
|
9c77e2ffe3 |
4 changed files with 10 additions and 7 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:
|
||||
|
|
|
@ -2,12 +2,11 @@ import logging
|
|||
import os
|
||||
|
||||
from glob import glob
|
||||
from shutil import rmtree
|
||||
from typing import ClassVar
|
||||
|
||||
from constants import Arch
|
||||
from exec.cmd import run_root_cmd
|
||||
from exec.file import makedir, root_makedir
|
||||
from exec.file import makedir, remove_file, root_makedir
|
||||
from config.state import config
|
||||
|
||||
from .abstract import Chroot, get_chroot
|
||||
|
@ -19,10 +18,10 @@ class BaseChroot(Chroot):
|
|||
_copy_base: ClassVar[bool] = False
|
||||
|
||||
def create_rootfs(self, reset, pacman_conf_target, active_previously):
|
||||
if reset:
|
||||
if reset and os.path.exists(self.path):
|
||||
logging.info(f'Resetting {self.name}')
|
||||
for dir in glob(os.path.join(self.path, '*')):
|
||||
rmtree(dir)
|
||||
remove_file(dir, recursive=True)
|
||||
makedir(config.get_path('chroots'))
|
||||
root_makedir(self.get_path())
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class DeviceChroot(BuildChroot):
|
|||
really_active.append(mnt)
|
||||
if really_active:
|
||||
raise Exception(f'{self.name}: Chroot has submounts active: {really_active}')
|
||||
if os.path.ismount(self.path):
|
||||
if os.path.ismount(self.path) or check_findmnt(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')):
|
||||
raise Exception(f'{self.name}: {self.path}/usr/bin exists, not mounting over existing rootfs.')
|
||||
|
|
|
@ -31,7 +31,7 @@ CONFIG_DEFAULTS_DICT = {
|
|||
},
|
||||
'pacman': {
|
||||
'parallel_downloads': 4,
|
||||
'check_space': False, # TODO: investigate why True causes issues
|
||||
'check_space': True,
|
||||
'repo_branch': DEFAULT_PACKAGE_BRANCH,
|
||||
},
|
||||
'paths': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue