home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Utilities / BootCD.dmg.sit / BootCD.dmg / BootCD.app / Contents / Resources / rc < prev    next >
Encoding:
Text File  |  2003-02-02  |  2.7 KB  |  159 lines

  1. #!/bin/sh
  2.  
  3. ##
  4. # Multi-user startup script.
  5. #
  6. # Copyright 1997-2002 Apple Computer, Inc.
  7. #
  8. # Modified for BootCD by Charles Srstka, 2002.
  9. #
  10. # Customize system startup by adding scripts to the startup 
  11. # directory, rather than editing this file.
  12. ##
  13.  
  14. ##
  15. # Set shell to ignore Control-C, etc.
  16. # Prevent inadvertent problems caused by interrupting the shell during boot.
  17. ##
  18.  
  19. stty intr  undef
  20. stty kill  undef
  21. stty quit  undef
  22. stty susp  undef
  23. stty start undef
  24. stty stop  undef
  25. stty dsusp undef
  26.  
  27. # Preheat the load_hdi process, so hdid doesn't time out waiting for it 
  28. # later
  29. /usr/libexec/load_hdi
  30.  
  31. . /etc/rc.common
  32.  
  33. stty status '^T'
  34.  
  35. ##
  36. # Handle arguments passed from init.
  37. ##
  38.  
  39. BootType=$1; shift;
  40.  
  41. if [ -z "${BootType}" ]; then BootType="multiuser"; fi
  42.  
  43. ##
  44. # Handle options
  45. ##
  46.  
  47. VerboseFlag=""
  48.    SafeBoot=""
  49.  
  50. args=$(getopt vx $*)
  51. set -- ${args};
  52. for option; do
  53.     case "${option}" in
  54.       -v)
  55.         VerboseFlag="-v"
  56.     ;;
  57.       -x)
  58.         SafeBoot="-x"
  59.     ;;
  60.     esac;
  61. done;
  62.  
  63. echo ""
  64.  
  65. case "${BootType}" in
  66.   "autoboot")
  67.     ConsoleMessage "Automatic reboot in progress"
  68.     ;;
  69.   "multiuser")
  70.     ConsoleMessage "Multiuser startup in progress"
  71.     ;;
  72.   *)
  73.     ConsoleMessage "Unknown boot request: multiuser startup in progress"
  74.     ;;
  75. esac
  76.  
  77. netboot=$(/usr/sbin/sysctl kern.netboot | /usr/bin/sed -e 's/^[^0-9]*//')
  78.  
  79. #
  80. # Source the preheat script if it exists, speeds CD boot by > 1 minute
  81. #
  82. if [ -f /System/Installation/CDIS/preheat.sh ]; then
  83.         /System/Installation/CDIS/preheat.sh
  84. fi
  85.  
  86. ##
  87. # Mount essential local filesystems (according to /etc/fstab).
  88. ##
  89.  
  90. ConsoleMessage "Mounting local filesystems"
  91.  
  92. mount -u -o ro /
  93. #mount_synthfs synthfs /Volumes
  94. #autodiskmount -va
  95. mount -t fdesc -o union stdin /dev
  96. mount_volfs /.vol
  97.  
  98. ##
  99. # Start kextd
  100. ##
  101.  
  102. if [ "${SafeBoot}" = "-x" ]; then
  103.     ConsoleMessage "Configuring kernel extensions for safe boot"
  104.     kextd -x
  105. else
  106.     ConsoleMessage "Configuring kernel extensions"
  107.     if [ -e /private/etc/fwxstartup ]; then
  108.         /private/etc/fwxstartup
  109.     fi
  110.     kextd
  111. fi
  112.  
  113. #
  114. # Start autodiskmount so DiskArbitration can be started and
  115. # we can start the ram disk
  116. #
  117.  
  118. /sbin/autodiskmount
  119.  
  120. #
  121. # Start the ram disk and put important stuff on it
  122. #
  123.  
  124. /usr/bin/RamDisk /etc/RamDiskContents RAMDISK_SIZE /ramdisk
  125.  
  126. #
  127. # Now kill autodiskmount, so it can be started properly later
  128. #
  129.  
  130. kill `ps -axec | grep autodiskmount | cut -c1-5`
  131.  
  132. ##
  133. # Early start for any startup items for performance reasons
  134. ##
  135. configd
  136.  
  137. ##
  138. # Start System Services
  139. ##
  140.  
  141. # Set language from CDIS.custom - assumes this is parse-able by sh
  142. . /var/log/CDIS.custom 
  143. export LANGUAGE
  144.  
  145. #
  146. # Get things running with SystemStarter
  147. #
  148.  
  149. /sbin/SystemStarter -g
  150.  
  151. #
  152. # Just in case SystemStarter doesn't put up the login window, do it
  153. # ourselves
  154. #
  155.  
  156. /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
  157.  
  158. exit 0
  159.