mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-06-25 01:48:22 -04:00
Refactor chroot.py into Chroot class
This commit is contained in:
parent
8d1061004a
commit
c5183bd0bf
2 changed files with 382 additions and 227 deletions
4
utils.py
4
utils.py
|
@ -23,7 +23,7 @@ def umount(dest):
|
|||
)
|
||||
|
||||
|
||||
def mount(src: str, dest: str, options=['bind'], fs_type=None) -> subprocess.CompletedProcess:
|
||||
def mount(src: str, dest: str, options=['bind'], fs_type=None, register_unmount=True) -> subprocess.CompletedProcess:
|
||||
opts = []
|
||||
for opt in options:
|
||||
opts += ['-o', opt]
|
||||
|
@ -38,7 +38,7 @@ def mount(src: str, dest: str, options=['bind'], fs_type=None) -> subprocess.Com
|
|||
],
|
||||
capture_output=False,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
if result.returncode == 0 and register_unmount:
|
||||
atexit.register(umount, dest)
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue