X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-debootstrap;h=622a693c452337be48bbd546ed3b012137e70138;hb=c7c6cfd5ea3dcdfe0c2b627f8e1d698f819a79e4;hp=93bcbbf586baa9cb1e2620df0aaaa894d23ffd63;hpb=e781fc540f6654d5249813f85ff7fb49de73396f;p=grml-debootstrap.git diff --git a/grml-debootstrap b/grml-debootstrap index 93bcbbf..622a693 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -389,7 +389,7 @@ fi # make sure we have what we need {{{ if [ -n "$VIRTUAL" ] ; then - check4progs grub-mkimage kpartx mksh parted qemu-img || bailout 1 + check4progs kpartx mksh parted qemu-img || bailout 1 fi # }}} @@ -535,6 +535,7 @@ prompt_for_release() squeeze Debian/6.0 \ wheezy Debian/7.0 \ jessie Debian/8.0 \ + stretch Debian/9.0 \ sid Debian/unstable)" [ $? -eq 0 ] || bailout } @@ -838,7 +839,7 @@ fi # Support for generic release codenames is unavailable. {{{ if [ "$RELEASE" = "stable" ] || [ "$RELEASE" = "testing" ] ; then eerror "Generic release codenames (stable, testing) are unsupported. \ -Please use specific codenames such as lenny, squeeze, wheezy or jessie." ; eend 1 +Please use specific codenames such as lenny, squeeze, wheezy, jessie or stretch." ; eend 1 bailout 1 fi # }}} @@ -1092,12 +1093,15 @@ finalize_vm() { bailout 1 fi - einfo "Installing Grub as bootloader." mount -t proc none "${MNTPOINT}"/proc mount -t sysfs none "${MNTPOINT}"/sys mount --bind /dev "${MNTPOINT}"/dev mount --bind /dev/pts "${MNTPOINT}"/dev/pts +# Has chroot-script installed GRUB to MBR using grub-install (successfully), already? +# chroot-script skips installation for unset ${GRUB} +if [[ -z "${GRUB}" ]] || ! dd if="${GRUB}" bs=512 count=1 2>/dev/null | cat -v | fgrep -q GRUB; then + einfo "Installing Grub as bootloader." mkdir -p "${MNTPOINT}/boot/grub" if ! [ -d "${MNTPOINT}"/usr/lib/grub/i386-pc/ ] ; then eerror "Error: grub not installed inside Virtual Machine. Can not install bootloader." ; eend 1 @@ -1115,6 +1119,7 @@ finalize_vm() { chroot "${MNTPOINT}" grub-mkimage -O i386-pc -p "(hd0,msdos1)/boot/grub" -o /tmp/core.img biosdisk part_msdos ext2 dd if="${MNTPOINT}/tmp/core.img" of="${ORIG_TARGET}" conv=notrunc seek=4 rm -f "${MNTPOINT}/tmp/core.img" +fi einfo "Updating grub configuration file." if [ -n "$BOOT_APPEND" ] ; then @@ -1132,7 +1137,7 @@ finalize_vm() { umount "${MNTPOINT}"/proc umount "${MNTPOINT}"/sys umount "${MNTPOINT}"/dev/pts - umount "${MNTPOINT}"/dev + try_umount 3 "${MNTPOINT}"/dev umount "${MNTPOINT}" kpartx -d "${ORIG_TARGET}" >/dev/null }