31b2d189ab
feature and offer the user to boot into the Installer or into the Desktop (Live-CD mode). Thanks to Vincent Duvert who offered a method that worked around some interference from mysterious debug output... The launching of the servers has been refactored, since that needs to be done anyways before an alert can be shown. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30332 a95241bf-73f2-0310-859d-f6bbb57e9c96
75 lines
1.1 KiB
Plaintext
75 lines
1.1 KiB
Plaintext
## The system's main CD 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
|
|
##
|
|
|
|
|
|
# Launch Terminal or consoled depending on $SAFEMODE
|
|
if [ "$SAFEMODE" != "yes" ]; then
|
|
if [ -x /boot/system/apps/Installer ]; then
|
|
/boot/system/apps/Installer
|
|
#/boot/system/apps/Terminal -x /boot/system/apps/Installer
|
|
else
|
|
/boot/system/apps/Terminal
|
|
fi
|
|
#launch system/apps/Terminal
|
|
else
|
|
launch system/bin/consoled
|
|
fi
|
|
|
|
# sync disks
|
|
/bin/sync
|
|
|
|
# prepare for reboot
|
|
# (reboot quickly in 10 seconds)
|
|
# (we must start the shutdown process before /boot is ejected)
|
|
/bin/shutdown -r -q -d 10 &
|
|
|
|
# unblock the CD tray
|
|
/bin/eject -u /boot
|
|
# and open it before rebooting
|
|
/bin/eject /boot
|
|
|
|
|