2008-03-06 04:20:09 +03:00
|
|
|
## 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
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2009-08-26 12:58:26 +04:00
|
|
|
# Launch Installer
|
|
|
|
|
|
|
|
cd /boot/home
|
|
|
|
if [ -x /boot/system/apps/Installer ]; then
|
|
|
|
/boot/system/apps/Installer
|
2008-03-06 04:20:09 +03:00
|
|
|
else
|
2009-08-26 12:58:26 +04:00
|
|
|
/boot/system/apps/Terminal
|
2008-03-06 04:20:09 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# sync disks
|
2009-04-22 23:40:41 +04:00
|
|
|
/bin/sync
|
2008-03-06 04:20:09 +03:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|