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