diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-22 23:53:47 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-22 23:53:47 +0000 |
commit | 77b9eca156c091fd42cbd63803173a475725a3f9 (patch) | |
tree | 2a646db2c9df9ef5d571a0290b3418547adf0e87 /install | |
parent | fcfb7b28afa96359e77987a91d3339ef1024b8ac (diff) | |
download | live-77b9eca156c091fd42cbd63803173a475725a3f9.tar.gz |
Run installgrub from CD, not from chroot.
Device nodes can differ. If we get c1d0 on CD,
same disk can be c0d0 in chroot
Diffstat (limited to 'install')
-rwxr-xr-x | install | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -642,7 +642,7 @@ def debootstrap(): os.execl('/usr/sbin/debootstrap', 'debootstrap', '--debian-installer', '--no-check-gpg', '--exclude=gawk,aptitude,aptitude-common,libboost-iostreams1.48.0,libboost-iostreams1.49.0,libcwidget3', - '--include=installgrub,illumos-grub,illumos-kernel,locales,bash-completion,vim', + '--include=illumos-grub,illumos-kernel,locales,bash-completion,vim', codename, rootdir, mirror) except EnvironmentError as e: sys.exit(e.errno) @@ -861,8 +861,7 @@ def configure_grub(): except: pass - # Zpool was not created during installation, trying - # to guess slice name: + # Zpool was not created during installation, trying to guess slice name: if not rslice: slices = get_zpool_slice(rpool) if len(slices) == 1 and re.match(r'^\w+s\d+$', slices[0]): @@ -878,7 +877,7 @@ def configure_grub(): items.append(('Install GRUB to MBR', 'mbr')) items.append(('Install GRUB to a partition only', 'partition')) items.append(('Only update GRUB menu', 'menu')) - if not solaris_partition: + if not solaris_partition: # installing on existing pool default = 'menu' elif solaris_partition.logical: default = 'mbr' @@ -906,11 +905,13 @@ def configure_grub(): else: progress.text = 'Installing GRUB to partition ...' - installgrub_cmd += ['/boot/grub/stage1', '/boot/grub/stage2', '/dev/rdsk/' + rslice] - rc, out, err = in_bootenv(installgrub_cmd) - if rc != 0: + installgrub_cmd += [rootdir+'/boot/grub/stage1', rootdir+'/boot/grub/stage2', + '/dev/rdsk/' + rslice] + installgrub = Popen(installgrub_cmd, stdout=PIPE, stderr=PIPE) + out, err = installgrub.communicate() + if installgrub.returncode != 0: ButtonChoiceWindow(screen, title='Error', - text='Installing of GRUB failed: ' + err, buttons=['Ok'], width=60) + text='Installing of GRUB failed: '+err, buttons=['Ok'], width=60) m = re.search(r'stage1 written to partition (\d)', out) if m: @@ -931,7 +932,7 @@ def configure_grub(): menu = open(rpool_path + '/boot/grub/menu.lst', 'w') print(grub_top, file=menu) menu.close() - re_bootfs = re.compile(r'^bootfs\s+' + bootenv) + re_bootfs = re.compile(r'^\s*bootfs\s+' + bootenv) have_this_bootenv = False menu = open(rpool_path + '/boot/grub/menu.lst', 'r+') for line in menu: |