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