home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / 2300eide.zip / INSTALL < prev    next >
Text File  |  1994-11-14  |  2KB  |  100 lines

  1. #
  2. #  (C) Copyright Promise Technology, Inc., 1994
  3. # This source file is the property of Promise Technology Inc.
  4. # It may not be copied or distributed in any isomorphic form
  5. # without an appropriate prior licensing arrangement with 
  6. # Promise Technology, Inc.
  7. #
  8. # Shell script to install UNIX driver
  9. #
  10.  
  11. TMPFILE=/tmp/tmp$$
  12. MDEVICE=/etc/conf/cf.d/mdevice
  13. SCODRIVER=Driver.sco
  14. ATTDRIVER=Driver.att
  15. SCOPACK=/etc/conf/pack.d/wd0
  16. SCOHDSPACE=/etc/conf/pack.d/hd/space.c
  17. ATTPACK=/etc/conf/pack.d/hd
  18.  
  19.  
  20. strings - /bin/pwd | grep 'SCO' > /dev/null 2>&1
  21. if [ $? = 0 ]
  22. then
  23.     UNIXID=SCO
  24. fi
  25.  
  26. strings - /bin/pwd | grep 'UNIX System V/386' > /dev/null 2>&1
  27. if [ $? = 0 ]
  28. then
  29.     UNIXID="AT&T"
  30. fi
  31.  
  32. if [ "$UNIXID" != "SCO" -a "$UNIXID" != "AT&T" ]
  33. then
  34.     echo "Only SCO UNIX and AT&T UNIX are supported now!\n"
  35.     exit 1
  36. fi
  37.  
  38. echo "\nInstalling driver on your $UNIXID unix ...\n"
  39.  
  40. while [ 1 ]
  41. do
  42.     echo "\nWill the EIDE2300 controller be in TURBO or FAST mode"
  43.     echo " (T/F)? (default=T)\c"
  44.     read ANS
  45.     if [ "$ANS" = "" -o "$ANS" = "T" -o "$ANS" = "t" ]
  46.     then
  47.         TURBOMODE=1
  48.         break
  49.     fi
  50.     if [ "$ANS" = "F" -o "$ANS" = "f" ]
  51.     then
  52.         TURBOMODE=0
  53.         break
  54.     fi
  55.  
  56. done
  57. # mdevice, just modify the SVR4.0
  58. if [ "$UNIXID" = "AT&T" ]
  59. then 
  60.     sed -e '/^hd/s/[     ]hd/    pti/g' $MDEVICE > $TMPFILE
  61. fi
  62. cp $TMPFILE $MDEVICE 2> /dev/null
  63.  
  64. #
  65. # /etc/conf/pack.d/xxx/Driver.o 
  66. # /etc/conf/pack.d/xxx/space.c
  67. #
  68. if [ $UNIXID = SCO ]
  69. then
  70.     THISDRIVER=$SCODRIVER
  71.     THISPACK=$SCOPACK
  72. else
  73.     THISDRIVER=$ATTDRIVER
  74.     THISPACK=$ATTPACK
  75. fi
  76.     
  77. if [ ! -f ${THISPACK}/Driver.ptibak ]
  78. then
  79.     cp ${THISPACK}/Driver.o  ${THISPACK}/Driver.ptibak  2> /dev/null
  80. fi
  81. cp $THISDRIVER    ${THISPACK}/Driver.o  2> /dev/null
  82. echo "
  83.     int    pti_turbo_mode = ${TURBOMODE};
  84. " > ${THISPACK}/space.c
  85.  
  86. /etc/conf/bin/idbuild
  87. if [ $? != 0 ]
  88. then
  89.     exit 1
  90. fi
  91. cp ptisetmode /bin  2> /dev/null
  92. chmod 0500 /bin/ptisetmode
  93. chown root /bin/ptisetmode
  94. chgrp sys /bin/ptisetmode
  95.  
  96. rm $TMPFILE > /dev/null 2>&1
  97. sync
  98. sync
  99. exit 0
  100.