X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=b3f9b688d8bad3ebb311b5557497f5416e83b6d4;hb=ce4658e5e8c0009ca23ccf462e2ac0efd59a3dc0;hp=bfbb597e02c0c5d6d0becb2310366287143abf8c;hpb=d1bb716ac233b7d645a22f86cb437d7f49b45dd2;p=kernel-cn.git diff --git a/debian/postinst b/debian/postinst index bfbb597..b3f9b68 100755 --- a/debian/postinst +++ b/debian/postinst @@ -58,6 +58,14 @@ echo "." ################################################################################ +# remove obsolete symlinks and kernels +rm -f /boot/vmlinuz /boot/vmlinuz.old /boot/vmlinuz.old2 \ + /boot/vmlinuz.plain /vmlinuz /vmlinuz.old /boot/vmlinuz.plain \ + /boot/vmlinuz.generic /boot/vmlinuz-generic /boot/vmlinuz-old +echo "CN: Removed old symlinks in / and /boot." + +################################################################################ + # intro msg echo -n "CN: Configuring system (this will take a while):" @@ -102,6 +110,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 +124,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 @@ -298,13 +324,6 @@ echo "." ################################################################################ -# remove obsolete links -rm -f /boot/vmlinuz /boot/vmlinuz.old /boot/vmlinuz.old2 \ - /boot/vmlinuz.plain /vmlinuz /vmlinuz.old /boot/vmlinuz.plain -echo "CN: Removed old symlinks in / and /boot." - -################################################################################ - # fix old kernel-2.4-cn postrm if [ -e /var/lib/dpkg/info/kernel-2.4-cn.postrm ]; then echo "CN: Fixed old kernel-2.4-cn postrm."