grub_install: use same method for checking grub-install and update-grub
[grml-debootstrap.git] / grml-debootstrap
index 364df6c..513c27b 100755 (executable)
@@ -1618,15 +1618,7 @@ grub_install() {
       eerror "Error: grub not installed inside Virtual Machine. Can not install bootloader." ; eend 1
       bailout 1
     fi
-
-    case "$RELEASE" in
-      lenny|squeeze|wheezy)
-        cp "${MNTPOINT}"/usr/lib/grub/i386-pc/* "${MNTPOINT}/boot/grub/"
-        ;;
-      *)
-        cp -a "${MNTPOINT}"/usr/lib/grub/i386-pc "${MNTPOINT}/boot/grub/"
-        ;;
-    esac
+    cp -a "${MNTPOINT}"/usr/lib/grub/i386-pc "${MNTPOINT}/boot/grub/"
 
     if [ -n "$VMEFI" ]; then
 
@@ -1692,6 +1684,11 @@ grub_install() {
     eend $?
   fi
 
+  if [ -n "${BOOT_APPEND}" ] ; then
+    echo "Adding BOOT_APPEND configuration ['${BOOT_APPEND}'] to /etc/default/grub."
+    sed -i "/GRUB_CMDLINE_LINUX_DEFAULT/ s#\"\$# ${BOOT_APPEND}\"#" "${MNTPOINT}/etc/default/grub"
+  fi
+
   einfo "Updating grub configuration file."
   chroot "${MNTPOINT}" update-grub
   chroot "${MNTPOINT}" sync