summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-08-31 19:22:31 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-09-01 00:36:04 +0400
commitafa42ac2d8d2e6e15d20768594a7f594bef9e847 (patch)
treeb134ce06988e722490805d4c038fbba763bf4ff9
parent465582f4d5ddada716f4eb3f16199f33918b9b36 (diff)
downloadlive-afa42ac2d8d2e6e15d20768594a7f594bef9e847.tar.gz
Introduce install profiles
-rwxr-xr-xinstall54
1 files changed, 50 insertions, 4 deletions
diff --git a/install b/install
index d76226b..115cc3c 100755
--- a/install
+++ b/install
@@ -78,6 +78,26 @@ mirrors = [
('http://mirror-ru.osdyson.org/apt/', 'Russia'),
]
+profile = None
+profiles = [
+ {
+ # This must be the first
+ 'name': 'Minimal',
+ 'desc' : 'Minimal package set with minimal configuration',
+ },
+ {
+ 'name': 'Basic',
+ 'desc' : 'Basic system without X',
+ 'packages' : 'locales vim bash-completion mc sudo lynx mutt wget curl openssh-server illumos-grub illumos-kernel',
+ },
+ {
+ 'name': 'Desktop',
+ 'desc' : 'Install X, XFCE and some graphical applications',
+ 'packages' : 'mc illumos-grub illumos-kernel locales bash-completion vim-gtk xfce4 synaptic abiword dillo gnumeric'
+ 'sylpheed geany lightdm pidgin evince sudo',
+ },
+]
+
# Top of /rpool/boot/grub/menu.lst, if creating new file:
grub_top = r'''
foreground 343434
@@ -619,6 +639,29 @@ def configure_mirror():
if choice == 'cancel':
raise Abort('Choosing APT mirror')
+def choose_profile():
+ global profile
+ global profiles
+ maxlen = 0
+ for p in profiles:
+ if len(p['name']) > maxlen:
+ maxlen = len(p['name'])
+ items = map(lambda x: '{profile: <{0}} - {desc}'.format(maxlen, profile=x['name'], desc=x['desc']), profiles)
+ while not profile:
+ (choice, p) = ListboxChoiceWindow(screen,
+ title='Install software',
+ text='Choose software profile. Additional software will be installed depending on your choice.',
+ items=items,
+ buttons=[('Ok','ok'), ('Cancel', 'cancel')],
+ width=76,
+ scroll=1,
+ default=1, # default is "basic"
+ )
+ if choice == 'cancel':
+ raise Abort('Choosing software profile')
+ if choice in ['ok', None]:
+ profile = p
+
def debootstrap():
progress = ProgressBar(screen,
@@ -641,10 +684,9 @@ def debootstrap():
os.close(log)
os.close(write)
try:
- os.execl('/usr/sbin/debootstrap', 'debootstrap',
- '--debian-installer', '--no-check-gpg',
+ os.execl('/usr/sbin/debootstrap', 'debootstrap', '--debian-installer',
'--exclude=gawk,aptitude,aptitude-common,libboost-iostreams1.48.0,libboost-iostreams1.49.0,libcwidget3',
- '--include=illumos-grub,illumos-kernel,locales,bash-completion,vim',
+ '--include=illumos-grub,illumos-kernel',
codename, rootdir, mirror)
except EnvironmentError as e:
sys.exit(e.errno)
@@ -703,7 +745,7 @@ def debootstrap():
os.close(log)
return os.WEXITSTATUS(status)
-def install():
+def install_minimal():
while True:
configure_mirror()
code = debootstrap()
@@ -727,6 +769,10 @@ def install():
umount_in_bootenv() # debootstrap mounts required FS for us
call(['zfs', 'rollback', '-r', bootenv + '@empty'])
+def install():
+ choose_profile()
+ install_minimal()
+ install_profile()
def umount_in_bootenv():
'''unmount all FS mounted in BE on final cleanup.