diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-10 02:10:06 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-10 02:10:06 +0000 |
commit | 6a0b4e921b82024dbb89306740b8386bb7008352 (patch) | |
tree | 76a935831611463eec58a56eec7b990fc42e778b | |
parent | add8a12071206b344f8a19b42bdac37007599d30 (diff) | |
download | live-6a0b4e921b82024dbb89306740b8386bb7008352.tar.gz |
Can run debootstrap, but ...
-rwxr-xr-x | install | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -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() |