home *** CD-ROM | disk | FTP | other *** search
- :
- # @(#) dkinit.sh 1.9 88/07/26
- #
- # Copyright (C) The Santa Cruz Operation, 1986.
- # This Module contains Proprietary Information of
- # The Santa Cruz Operation, Microsoft Corporation
- # and AT&T, and should be treated as Confidential.
- #
- # DKINIT - XENIX System V hard disk initialization with
- # non-standard disk support.
- #
- # Version 1.0 - 09/29/86
-
- Getdfl() {
- read prm1 prm2 prm3 prm4 prm5 prm6 prm7 prm8 < /tmp/dkinit$$
- }
- Showdfl() {
- echo "
- Disk Parameters Values
- --------------- ------
- 1. Cylinders $prm1
- 2. Heads $prm2
- 3. Write Reduce $prm3
- 4. Write Precomp $prm4
- 5. Ecc $prm5
- 6. Control $prm6
- 7. Landing Zone $prm7
- 8. Sectors/track $prm8"
- }
-
- modified=
-
- case $# in
- 1) controller=0
- ;;
- 2) case "$2" in
- 0) controller=0
- ;;
- 1) controller=1
- ;;
- *)
- echo "USAGE: dkinit drive-number (0|1) [controller-number (0|1)]"
- exit 1
- ;;
- esac
- ;;
- *)
- echo "USAGE: dkinit drive-number (0|1) [controller-number (0|1)]"
- exit 1
- ;;
- esac
-
- case $1 in
- 0) if [ $controller -eq 0 ]
- then
- dparam -w
- dn=0
- else
- dn=4
- fi
- ;;
- 1) if [ $controller -eq 0 ]
- then
- dn=1
- else
- dn=5
- fi
- ;;
- *)
- echo "USAGE: dkinit drive-number (0|1) [controller-number (0|1)]"
- exit 1
- ;;
- esac
-
- dparam /dev/rdsk/${dn}s0 > /tmp/dkinit$$
- Getdfl
-
- while echo "\nHard Disk Drive $dn Configuration
-
- 1. Display current disk parameters
- 2. Modify current disk parameters
- 3. Select default disk parameters
-
- Enter an option or 'q' to quit: \c"
- do
- read ans
- case "$ans" in
- 1) Showdfl
- ;;
- 2)
- Showdfl
- while echo "\nEnter a parameter to modify or 'q' to return to the main menu: \c"
- do
- read y
- case "$y" in
- [1-8]) while echo "\nEnter the new value or <RETURN> to use the existing value: \c"
- do
- read z
- case "$z" in
- [0-9]*)
- eval prm$y=$z
- modified=1
- break
- ;;
- "") break
- ;;
- *) echo "Please enter a numeric value. \n"
- ;;
- esac
- done
- ;;
- [qQ]) break
- ;;
- *) echo "Please enter a choice, 1-8 or 'q'. \n"
- ;;
- esac
- done
- ;;
- 3) [ $modified ] && {
- Getdfl
- Showdfl
- }
- ;;
- [qQ])
- [ $modified ] && {
- case $dn in
- 1) dparam -w ;;
- 4|5) dparam -w /dev/dsk/4s0 ;;
- esac
- dparam /dev/rdsk/${dn}s0 $prm1 $prm2 $prm3 $prm4 $prm5 $prm6 $prm7 $prm8
- }
- break
- ;;
- *) echo "\nPlease enter '1', '2', '3' or 'q'.\n"
- ;;
- esac
- done
-