summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-04-14 15:13:30 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-04-14 15:13:30 +0000
commit10fa8fd271263c2fdc3dafe6324e7cd71a0bcb1c (patch)
tree04f3f3a70bf3f0fb60b70c87713928052eb6e7c2 /install
parent9a9cdba02e32064d0580d17700951476808d61e0 (diff)
downloadlive-10fa8fd271263c2fdc3dafe6324e7cd71a0bcb1c.tar.gz
Check if bootenv is created
Diffstat (limited to 'install')
-rwxr-xr-xinstall32
1 files changed, 18 insertions, 14 deletions
diff --git a/install b/install
index 1a69261..f4afd8c 100755
--- a/install
+++ b/install
@@ -754,22 +754,26 @@ def configure_bootenv():
def cleanup(destroy_bootenv=False):
+ global bootenv
+ global rootdir
progress = ProgressMessage(screen, title='Cleaning up', width=50)
- umount_in_bootenv()
- call(['umount', rootdir], stdout=PIPE, stderr=PIPE)
- if destroy_bootenv:
- progress.text='Destroying "{}", please wait ...'.format(bootenv)
- call(['zfs', 'destroy', '-r', bootenv], stdout=PIPE, stderr=PIPE)
- else:
- progress.text = 'Adjusting boot environment "{}" ...'.format(bootenv)
- call(['zfs', 'destroy', '-r', bootenv + '@empty'], stdout=PIPE, stderr=PIPE)
- call(['zfs', 'set', 'canmount=noauto', bootenv], stdout=PIPE, stderr=PIPE)
- call(['zfs', 'set', 'mountpoint=/', bootenv], stdout=PIPE, stderr=PIPE)
+ if bootenv:
+ umount_in_bootenv()
+ call(['umount', rootdir], stdout=PIPE, stderr=PIPE)
+ if destroy_bootenv:
+ progress.text='Destroying "{}", please wait ...'.format(bootenv)
+ call(['zfs', 'destroy', '-r', bootenv], stdout=PIPE, stderr=PIPE)
+ else:
+ progress.text = 'Adjusting boot environment "{}" ...'.format(bootenv)
+ call(['zfs', 'destroy', '-r', bootenv + '@empty'], stdout=PIPE, stderr=PIPE)
+ call(['zfs', 'set', 'canmount=noauto', bootenv], stdout=PIPE, stderr=PIPE)
+ call(['zfs', 'set', 'mountpoint=/', bootenv], stdout=PIPE, stderr=PIPE)
- try:
- os.rmdir(rootdir)
- except:
- pass
+ try:
+ os.rmdir(rootdir)
+ except:
+ pass
+ bootenv = None
progress.text = 'Exporting ZFS pools ...'
for pool in imported_zpools: