mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
umount /sys & /proc when debootstrap is aborted
This commit is contained in:
parent
1df2588b23
commit
5883673380
1 changed files with 11 additions and 2 deletions
|
@ -79,8 +79,17 @@ class Bootstrap(Task):
|
|||
# Optional bootstrapping script to modify the bootstrapping process
|
||||
arguments.append(info.bootstrap_script)
|
||||
|
||||
from ..tools import log_check_call
|
||||
log_check_call(executable + options + arguments)
|
||||
try:
|
||||
from ..tools import log_check_call
|
||||
log_check_call(executable + options + arguments)
|
||||
except KeyboardInterrupt:
|
||||
# Sometimes ../root/sys and ../root/proc are still mounted when
|
||||
# quitting debootstrap prematurely. This break the cleanup process,
|
||||
# so we unmount manually (ignore the exit code, the dirs may not be mounted).
|
||||
from ..tools import log_call
|
||||
log_call(['umount', os.path.join(info.root, 'sys')])
|
||||
log_call(['umount', os.path.join(info.root, 'proc')])
|
||||
raise
|
||||
|
||||
|
||||
class IncludePackagesInBootstrap(Task):
|
||||
|
|
Loading…
Add table
Reference in a new issue