* izmjena imena iz kernel-2.6-cn u genericki kernel-cn
[kernel-cn.git] / debian / postinst
index 1ff9d57..29e424e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# postinst script for kernel-2.6-cn
+# postinst script for kernel-cn
 #
 # see: dh_installdeb(1)
 
@@ -34,7 +34,7 @@ esac
 . /usr/share/carnet-tools/functions.sh
 
 # import GRUB helper functions
-. /usr/share/kernel-2.6-cn/grub-functions.sh
+. /usr/share/kernel-cn/grub-functions.sh
 
 ################################################################################
 
@@ -89,7 +89,7 @@ echo "."
 # detect existing Grub2 installation
 
 GRUB2="no"
-if [ \( -e /boot/grub/grub.cfg \) -o \( -e /boot/grub/core.img \) ]; then
+if [ \( -e /boot/grub/grub.cfg \) -o \( -e /boot/grub/core.img \) -o \( -e /usr/lib/grub/i386-pc/ext2.mod \) ]; then
     echo "CN: Detected GRUB2 installation, will try to use it."
     GRUB2="yes"
     if [ -e /boot/grub/menu.lst ]; then
@@ -246,7 +246,7 @@ fi
 echo -n " grub3"
 
 # import GRUB helper functions (again, updated device map)
-. /usr/share/kernel-2.6-cn/grub-functions.sh
+. /usr/share/kernel-cn/grub-functions.sh
 
 if [ "x$GRUB2" = "xno" ]; then
     # Grub1 part
@@ -420,7 +420,7 @@ else
   /etc/init.d/procps restart >/dev/null 2>&1 || true
 fi
 
-# finished with basic kernel-2.6-cn stuff
+# finished with basic kernel-cn stuff
 echo "."
 
 ################################################################################
@@ -432,7 +432,7 @@ echo -n "CN: Setting up PAM configurations:"
 if [ -e /etc/security/limits.conf ]; then
     rm -f /etc/security/limits.conf.$$
     cp /etc/security/limits.conf /etc/security/limits.conf.$$
-    cp-update kernel-2.6-cn /etc/security/limits.conf.$$ <<'EOF'
+    cp-update kernel-cn /etc/security/limits.conf.$$ <<'EOF'
 *       soft    core        0
 *              hard    nofile          16384
 *              soft    nofile          16384
@@ -464,72 +464,6 @@ echo "."
 
 ################################################################################
 
-# 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."
-    cat > /var/lib/dpkg/info/kernel-2.4-cn.postrm.$$ <<'EOF'
-#!/bin/sh
-
-set -e
-
-# be sure, be safe
-if [ "$1" != "remove" ]; then
-  exit 0
-fi
-
-# import CN-functions
-. /usr/share/carnet-tools/functions.sh
-
-# remove us from limits.conf
-cp-update -r kernel-2.4-cn /etc/security/limits.conf
-
-# remove us from modules
-cp-update -r kernel-2.4-cn /etc/modules
-EOF
-    if ! cmp -s /var/lib/dpkg/info/kernel-2.4-cn.postrm \
-        /var/lib/dpkg/info/kernel-2.4-cn.postrm.$$; then
-        mv /var/lib/dpkg/info/kernel-2.4-cn.postrm.$$ \
-            /var/lib/dpkg/info/kernel-2.4-cn.postrm
-        chmod +x /var/lib/dpkg/info/kernel-2.4-cn.postrm
-    fi
-    rm -f /var/lib/dpkg/info/kernel-2.4-cn.postrm.$$
-fi
-
-################################################################################
-
-# fix old kernel-cn postrm
-if [ -e /var/lib/dpkg/info/kernel-cn.postrm ]; then
-    echo "CN: Fixed old kernel-cn postrm."
-    cat > /var/lib/dpkg/info/kernel-cn.postrm.$$ <<'EOF'
-#!/bin/sh
-
-set -e
-
-# be sure, be safe
-if [ "$1" != "remove" ]; then
-  exit 0
-fi
-
-# import CN-functions
-. /usr/share/carnet-tools/functions.sh
-
-# remove us from limits.conf
-cp-update -r kernel-cn /etc/security/limits.conf
-
-# remove us from modules
-cp-update -r kernel-cn /etc/modules
-EOF
-    if ! cmp -s /var/lib/dpkg/info/kernel-cn.postrm \
-        /var/lib/dpkg/info/kernel-cn.postrm.$$; then
-        mv /var/lib/dpkg/info/kernel-cn.postrm.$$ \
-            /var/lib/dpkg/info/kernel-cn.postrm
-        chmod +x /var/lib/dpkg/info/kernel-cn.postrm
-    fi
-    rm -f /var/lib/dpkg/info/kernel-cn.postrm.$$
-fi
-
-################################################################################
-
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.