home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / osmp / install / postinstall < prev    next >
Text File  |  1998-08-19  |  5KB  |  198 lines

  1. #ident    "@(#)pkg.osmp:ifiles/postinstall    1.29.1.7"
  2.  
  3. #exec 2>/tmp/osmp.post.err
  4. #set -x
  5.  
  6. # assume that we've not configured a PSM or requested an
  7. # add-on PSM floppy install unless explicitly directed
  8. # by the user interview
  9.  
  10. PSMFLOP=FALSE
  11. CONFIGURED_SOMETHING=FALSE
  12.  
  13. # for initial system (boot floppy) install, the osmp
  14. # request script didn't create /tmp/psmindex.  Create it
  15. # via looking for a PSMINDEX define in /isl/ifile
  16.  
  17. [ -f /etc/inst/scripts/postreboot.sh ] && {
  18.     grep PSMINDEX /isl/ifile > /tmp/psmindex
  19. }
  20.  
  21. # the file /tmp/psmindex contains to convert info in the file into
  22. # a value for the variable "DIR"
  23.  
  24. [ -f /tmp/psmindex ] && {
  25.     . /tmp/psmindex
  26.     case ${PSMINDEX} in
  27.         0) DIR=""
  28.            OTHERS="compaq mps cbus"
  29.            ;;
  30.         1) DIR=compaq
  31.            OTHERS="mps cbus"
  32.            ;;
  33.         2) DIR=mps
  34.            OTHERS="compaq cbus"
  35.            ;;
  36. #        3) DIR=abon
  37. #           OTHERS="mps compaq cbus"
  38. #           ;;
  39. #        3) DIR=""
  40. #           OTHERS="compaq mps cbus"
  41. #           PSMFLOP=TRUE
  42. #           ;;
  43.         3) DIR=cbus
  44.            OTHERS="compaq mps"
  45.            ;;
  46.         4) DIR=cbus
  47.            OTHERS="compaq mps"
  48.            ;;
  49.         5) DIR=cbus
  50.            OTHERS="compaq mps"
  51.            ;;
  52.         6) DIR=""
  53.            OTHERS="compaq mps cbus"
  54.            PSMFLOP=TRUE
  55.     esac
  56. }
  57.  
  58.  
  59. # The following commented code block represents how support for Tricord,
  60. # Corollary, Olivetti, Acer and AST Manhattan SMP systems were
  61. # supported in UW2.1.  Left in case we add any of them back in for
  62. # Gemini later.
  63.  
  64. #[ -f /tmp/psmindex ] && {
  65. #    . /tmp/psmindex
  66. #    case ${PSMINDEX} in
  67. #        0) DIR=""
  68. #           OTHERS="compaq mps tricord cbus ast olivetti acer"
  69. #           ;;
  70. #        1) DIR=compaq
  71. #           OTHERS="mps tricord cbus ast olivetti acer"
  72. #           ;;
  73. #        2) DIR=mps
  74. #           OTHERS="compaq tricord cbus ast olivetti acer"
  75. #           ;;
  76. #        3) DIR=tricord
  77. #           OTHERS="compaq mps cbus ast olivetti acer"
  78. #           ;;
  79. #        4) DIR=cbus
  80. #           OTHERS="compaq mps tricord ast olivetti acer"
  81. #           ;;
  82. #        5) DIR=cbus
  83. #           OTHERS="compaq mps tricord ast olivetti acer"
  84. #           ;;
  85. #        6) DIR=cbus
  86. #           OTHERS="compaq mps tricord ast olivetti acer"
  87. #           ;;
  88. #        7) DIR=ast
  89. #           OTHERS="compaq mps tricord cbus olivetti acer"
  90. #           ;;
  91. #        8) DIR=olivetti
  92. #           OTHERS="compaq mps tricord cbus ast acer"
  93. #           ;;
  94. #        9) DIR=acer
  95. #           OTHERS="compaq mps tricord cbus ast olivetti"
  96. #           ;;
  97. #        10) DIR=""
  98. #           OTHERS="compaq mps tricord cbus ast olivetti acer"
  99. #           PSMFLOP=TRUE
  100. #    esac
  101. #}
  102.  
  103.  
  104. FAILURE=1
  105. TMP=/tmp/osmp.err
  106. rm -f ${TMP}
  107.  
  108. do_install() {
  109.     MOD=$1
  110.     cd /tmp/${MOD}
  111.     /etc/conf/bin/idinstall -k -P osmp -a ${MOD} 2>> ${TMP} ||
  112.     /etc/conf/bin/idinstall -k -P osmp -u ${MOD} 2>> ${TMP} || {
  113.     pfmt -s nostd -g ${PKGMSG}:2 "The installation of the %s package cannot be completed\nbecause of an error in the driver installation.\nThe file %s contains the errors.\n" ${NAME} ${TMP}
  114.     exit ${FAILURE}
  115.     }
  116.     
  117.     CONFIGURED_SOMETHING=TRUE
  118. }
  119.  
  120. #Install modules, but get list of files to removef before
  121. #doing the idinstall since it deletes the files
  122.  
  123. if [ -n "$DIR" ] 
  124. then
  125.     for i in ${DIR} ${OTHERS}
  126.     do
  127.       VOLATILES=`echo /tmp/$i /tmp/${i}/*`
  128.       removef osmp ${VOLATILES} >/dev/null 1>/dev/null 2>&1
  129.     done
  130.     do_install $DIR
  131. else
  132.     for i in ${OTHERS}
  133.     do
  134.       VOLATILES=`echo /tmp/$i /tmp/${i}/*`
  135.       removef osmp ${VOLATILES} >/dev/null 1>/dev/null 2>&1
  136.     done
  137. fi
  138.  
  139. #
  140. # Cleanup
  141. #
  142.  
  143. cd /
  144. rm -rf ${VOLATILES} 1>/dev/null 2>&1
  145.  
  146. removef -f osmp >/dev/null
  147. installf -f osmp >/dev/null
  148.  
  149. if [ "${CONFIGURED_SOMETHING}" = "TRUE" ]
  150. then
  151.     # always call idtype to set /etc/conf/cf.d/type if a PSM
  152.     # was configured
  153.     /etc/conf/bin/idtype mp 1>/dev/null 2>/dev/null
  154.  
  155.     # if /etc/inst/scripts/postreboot.sh doesn't exist, means 
  156.     # this is a non-boot flop installation of the package,
  157.     # so a kernel build is in order. Exit 10 so
  158.     # the need to reboot is flagged
  159.  
  160. #    [ ! -f /etc/inst/scripts/postreboot.sh ] && {
  161. #        /etc/conf/bin/idbuild 2>${TMP}
  162. #        [ "$?" != 0 ] && exit ${FAILURE}
  163. #        /etc/conf/bin/idbuild 2>${TMP}
  164. #        [ "$?" != 0 ] && exit ${FAILURE}
  165. #        
  166. #    }
  167.     /etc/conf/bin/idbuild 2>${TMP}
  168.     [ "$?" != 0 ] && exit ${FAILURE}
  169. fi
  170.  
  171. /usr/bin/ed /etc/conf/cf.d/deflist > /dev/null 2>&1 << EOT
  172. s/-DUNIPROC/-UUNIPROC/g
  173. w
  174. q
  175. EOT
  176.  
  177. # OSMP package leaves osmp.post.sh in /tmp for ISL.
  178. # Check for PSMFLOP=FALSE and remove osmp.post.sh
  179. # since there is no need for ISL to run the script.
  180. # osmp.post.sh will prompt for insertion of the PSM floppy.
  181.  
  182. if [ "${PSMFLOP}" != "TRUE" ]
  183. then
  184.     rm -f /tmp/osmp.post.sh 1>/dev/null 2>&1
  185. fi
  186.  
  187. # configure the processor manager GUI
  188. #
  189. GUI=psrsetup
  190. ADMINLIB=/usr/lib/scoadmin/$GUI
  191. /usr/bin/scoadmin -v -p Hardware -f -c $ADMINLIB/"$GUI".obj
  192. /sbin/osaconf -a sco "$GUI"Osa LOOP_BACK sco_Tcl_osa $ADMINLIB/"$GUI"Osa
  193. /sbin/classconf -a sco "$GUI" "$GUI"Osa
  194.  
  195.  
  196. exit 10 # notify that idbuild is necessary!
  197.