fp@224: #!/bin/sh fp@224: fp@224: #------------------------------------------------------------------------------ fp@224: # fp@224: # Realtime module install script fp@224: # fp@224: # $Id: install.sh 5 2006-04-07 13:49:10Z fp $ fp@224: # fp@224: # Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@224: # fp@224: # This file is part of the IgH EtherCAT Master. fp@224: # fp@224: # The IgH EtherCAT Master is free software; you can redistribute it fp@224: # and/or modify it under the terms of the GNU General Public License fp@224: # as published by the Free Software Foundation; version 2 of the License. fp@224: # fp@224: # The IgH EtherCAT Master is distributed in the hope that it will be fp@224: # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@224: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@224: # GNU General Public License for more details. fp@224: # fp@224: # You should have received a copy of the GNU General Public License fp@224: # along with the IgH EtherCAT Master; if not, write to the Free Software fp@224: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@224: # fp@224: #------------------------------------------------------------------------------ fp@224: fp@224: # Fetch parameters fp@224: fp@224: if [ $# -ne 2 ]; then fp@224: echo "Usage: $0 " fp@224: exit 1 fp@224: fi fp@224: fp@224: MODULENAME=$1 fp@224: KERNEL=$2 fp@224: fp@224: MODULESDIR=/lib/modules/$KERNEL/kernel/drivers/rt fp@224: fp@224: echo "Realtime installer" fp@224: echo " target: $MODULENAME" fp@224: echo " kernel: $KERNEL" fp@224: fp@224: # Create target directory fp@224: fp@224: if [ ! -d $MODULESDIR ]; then fp@224: echo " creating $MODULESDIR..." fp@224: mkdir $MODULESDIR || exit 1 fp@224: fi fp@224: fp@224: # Install files fp@224: fp@224: echo " installing $MODULENAME..." fp@224: if ! cp $MODULENAME.ko $MODULESDIR/$MODULENAME.ko; then exit 1; fi fp@224: fp@224: # Calculate dependencies fp@224: fp@224: echo " building module dependencies..." fp@224: depmod fp@224: fp@224: # Finish fp@224: fp@224: echo "done." fp@224: exit 0 fp@224: fp@224: #------------------------------------------------------------------------------