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

  1. #ident  "@(#)postinstall    17.19    98/08/10"
  2. #copyright    "%c%"
  3. #!/usr/bin/sh
  4.  
  5. # Load Vars, and export any which child procs may need
  6. export BIN TTY UPD_INSTRM UPD_instrm UPD_INTRMED UPD_BKUPREST UPDMENUDIR UPDPKGDIR
  7.  
  8. UPDINST=${UPDPKGDIR}/install
  9. export UPDINST
  10.  
  11. [ -f /tmp/${PKGINST}.vars ] && . /tmp/${PKGINST}.vars
  12.  
  13. # Load RC Scripts.
  14. . ${UPDINST}/updpkg.rc
  15. unset UPDVARFILE
  16.  
  17. MenuLang
  18.  
  19. LogMsg "postinstall: `GetText STARTED`"
  20. DbgMsg "postinstall: STARTED"
  21. UPD_INSTRM="${UPD_INSTRM_i}"
  22. UPD_instrm="${UPD_instrm_i}"
  23. UPD_INSTRMED="${UPD_INSTRMED_i}"
  24. UPD_BKUPREST="${UPD_BKUPREST_i}"
  25. export UPD_INSTRM UPD_instrm UPD_INSTRMED UPD_BKUPREST
  26. unset UPD_INSTRM_i UPD_instrm_i UPD_INSTRMED_i UPD_BKUPREST_i
  27. unset UPD_INSTRM_r UPD_instrm_r UPD_INSTRMED_r UPD_BKUPREST_r
  28. DbgMsg "    UPD_INSTRM=${UPD_INSTRM}"
  29. DbgMsg "    UPD_instrm=${UPD_instrm}"
  30. DbgMsg "    UPD_INSTRMED=${UPD_INSTRMED}"
  31. DbgMsg "    UPD_BKUPREST=${UPD_BKUPREST}"
  32. DbgMsg "    ProcMsg=${ProcMsg}"
  33. DbgMsg "    GenericProcMsg=${GenericProcMsg}"
  34.  
  35. #
  36. # Define trap and trap command for interruption (delete key)
  37. # of the Update Installation.
  38. #
  39. TrapCmd ()
  40. {
  41.     MsgHandler 1 UpdIntrMsg
  42.     RmExit 3
  43. }
  44. trap 'TrapCmd' 2 3 15
  45.  
  46. #
  47. # Routine to delete all files which need to be deleted
  48. #
  49. DeleteFiles ()
  50. {
  51.     LogMsg "DeleteFiles: `GetText STARTED`"
  52.     DbgMsg "DeleteFiles: STARTED"
  53.  
  54.     #
  55.     # Delete files that should be deleted after
  56.     # installation is successful.  Directories
  57.     # to be deleted should follow their files
  58.     # to be deleted in Files.
  59.     #
  60.     ${BIN}/grep "^D" ${UPDINST}/Files |
  61.     while read key pkg type size file
  62.     do    for class in ${CLASSES}
  63.         do    [ "$class" = "$pkg" ] || continue
  64.             case "${type}" in
  65. #            d) ${BIN}/rmdir "${file}" && echo "${file}" ;;
  66. #            *) ${BIN}/rm "${file}" && echo "${file}" ;;
  67.             d) if ${BIN}/rmdir "${file}" 
  68.                then 
  69.                 echo "${file}" 
  70.                else 
  71.                 echo rmdir failed "${file}"
  72.                fi;;
  73.             *) if ${BIN}/rm "${file}" 
  74.                      then 
  75.                 echo "${file}" 
  76.                else 
  77.                 echo rm failed "${file}"
  78.                fi;;
  79.             esac >> ${UPDTMP}/DFiles.${pkg}
  80.         done
  81.     done 2>/dev/null
  82.  
  83.     #
  84.     # Update the software installation
  85.     # database for the deleted files.
  86.     #
  87.     for pkg in ${CLASSES}
  88.     do    [ -s ${UPDTMP}/DFiles.${pkg} ] && {
  89.             RemoveF ${pkg} ${UPDTMP}/DFiles.${pkg}
  90.             RemoveFClose ${pkg}
  91.         }
  92.         ${BIN}/rm -f ${UPDTMP}/DFiles.${pkg}
  93.     done
  94.  
  95.     unset pkg class
  96.     LogMsg "DeleteFiles: `GetText COMPLETED`"
  97.     DbgMsg "DeleteFiles: COMPLETED"
  98.     return 0
  99. }
  100.  
  101. #
  102. # Point to temporary work directory.
  103. #
  104. UPDTMP=/tmp/${PKGINST}
  105. export UPDTMP
  106. DbgMsg "    UPDTMP=${UPDTMP}"
  107. > ${UPDTMP}/installf
  108.  
  109. ################################################
  110. # define any uw7rs specific functions here BEGIN
  111. ################################################
  112.  
  113. # networking tlibs in scoadm package
  114. SCOADM="/usr/lib/netadm"
  115.  
  116. # networking tlibs in inet package
  117. INET="/usr/lib/scoadmin/ncm/hosts /usr/lib/scoadmin/ncm/dns /usr/lib/scoadmin/ncm/main /usr/lib/scoadmin/ncm/nis /usr/lib/scoadmin/ncm/ntp"
  118.  
  119. for FILE in $INET $SCOADM
  120. do
  121.     [ -f $FILE.tlib ] && /bin/touch $FILE.tlib
  122.     [ -f $FILE.tndx ] && /bin/touch $FILE.tndx
  123. done
  124.  
  125. # datestamp tcl.tndx later than tcl.tlib
  126. TCL_PATH=/usr/lib/tclX7.6.0
  127. touch ${TCL_PATH}/tcl.tndx 
  128.  
  129. # datestamp vtcl.tndx later than vtcl.tlib
  130. VTCL_PATH=/usr/lib/vtcl
  131. touch ${VTCL_PATH}/vtcl.tndx
  132.  
  133.  
  134. ################################################
  135. # define any uw7rs-specific functions here END
  136. ################################################
  137.  
  138. ################################################
  139. # Update 1 specific functions BEGIN here
  140. ################################################
  141.  
  142.  
  143. # ul98-16307 alexma (Xenix removal)
  144. # remove by hand those Xenix files which don't exist in the contents file
  145. rm -f /usr/bin/restore /usr/sbin/restore /sbin/restore /usr/bin/backup /usr/sbin/backup  > /dev/null 2>&1
  146. DbgMsg " postinstall: Xenix restore and backup files deleted."
  147. # ul98-16307
  148.  
  149. # ul98-02137 andrewma/donaldp
  150. [ -f /usr/lib/scoadmin/account/account.tlib ] && {
  151. /sbin/osaconf -A sco accountOsa LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
  152. /sbin/osaconf -A sco accounts LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
  153. /sbin/osaconf -A sco groupOsa LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
  154. /sbin/osaconf -A sco groups LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
  155. DbgMsg " SCOadmin object service agents have been registered with osaconf (account.tlib)"
  156. }
  157.  
  158. # ul98-14106 anurags start
  159. [ -d /usr/lib/scoadmin/hotplug/hotplug.obj ] && {
  160.     if /usr/bin/scoadmin -p Hardware -f -c /usr/lib/scoadmin/hotplug/hotplug.obj
  161.     then
  162.         DbgMsg "scoadmin -f -c of hotplug successful"
  163.     else
  164.         DbgMsg "scoadmin -f -c of hotplug failed"
  165.     fi
  166. }
  167. # ul98-14106 end
  168.  
  169. # ul98-06811a0 kd start
  170. cp /sbin/rc1 /usr/sbin/rc1
  171. installf base /usr/sbin/rc1
  172. installf -f base
  173. DbgMsg "postinstall for ul98-06811a0 done"
  174. # ul98-06811a0 kd end
  175.  
  176. # PTF 7002 specific postinstall function start
  177. # edit the mpio depend file - change first field from R to P and add ident line
  178. [ -f /var/sadm/pkg/mpio/install/depend ] && {
  179.    sed "s/^R/P/" /var/sadm/pkg/mpio/install/depend > /var/sadm/pkg/mpio/install/depend_tmp
  180.    sed '1i\
  181. #ident  "@(#)pkg.mpio:depend    1.1.1.2"' /var/sadm/pkg/mpio/install/depend_tmp > /var/sadm/pkg/mpio/install/depend
  182.    rm /var/sadm/pkg/mpio/install/depend_tmp
  183.    DbgMsg "postinstall: /var/sadm/pkg/mpio/install/depend file has been manipulated for PTF7002"
  184. }
  185. # PTF 7002 specific postinstall function end
  186.  
  187. # edit the file /etc/conf/init.d/kernel to add an entry for /etc/scsi/sdistatic
  188. # after the entry for ckroot.
  189. # ul98-15517 rene
  190. file=/etc/conf/init.d/kernel
  191. cp $file $file.new
  192. ed - $file.new <<-'!'
  193.     /^[^:]*::sysinit:\/sbin\/ckroot/a
  194.     pdi0::sysinit:/etc/scsi/sdistatic -B >/dev/sysmsg 2>&1
  195.     .
  196.     w
  197.     q
  198.     !
  199. mv $file.new $file
  200. DbgMsg "postinstall: entry for /etc/scsi/sdistatic added to /etc/conf/init.d/kernel"
  201.  
  202. # PTF 7003 specific postinstall function start
  203. # Create the /etc/.snum file, empty, required for Oracle 7
  204. > /etc/.snum
  205. chown root:sys /etc/.snum
  206. chmod 444 /etc/.snum
  207. installf ${PKGINST} /etc/.snum f 444 root sys > /dev/null 2>&1
  208. installf -f ${PKGINST} > /dev/null 2>&1
  209. DbgMsg "postinstall for PTF7003, empty /etc/.snum created"
  210. # PTF7003 postinstall specific functions end
  211.  
  212.  
  213. # PTF7011 postinstall specific function start
  214. # Check whether the dlpi driver is in the kernel already and if so
  215. # idinstall the new dlpi driver
  216.  
  217. [ -f /etc/conf/pack.d/dlpi/Driver.o ] && {
  218.     cd /etc/inst/nd/dlpi
  219.     if ${CONFBIN}/idinstall -u -k dlpi 
  220.     then
  221.         DbgMsg "idinstall of new dlpi driver into the linkkit"
  222.     else
  223.          DbgMsg "DLPI Driver installation failed"
  224.     fi
  225. }
  226. # PTF7011 postinstall specific function end
  227.  
  228. # ul98-11502a0 postinstall specific function start
  229. # Check whether the dlpibase driver is in the kernel already and if so
  230. # idinstall the new dlpibase driver
  231.  
  232. [ -f /etc/conf/pack.d/dlpibase/Driver_atup.o ] && {
  233.     cd /etc/inst/nd/dlpibase
  234.     if ${CONFBIN}/idinstall -u -k dlpibase 
  235.     then
  236.         DbgMsg "idinstall of new dlpibase driver into the linkkit"
  237.     else
  238.      DbgMsg "DLPIbase Driver installation failed"
  239.     fi
  240. }
  241. # ul98-11502a0 postinstall specific function end
  242.  
  243. # ul97-16935a1 start
  244. if `/bin/pkginfo inet >/dev/null 2>&1`
  245. then
  246.     /bin/touch /usr/lib/scoadmin/ncm/hosts.tndx
  247.     /bin/touch /usr/lib/scoadmin/ncm/dns.tndx
  248.     /bin/touch /usr/lib/scoadmin/ncm/main.tndx
  249.     /bin/touch /usr/lib/scoadmin/ncm/nis.tndx
  250.     /bin/touch /usr/lib/scoadmin/ncm/ntp.tndx
  251. fi
  252.  
  253. if `/bin/pkginfo ppp >/dev/null 2>&1`
  254. then
  255.     /bin/touch /usr/lib/ppp/pppadm.tndx
  256. fi
  257. DbgMsg "postinstall for ul97-16935a1 done - touch /usr/lib/scoadmin/ncm/*.tndx"
  258. # ul97-16935a1 end
  259.  
  260. # ul98-11806 start
  261. if `/bin/pkginfo inet >/dev/null 2>&1`
  262. then
  263.     /bin/touch /usr/lib/osa.tlib
  264.     /bin/touch /usr/lib/osa.tndx
  265. fi
  266. DbgMsg "postinstall for ul98-11806 done - touch /usr/lib/osa.tndx & osa.tlib"
  267. # end ul98-11806
  268.  
  269. # fixes ul98-04801 start
  270. if `/bin/pkginfo ppp >/dev/null 2>&1`
  271. then
  272.    PPPFILES="/usr/lib/ppp/psm/pred1_rt.so  /usr/lib/ppp/psm/pred1_parse.so \
  273.    /usr/lib/ppp/psm/ppppred1Osa"
  274.    for f in $PPPFILES
  275.    do
  276.  
  277.     if [ -f $f ]
  278.     then
  279.         removef ppp $f > /dev/null 2>&1
  280.         rm -f $f
  281.         DbgMsg "postinstall for ul98-04801, $f removed"
  282.     fi
  283.    done
  284.    removef -f ppp
  285. fi
  286.  
  287. [ -f /etc/conf/pack.d/pred1/Driver.o ] && {
  288.         if ${CONFBIN}/idinstall -d pred1 >/dev/null 2>&1
  289.         then
  290.                 DbgMsg "idinstall -d of pred1 driver"
  291.         else
  292.              DbgMsg "idinstall -d of pred1 driver failed"
  293.         fi
  294. }
  295. # fixes ul98-04801 end
  296.  
  297. # ul98-08202a1 start
  298. CLASSCONF=/sbin/classconf
  299. ${CLASSCONF} -A sco dhcp dhcpOsa
  300. ${CLASSCONF} -A sco dhcpOptionVendorClass dhcpOsa
  301. DbgMsg "postinstall of ul98-08202a1 done"
  302. # ul98-08202a1 end
  303.  
  304. # fix acp links
  305. ${BIN}/ln -f /usr/bin/ls /usr/bin/lx >/dev/null 2>&1
  306. ${BIN}/ln -f /usr/bin/ls /usr/bin/l >/dev/null 2>&1
  307. ${BIN}/ln -f /usr/bin/ls /usr/bin/lc >/dev/null 2>&1
  308. ${BIN}/ln -f /usr/bin/ls /usr/bin/lf >/dev/null 2>&1
  309. ${BIN}/ln -f /usr/bin/ls /usr/bin/lr >/dev/null 2>&1
  310. ################################################
  311. # Update 1 specific functions END here
  312. ################################################
  313.  
  314. if [ "$SILENT_INSTALL" != "true" ]
  315. then
  316.     #
  317.     # Display working menu
  318.     #
  319.     DbgMsg "  UPD_POSTINSTALL_MSG=${UPD_POSTINSTALL_MSG}"
  320.     DbgMsg "  postinstall: Display working menu at 0%"
  321.     WorkMenu "${UPD_POSTINSTALL_MSG}" 0
  322.  
  323.     DbgMsg "  postinstall: Display working menu at 5%"
  324.     WorkMenu "" 5
  325.  
  326.     DbgMsg "  postinstall: Display working menu at 10%"
  327.     WorkMenu "" 10
  328.  
  329.  
  330.     DbgMsg "  postinstall: Display working menu at 15%"
  331.     WorkMenu "" 15
  332. fi
  333.  
  334. #
  335. # Merge the Master files
  336. #
  337. DbgMsg "  postinstall: merge the master files"
  338. if [ -d ${UPDTMP}/mdevice ]
  339. then
  340.     cd ${UPDTMP}/mdevice
  341.     for file in *
  342.     do
  343.         if [ -f /etc/conf/mdevice.d/${file} ]
  344.         then
  345.             DbgMsg "  preinstall: merge on /etc/conf/mdevice.d/${file}"
  346.             DbgMsg "    ORIG ${file} BEFORE START:"
  347.             DbgAddFile ${file}
  348.             DbgMsg "    ORIG BEFORE END"
  349.             DbgMsg "    NEW ${file} BEFORE START:"
  350.             DbgAddFile /etc/conf/mdevice.d/${file}
  351.             DbgMsg "    NEW BEFORE END"
  352.             oldlin=`${BIN}/cat ${file} | ${BIN}/grep "^${file}"`
  353.             newlin=`${BIN}/cat /etc/conf/mdevice.d/${file} | ${BIN}/grep "^${file}"`
  354.             mname="`echo ${newlin} | ${BIN}/cut -d' ' -f1`"
  355.             mpref="`echo ${newlin} | ${BIN}/cut -d' ' -f2`"
  356.             mchar="`echo ${newlin} | ${BIN}/cut -d' ' -f3`"
  357.             mordr="`echo ${oldlin} | ${BIN}/cut -d' ' -f4`"
  358.             mbmaj="`echo ${oldlin} | ${BIN}/cut -d' ' -f5`"
  359.             mcmaj="`echo ${oldlin} | ${BIN}/cut -d' ' -f6`"
  360.             while read inlin
  361.             do
  362.                 DbgMsg "    '${mname}':'${inlin}'?"
  363.                 if [ "`echo ${inlin} | ${BIN}/cut -d' ' -f1`" = "${mname}" ]
  364.                 then
  365.                     echo "${mname}    ${mpref}    ${mchar}    ${mordr}    ${mbmaj}    ${mcmaj}"
  366.                 else
  367.                     echo "${inlin}"
  368.                 fi
  369.             done < /etc/conf/mdevice.d/${file} > ${file}.new
  370.             ${BIN}/mv -f ${file}.new /etc/conf/mdevice.d/${file} >/dev/null 2>&1
  371.             DbgMsg "    MERGED ${file} START:"
  372.             DbgAddFile /etc/conf/mdevice.d/${file}
  373.             DbgMsg "    MERGED END"
  374.         fi
  375.     done
  376.     unset file inlin oldlin newlin mname pref mchar mordr mbmaj mcmaj
  377.     cd /
  378. else
  379.     DbgMsg "  postinstall: no mdevice files to merge"
  380. fi
  381. ${BIN}/rm -rf ${UPDTMP}/mdevice
  382.  
  383. if [ "$SILENT_INSTALL" != "true" ]
  384. then
  385.     DbgMsg "  postinstall: Display working menu at 20%"
  386.     WorkMenu "" 20
  387. fi
  388.  
  389. DbgMsg "  postinstall: exec DeleteFiles"
  390. DeleteFiles
  391.  
  392. # ul98-16307 alexma, Xenix removal
  393. # /etc/conf/pack.d/{xnamfs,i286x,XENIX} directories should have been removed
  394. # by the DeleteFiles function above. However, mod_reg files may be left lying
  395. # around from idbuild. If so, delete and remove directories manually.
  396.  
  397. # xnamfs seems to associated with both base and acp package. To make it
  398. # disappear, do removef for both packages.
  399. # Also, the link for /etc/xinstall=/sbin/xinstall doesn't want to
  400. # disappear so do it manually as well.
  401.  
  402. XDIR_LIST="xnamfs i286x XENIX"
  403. removef base /etc/conf/pack.d/xnamfs >/dev/null 2>&1
  404. removef -f base >/dev/null 2>&1
  405. for i in ${XDIR_LIST} 
  406. do
  407.     if [ -d /etc/conf/pack.d/${i} ]
  408.     then
  409.         rm -rf /etc/conf/pack.d/${i} >/dev/null 2>&1
  410.         removef acp /etc/conf/pack.d/${i} >/dev/null 2>&1
  411.         DbgMsg " postinstall: /etc/conf/pack.d/${i} directory removed manually"
  412.     fi
  413. done
  414. removef acp /etc/xinstall >/dev/null 2>&1
  415. removef acp /usr/sbin/xinstall >/dev/null 2>&1
  416. removef -f acp >/dev/null 2>&1
  417.  
  418. # ul98-16307 end
  419.  
  420.  
  421. if [ "$SILENT_INSTALL" != "true" ]
  422. then
  423.     DbgMsg "  postinstall: Display working menu at 25%"
  424.     WorkMenu "" 25
  425.  
  426.     DbgMsg "  postinstall: Display working menu at 30%"
  427.     WorkMenu "" 30
  428.  
  429.     DbgMsg "  postinstall: Display working menu at 35%"
  430.     WorkMenu "" 35
  431. fi
  432.  
  433. #
  434. # Tidy up the /tmphba kludge
  435. #
  436. #I2OOSM_LIST="pkginfo pkgmap root/tmp/hbacpio.z root/tmp/i2oOSM/Drvmap \
  437. #       root/tmp/i2oOSM/Master root/tmp/i2oOSM/System root/tmp/i2oOSM/modcpio.z"
  438. #
  439. #for i in ${I2OOSM_LIST}
  440. #do
  441. #        removef ${PKGINST} /tmphba/hbaflop/i2oOSM/${i} >/dev/null 2>&1
  442. #        DbgMsg " postinstall: /tmphba/hbaflop/i2oOSM/${i} file removef'd"
  443. #done
  444. #removef -f ${PKGINST} >/dev/null 2>&1
  445. #
  446. #if [ "$ISL_INSTALL" != "true" ]
  447. #then
  448. #        DbgMsg " postinstall: /tmphba removed manually"
  449. #        rm -rf /tmphba >/dev/null 2>&1
  450. #fi
  451.  
  452. #
  453. # For the temp files installed in /usr/lib/tmp and /usr/ccs/lib/tmp,
  454. # move the new ones in place (do not copy, running programs would
  455. # core dump).  Make sure these directories are the same as the
  456. # ones in the postremove script.
  457. #
  458. TempFiles=""
  459. DbgMsg "  postinstall: installing files from /usr/lib/tmp and /usr/ccs/lib/tmp"
  460. for file in /usr/lib/tmp/* /usr/ccs/lib/tmp/* 
  461. do
  462.     if [ -f "${file}" ]
  463.     then
  464.         orig=`echo ${file} | ${BIN}/sed 's%/tmp/%/%'`
  465.         DbgMsg "    installing ${orig}"
  466.         ${BIN}/mv -f ${file} ${orig} >/dev/null 2>&1
  467.         rc=${?}
  468.         DbgMsg "        mv to lib rc=${rc}"
  469.         TempFiles="${TempFiles} ${orig}"
  470.         GetPerms ${orig}
  471.         . ${UPDTMP}/perms
  472.         echo "${orig} f ${perm} ${own} ${grp}" >> ${UPDTMP}/installf
  473.     fi
  474. done
  475. unset file orig rc perm own grp
  476. ${BIN}/rm -rf ${UPDTMP}/perms
  477. [ -d /usr/lib/tmp ] && RemoveTemps /usr/lib/tmp
  478. [ -d /usr/ccs/lib/tmp ] && RemoveTemps /usr/ccs/lib/tmp
  479. DbgMsg "  postinstall: tmp files from /usr/ccs/tmp and /usr/lib/tmp installed."
  480. DbgMsg "  postinstall: TempFiles=${TempFiles}"
  481.  
  482.  
  483. if [ "$SILENT_INSTALL" != "true" ]
  484. then
  485.     DbgMsg "  postinstall: Display working menu at 45%"
  486.     WorkMenu "" 45
  487. fi
  488.  
  489. #
  490. # Make any links to the files just moved in.
  491. #
  492. if [ "$ISL_INSTALL" = "true" ]
  493. then
  494.         echo "## Processing links." >&2
  495. fi
  496.  
  497. DbgMsg "  postinstall: relinking tmp files and removing old tmp files"
  498. for file in ${TempFiles}
  499. do
  500.     case "${file}" in
  501.     /usr/lib/libsocket.so)
  502.         DbgMsg "  postinstall: special processing for libsocket.so"
  503.         ${BIN}/ln -f /usr/lib/libsocket.so /usr/lib/libsocket.so.1 >/dev/null 2>&1
  504.         ${BIN}/ln -f /usr/lib/libsocket.so /usr/lib/libsocket.so.2 >/dev/null 2>&1
  505.         echo "/usr/lib/libsocket.so.1=/usr/lib/libsocket.so l"
  506.         echo "/usr/lib/libsocket.so.2=/usr/lib/libsocket.so l"
  507.         ;;
  508.     /usr/lib/libresolv.so)
  509.         DbgMsg "  postinstall: special processing for libresolv.so"
  510.         ${BIN}/ln -f /usr/lib/libresolv.so /usr/lib/libresolv.so.2 >/dev/null 2>&1
  511.         echo "/usr/lib/libresolv.so.2=/usr/lib/libresolv.so l"
  512.         ;;
  513.     /usr/lib/libnsl_i.so)
  514.  
  515. # ul98-05506
  516. # check for pkginfo of "crypt" package 
  517. # if crypt is installed or installing on BL15.3v1s, then print 
  518. # warning message that libnsl has been overwritten (see part2 below)
  519.         ${BIN}/ln -f /usr/lib/libnsl_i.so /usr/lib/libnsl.so >/dev/null 2>&1
  520.         ${BIN}/ln -f /usr/lib/libnsl_i.so /usr/lib/libnsl.so.1 >/dev/null 2>&1
  521.         DbgMsg "postinstall for ul98-05506, libnsl links made"
  522. # end ul98-05506
  523.                 echo "/usr/lib/libnsl.so=/usr/lib/libnsl_i.so l"
  524.                 echo "/usr/lib/libnsl.so.1=/usr/lib/libnsl.so l"
  525.         ;;
  526.     *)
  527.         DbgMsg "  postinstall: getting contents entries for ${file}"
  528.         ${BIN}/grep "=${file} l " /var/sadm/install/contents |
  529.         while read line
  530.         do
  531.             link="`echo $line | ${BIN}/cut -d'=' -f1`"
  532.             ${BIN}/ln -f ${file} ${link} >/dev/null 2>&1
  533.             echo "${link}=${file} l"
  534.             DbgMsg " postinstall: link=${link}, file=${file}"
  535.         done
  536.         ;;
  537.     esac
  538. done >> ${UPDTMP}/installf
  539. unset file line TempFiles perm own grp
  540.  
  541.  
  542. if [ "$SILENT_INSTALL" != "true" ]
  543. then
  544.     DbgMsg "  postinstall: Display working menu at 50%"
  545.     WorkMenu "" 50
  546.  
  547.     DbgMsg "  postinstall: Display working menu at 55%"
  548.     WorkMenu "" 55
  549.     
  550.     DbgMsg "  postinstall: Display working menu at 60%"
  551.     WorkMenu "" 60
  552.     
  553.     DbgMsg "  postinstall: Display working menu at 65%"
  554.     WorkMenu "" 65
  555.     
  556.     DbgMsg "  postinstall: Display working menu at 70%"
  557.     WorkMenu "" 70
  558.  
  559.     DbgMsg "  postinstall: Display working menu at 75%"
  560.     WorkMenu "" 75
  561.  
  562.     DbgMsg "  postinstall: Display working menu at 80%"
  563.     WorkMenu "" 80
  564.  
  565.     DbgMsg "  postinstall: Display working menu at 85%"
  566.     WorkMenu "" 85
  567.  
  568.     DbgMsg "  postinstall: Display working menu at 90%"
  569.     WorkMenu "" 90
  570. fi
  571.  
  572.  
  573. #
  574. # Remove and add Update information to the
  575. # installation software database as needed.
  576. #
  577.  
  578. if [ "$ISL_INSTALL" = "true" ]
  579. then
  580.         echo "## Updating the software installation database." >&2
  581. fi
  582.  
  583. ${BIN}/sort -u ${UPDTMP}/installf |
  584.     ${USBIN}/installf ${PKGINST} - >/dev/null 2>&1
  585. DbgMsg "  postinstall: run ${USBIN}/removef -f ${PKGINST}"
  586. ${USBIN}/removef -f ${PKGINST} >/dev/null 2>&1
  587. DbgMsg "  postinstall: run ${USBIN}/installf -f ${PKGINST}"
  588. ${USBIN}/installf -f ${PKGINST} >/dev/null 2>&1
  589.  
  590. if [ "$SILENT_INSTALL" != "true" ]
  591. then
  592.     DbgMsg "  postinstall: Display working menu at 95%"
  593.     WorkMenu "" 95
  594. fi
  595.  
  596.  
  597. #
  598. # Markup updated packages
  599. #
  600. EXITRC=0
  601. for pkg in ${CLASSES}
  602. do
  603.     case ${pkg} in
  604.     merge)    for pkg in merge demerge esmerge frmerge itmerge jamerge
  605.         do    [ -d /var/sadm/pkg/${pkg} ] &&
  606.             > /var/sadm/pkg/${pkg}/${PKGINST}
  607.         done
  608.         ;;
  609.     nwsrvr)    for pkg in nwsrvr nwsrvrJ
  610.         do    [ -d /var/sadm/pkg/${pkg} ] &&
  611.             > /var/sadm/pkg/${pkg}/${PKGINST}
  612.         done
  613.         ;;
  614. acp|base|cmds|compaq|inet|kdb|ls|nfs|nics|nsu|nuc|nwnet|osmp|rpc|vxfs|vxvm)
  615.         # those packages include updates to /etc/conf
  616.         EXITRC=10    # please reboot
  617.         > /var/sadm/pkg/${pkg}/${PKGINST}
  618.         ;;
  619.     *)    [ -d /var/sadm/pkg/${pkg} ] &&
  620.         > /var/sadm/pkg/${pkg}/${PKGINST}
  621.         ;;
  622.     esac
  623. done
  624.  
  625. #
  626. # Postinstall script addition from u701p2
  627. # Mail: conversion of sendmail.cf to current version
  628. #     add charsetlist variable to mailx.rc
  629. #       add sticky bit to /var/mail
  630. #       MR's ul96-24714 and ul97-14212
  631. #
  632. /etc/mail/convertcf /etc/sendmail.cf
  633. if [ -f /etc/mail/mailx.rc ]
  634. then
  635.         cp /etc/mail/mailx.rc /etc/mail/mailx.rc.bak
  636. fi
  637. echo '# mapping of charsets to translation dlls' >> /etc/mail/mailx.rc
  638. echo 'set charsetlist="ISO-2022-JP,/etc/mail/charset/jis.dll"' >> /etc/mail/mailx.rc
  639. chmod 1777 /var/mail
  640.  
  641. #
  642. # Postinstall script for man command
  643. #     - save /etc/default/man as /etc/default/man.bak
  644. #     - add /usr/lib/scohelp/%L/man: to MANPATH
  645. #     - change PAGER=/usr/bin/more to PAGER=/usr/bin/pg
  646. #     - MR's ul98-21508
  647. #
  648. config_file=/etc/default/man
  649. temp_file=/tmp/man.0001
  650. if [ -f $config_file ]
  651. then
  652.         cp /etc/default/man /etc/default/man.bak
  653.         sed -e 's!PAGER=.*.$!PAGER=/usr/bin/pg!' $config_file | \
  654.         sed 's!MANPATH=!MANPATH=/usr/lib/scohelp/%L/man:!g' > $temp_file
  655.         mv $temp_file $config_file
  656. fi
  657.  
  658.  
  659. #
  660. # Postinstall script addition from update701
  661. # Scohelp: start up scohelp server after scohelp packaging
  662. #          files have been installed. The server will only
  663. #          start when doing a layered install, not at ISL
  664. #          time.
  665. #      MRs: ul98-13416 and ul98-03517 
  666. #       Preinstall stops the daemon, code moved there 7/13/98
  667. #
  668.  
  669. if [ "$ISL_INSTALL" = "true" ]
  670. then
  671.    
  672.    :
  673. else
  674.    if [ -x /etc/scohelphttp ]
  675.    then
  676.       /etc/scohelphttp start >> /var/adm/log/scohelphttp.log 2>&1
  677.    fi   
  678. fi
  679. #
  680. # Morepkgs: MR #ul98-17516, added on 7/11/98.
  681. #    Add symbolic link from /etc/rc2.d to morepkgs script to invoke
  682. #    morepkgs for ISL installation only.
  683. #
  684. if [ "$ISL_INSTALL" = "true" ]
  685. then
  686.     MOREPKGS_DEBUG=`grep "^DEBUG_ALL=" /isl/ifile`
  687.     eval $MOREPKGS_DEBUG
  688.     SEC_MED_TYPE=`grep "^SEC_MEDIUM_TYPE=" /isl/ifile`
  689.     eval $SEC_MED_TYPE
  690.     #
  691.     # Make the symbolic link to invoke morepkgs if this is a
  692.     # cd-rom install or DEBUG_ALL=1... (IVAR_DEBUG_ALL=1 at boot time)
  693.     #
  694.     if [ "$SEC_MEDIUM_TYPE" = "cdrom" -o "$DEBUG_ALL" = "1" ]
  695.     then
  696.         ln -s /var/sadm/pkg/update701/install/update701/morepkgs/scripts/morepkgs.sh /etc/rc2.d/S03morepkgs
  697.         chmod 555 /etc/rc2.d/S03morepkgs
  698.         chmod 555 /etc/rc2.d/S03morepkgs.sh
  699.     fi
  700. fi
  701.  
  702. [ ${EXITRC} = 10 ] && > /etc/conf/.rebuild    # idbuild on shutdown
  703.  
  704. if [ "$SILENT_INSTALL" != "true" ]
  705. then
  706.     DbgMsg "  postinstall: Display working menu at 100%"
  707.     WorkMenu "" 100
  708.  
  709.     ${BIN}/sleep 2
  710.     MenuClear
  711. fi
  712.  
  713. # ul98-05506, part 2 - issue warning (can't do above, goes to installf)
  714. Ver=`grep "^VERSION=" /var/sadm/pkg/base/pkginfo | cut -f2 -d'='`
  715. if [ "${Ver}" = "7" ] || `/bin/pkginfo crypt >/dev/null 2>&1`
  716.     then
  717.     echo "WARNING: lost domestic crypt functionality in libnsl by installing the ${NAME} package"
  718.     DbgMsg "postinstall: lost domestic crypt functionality in libnsl by installing the ${NAME} package"
  719. fi
  720. # ul98-05506 part 2 end
  721.  
  722.  
  723. LogMsg "postinstall: `GetText COMPLEXIT` - ${EXITRC}"
  724. DbgMsg "postinstall: COMPLEXIT - ${EXITRC}"
  725. RmExit ${EXITRC}
  726.