diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-06-16 19:00:31 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-06-16 19:00:31 +0000 |
commit | dc405ac7a27604addd8ae4842dc2c7eee8e1704a (patch) | |
tree | 4759e525ffcab4d3ebf54072b14f47fc903f5e1a | |
parent | 487e01aa8681dd76eeb603c7936ca5b2af74bfb6 (diff) | |
download | live-dc405ac7a27604addd8ae4842dc2c7eee8e1704a.tar.gz |
Disk selection
-rwxr-xr-x | setup | 40 |
1 files changed, 29 insertions, 11 deletions
@@ -17,14 +17,18 @@ def get_hdd(): for line in out: match = pat.search(line) if match: - HDD.append({'name': match.group(1), 'desc': match.group(2), 'use': 0}) - # if there is only one disk, use it by default: - if len(HDD) == 1: - HDD[0]['use'] = 1 + HDD.append({ + 'name': match.group(1), + 'desc': match.group(2), + 'use': 0, + }) if len(HDD) == 0: d.msgbox(width=50, title='Error: no disks found', text='\nSorry, no hard disks found on your system. Installation is not possible.') sys.exit(1) + # if there is only one disk, use it by default: + if len(HDD) == 1: + HDD[0]['use'] = 1 @@ -33,26 +37,40 @@ def choose_hdd(): choices = [] for hdd in HDD: choices.append((hdd['name'], hdd['desc'], hdd['use'])) - res = d.checklist(choices=choices, + (code, disks) = d.checklist(choices=choices, width=60, height=20, title='Choose disks to use for root zpool', text=''' - ''') - break +Each disk you choose should have one Solaris partition. \ +Only primary partitions are allowed. If disk does not have \ +a Solaris partition you will asked to create one. ''') + if code: + break + if len(disks) > 0: + for hdd in HDD: + if hdd['name'] in disks: + hdd['use'] = 1 + else: + hdd['use'] = 0 + break + else: + d.msgbox(width=40, height=8, title='You need at least one disk', + text='\nPlease choose at least one disk.') def welcome(): - rc = d.yesno(width=60, height=20, title='Welcome to Dyson installer', + no = d.yesno(width=60, height=20, title='Welcome to Dyson installer', text=''' Dyson is an operating system derived from Debian and based on Illumos core. \ It uses Illumos unix kernel and libc, ZFS file system and SMF to manage system startup. \ To learn more visit http://osdyson.org -This installer will guide you though disk paritioning, filesystem creation,\ +This installer will guide you though disk paritioning, filesystem creation, \ installation of base system and minimal configuration. -Please note, this system IS VERY EXPERIMENTAL. You can LOOSE ALL YOUR DATA which this system can reach ;-) +Please note, this system IS VERY EXPERIMENTAL. \ +You can LOOSE ALL YOUR DATA which this system can reach ;-) Whould you like to continue?''') - if rc: + if no: sys.exit(1) |