Init RT-FireWire and RTnet

From wiki.network-crawler.de
Jump to: navigation, search
      1 #!/bin/ash
     2 #
     3 # start_firewire <LOCAL_IP> <REMOTE_IP>
     4 #
     5 # example (target 1): start_firewire 10.0.0.1 10.0.0.2
     6 #
     7
     8 PATH_TO_RTFIREWIRE=/usr/local/rt-firewire/modules
     9 PATH_TO_RTNET=/usr/local/rtnet/modules
    10 PATH_TO_RTNET_EXECUTABLE=/usr/local/rtnet/sbin/
    11
    12 if [ -n "$1" ] && [ -n "$2" ];
    13 then
    14         echo "Turning on log-facilities..."
    15         syslogd
    16         klogd -c8
    17
    18         mount /proc
    19
    20         #echo "Initializing Xenomai modules..."
    21         #insmod /lib/modules/2.6.15-ipipe/xeno_nucleus.ko
    22         #insmod /lib/modules/2.6.15-ipipe/xeno_native.ko
    23         #insmod /lib/modules/2.6.15-ipipe/xeno_rtdm.ko
    24         #insmod /lib/modules/2.6.15-ipipe/xeno_posix.ko
    25
    26         echo "Initializing RT-FireWire..."
    27         insmod $PATH_TO_RTFIREWIRE/rtpkbuff.ko
    28         insmod $PATH_TO_RTFIREWIRE/rt_serv.ko
    29         insmod $PATH_TO_RTFIREWIRE/rtpc.ko
    30         insmod $PATH_TO_RTFIREWIRE/rt_ieee1394.ko
    31         insmod $PATH_TO_RTFIREWIRE/bis1394.ko
    32         insmod $PATH_TO_RTFIREWIRE/rt_ohci1394.ko
    33
    34         echo "Initializing RTnet..."
    35         insmod $PATH_TO_RTNET/rtnet.ko
    36         sleep 1;
    37         insmod $PATH_TO_RTNET/rt_loopback.ko
    38         insmod $PATH_TO_RTNET/rtpacket.ko
    39         insmod $PATH_TO_RTNET/rtipv4.ko
    40         insmod $PATH_TO_RTNET/rt_eth1394.ko
    41         insmod $PATH_TO_RTNET/rtmac.ko
    42
    43         $PATH_TO_RTNET_EXECUTABLE/rtifconfig rteth0 up $1
    44         $PATH_TO_RTNET_EXECUTABLE/rtifconfig rtlo up 127.0.0.1
    45         $PATH_TO_RTNET_EXECUTABLE/rtifconfig -a
    46         echo "Solicit $2..."
    47         $PATH_TO_RTNET_EXECUTABLE/rtroute solicit $2 dev rteth0
    48         #rtroute add 10.0.0.1 C0:FF:00:00:00:00 dev rteth0
    49         $PATH_TO_RTNET_EXECUTABLE/rtroute
    50 else
    51         echo "Usage: start_firewire <LOCAL_IP> <REMOTE_IP>"
    52 fi