#!/bin/sh
-# postinst script for kernel-2.6-cn
+# postinst script for kernel-cn
#
# see: dh_installdeb(1)
. /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
################################################################################
# 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
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
/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 "."
################################################################################
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
################################################################################
-# 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.