X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=kernel-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=e22b539cce23447b87ef7c8458e254b4c26aa80f;hp=b3f9b688d8bad3ebb311b5557497f5416e83b6d4;hb=e7d98e8f3aabd8ac906b73bfa2e301e38d490be8;hpb=fa07732cc0cb3a7753184e5e806cae0e30702779 diff --git a/debian/postinst b/debian/postinst index b3f9b68..e22b539 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,5 +1,5 @@ #!/bin/sh -# postinst script for spamassassin-cn +# postinst script for kernel-2.6-cn # # see: dh_installdeb(1) @@ -30,6 +30,9 @@ esac # import CN-functions . /usr/share/carnet-tools/functions.sh +# import GRUB helper functions +. /usr/share/kernel-2.6-cn/grub-functions.sh + ################################################################################ # starting up backup @@ -152,6 +155,16 @@ if ! grub-install --no-floppy '(hd0)' >/dev/null 2>&1; then fi echo -n " grub4" +# fix possible wrong params in menu.lst +cp_check_and_sed '^# groot=' \ + "s;^# groot=.*;# groot=$grub_root_device;g" \ + /boot/grub/menu.lst || true +cp_check_and_sed '^# kopt=' \ + "s;^# kopt=\(.*\)root=[^[:space:]]*\(.*\);# kopt=\1root=$root_device\2;g" \ + /boot/grub/menu.lst || true +/usr/sbin/update-grub >/dev/null 2>&1 || true +echo -n " grub5" + # restore execshield state if [ ! -z "$SHIELD" ]; then sysctl -w -e "kernel.exec-shield=$SHIELD" >/dev/null 2>&1