#!/bin/sh echo "-------------------------------------------" echo "Rebuilding zaptel drivers" echo "-------------------------------------------" amportal stop /etc/init.d/zaptel stop echo "-------------------------------------------" echo "Kernel setup" echo "-------------------------------------------" SOURCE_DIRECTORY=/usr/src KERNEL_VERSION=`uname -r` MODULES_DIRECTORY=/lib/modules/$KERNEL_VERSION/extra if [ Psmp = P`uname -r|grep -o smp` ] then KERNEL_DIRECTORY=${KERNEL_VERSION%%smp}-smp-`uname -m` KERNEL_CPU=smp else KERNEL_DIRECTORY=$KERNEL_VERSION-`uname -m` KERNEL_CPU=one fi echo -e "Kernel version:\t\t$KERNEL_VERSION" echo -e "Kernel directory:\t$KERNEL_DIRECTORY" echo -e "Modules directory:\t$MODULES_DIRECTORY" # check that the kernel libraries for the currently running kernel are present # if not try and install or update them echo "" echo "-----------------------------------------------------" echo "Seting up links to kernel sources" echo "-----------------------------------------------------" echo "" ### If the links exist, remove them in case they are pointing to another version of the kernel. if [ -d /usr/src/linux/ ] then rm -f /usr/src/linux fi ln -s $SOURCE_DIRECTORY/kernels/$KERNEL_DIRECTORY /usr/src/linux echo -e "Link linux:\t\t`ls -l linux`" if [ -d /usr/src/linux-2.6/ ] then rm -f /usr/src/linux-2.6 fi ln -s $SOURCE_DIRECTORY/kernels/$KERNEL_DIRECTORY /usr/src/linux-2.6 echo -e "Link linux-2.6:\t\t`ls -l linux-2.6`" cd /usr/src/zaptel make install-udev make clean make linux26 make zttool make install /etc/init.d/zaptel start amportal start echo "Done."