#!/bin/sh PATH=/usr/ucb:/usr/bsd:/bin:/usr/bin:/usr/etc:/etc:/usr/gnu/bin:/usr/local/gnu/bin:/usr/local/bin ; export PATH wdir=`/bin/pwd` instpak="$wdir/!TCM5970.CFG $wdir/INSTALL $wdir/INSTALL.manual $wdir/README $wdir/fe_control $wdir/fe_control.1 $wdir/if_fe.o $wdir/lanscan $wdir/fescan $wdir/lanconfig /etc/eisa_config /etc/master /etc/conf/liblan.a " # must be root to run if [ `whoami` != "root" ] then echo "$0: Sorry must be run as root." exit fi # must be HPUX 9.0 x=`/bin/uname -s -r | grep "HP-UX A.09"` if [ -z "$x" ] then echo "$0: Sorry will only run on HP-UX 9.0x systems" exit fi # make sure we have the install files for i in $instpak do if [ ! -f $i ] then echo "$0: `echo $i | sed -e s-$wdir--` is missing, can't contiune" exit fi done previnst="" # check for previous installation of driver x=`strings /hp-ux | grep Phobos` if [ -n "$x" ] then echo "" echo "FE driver already installed in kernel." previnst="TRUE" elif [ -f /etc/eisa/\!TCM5970.CFG ] then echo "" echo "fe_install as run been attempted earlier." previnst="TRUE" fi if [ -n "$previnst" ] then echo "Please confirm that you want to run fe_install." echo "Continue with install (y/n) [n] \c" read y case $y in yes|YES|y|Y) if [ -f ./fe_uninstall ] then ./fe_uninstall -cleanup else echo "Need to run fe_uninstall and it is not in this directory" echo "quiting" echo "" exit 1 fi ;; n|N|no|NO|"") exit ;; *) : esac fi # install the EISA config file, load and verify echo "Configuring EISA card, please ignore following messages" sleep 2 /bin/cp \!TCM5970.CFG /etc/eisa /etc/eisa_config -a havecard=`/etc/eisa_config < /dev/null | grep TCM5970 2>/dev/null` echo "" echo "" echo "" echo "" sleep 2 if [ ! -n "$havecard" ] then echo "*** NOTICE ***" echo "H100 ethernet adapter not found on system. Will continue to build" echo "new kernel. Once the adapter is installed the system should automatically" echo "configure it." echo "" sleep 4 else echo "H100 ethernet adapter found!" sleep 2 fi ################################ let get down to work ######################## # man page for fe_control mkdir -p /usr/man/man1 /bin/cp -p fe_control.1 /usr/man/man1 # fe_control /bin/cp -p fe_control /usr/bin/fe_control # lanscan if [ ! -f /etc/lanscan.hpux ] then /bin/mv /etc/lanscan /etc/lanscan.hpux fi /bin/cp -p lanscan /etc/lanscan #fescan /bin/cp -p fescan /etc/fescan # lanconfig if [ ! -f /etc/lanconfig.hpux ] then /bin/mv /etc/lanconfig /etc/lanconfig.hpux fi /bin/cp -p lanconfig /etc/lanconfig # if_fe.o if [ ! -f /etc/conf/liblan.a.b4fe ] then /bin/mv /etc/conf/liblan.a /etc/conf/liblan.a.b4fe fi /bin/cp /etc/conf/liblan.a.b4fe /etc/conf/liblan.a ar -r /etc/conf/liblan.a if_fe.o #add fe entry to /etc/master x=`grep "fe fe" /etc/master` if [ -z "$x" ] then if [ ! -f /etc/master.b4fe ] then /bin/mv /etc/master /etc/master.b4fe fi /bin/cp /etc/master.b4fe /etc/master replace=`grep '\-\-\-' /etc/master | /usr/bin/head -1` last=`echo "$replace" | sed -e s"/* --- - - -1 //"` sed -e s"/$replace/fe fe 9 181 -1 $last/" /etc/master > /etc/master.new y=`grep "fe fe" /etc/master.new` if [ -z "$y" ] then echo "$0: Sorry error dealing with master file" exit else /bin/mv /etc/master.new /etc/master fi fi # add fe to dfile if [ ! -f /etc/conf/dfile.b4fe ] then /bin/mv /etc/conf/dfile /etc/conf/dfile.b4fe fi /bin/cp /etc/conf/dfile.b4fe /etc/conf/dfile echo "fe" >> /etc/conf/dfile # config the kernel cd /etc/conf /etc/config dfile # build /bin/rm -f hp-ux /bin/make -f config.mk if [ ! -f /etc/conf/hp-ux ] then echo "$0: Error building new kernel - stopping" exit fi # put in place - saving old kernel echo "Ready to install new kernel and reboot? (y/n) [y] \c" read y case $y in yes|YES|y|Y|"") : ;; n|N|no|NO) exit ;; *) : esac /bin/cp /hp-ux /SYSBKUP /bin/cp hp-ux /hp-ux /bin/sync /bin/sync /etc/reboot