Chroot.activate(): actually do the mounting
This commit is contained in:
parent
c5183bd0bf
commit
91cec7fabd
1 changed files with 11 additions and 3 deletions
14
chroot.py
14
chroot.py
|
@ -46,8 +46,10 @@ BASIC_MOUNTS = {
|
||||||
'options': ['mode=1777,nosuid,nodev'],
|
'options': ['mode=1777,nosuid,nodev'],
|
||||||
},
|
},
|
||||||
'/run': {
|
'/run': {
|
||||||
'src': '/run'
|
'src': '/run',
|
||||||
}
|
'type': 'tmpfs',
|
||||||
|
'options': ['bind'],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Chroot = None
|
Chroot = None
|
||||||
|
@ -260,8 +262,14 @@ class Chroot:
|
||||||
return
|
return
|
||||||
if not self.initialised:
|
if not self.initialised:
|
||||||
self.init(fail_if_active=False)
|
self.init(fail_if_active=False)
|
||||||
|
for dst, opts in BASIC_MOUNTS.items():
|
||||||
|
self.mount(
|
||||||
|
opts['src'],
|
||||||
|
dst,
|
||||||
|
fs_type=opts['type'],
|
||||||
|
options=opts['options']
|
||||||
|
)
|
||||||
self.active = True
|
self.active = True
|
||||||
raise NotImplementedError('TODO: implement mounting /dev, /proc and /sys')
|
|
||||||
|
|
||||||
def deactivate(self, fail_if_inactive: bool = False):
|
def deactivate(self, fail_if_inactive: bool = False):
|
||||||
if not self.active:
|
if not self.active:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue