- jos poboljsanja za grub2 detekciju i regeneriranje confa u slucaju
authorDinko Korunic <kreator@carnet.hr>
Thu, 28 Apr 2011 13:40:47 +0000 (15:40 +0200)
committerDinko Korunic <kreator@carnet.hr>
Thu, 28 Apr 2011 13:40:47 +0000 (15:40 +0200)
  ptorebe

debian/postinst

index 6dfe2d6..146bc1e 100755 (executable)
@@ -89,7 +89,7 @@ echo "."
 # detect existing Grub2 installation
 
 GRUB2="no"
-if [ -e /boot/grub/grub.cfg ]; then
+if [ \( -e /boot/grub/grub.cfg \) -o \( -e /boot/grub/core.img \) ]; then
     echo "CN: Detected GRUB2 installation, will try to use it."
     GRUB2="yes"
     if [ -e /boot/grub/menu.lst ]; then
@@ -178,6 +178,7 @@ if [ "x$GRUB2" = "xno" ]; then
     fi
 else
     # Grub2 part
+    touch /boot/grub/grub.cfg
     update-grub >/dev/null 2>&1 || true
 fi
 echo -n " grub2"
@@ -232,7 +233,8 @@ EOF
     fi
 else
     # Grub2 part
-    grub-mkdevicemap -n
+    grub-mkdevicemap --no-floppy
+    grub-install --no-floppy --grub-setup=/bin/true "$(grub-probe /boot/grub)" >/dev/null 2>&1
 fi
 echo -n " grub3"
 
@@ -267,7 +269,7 @@ if [ "x$GRUB2" = "xno" ]; then
     fi
 else
     # Grub2 part
-    install_device='(hd0)'
+    install_device="$(grub-probe /boot/grub)"
 fi
 echo -n " grub4"