home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.16 / etc / inst / scripts / rebuild / rebuild~
Text File  |  1998-08-19  |  2KB  |  67 lines

  1. # Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  2. #                                                                         
  3. #        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  4. #                   SANTA CRUZ OPERATION INC.                             
  5. #                                                                         
  6. #   The copyright notice above does not evidence any actual or intended   
  7. #   publication of such source code.                                      
  8.  
  9. #ident    "@(#)rebuild.sh    15.1"
  10.  
  11. function do_dump_dev
  12. # arg 1 is the number of the disk (0 or 1)
  13. {
  14.     [ -n "$SH_VERBOSE" ] && set -x
  15.     typeset DUMP_SLICE MINOR line DISK_NUM=$1
  16.  
  17.     /usr/sbin/prtvtoc ${CHAR_DISK_NODES[$DISK_NUM]} 2> /dev/null |
  18.     while read line
  19.     do
  20.         set -- $line
  21.         if [ "$3" = "DUMP" ]
  22.         then
  23.             DUMP_SLICE=${2%:*}
  24.             break
  25.         fi
  26.     done
  27.     [ -n "$DUMP_SLICE" ] || return 1
  28.  
  29.     # We call symlink, not link, below.  This is essential, because
  30.     # /etc/scsi/pdimkdev would remove /dev/dump if it were a hard link.
  31.     call symlink ${BLOCK_DISK_NODES[$DISK_NUM]%s0}s$DUMP_SLICE /dev/dump
  32.  
  33.     grep -v "PANICBOOT" < /etc/default/init > /tmp/TTT
  34.     cat /tmp/TTT > /etc/default/init
  35.     call unlink /tmp/TTT
  36.     print "PANICBOOT=YES" >> /etc/default/init
  37.     return 0
  38. }
  39.  
  40. # See usr/src/*/sysinst/stage/*.ele -- these files control which disks can be
  41. # used for the dump slice.
  42. #
  43. # For now we do not allow the user to put a dump slice on the second disk.
  44. # The main reason is that we cannot know for certain what the minor number of
  45. # the dump slice on the second disk will be, so we cannot know what to put in
  46. # /etc/conf/sassign.d/kernel.
  47.  
  48. # do_dump_dev 0 || do_dump_dev 1
  49. do_dump_dev 0
  50.  
  51. # We are now finished with the tape and disk nodes.  We remove them now so that
  52. # when /etc/scsi/pdimkdev runs from /etc/inittab it starts with a clean slate.
  53. sh_rm -f /dev/rdsk/c* /dev/dsk/c* /dev/rmt/*
  54.  
  55. while :
  56. do
  57.     if $IDCMD/idbuild -B > /tmp/kernel.build 2>&1
  58.     then
  59.         break
  60.     else
  61.         faultvt "$IDBUILD_FAILED"
  62.     fi
  63. done
  64.  
  65. $IDCMD/idmkinit -o /etc
  66. call unlink /etc/.wsinitdate
  67.