From 6a0b4e921b82024dbb89306740b8386bb7008352 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 10 Apr 2013 02:10:06 +0000 Subject: Can run debootstrap, but ... --- install | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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() -- cgit v1.2.3