|
|

楼主 |
发表于 2007-11-25 20:59:33
|
显示全部楼层
#! /bin/sh
# postinst script for cpad-kernel-source
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see /usr/share/doc/packaging-manual/
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
# Load the debconf libs
. /usr/share/debconf/confmodule
kernel=`uname -s`
case "$1" in
configure|reconfigure)
if [ "$1" = "configure" ] && \
[ "$DEBCONF_RECONFIGURE" != "1" ] && \
db_get cpad-kernel-source/module && \
[ "$RET" = "true" ] \
|| [ "$1" = "reconfigure" ] || \
[ "$DEBCONF_RECONFIGURE" = "1" ] && \
db_get cpad-kernel-source/recompile && \
[ "$RET" = "true" ];
then
db_get cpad-kernel-source/kernel
ksrc=$RET
if [ -d $ksrc/include ]; then
kvers="`head -n 1 $ksrc/include/linux/version.h | cut -c 22- | rev | cut -c 2- | rev`"
[ $kvers = `uname -r` ] || echo "Warning: kernel headers don't match running $kernel version."
echo -n "Building cpad module for $kernel $kvers (this may take a few minutes)..."
db_get cpad-kernel-source/verbose
VERBOSE=$RET
if $VERBOSE; then
echo
cd /usr/src/modules/cpad-kernel
debian/rules kdist KVERS=$kvers KSRC=$ksrc;
else
cd /usr/src/modules/cpad-kernel
debian/rules kdist KVERS=$kvers KSRC=$ksrc >/dev/null 2>/dev/null
echo "Done."
fi
else
echo "Error: kernel headers not found in '$ksrc'"
fi
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0 |
|