224
|
1 |
#!/bin/sh
|
|
2 |
|
|
3 |
#------------------------------------------------------------------------------
|
|
4 |
#
|
|
5 |
# Realtime module install script
|
|
6 |
#
|
|
7 |
# $Id: install.sh 5 2006-04-07 13:49:10Z fp $
|
|
8 |
#
|
|
9 |
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
|
|
10 |
#
|
|
11 |
# This file is part of the IgH EtherCAT Master.
|
|
12 |
#
|
|
13 |
# The IgH EtherCAT Master is free software; you can redistribute it
|
|
14 |
# and/or modify it under the terms of the GNU General Public License
|
|
15 |
# as published by the Free Software Foundation; version 2 of the License.
|
|
16 |
#
|
|
17 |
# The IgH EtherCAT Master is distributed in the hope that it will be
|
|
18 |
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 |
# GNU General Public License for more details.
|
|
21 |
#
|
|
22 |
# You should have received a copy of the GNU General Public License
|
|
23 |
# along with the IgH EtherCAT Master; if not, write to the Free Software
|
|
24 |
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
25 |
#
|
|
26 |
#------------------------------------------------------------------------------
|
|
27 |
|
|
28 |
# Fetch parameters
|
|
29 |
|
|
30 |
if [ $# -ne 2 ]; then
|
|
31 |
echo "Usage: $0 <MODULENAME> <KERNEL>"
|
|
32 |
exit 1
|
|
33 |
fi
|
|
34 |
|
|
35 |
MODULENAME=$1
|
|
36 |
KERNEL=$2
|
|
37 |
|
|
38 |
MODULESDIR=/lib/modules/$KERNEL/kernel/drivers/rt
|
|
39 |
|
|
40 |
echo "Realtime installer"
|
|
41 |
echo " target: $MODULENAME"
|
|
42 |
echo " kernel: $KERNEL"
|
|
43 |
|
|
44 |
# Create target directory
|
|
45 |
|
|
46 |
if [ ! -d $MODULESDIR ]; then
|
|
47 |
echo " creating $MODULESDIR..."
|
|
48 |
mkdir $MODULESDIR || exit 1
|
|
49 |
fi
|
|
50 |
|
|
51 |
# Install files
|
|
52 |
|
|
53 |
echo " installing $MODULENAME..."
|
|
54 |
if ! cp $MODULENAME.ko $MODULESDIR/$MODULENAME.ko; then exit 1; fi
|
|
55 |
|
|
56 |
# Calculate dependencies
|
|
57 |
|
|
58 |
echo " building module dependencies..."
|
|
59 |
depmod
|
|
60 |
|
|
61 |
# Finish
|
|
62 |
|
|
63 |
echo "done."
|
|
64 |
exit 0
|
|
65 |
|
|
66 |
#------------------------------------------------------------------------------
|