From: Dinko Korunic Date: Thu, 28 Apr 2011 13:40:47 +0000 (+0200) Subject: - jos poboljsanja za grub2 detekciju i regeneriranje confa u slucaju X-Git-Tag: v2.6.32.1~4 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=kernel-cn.git;a=commitdiff_plain;h=110c86bdb7f0b5bd904e8baa95e8673ecfe28719 - jos poboljsanja za grub2 detekciju i regeneriranje confa u slucaju ptorebe --- 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"