summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-04-10 02:10:06 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-04-10 02:10:06 +0000
commit6a0b4e921b82024dbb89306740b8386bb7008352 (patch)
tree76a935831611463eec58a56eec7b990fc42e778b
parentadd8a12071206b344f8a19b42bdac37007599d30 (diff)
downloadlive-6a0b4e921b82024dbb89306740b8386bb7008352.tar.gz
Can run debootstrap, but ...
-rwxr-xr-xinstall33
1 files changed, 33 insertions, 0 deletions
diff --git a/install b/install
index a7ccb5c..72d6374 100755
--- a/install
+++ b/install
@@ -479,6 +479,38 @@ def configure_mirror():
raise Abort('Choosing APT mirror')
+def debootstrap():
+ progress = ProgressBar(screen,
+ title='Installing base system',
+ width=70)
+
+ progress.text = 'Starting debootstrap ...'
+
+ read, write = os.pipe()
+
+ pid = os.fork()
+ if pid == 0:
+ os.close(read)
+ os.dup2(write, 3)
+ os.close(write)
+ try:
+ os.execl('/usr/sbin/debootstrap', 'debootstrap',
+ '--debian-installer', '--no-check-gpg',
+ '--include=illumos-grub,illumos-kernel',
+ codename, '/mnt/' + rpool + '/' + bootenv, mirror)
+ except OSError as e:
+ sys.exit(e.errno)
+ else:
+ os.close(write)
+ f = os.fdopen(read, 'r', 0)
+ r = re.compile(' +')
+ for line in f:
+ i = r.split(line)
+ if i[0] == 'P:':
+ progress.progress = int(int(i[1]) * 100 / int(i[2]))
+
+
+
def destroy_bootenv():
pass
@@ -490,6 +522,7 @@ try:
configure_rpool()
configure_mirror()
configure_zfs()
+ debootstrap()
except Abort as e:
destroy_bootenv()