Fix grub-install invocation for post-wheezy releases and sid (issue #78)
[grml-debootstrap.git] / chroot-script
index 1a74aef..a06aa7e 100755 (executable)
@@ -575,7 +575,16 @@ grub_install() {
      done
   else
      echo "Installing grub on ${GRUB}:"
      done
   else
      echo "Installing grub on ${GRUB}:"
-     grub-install --no-floppy "$GRUB"
+     case "$RELEASE" in
+       lenny|squeeze|wheezy)
+         grub-install --no-floppy "$(readlink -f "${GRUB}")"
+         ;;
+       *)
+         echo "(hd0) ${GRUB}" > /boot/grub/device.map
+         grub-install "(hd0)"
+         rm /boot/grub/device.map
+         ;;
+     esac
   fi
 
   echo "Adjusting grub configuration for use on ${GRUB}."
   fi
 
   echo "Adjusting grub configuration for use on ${GRUB}."