diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-14 15:13:30 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-14 15:13:30 +0000 |
commit | 10fa8fd271263c2fdc3dafe6324e7cd71a0bcb1c (patch) | |
tree | 04f3f3a70bf3f0fb60b70c87713928052eb6e7c2 /install | |
parent | 9a9cdba02e32064d0580d17700951476808d61e0 (diff) | |
download | live-10fa8fd271263c2fdc3dafe6324e7cd71a0bcb1c.tar.gz |
Check if bootenv is created
Diffstat (limited to 'install')
-rwxr-xr-x | install | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -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: |