#!/bin/sh
stty intr undef
stty kill undef
stty quit undef
stty susp undef
stty start undef
stty stop undef
stty dsusp undef
. /etc/rc.common
stty status '^T'
BootType=$1; shift;
if [ -z "${BootType}" ]; then BootType="multiuser"; fi
VerboseFlag=""
SafeBoot=""
args=$(getopt vx $*)
set -- ${args};
for option; do
case "${option}" in
-v)
VerboseFlag="-v"
;;
-x)
SafeBoot="-x"
;;
esac;
done;
echo ""
case "${BootType}" in
"autoboot")
ConsoleMessage "Automatic reboot in progress"
;;
"multiuser")
ConsoleMessage "Multiuser startup in progress"
;;
*)
ConsoleMessage "Unknown boot request: multiuser startup in progress"
;;
esac
if [ -d /System/Installation ] && [ -f /etc/rc.cdrom ]; then
/etc/rc.cdrom ${BootType}
ConsoleMessage "CD-ROM boot procedure complete"
halt
exit 0
fi
ConsoleMessage "Mounting local filesystems"
mount -vat hfs
mount -vat ufs
mount -t fdesc -o union stdin /dev
mkdir -p /.vol && mount_volfs /.vol
rm -f /mach.sym
sysctl -n kern.symfile
if [ -f /mach.sym ]; then
rm -f /mach
ln -s /mach.sym /mach
else
rm -f /mach
ln -s /mach_kernel /mach
fi
sync
if [ "${SafeBoot}" = "-x" ]; then
ConsoleMessage "Configuring kernel extensions for safe boot"
kextd -x
else
ConsoleMessage "Configuring kernel extensions"
kextd
fi
if [ -f /var/log/runFixUpResources ]; then
/System/Library/CoreServices/FixupResourceForks > /var/tmp/FixupResourceForks.log 2>&1
sync
rm -f /var/log/runFixUpResources
fi
if [ -x /System/Library/CoreServices/StartATSServer ]; then
ConsoleMessage "Starting ATS Server"
/System/Library/CoreServices/StartATSServer
fi
if [ -z "${VerboseFlag}" ] &&
[ -x /System/Library/CoreServices/WindowServer ]; then
ConsoleMessage "Starting Window Server"
/System/Library/CoreServices/WindowServer
fi
update
ConsoleMessage "Starting virtual memory"
swapdir=/private/var/vm
if [ ! -d ${swapdir} ]; then
ConsoleMessage "Creating default swap directory"
mount -uw /
mkdir -p -m 755 ${swapdir}
chown root:wheel ${swapdir}
else
rm -rf ${swapdir}/swap*
fi
dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile
. /var/log/CDIS.custom
export LANGUAGE
SystemStarter ${VerboseFlag}
exit 0