X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostinst;h=fa25902a2004522a7cc99d2f89cc2e40719722b8;hb=aee49310b1365b468f50781f0c2a27967465b62f;hp=bfbb597e02c0c5d6d0becb2310366287143abf8c;hpb=d1bb716ac233b7d645a22f86cb437d7f49b45dd2;p=kernel-cn.git diff --git a/debian/postinst b/debian/postinst index bfbb597..fa25902 100755 --- a/debian/postinst +++ b/debian/postinst @@ -102,6 +102,7 @@ if [ ! -d /boot/grub ]; then cp -a /usr/lib/grub/i386-pc/* /boot/grub fi fi +echo -n " grub1" # create/update grub configuration if [ -e /boot/grub/menu.lst ]; then @@ -115,18 +116,35 @@ if [ ! -e /boot/grub/menu.lst ]; then else /usr/sbin/update-grub >/dev/null 2>&1 || true fi +echo -n " grub2" -# install grub loader +# workaround grsec +if [ -x /sbin/chpax ]; then + if [ -x /usr/sbin/grub ]; then + chpax -spmrx /usr/sbin/grub || true + fi + if [ -x /usr/sbin/grub-probe ]; then + chpax -spmrx /usr/sbin/grub-probe || true + fi +fi +echo -n " grub3" + +# workaround execshield SHIELD=$(sysctl -e -n kernel.exec-shield) if [ ! -z "$SHIELD" ]; then sysctl -w -e kernel.exec-shield=0 >/dev/null 2>&1 fi + +# install grub loader if ! grub-install --no-floppy '(hd0)' >/dev/null 2>&1; then echo "." echo "CN: FATAL ERROR running grub-install!" echo "CN: Do not reboot your server and report this to OTRS immediately!" exit 1 fi +echo -n " grub4" + +# restore execshield state if [ ! -z "$SHIELD" ]; then sysctl -w -e "kernel.exec-shield=$SHIELD" >/dev/null 2>&1 fi