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 | |
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
-rwxr-xr-x | install | 19 | ||||
-rwxr-xr-x | protostar | 11 |
2 files changed, 18 insertions, 12 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: @@ -51,7 +51,7 @@ echo "Preparing base system (debootstrap)..." debootstrap \ --no-check-gpg \ --exclude=locales,syslogd,gawk,aptitude,aptitude-common,libboost-iostreams1.48.0,libboost-iostreams1.49.0,libcwidget3 \ - --include=python-newt,truss,illumos-grub-eltorito,illumos-kernel,mc,vim,screen,openssh-client,wget,bzip2,xz-utils,debootstrap,less,file,lynx,bash-completion \ + --include=python-newt,truss,installgrub,illumos-grub-eltorito,illumos-kernel,mc,vim,screen,openssh-client,wget,bzip2,xz-utils,debootstrap,less,file,lynx,bash-completion \ "${DIST}" \ "${ROOT}" \ "${REPO}" @@ -79,7 +79,6 @@ rm -rf "${ROOT}"/usr/share/doc/* rm -rf "${ROOT}"/usr/share/locale/*/LC_MESSAGES rm -rf "${ROOT}"/usr/share/man/*/man[0-9]* - #sed -i '/^PermitRootLogin/ s,no,yes,' /etc/ssh/sshd_config cat <<VFSTAB > $ROOT/etc/vfstab @@ -96,7 +95,6 @@ echo "dyson-${DIST}-live" > "${ROOT}/etc/nodename" # Set root password (just "root"): echo 'root:root' | chpasswd -R "$ROOT" -echo 'User: root, password: root' >> "${ROOT}/etc/issue" # Script to find and mount usr.lzma: sed "s/##USR_IMG##/$USR_IMG/g" "fs-root" > "${ROOT}/lib/svc/method/fs-root" @@ -129,6 +127,13 @@ touch "${BOOTARCH}/reconfigure" pushd "${ROOT}" +# We use 32-bit installgrub, but is not required to boot ;-) +if [ -e lib32 ]; then + mkdir -p usr/lib32 + mv lib32/* usr/lib32/ + ln -sf usr/lib32 $BOOTARCH/lib32 +fi + # Move some critical libs: march=`dpkg-architecture -qDEB_HOST_MULTIARCH` mkdir -p lib/$march |