home *** CD-ROM | disk | FTP | other *** search
- :
- # s3cddx.rmv
- #
- # Copyright (C) 1991 Xware.
- #
-
- PATH=/bin:/usr/bin:/etc:/etc/conf/bin
- PERM=/etc/perms/inst # OS (link kit) permlist
-
- : ${OK=0} ${FAIL=1}
-
- #
- # exit with the status passed as argument
- #
-
- cleanup()
- {
- trap '' 1 2 3 15
- exit $1
- }
-
- #
- # prompt for yes or no answer with message passed as argument -
- # returns non-zero for no
- #
-
- getyn()
- {
- while echo "\n$* (y/n) \c">&2
- do read yn rest
- case $yn in
- [yY]) return 0 ;;
- [nN]) return 1 ;;
- *) echo "Please answer y or n" >&2 ;;
- esac
- done
- }
-
- #
- # test to see if link kit is installed
- #
-
- chklinkkit()
- {
- echo "Checking Link Kit installation..."
- until fixperm -i -d LINK $PERM 2> /dev/null
- do case $? in
- 3|4) echo "The Link Kit is not installed." >&2
- ;;
- 5) echo "The Link Kit is only partially installed." >&2
- echo "Attempting to remove TCP/IP package anyway." >&2
- return 0
- ;;
- *) echo "Error testing for Link Kit. Exiting."; cleanup 1
- ;;
- esac
-
- #
- # Not fully installed. Do so here
- #
-
- while echo "Do you wish to install it now? (y/n) \c"
- do read ANSWER
- case $ANSWER in
- Y|y) custom -o -i LINK
- break
- ;;
- N|n) echo "Driver cannot be removed without the Link Kit."
- cleanup 1
- ;;
- *) echo "Please answer 'y' or 'n'. \c"
- ;;
- esac
- done
- done
- }
-
- #
- # relink the kernel
- #
-
- relink()
- {
- cd /etc/conf/cf.d
- echo "\nRe-linking the kernel ... \c">&2
- ./link_unix 2>&1 | tee -a kmakelog ||
- {
- echo "\nError: Kernel link failed.
- Check /etc/conf/cf.d/kmakelog for details." >&2
- cleanup 1
- }
- rm -f kmakelog
- return 0
- }
-
- #
- # main()
- #
-
- cd /
-
- trap 'echo "\nInterrupted! Exiting ..."; cleanup 1' 1 2 3 15
-
- #
- # if no arguments given, default is ALL
- #
-
- if [ -z "$*" ] ; then
- args="ALL"
- else
- args="$*"
- fi
-
- #
- # set flags for each package to be removed
- #
-
- for i in $args
- do
- case $i in
- "ALL" | "all")
- REMOVE_S3CDDX="YES"
- REMOVE_S3CCON="YES"
- ;;
- "S3CDDX"|"s3cddx")
- REMOVE_S3CDDX="YES"
- ;;
- "S3CCON"|"s3ccon")
- REMOVE_S3CCON="YES"
- ;;
- *)
- REMOVE_S3CDDX=""
- REMOVE_S3CCON=""
- ;;
- esac
- done
-
- if [ -n "$REMOVE_S3CDDX" ] ; then
- echo "Removing S3 86C911 Carrera DDX..." 2>/dev/null
- mkdev graphics
- fi
-
- if [ -n "$REMOVE_S3CCON" ] ; then
- echo "Removing S3 86C911 Console Driver Patch..." 2>/dev/null
-
- #
- # check for linkkit
- #
-
- chklinkkit
-
- #
- # resore the original VGA console driver
- #
-
- mv /etc/conf/pack.d/vga/Driver.ORG /etc/conf/pack.d/vga/Driver.o
-
- #
- # build the kernel
- #
-
- cd /etc/conf/cf.d
- ./link_unix
- fi
-
- cleanup 0
-
-