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