📄 install.3
字号:
#!/bin/sh# # @(#)install.3 4.7 (ULTRIX) 2/14/91## install.3: for installation only# see .profile#-------------------------------------------------------------------## 006 - Jan 1991 - Jon Wallace# Added code and new environment variable for grey-scale monitor# question.## 005 - Jan 1991 - Jon Wallace# Added code to test whether customized kernel move is successful# or not, and to echo warning messages if it is not.## 004 - Aug 31, 1990 - Jon Wallace# Put in fix to remove embedded spaces when doing a read## 003 - July 5, 1990 - ccb# MUP support, keyed on MUPSUPPORT flag## 002 - Aug 16, 1988 - Jon Wallace# Modified script for CDROM support ## 001 - Jan 26, 1988 - Tung-Ning Cherng# Allowed using the existing partition of system disk for V2.4## 000 - July,16 1987 - Tungning Cherng created# It was a part of install.2 before.# PATH=.:/install.tmp:/bin:/etc:/usr/bin:/usr/ucb:/usr/etcHOME=/export PATH HOMEMUPSUPPORT=1 # give this a value to turn on in-line MUP supportLL=""MSG1="The installation software successfully installed the mandatory softwaresubsets. However, it failed to install other parts of the supportedsoftware subsets. You can continue with the installation and installthe other supported software subsets at a later time using the setldutility or, you can request that the installation software again tryto install these supported software subsets.Select one of the following options: 1) Continue with the installation 2) Try to re-install supported software subsetsEnter your choice [1]: " MSG2="The installation software failed to install the unsupported softwaresubsets but will continue to proceed with the next task. You can installthe unsupported software subsets at a later time, using the setld utility."ERMSG1="This error causes the installation procedure to stop. One possiblecause for the error is a corrupt system disk. You may want to replaceor use another system disk, and begin the installation again. If thiserror message appears a second time, contact a DIGITAL representative."trap 'while :do echo -n "Do you want to stop the installation? (y/n) []:" read ans ans=`echo $ans` case $ans in [yY]*) echo "Begin your installation again by following the instructions in yourinstallation guide." exit 1 ;; [nN]* ) break ;; * ) continue ;; esacdone ' 1 2 3## read the root device from the file .minidevice# To know media_D media_d media_u # and root_D root_d root_u .#if test -s "/.minidevice" then set `cat .minidevice` root_D=$1; root_d=$2; root_u=$3; root_p=a media_D=$4; media_d=$5; media_u=$6 media_p=$7 (cd /dev; MAKEDEV $root_d$root_u >/dev/null )else echo "The installation procedure failed to recognize the distributiondevice and the system disk you are using. $ERMSG1" exit 1fiset xxx `dd if=/.advflag 2>/dev/null`ADVFLAG=$2DEF_PT=$3MACHTYPE=$4export ADVFLAG DEF_PT MACHTYPECPUTYPE=`sizer -c`case $MACHTYPE invax ) KERNELPATH="/sys/VAX" CONFIGPATH="/sys/conf/vax" DISK_MEDIA_DIR="VAX/BASE" ;;mips) KERNELPATH="/sys/MIPS" CONFIGPATH="/sys/conf/mips" DISK_MEDIA_DIR="RISC/BASE" ;;esaccase $remoteflag iny ) realsysname=`/bin/hostname` sysname=`echo ${realsysname} | dd conv=ucase 2>/dev/null` media_D=REMOTE ;;* ) set xxx `cat /tmp/realsysname` # from the doconfig -n realsysname=$2; sysname=$3 cd /install.tmp ;;esacwhile : truedo case $DEF_PT in 1 ) case $root_D in RA82 | RA90 ) usr_p=d ;; *) usr_p=g ;; esac ;; esac ans=y case $ADVFLAG in 1) case $DEF_PT in 0 ) ans=n ;; 1 ) # assign the default area and do the alignment of table. chpt -q /dev/r$root_d${root_u}c > /tmp/ptable awk '{if ($1 == "partition") printf \"%-10s%10s %10s %10s %-12s default\n",$1,$2,$3,$4,$5}' /tmp/ptable > /tmp/ptmp awk '{if ($1 == "a") printf \"%5s %10s %10s %10s %-12s root\n",$1,$2,$3,$4,$5}' /tmp/ptable >> /tmp/ptmp awk '{if ($1 == "b") printf \"%5s %10s %10s %10s %-12s swap, dump\n",$1,$2,$3,$4,$5}' /tmp/ptable >> /tmp/ptmp case $usr_p in d ) awk '{if ($1 == "d") printf \"%5s %10s %10s %10s %-12s /usr\n",$1,$2,$3,$4,$5}' /tmp/ptable >> /tmp/ptmp ;; g ) awk '{if ($1 == "g") printf \"%5s %10s %10s %10s %-12s /usr \n",$1,$2,$3,$4,$5}' /tmp/ptable >> /tmp/ptmp ;; esac echo "*** FILE SYSTEM DEFAULT OPTION ***The following table shows the default file system layout on $root_D, $root_d${root_u}:" dd if=/tmp/ptmp 2>/dev/null echo -n "If you choose the defaults, the var area will be allocated to /usr/var. Do you want to choose the default file system layout? (y/n): " read ans ans=`echo $ans` ;; esac ;; esac case $ans in y ) usr_d=$root_d; usr_u=$root_u umount /dev/$usr_d$usr_u$usr_p > /dev/null 2>&1 echo "Making the new file system for /usr on /dev/r$usr_d$usr_u$usr_p $root_D" echo "Making the new file system for /usr on /dev/r$usr_d$usr_u$usr_p $root_D" 2>&1 >> /FILESYS.log newfs /dev/r$usr_d$usr_u$usr_p $root_D 2>&1 >> /FILESYS.log case $? in 0 ) ;; * ) echo "The newfs command failed to construct the /usr file system onpartition $usr_p of the system disk, $usr_d$usr_u. ${LL}$ERMSG1" exit 1 ;; esac mount /dev/$usr_d$usr_u$usr_p /usr case $? in 0 ) ;; * ) echo "The mount command failed to mount the /usr file system on partition$usr_p of the system disk, $usr_d$usr_u. $ERMSG1" exit 1 ;; esac mkdir /usr/var chmod 755 /usr/var ln -s /usr/var /var swap1_d=$root_d swap1_u=$root_u swap1_p=b dump_d=$root_d dump_u=$root_u dump_p=b ;; n ) . ask_filesys ;; * ) continue ;; esac breakdone## Start to retore the /usr file system#echo "/dev/${root_d}${root_u}a:/:rw:1:1:ufs::" > /etc/fstabecho "/dev/${usr_d}${usr_u}${usr_p}:/usr:rw:1:2:ufs::" >> /etc/fstabcase "${var_d}${var_u}${var_p}" in"${usr_d}${usr_u}${usr_p}" | "" ) ;;*) echo "/dev/${var_d}${var_u}${var_p}:/var:rw:1:4:ufs::" >> /etc/fstab ;;esaccase "${swap2_p}" in"" ) ;;* ) echo "/dev/${swap2_d}${swap2_u}${swap2_p}::sw:0:0:ufs::" >> /etc/fstab ;;esacchmod 644 /etc/fstabWS=`sizer -wt`case $WS in0 ) echo "This distribution media includes subsets for ULTRIX WorksystemSoftware (UWS). A UWS license (on a workstation) or a UWS ServerLicense (on a timesharing machine or server) is required to installthese subsets." while : do echo -n "Do you want to install ULTRIX Worksystem Software? y/n []: " read WS_BITS WS_BITS=`echo $WS_BITS` case $WS_BITS in Y | y ) WS_BITS="Y" break ;; N | n ) break ;; * ) echo "You must answer 'y' or 'n'." ;; esac done ;;* ) WS_BITS="Y" while : do echo -n "Select one of the options below that describes the type of displaybeing used: 1) Black and White 2) Color 3) Gray ScaleEnter your choice: " read ans ans=`echo $ans` case $ans in 1 | 2 ) ISL_ISGRAY=0 break ;; 3 ) ISL_ISGRAY=1 break ;; * ) ;; esac done ;;esacexport WS_BITS ISL_ISGRAYcase $ADVFLAG in0 ) echo "${LL}Installing mandatory software subsets." if test "$WS_BITS" = "Y" then ADVFLAG=2 export ADVFLAG fi ;;1) echo "${LL}*** SUPPORTED SOFTWARE INSTALLATION ***" if test "$WS_BITS" = "Y" then ADVFLAG=3 export ADVFLAG fi ;;esaccd /N=1while test $N -le 3do case $N in 1 ) ;; 2 ) echo "*** Attempting again to install the supported software subsets. *** " ;; 3 ) echo " The installation software failed to install the supported softwaresubsets. This causes the installation procedure to stop. Contact yourDIGITAL representative." exit 1 ;; esac N=`expr $N + 1` case $media_D in REMOTE ) for i in `cat /etc/hosts` do SERVER=$i done setld -l $SERVER: case $? in 0 ) echo "The installation procedure has successfully installed the software subsets." break ;; 1 ) echo "The installation procedure was unable to install the supported softwaresubsets." continue ;; * ) echo -n "$MSG1" read ans ans=`echo $ans` case $ans in 2 ) N=2 continue ;; "" | * ) break ;; esac ;; esac ;; RA60 | CDROM ) (cd /dev; MAKEDEV ${media_d}${media_u} >/dev/null ) DRIVE=/dev/$media_d$media_u$media_p if test "$media_D" = "RA60" then echo "The installation procedure checks your distribution media,${media_d}${media_u}, to ensure that it is not corrupt." fsck /dev/r${media_d}${media_u}${media_p} case $? in 0 ) ;; * ) echo "The fsck command failed to perform a file consistency check on partition${media_p} of the distribution media, ${media_d}${media_u}. Thus, the installation softwarewas unable to load the supported software subsets." exit 1 ;; esac fi mount -r /dev/${media_d}${media_u}${media_p} /mnt case $? in 0 ) ;; * ) echo "The mount command failed to mount partition ${media_p} of the distributionmedia, ${media_d}${media_u}. Thus, the installation software was unableto load the supported software subsets. " exit 1 ;; esac setld -l /mnt/$DISK_MEDIA_DIR case $? in 0 ) echo "The installation software has successfully installed the software subsets." if [ "$MUPSUPPORT" ] then install.mup DISK /mnt/${DISK_MEDIA_DIR}_UPGRADE $DRIVE && break exit 1 else umount /dev/${media_d}${media_u}${media_p} break fi ;; 1 ) umount /dev/${media_d}${media_u}${media_p} echo "The installation software was unable to install the supported softwaresubsets." continue ;; * ) echo -n "$MSG1" read ans ans=`echo $ans` case $ans in 2 ) N=2 umount /dev/${media_d}${media_u}${media_p} continue ;; "" | * ) if [ "$MUPSUPPORT" ] then install.mup DISK /mnt/${DISK_MEDIA_DIR}_UPGRADE $DRIVE && break exit 1 else umount $DRIVE break fi ;; esac ;; esac ;; * ) # tape. (cd /dev; rm -f *rmt*; MAKEDEV ${media_d}${media_u} >/dev/null ) setld -l /dev/nrmt0h case $? in 0 ) echo "The installation software has successfully installed the softwaresubsets. You can now remove the tape containing the software subsetsfrom the device." [ "$MUPSUPPORT" ] && { install.mup TAPE /dev/nrmt0h || exit 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -