haiku/data/system/boot/Bootscript
Stephan Aßmus 16eb448eb4 * The HaikuImage script will put a file "fresh_install" into
/boot/home/config/settings.
* The Bootscript will check for the existance of this file and updates the
  mime database with all the applications and preflets that come with the
  install. Then it removes the indicator file.

This fixes the problem that all the apps are not known to the system until
you run them once. Ie "Open With..." and such stuff works out of the box.
Feel free to find a more elegant way, I just found this simple and effective.
:-)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-05 22:25:33 +00:00

136 lines
2.5 KiB
Plaintext

## The system's main boot script.
##
## Some functions used by the main script
##
# launch <executable path> [thread to wait for]
launch() {
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
}
# runprog <executable path>
runprog() {
if [ -f "/boot/$1" ]
then
"/boot/$1"
return 1
else
echo There is no "$1"
fi
return 0
}
##
## Main script starts here
##
# Set up stdin/out/err to nirvana
exec </dev/null
exec >/dev/null 2>&1
# Standard locations of boot files
SCRIPTS=beos/system/boot
SERVERS=beos/system/servers
# Set up the environment
export SAFEMODE=`/bin/safemode`
launchscript $SCRIPTS/SetupEnvironment
# Sets timezone etc.
runprog beos/bin/clockconfig
# Launch servers
# We must wait for the app_server and registrar to be ready
launch $SERVERS/registrar _roster_thread_ # launch registrar
launch $SERVERS/debug_server # launch debug_server
# Init Network
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/net_server # launch net_server
fi
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/app_server picasso # launch app_server
else
launch $SERVERS/fake_app_server picasso
fi
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/syslog_daemon
waitfor _input_server_event_loop_ # wait for input devices
fi
# Launch Terminal or consoled depending on $SAFEMODE
if [ "$SAFEMODE" != "yes" ]; then
if [ -e /etc/users ]; then
launch beos/system/Login
# nothing more
else
launch beos/system/Tracker
launch beos/system/Deskbar
# install ProcessController in the deskbar
(sleep 7; /boot/beos/apps/ProcessController -deskbar) &
fi
launch beos/apps/Terminal
else
launch beos/bin/consoled
fi
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/media_server
launch $SERVERS/midi_server
fi
# Launch Print Server
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/print_server
fi
# Check for daily saving time
launch beos/bin/dstcheck
if [ "$SAFEMODE" != "yes" ]; then
# Start user boot script
if [ -f $HOME/config/boot/UserBootscript ]; then
. $HOME/config/boot/UserBootscript
fi
fi
# Check for fresh install and register all bundled app mimetypes
FRESH_INSTALL_INDICATOR_FILE=$HOME/config/settings/fresh_install
if [ -e $FRESH_INSTALL_INDICATOR_FILE ]; then
mimeset -all -f /boot/beos/apps
mimeset -all -f /boot/beos/preferences
mimeset -all -f /boot/beos/system/servers
mimeset -all -f /boot/apps
rm $FRESH_INSTALL_INDICATOR_FILE
fi