#!/bin/sh

# $Id: gm_install,v 1.9 2000/12/20 23:48:43 maxstern Exp $

echo "**************************************************"
echo "Begin GM_INSTALL "`date`
echo "**************************************************"
echo "Beginning one-time installation steps."
echo "**************************************************"
echo "This script makes the following assumptions:"
echo "- superuser privileges (because subdirectories will be created in /usr/)"
echo "- GM build has completed successfully"
echo "- current working directory is the binary subdirectory of the GM source tree"

echo "Creating myricom software directory /usr/myricom/."
echo "Should fail harmlessly if it already exists."
mkdir /usr/myricom

echo "Creating device names in /dev/."
echo "The following ln commands will fail if the links already exist."
echo "This is OK, provided the existing links are correct."
ln -s /hw/gm0 /dev/gm0
ln -s /hw/gm1 /dev/gm1
ln -s /hw/gm2 /dev/gm2
ln -s /hw/gm3 /dev/gm3
ln -s /hw/gmp0 /dev/gmp0
ln -s /hw/gmp1 /dev/gmp1
ln -s /hw/gmp2 /dev/gmp2
ln -s /hw/gmp3 /dev/gmp3
# Add more 'ln' statements if you will have Myrinet cards with unit
# numbers greater than 3.

ls -l /dev/gm*

echo "Installing configuration files in /var/sysgen/master.d, /var/sysgen/ioconfig,"
echo "and /var/sysgen/system"
cp -p master.d        /var/sysgen/master.d/myrigm
cp -p myrigm.ioconfig /var/sysgen/ioconfig/myrigm
cp -p myrigm.sm       /var/sysgen/system/myrigm.sm

echo "**************************************************"
echo "Beginning installation steps that are needed after every build."
echo "**************************************************"

echo "Installing GM driver as /var/sysgen/boot/myrigm.o."
cp -i -p sbin/gm /var/sysgen/boot/myrigm.o
ls -l /var/sysgen/boot/myrigm.o

echo "Installing mapper, test programs, et al. in /usr/myricom/."
cp -pr * /usr/myricom

ls -lFAR /usr/myricom


echo "NOTE: ml load or reboot needed to load and attach GM."
echo "NOTE: ifconfig command was not issued -- issue it manually if desired."

echo "**************************************************"
echo "End GM_INSTALL "`date`
echo "**************************************************"
