home *** CD-ROM | disk | FTP | other *** search
Wrap
#ident "@(#)postinstall 1.13" # # Revision History: # # L000 20th Oct 1997 # The script now invokes /usr/lib/scoadmin/account/make-owner to # make current system owners have privileges to run NetWare server # applications # # SCRIPTS=/usr/sbin/pkginst PKGMSG=${PKGINST}.pkg LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}} ADMINUSER=/usr/bin/adminuser SCOADMIN=/usr/bin/scoadmin GREP=/usr/bin/grep NETCFG=/usr/sbin/netcfg # # The HOW_INSTALL variable is set up by the package's request script. # # HOW_INSTALL = B_FLOP -- ISL, prereboot # # HOW_INSTALL = POSTREBOOT -- ISL, postreboot # # HOW_INSTALL = NORMAL -- manual pkgadd # # The following HOW_INSTALL clauses are order dependent HOW_INSTALL=NORMAL if [ -f /etc/rc2.d/S02POSTINST ] then # We are rebooting after fnd set installation HOW_INSTALL=POSTREBOOT elif [ -f /etc/inst/scripts/postreboot.sh ] then # We are in foundation set installation on the boot floppies HOW_INSTALL=ON_BFLOP fi # now perform any necessary isl netcfg related tasks if [ "${HOW_INSTALL}" = "POSTREBOOT" -a -x ${NETCFG} ] then # # execute the netcfg to modify information. # ( stty=`stty -g` 2>/dev/null # # Get the NICS parameters from the ifile. # if [ -f /isl/ifile ] then . /isl/ifile fi if [ "$IPX_DEFER" != "TRUE" -a "$NICS_DRIVER_NAME" -a "$NICS_TYPE" ] then if [ "$NICS_TYPE" = "MDI" ] then # # During the installation we will # only ever configure one interface. # In the MDI case NIC devices are # of the form netX. So it is safe # to assume that here we will be # adding net0. # $NETCFG -a ipx#net0 else # # ODI drivers have the form: # NIC_X, e.g. TCM59X_0 # # # DLPI drivers have the form: # the form NIC_X, e.g. NE2000_0 # $NETCFG -a ipx#${NICS_DRIVER_NAME}_0 fi fi stty $stty 2>/dev/null ) exit 0 fi cd / if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]; then if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \ -d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]; then cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \ /usr/lib/locale/${LOCALE}/LC_MESSAGES fi fi . ${SCRIPTS}/updebug [ "$UPDEBUG" = YES ] && set -x # # Create and install NULL files in /etc/netware # touch /etc/netware/nwconfig installf -c base ${PKGINST} /etc/netware/nwconfig v 0644 root sys touch /etc/netware/sapouts installf -c base ${PKGINST} /etc/netware/sapouts v 0644 root sys installf -f -c base ${PKGINST} if [ "$PKGINSTALL_TYPE" = NEWINSTALL ] then # # Set up NetWare configuration # Make sure server name configured # NAME=`/usr/sbin/nwcm -v server_name` if echo $NAME | fgrep \"\" >/dev/null then # Server name not set, set it /usr/sbin/nwcm -q -s "server_name=`uname -n`" fi /usr/sbin/nwcm -s spx_network_rlogin=on >/dev/null 2>&1 /usr/sbin/nwcm -s router_type=FULL >/dev/null 2>&1 /usr/sbin/nwcm -s ipx_start_at_boot=off >/dev/null 2>&1 /usr/sbin/nwcm -s ipx_auto_discovery=off >/dev/null 2>&1 else # # Overlay/Upgrade # Restore saved files # Save previous sap name so the permanent sap services # get updated when we reboot. # ${SCRIPTS}/pkgmrgconf "${PKGINST}" "$AUTOMERGE" "$NAME" for i in 0x03e4 0x0247 0x03ee 0x03e1 do SAPNAME="`/usr/sbin/nwsaputil -q -t $i | /usr/bin/cut -f1 -d' '`" if [ -n "$SAPNAME" ] then if [ ! -f /etc/netware/.olduname ] then echo $SAPNAME >/etc/netware/.olduname installf -c base ${PKGINST} /etc/netware/.olduname v 0644 root sys installf -f -c base ${PKGINST} else echo $SAPNAME >/etc/netware/.olduname fi chmod 0644 /etc/netware/.olduname chown root /etc/netware/.olduname chgrp sys /etc/netware/.olduname break; fi done fi if [ ! -f /etc/netware/.olduname ] then uname -n >/etc/netware/.olduname chmod 0644 /etc/netware/.olduname chown root /etc/netware/.olduname chgrp sys /etc/netware/.olduname installf -c base ${PKGINST} /etc/netware/.olduname v 0644 root sys installf -f -c base ${PKGINST} fi # # Configure Drivers # ERR=/tmp/nwnet.err CWD=/tmp/nwnet rm -f ${ERR} for i in ipx ripx nspx nwip do cd ${CWD}/${i} echo "/etc/conf/bin/idinstall -k -P ${PKGINST} -u ${i}" >> ${ERR} 2>&1 /etc/conf/bin/idinstall -k -P ${PKGINST} -u ${i} >> ${ERR} 2>&1 if [ $? -ne 0 ] then echo "/etc/conf/bin/idinstall -k -P ${PKGINST} -a ${i}" >> ${ERR} 2>&1 /etc/conf/bin/idinstall -k -P ${PKGINST} -a ${i} >> ${ERR} 2>&1 if [ $? -ne 0 ] then message -d `pfmt -s nostd -g ${PKGMSG}:5 "The installation cannot be completed due to an error \nin the driver installation. The file %s contains the errors." ${ERR} 2>&1` exit 2 fi fi cd ${CWD} done # # Rebuild Kernel # echo "/etc/conf/bin/idbuild -M ipx -M ripx -M nspx -M nwip" >> ${ERR} 2>&1 /etc/conf/bin/idbuild -M ipx -M ripx -M nspx -M nwip >> ${ERR} 2>&1 if [ $? -ne 0 ] then message -d `pfmt -s nostd -g ${PKGMSG}:6 "The installation cannot be completed due to an error \nin the driver installation (idbuild). The file %s contains the errors. " ${ERR} 2>&1` fi # # execute scripts to modify /etc/inet/services and /etc/netconfig. # # /etc/netconfig is modified by netcfg. sh /var/sadm/pkg/nwnet/install/nwservices install >/tmp/nwservices cp /tmp/nwservices /etc/inet/services # # Add /dev/NVT to /etc/ttysrch to speed up ttyname # echo "/dev/NVT MF" >>/etc/ttysrch # Now clean up # # Remove tmp files from package installation database. # cd ${CWD} find `pwd` -depth -print >/tmp/$$a removef $PKGINST `cat /tmp/$$a` >/dev/null 2>&1 rm -f /tmp/$$a # # Setup scoadmin NetWare folder # if [ -x $SCOADMIN ] then $SCOADMIN -p NetWare -f -c /usr/lib/scoadmin/NetWare/NetWare_Setup.obj fi # # Setup tfadmin privileges # $ADMINUSER -a NetWare_Setup:/usr/X/bin/NetWare_Setup:allprivs root # L000 vvv # # If we're running from install on boot, no need to setup owner since # the postreboot.sh will take care of it. if, however, this is an # after-the-fact pkgadd, the owner has to be setup here. # [ -f /etc/inst/scripts/postreboot.sh ] || { set `grep mail= /var/sadm/install/admin/* | cut -f2 -d=` while [ $# -ne 0 ] do [ "$1" != "root" ] && /usr/lib/scoadmin/account/make-owner $1 2>/dev/null shift done } # L000 ^^^ # # Install the nwcm wrapper # mv /usr/sbin/nwcm /usr/sbin/nwcm.be mv /usr/sbin/nwcm.filter /usr/sbin/nwcm # Register the changes to avoid pkgchk -n errors installf -c base ${PKGINST} /usr/sbin/nwcm installf -f -c base ${PKGINST} removef ${PKGINST} /usr/sbin/nwcm.filter removef -f ${PKGINST} # now run netcfg if its a norma (ie non isl) installation if [ "${HOW_INSTALL}" = "NORMAL" -a -x ${NETCFG} ] then # # execute the netcfg to modify information. # $NETCFG fi cd / rm -fr ${CWD} removef -f ${PKGINST} if [ "$PKGINSTALL_TYPE" != NEWINSTALL ] then exit 10 else exit 0 fi