From 110c86bdb7f0b5bd904e8baa95e8673ecfe28719 Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Thu, 28 Apr 2011 15:40:47 +0200 Subject: [PATCH] - jos poboljsanja za grub2 detekciju i regeneriranje confa u slucaju ptorebe --- debian/postinst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/postinst b/debian/postinst index 6dfe2d6..146bc1e 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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" -- 1.7.10.4