#sccs "@(#)flopsys/flopfs:profile.hd 1.41" # # Installation script for loading Foundation onto Hard Disk Feb 24, 1986 # Substantially modified for 3.5 by Fred Dewey and Ed Bank, 3/86. # # set path PATH=:/bin:/usr/bin:/etc; export PATH SAVEDIR=/u/SAVE3.5 CONVDIR=/u/CONV3.5 LISTING=$SAVEDIR/listing INSTROOT=/usr/installed INSTFILE=$INSTROOT/CONTENTS UA=/usr/lib/ua SHOWFILE=$UA/Showsoft.menu REMVFILE=$UA/Uninstall.menu NFLOPPYS=`cat /etc/.nflops` export CONVDIR SAVEDIR LISTING INSTROOT INSTFILE UA NFLOPPYS ## save the profile mv /etc/profile /etc/profile.hd ## see if the system is being converted if [ -d "$CONVDIR" ] then if [ -s /etc/.version ] then VERSION=`cat /etc/.version | cut -c1-4` else VERSION="2.0" fi fOLDVER=`expr "$VERSION" '>=' 3.2` if [ "$fOLDVER" = 0 ] then ## Remove all phone manager, terminal emul and encryption modules, ## since they are no longer part of the FND set cat << -END- The telephone manager, terminal emulator, development set and encryption software are now separately installable. The old versions of the above software will now be removed. If you use any of the above software, you will need to install it after you have completed installing this foundation set. -END- else cat << -END- The terminal emulator, the telephone manager, the development set, the RS-232 expansion, and the encryption products must be reinstalled using the latest version of each. The old versions will now be removed. -END- fi ## These packages are separately installable PRODUCTS="ENCRYPTION ncryption DEVELOPMENT ATE PHONE hone \ EXPANSION xpansion LOADER oader" ## Clobber the old stuff - This breaks if PRODUCTS = "" mv /bin/wnlessmsg /usr/bin/message if [ -s "$INSTFILE" ] then cp $INSTFILE /tmp/SOFTW else > /tmp/SOFTW fi for PCKG in $PRODUCTS do grep "$PCKG " /tmp/SOFTW | \ while read PROGRAM DESC do # Remove hazardous instructions from uninstall script grep -v "telinit" $INSTROOT/$PROGRAM.un | \ grep -v ".phclr" | grep -v "lddrv[ ]*-" | \ grep -v "setgetty" | grep -v "cmbupd" > /tmp/Uninstall ## Suppress output from uninstall program. ## Substitute brief message instead. echo echo " Removing $DESC ..." echo chmod +x /tmp/Uninstall /tmp/Uninstall > /dev/null 2>&1 ## /tmp/Uninstall 2> /dev/null :: OLD WAY grep -v "$PROGRAM " $INSTFILE > /tmp/CONTENTS mv /tmp/CONTENTS $INSTROOT grep -v "$DESC" $SHOWFILE > /tmp/Showsoft.menu mv /tmp/Showsoft.menu $UA grep -v "$DESC" $REMVFILE > /tmp/Uninstall.menu mv /tmp/Uninstall.menu $UA rm -f $PROGRAM.un done done rm -f /tmp/Uninstall ## first do the phone manager rm -f /usr/bin/phnum rm -f /usr/bin/phcreate rm -f /usr/bin/phpref rm -f /usr/bin/phstub rm -f /usr/bin/Phones.sh rm -f /usr/lib/ua/phone.hlp rm -f /usr/lib/ua/Phones.form rm -f /etc/ph ## now do ATE rm -f /usr/lib/ua/te.hlp rm -f /usr/bin/async_main ## remove encrypt stuff also. Fred Dewey rm -f /usr/bin/crypt rm -f /usr/lib/makekey ## clobber the existing backup information. rm -f /etc/.lastbackup rm -f /etc/.lastpartial if [ ! -s /etc/.installdate ] then date > /etc/.installdate fi set `cat -s /etc/.installdate` cat > $UA/Backup.menu << _END_ Menu = Partial Backup includes files changed since $2 $3 Label = Backup Prompt =Complete Backup saves whole system, Partial Backup saves changed items. Name = Complete Backup - has not been done yet. Name = Partial Backup - has not been done yet. Name = Backup one user _END_ ## now update the various windows uaupd -r "Telephone" Office uaupd -r "Phone manager" Preferences uaupd -r "Phone Directory" Suffixes uaupd -r "Phone Number" Suffixes uaupd -r "Modem Profile" Suffixes uaupd -r "RS-232 Profile" Suffixes uaupd -r "Text Phone Directory" Suffixes cpio -pud $CONVDIR 2> /dev/null << -END- $UA/Preferences $UA/Suffixes $UA/Office $UA/Hardware $SHOWFILE $REMVFILE /etc/inittab /etc/lddrv/InstDrv /etc/master -END- cpio -pud $SAVEDIR 2> /dev/null << -END- $INSTFILE -END- ## The lp tree is no longer saved because the printer setup functions ## have changed. echo echo 'The current printer setup will not work with the new software.' echo 'To make your printers work again, you will need to use the' echo 'Printer Setup window in the Office.' echo rm -f /usr/spool/lp/* > /dev/null 2>&1 ls -d /usr/spool/lp/* | grep -v "/model" > /tmp/lp_list for DIR in `cat /tmp/lp_list` do rm -rf $DIR done # If serial port 0 was attached to a PRINTER if grep "PRINTER" /etc/.rs232 > /dev/null then echo "TYPE='NONE'" > /etc/.rs232 fi sleep 2 fi ## Move critical files out of the way before continuing. By linking ## these files to /tmp, they will still have good link counts and ## the fsck program should work correctly. ln /lib/shlib /tmp/ ln /dev/fp002 /tmp/ ln /dev/console /tmp/ echo "\n\nPlease insert the floppy disk labelled:" echo "\n System Software - Foundation Set (1) - 5 of ${NFLOPPYS}\n" echo "Touch to continue when ready. \c" read x echo "\n\nReading in progress - Do not remove the floppy disk." ## first remove old UNIX files before continuing rm -f /UNIX* ## ok, read in the foundation set cpio -Bicdum < /dev/rfp021 2> /dev/null if [ $? != 0 ] then cat << -END- The Foundation Set did not load properly. Possible reasons include: o The load procedure was aborted prematurely. o Your hard disk was not properly formatted. o There is a bad spot on one of the floppy disks. o There was a power surge during the copying. To try loading the Foundation Set software again, please insert the Foundation Set Floppy Boot Disk - disk 2 of ${NFLOPPYS} - in the floppy disk drive, and press when prompted. If this message appears again, try reformatting your hard disk. If that does not work, your Foundation Set diskettes may be bad. To try to reboot from the hard disk, remove the floppy disk from the drive before pressing . Please beware: there is a minimal set of unix commands on the hard disk at this time. It is NOT fully operational. -END- sync; sync; sync echo "Please wait ...\n" sleep 20 /etc/reboot "The system will now reboot." fi ## Set system date from real time clock so dates on converted files will ## be current TZ=`cat /etc/TZ`;export TZ date - ## Remove loadable driver ifiles and images (not .o files) to avoid ## possible problems loading drivers on the first boot rm -f /etc/lddrv/ifile* for DRIVER in /etc/lddrv/*.o do rm -f `echo $DRIVER | sed 's%\.o$%%'` done ## Link /u/install/.kshrc to /usr/lib/ua/.kshrc if necessary if [ ! -f /usr/lib/ua/.kshrc ] then ln /u/install/.kshrc /usr/lib/ua/.kshrc fi ## The lost+found directory needs to be created with ample space. LOSTROOT= mkdir $LOSTROOT/lost+found 2> /dev/null for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do > $LOSTROOT/lost+found/file$I done for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do rm -f $LOSTROOT/lost+found/file$I done ## see if the system is being converted if [ -d "$CONVDIR" ] then echo "\n\n Your system files will now be converted." echo "\n\n A log of the conversion will be saved in /usr/adm/convert.log." echo "\n\n System files will now be converted .... please wait.\n" ## All the files listed in the SPECIAL file that are tagged with a 'C' ## should be converted here, using conversion programs that combine the ## best of the old and the new, if they are different. Fred Dewey. cd /etc/convert ./convert rm -f /etc/.lastbackup /etc/.lastpartial ## Let's convert all /u/LOGNAME/.profile's to use the ## conditional shell execution. Gee, that sounds like fun. ./profconvert ## Put back the user logins for the "Others" file in /usr/lib/ua /etc/bldother > /dev/null 2>&1 cat << -END- The system will now reboot ....... -END- fi ## restart the system running Version 3.5 > /etc/mnttab # clear mount table again /usr/lib/lpshut > /dev/null 2> /dev/null sync;sync;sync sleep 3 reboot # reboot with real software