summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-05-01 22:18:57 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-05-01 22:18:57 +0400
commita33642a66fef0749f374fcee70f55e6d37976170 (patch)
tree2170f88780dcebd090a2a4e673e40692e1c083b0 /install
parented709bfcc1ef660c628b8382ae58d765c9b6d96e (diff)
downloadlive-a33642a66fef0749f374fcee70f55e6d37976170.tar.gz
Populate SMF repository
Diffstat (limited to 'install')
-rwxr-xr-xinstall30
1 files changed, 29 insertions, 1 deletions
diff --git a/install b/install
index 1f3ea90..dde095e 100755
--- a/install
+++ b/install
@@ -12,13 +12,13 @@ from __future__ import print_function
from DysonInstaller.hdd import HDD
from DysonInstaller.snack import *
-from DysonInstaller.Network import *
from snack import *
from subprocess import Popen, PIPE, call
from pprint import pprint
from tempfile import mkstemp, mkdtemp
from urllib2 import urlopen, URLError, HTTPError
from time import sleep
+from fnmatch import fnmatch
from os.path import basename, exists
import os
import re
@@ -788,6 +788,33 @@ def configure_nodename():
except:
pass
+def configure_smf():
+ ''' Populate SMF repository.
+ We could start svccfg and write all commands to its stdin.
+ It is fast, but actual execution of import is slow for each manifest.
+ So we start svccfg for each manifest to be able to show real progress.
+ /proc and /devices must be mounted in chroot env.
+ '''
+ try:
+ manifests = []
+ os.chdir(rootdir)
+ for root, dirs, files in os.walk('lib/svc/manifest'):
+ manifests += [ os.path.join('/', root, xml) for xml in files if fnmatch(xml, '*.xml')]
+ progress = ProgressBar(screen, title='Configuring SMF repository', width=70,
+ text='Importing SMF manifests ...', top=len(manifests))
+ for m in manifests:
+ progress.text = 'Importing ' + m
+ progress.advance()
+ svccfg_cmd = Popen(['/usr/sbin/chroot', rootdir, '/usr/sbin/svccfg', 'import', m],
+ stderr=PIPE, stdout=PIPE, stdin=PIPE,
+ env={'SVCCFG_REPOSITORY':'/etc/svc/repository.db'})
+ svccfg_cmd.communicate()
+ svccfg_cmd.wait()
+ except:
+ pass
+
+
+
def configure_packages():
screen.suspend()
call(['chroot', rootdir, '/usr/sbin/dpkg-reconfigure', 'tzdata', 'locales'], stderr=PIPE)
@@ -836,6 +863,7 @@ def configure_bootenv():
pass
set_root_password()
create_bootarchive()
+ configure_smf()
def slice4grub(s):