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

  1. #ident    "@(#)request    1.3"
  2. #ident    "$Header: $"
  3.  
  4. #    
  5. #    STREAMware TCP
  6. #    Copyright 1987, 1993 Lachman Technology, Inc.
  7. #    All Rights Reserved.
  8. #    
  9. #
  10. #  Main routine
  11. #  
  12.  
  13.  
  14. # There are three scenarious in which this script will run:
  15. #
  16. # $HOW_INSTALL=
  17. #
  18. # (a) ON_BFLOP:         it is called from foundation set installation on the
  19. #                       boot floppies.
  20. #
  21. # (b) POSTREBOOT:       it is called upon reboot from set installation on the
  22. #                       boot floppies.
  23. #
  24. # (c)NORMAL:            it is called from pkgadd'ing the individual package
  25. #                       or from the network set installation.
  26.  
  27. TTY=/dev/tty
  28. HOW_INSTALL=NORMAL
  29. #  The following HOW_INSTALL clauses are order dependent
  30.  
  31. # We are rebooting after fnd set installation if the script
  32. # /etc/rc2.d/S02POSTINST exists
  33. [ -f /etc/rc2.d/S02POSTINST ] && {
  34.         HOW_INSTALL=POSTREBOOT
  35.         TTY=/dev/console
  36. }
  37.  
  38. # We are in foundation set installation on the boot floppies if:
  39. # the script /etc/inst/scripts/postreboot.sh exists
  40. [ -f /etc/inst/scripts/postreboot.sh ] && {
  41.         HOW_INSTALL=ON_BFLOP
  42. }
  43.  
  44. [ "$HOW_INSTALL" = "ON_BFLOP" ] || {
  45.     exec >${TTY}
  46.     exec 2>${TTY}
  47.     exec <${TTY}
  48. }
  49.  
  50. #
  51. #  Make sure LANG environment variable is set.  If it's not set
  52. #  coming in to this request script, then default to the C-locale.
  53. #
  54. [ ${LANG} ] || LANG="C"
  55. export LANG
  56.  
  57. SCRIPTS=/usr/sbin/pkginst
  58. . ${SCRIPTS}/updebug
  59. [ "$UPDEBUG" = YES ] && set -x
  60.  
  61. MENU_RESP=$1
  62. if [ "${MENU_RESP}" = "" ]
  63. then
  64.         echo No response file given.  Usage: $0 response-file
  65.         exit 1
  66. fi
  67.  
  68. ############# Begin UPGRADE AND OVERLAY #######################
  69.  
  70. [ "$UPDEBUG" = YES ] && goany
  71.  
  72. export PKGINSTALL_TYPE AUTOMERGE
  73.  
  74. PKGINSTALL_TYPE=NEWINSTALL
  75.  
  76. $SCRIPTS/chkpkgrel
  77.  
  78. case $? in
  79.     0)    PKGINSTALL_TYPE=NEWINSTALL    ;;
  80.     2)    PKGINSTALL_TYPE=OVERLAY    ;;
  81.     4)    PKGINSTALL_TYPE=UPGRADE    ;;
  82.     6)    PKGINSTALL_TYPE=UPGRADE2    ;;
  83.     *)    ;;
  84. esac
  85.  
  86. [ "$UPDEBUG" = "YES" ] && goany
  87. [ "$PKGINSTALL_TYPE" = "NEWINSTALL" ] || AUTOMERGE=Yes
  88. [ "$HOW_INSTALL" = "NORMAL" ] || AUTOMERGE=Yes
  89.  
  90. export PKGINSTALL_TYPE AUTOMERGE
  91.  
  92. ############# End  UPGRADE AND OVERLAY #######################
  93.  
  94.  
  95. #
  96. #  Do we have OA&M Package installed?
  97. #
  98. `pkginfo -i oam > /dev/null 2>&1`
  99. USE_OAM=$?
  100. OAM=YES
  101. [ "${USE_OAM}" != "0" ] && OAM="NO"
  102.  
  103. #
  104. # Are we installing oam now...if so then set OAM...
  105. #
  106. for i in $PKGLIST
  107. do
  108.     case $i in
  109.     oam)        OAM=YES;;
  110.     esac
  111. done
  112.  
  113. export OAM
  114.     
  115. [ "$UPDEBUG" = YES ] && goany
  116.  
  117. #
  118. # set CLASSES to contain OAMadmin IFF
  119. # the packages oam are installed, respectively.
  120. #
  121. unset CLASSES
  122. CLASSES="none build save"
  123. [ "${OAM}" = "YES" ] && CLASSES=${CLASSES}" OAMadmin"
  124.  
  125. #
  126. # include "upgrade" class if we are doing an upgrade..
  127. #
  128. [ "${PKGINSTALL_TYPE}" = "UPGRADE" ] || [ "${PKGINSTALL_TYPE}" = "UPGRADE2" ] && CLASSES=${CLASSES}" upgrade"
  129.  
  130. #
  131. # this file should have been created by nics...if it is not there
  132. # then create it..
  133. #
  134. [ -d /etc/inst/nics ] || mkdir /etc/inst/nics
  135. if [ ! -f /etc/inst/nics/nics.map ]
  136. then
  137.     cat <<-!EOF! > /etc/inst/nics/nics.map
  138.     imx586     imx586
  139.     ee16       ee16
  140.     ie6        TCM503
  141.     el16       TCM507
  142.     el3        TCM5X9
  143.     3c523      TCM523
  144.     el2mca     TCM523
  145.     wd         SMC8K
  146.     SMC8000    SMC8K
  147.     ne1000     NE1000
  148.     ne2100     NE2100
  149.     ne2000     NE2000
  150.     ne2_32     NE2
  151.     am1500     NE1500T
  152.     am1500t    NE1500T
  153.     ne1500t    NE1500T
  154.     ntr2000    NTR2000
  155.     token      IBM164
  156.     eltoken    IBM164
  157.     nflxe      nflxe
  158.     nflxt      nflxt
  159.     pnt        pnt
  160.     !EOF!
  161. fi
  162.  
  163. #
  164. # If we're doing fnd set installation, save HOW_INSTALL in MENU_RESP so that
  165. # postinstall knows how it is being invoked. Then copy this request script
  166. # and the postinstall script into /etc/inst/scripts
  167. #
  168.  
  169. [ "${HOW_INSTALL}" = "ON_BFLOP" ] && {
  170.         echo "HOW_INSTALL=ON_BFLOP" >> ${MENU_RESP}
  171.     echo PKGINSTALL_TYPE=\"${PKGINSTALL_TYPE}\" >> ${MENU_RESP}
  172.         echo CLASSES=\"${CLASSES}\" >> ${MENU_RESP}
  173.         echo AUTOMERGE=\"${AUTOMERGE}\" >> ${MENU_RESP}
  174.         cp ${REQDIR}/request /etc/inst/scripts/inetrequest
  175.         cp ${REQDIR}/postinstall /etc/inst/scripts/inetpostinst
  176.         chmod +x /etc/inst/scripts/inet*
  177.         exit 0
  178. }
  179.  
  180. #
  181. # if nothing to install, exit w/ code 77 for pkging tools to exit gracefully.
  182. #
  183. [ "$CLASSES" ] || exit 77
  184.  
  185. echo CLASSES=\"${CLASSES}\" >> ${MENU_RESP}
  186.  
  187. ############# Begin  UPGRADE AND OVERLAY #######################
  188.  
  189. echo AUTOMERGE=\"${AUTOMERGE}\" >> ${MENU_RESP}
  190. echo PKGINSTALL_TYPE=\"${PKGINSTALL_TYPE}\" >> ${MENU_RESP}
  191. echo HOW_INSTALL=\"${HOW_INSTALL}\" >> ${MENU_RESP}
  192.  
  193. [ "$UPDEBUG" = YES ] && goany
  194.  
  195. ############# End  UPGRADE AND OVERLAY #######################
  196.  
  197. exit 0
  198.