diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-14 10:45:57 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-14 10:45:57 +0000 |
commit | 051088382122233d1c43250028046ed304a1697e (patch) | |
tree | 2c82e9362a64c57534ee234c91537effeb8d35d0 /install | |
parent | b101cecdd5392a6f9c3007524e81f22aca9a0828 (diff) | |
download | live-051088382122233d1c43250028046ed304a1697e.tar.gz |
Mount point of BE is legacy while installing
Diffstat (limited to 'install')
-rwxr-xr-x | install | 46 |
1 files changed, 21 insertions, 25 deletions
@@ -153,7 +153,7 @@ Whould you like to continue?''', def find_zpools(): global zpools - progress = ProgressMessage(screen, title='Please, wait', text='Searching for ZFS pools ...') + progress = ProgressMessage(screen, title='Please wait', text='Searching for ZFS pools ...') zpools = [] zpool_cmd = Popen(['zpool', 'list', '-H', '-o', 'name'], stdout=PIPE, stderr=PIPE) for line in zpool_cmd.stdout: @@ -164,7 +164,7 @@ def find_zpools(): def find_hdds(): global hdds - progress = ProgressMessage(screen, title='Please, wait', text='Searching for disks ...') + progress = ProgressMessage(screen, title='Please wait', text='Searching for disks ...') hdds = [] pat = re.compile('\d+\.\s+(\S+)\s+<(.+?)(\s+cyl.*)?>') format_cmd = Popen('format </dev/null', shell=True, stdout=PIPE) @@ -206,7 +206,7 @@ def choose_rpool(): def create_root_slice(hdd_name): '''Create root slice (0) over entire Solaris partition''' - progress = ProgressMessage(screen, title='Please, wait', + progress = ProgressMessage(screen, title='Please wait', text='Formatting Solaris partition on disk "{}" ...'.format(hdd_name)) fd, path = mkstemp() @@ -234,7 +234,7 @@ def create_rpool(hdd): else: pool_name = None; - progress = ProgressMessage(screen, title='Please, wait', + progress = ProgressMessage(screen, title='Please wait', text='Creating ZFS pool "{rpool}" on slice "{slice}" ...'.format(rpool=pool_name, slice=rslice)) zpool_cmd = Popen(['zpool', 'create', '-R', '/mnt/'+pool_name, @@ -265,7 +265,7 @@ def configure_rpool(): rpool = create_rpool(hdd) if rpool: if not pool_is_imported(rpool): - progress = ProgressMessage(screen, title='Please, wait', + progress = ProgressMessage(screen, title='Please wait', text='Importing ZFS pool "{}" ...'.format(rpool)) zpool_cmd = Popen(['zpool', 'import', '-R', '/mnt/'+rpool, '-f', rpool], stderr=PIPE, stdout=PIPE) out, err = zpool_cmd.communicate() @@ -335,9 +335,10 @@ def configure_zfs(): else: bootenv = None - rootdir = mkdtemp(prefix='install-', dir='/mnt/' + rpool) + rootdir = mkdtemp(prefix='install-') progress.text = 'Creating ' + bootenv - zfs_create(bootenv, options={'mountpoint':'/' + basename(rootdir)}) + zfs_create(bootenv, options={'mountpoint':'legacy'}) + call(['mount', '-F', 'zfs', bootenv, rootdir]) progress.advance() for fs in befs: @@ -472,7 +473,7 @@ def get_mirror(): def valid_mirror(mirror): - progress = ProgressMessage(screen, title='Please, wait...', + progress = ProgressMessage(screen, title='Please wait...', text='Checking APT mirror: ' + mirror) try: o = urlopen('{mirror}/dists/{codename}/Release'.format( @@ -560,8 +561,8 @@ def debootstrap(): os.close(write) try: os.execl('/usr/sbin/debootstrap', 'debootstrap', - '--exclude=gawk,aptitude,aptitude-common,libboost-iostreams1.48.0,libboost-iostreams1.49.0,libcwidget3', '--debian-installer', '--no-check-gpg', + '--exclude=gawk,aptitude,aptitude-common,libboost-iostreams1.48.0,libboost-iostreams1.49.0,libcwidget3', '--include=illumos-grub,illumos-kernel,locales', codename, rootdir, mirror) except OSError as e: @@ -618,6 +619,7 @@ def debootstrap(): except: pass status = os.wait()[1] + os.close(log) return os.WEXITSTATUS(status) def install(): @@ -640,14 +642,11 @@ def install(): break if choice == 'cancel': raise Abort('debootstrap failed') - p = ProgressMessage(screen, title='Please, wait', text='Undoing previous try ...') - umount_in_bootenv() + p = ProgressMessage(screen, title='Please wait', text='Undoing previous try ...') + umount_in_bootenv() # debootstrap mounts required FS for us call(['zfs', 'rollback', '-r', bootenv + '@empty']) -def umount(path): - call(['umount', path], stdout=PIPE, stderr=PIPE) - def umount_in_bootenv(): '''unmount all FS mounted in BE on final cleanup. These FS also may be left after interruption or debootstrap failure''' @@ -656,12 +655,9 @@ def umount_in_bootenv(): if not bootenv: return - fslist = ['/dev/fd', '/proc', '/devices'] - progress = ProgressBar(screen, title='Unmounting filesystems', top=len(fslist)) + fslist = ['/dev/fd', '/proc', '/devices', '/home'] for fs in fslist: - progress.advance() - progress.text = 'Unmounting ' + fs - umount(rootdir + fs) + call(['umount', rootdir + fs], stdout=PIPE, stderr=PIPE) def destroy_bootenv(): global bootenv @@ -670,8 +666,8 @@ def destroy_bootenv(): return umount_in_bootenv() progress = ProgressMessage(screen, title='Destroying boot environment', - text='Destroying "{}", please wait...'.format(bootenv)) - call(['zfs', 'unmount', bootenv], stdout=PIPE, stderr=PIPE) + text='Destroying "{}", please wait ...'.format(bootenv)) + call(['umount', rootdir], stdout=PIPE, stderr=PIPE) call(['zfs', 'destroy', '-r', bootenv], stdout=PIPE, stderr=PIPE) bootenv = None try: @@ -738,7 +734,7 @@ def configure_packages(): screen.resume() def create_bootarchive(): - progress = ProgressMessage(screen, title='Please, wait') + progress = ProgressMessage(screen, title='Please wait', width=50) progress.text = 'Creating boot archive, please wait ...' in_bootenv(['/sbin/bootadm', 'update-archive']) @@ -758,11 +754,11 @@ def configure_bootenv(): def cleanup(): '''Cleanup after successful installation''' + progress = ProgressMessage(screen, title='Cleaning up', width=60) + progress.text = 'Unmounting boot environment {} ...'.format(bootenv) umount_in_bootenv() - progress = ProgressMessage(screen, title='Cleaning up') - progress.text = 'Unmounting boot environment ...' + call(['umount', rootdir], stdout=PIPE, stderr=PIPE) call(['zfs', 'destroy', '-r', bootenv + '@empty'], stdout=PIPE, stderr=PIPE) - call(['zfs', 'unmount', bootenv], stdout=PIPE, stderr=PIPE) call(['zfs', 'set', 'canmount=noauto', bootenv], stdout=PIPE, stderr=PIPE) call(['zfs', 'set', 'mountpoint=/', bootenv], stdout=PIPE, stderr=PIPE) try: |