2004-11-03 19:36:40 +03:00
|
|
|
## The system's main boot script.
|
|
|
|
|
|
|
|
##
|
|
|
|
## Some functions used by the main script
|
|
|
|
##
|
|
|
|
|
|
|
|
# launch <executable path> [thread to wait for]
|
|
|
|
|
2005-01-19 05:46:12 +03:00
|
|
|
launch() {
|
2004-11-03 19:36:40 +03:00
|
|
|
if [ -f "/boot/$1" ]
|
|
|
|
then
|
|
|
|
"/boot/$1" &
|
|
|
|
[ "$2" != "" ] && waitfor "$2"
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
echo There is no "$1"
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# launchscript <script path>
|
|
|
|
|
|
|
|
launchscript() {
|
|
|
|
if [ -f "/boot/$1" ]
|
|
|
|
then
|
|
|
|
. "/boot/$1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2004-11-23 02:33:02 +03:00
|
|
|
# runprog <executable path>
|
|
|
|
|
|
|
|
runprog() {
|
|
|
|
if [ -f "/boot/$1" ]
|
|
|
|
then
|
|
|
|
"/boot/$1"
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
echo There is no "$1"
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2004-11-03 19:36:40 +03:00
|
|
|
##
|
|
|
|
## Main script starts here
|
|
|
|
##
|
|
|
|
|
|
|
|
# Set up stdin/out/err to nirvana
|
|
|
|
|
|
|
|
exec </dev/null
|
2006-05-16 18:50:46 +04:00
|
|
|
exec >/dev/null 2>&1
|
2004-11-03 19:36:40 +03:00
|
|
|
|
2005-01-19 05:46:12 +03:00
|
|
|
# Standard locations of boot files
|
|
|
|
SCRIPTS=beos/system/boot
|
|
|
|
SERVERS=beos/system/servers
|
|
|
|
|
2004-11-03 19:36:40 +03:00
|
|
|
# Set up the environment
|
|
|
|
|
2004-11-25 21:39:09 +03:00
|
|
|
export SAFEMODE=`/bin/safemode`
|
|
|
|
|
2004-11-03 19:36:40 +03:00
|
|
|
launchscript $SCRIPTS/SetupEnvironment
|
|
|
|
|
2004-11-25 21:39:09 +03:00
|
|
|
# Sets timezone etc.
|
2004-11-23 02:33:02 +03:00
|
|
|
runprog beos/bin/clockconfig
|
|
|
|
|
2005-01-16 00:34:20 +03:00
|
|
|
# Launch servers
|
|
|
|
|
2005-01-19 05:46:12 +03:00
|
|
|
# We must wait for the app_server and registrar to be ready
|
2005-07-15 16:31:59 +04:00
|
|
|
launch $SERVERS/registrar _roster_thread_ # launch registrar
|
|
|
|
|
|
|
|
launch $SERVERS/debug_server # launch debug_server
|
|
|
|
|
2007-01-15 19:16:10 +03:00
|
|
|
# Init Network
|
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
|
|
launch $SERVERS/net_server # launch net_server
|
|
|
|
fi
|
|
|
|
|
2005-06-07 04:54:23 +04:00
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
|
|
launch $SERVERS/app_server picasso # launch app_server
|
|
|
|
else
|
|
|
|
launch $SERVERS/fake_app_server picasso
|
|
|
|
fi
|
|
|
|
|
2005-01-19 05:46:12 +03:00
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
|
|
launch $SERVERS/syslog_daemon
|
2006-12-24 02:00:37 +03:00
|
|
|
waitfor _input_server_event_loop_ # wait for input devices
|
2005-01-19 05:46:12 +03:00
|
|
|
fi
|
|
|
|
|
2006-03-02 11:29:18 +03:00
|
|
|
# Launch Terminal or consoled depending on $SAFEMODE
|
2005-06-07 04:54:23 +04:00
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
2006-03-12 17:28:35 +03:00
|
|
|
launch beos/system/Tracker
|
2006-02-07 19:48:41 +03:00
|
|
|
launch beos/system/Deskbar
|
2006-03-12 17:28:35 +03:00
|
|
|
launch beos/apps/Terminal
|
2005-06-07 04:54:23 +04:00
|
|
|
else
|
|
|
|
launch beos/bin/consoled
|
|
|
|
fi
|
2005-01-16 00:34:20 +03:00
|
|
|
|
2006-03-12 17:21:39 +03:00
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
|
|
launch $SERVERS/media_server
|
2006-06-30 01:57:15 +04:00
|
|
|
launch $SERVERS/midi_server
|
2006-03-12 17:21:39 +03:00
|
|
|
fi
|
|
|
|
|
2004-12-14 19:38:47 +03:00
|
|
|
# Check for daily saving time
|
2006-03-30 15:58:15 +04:00
|
|
|
launch beos/bin/dstcheck
|
2004-12-14 19:38:47 +03:00
|
|
|
|
2006-03-02 11:29:18 +03:00
|
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
|
|
# Start user boot script
|
|
|
|
if [ -f $HOME/config/boot/UserBootscript ]; then
|
|
|
|
. $HOME/config/boot/UserBootscript
|
|
|
|
fi
|
|
|
|
fi
|