vboxadd.sh revision 4588953d4b4d0605b928cd0f52a08c239fc4664a
# Sun xVM VirtualBox
# Linux Additions kernel module init script
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
# chkconfig: 35 30 60
# description: VirtualBox Linux Additions kernel modules
#
### BEGIN INIT INFO
# Provides: vboxadd
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox Linux Additions kernel modules
### END INIT INFO
if [ -f /etc/arch-release ]; then
elif [ -f /etc/redhat-release ]; then
elif [ -f /etc/SuSE-release ]; then
elif [ -f /etc/gentoo-release ]; then
else
fi
if [ "$system" = "arch" ]; then
}
}
stat_busy "$1"
}
fi
if [ "$system" = "redhat" ]; then
echo
}
echo
}
echo -n "$1"
}
fi
if [ "$system" = "suse" ]; then
rc_status -v
}
rc_status -v
}
echo -n "$1"
}
fi
if [ "$system" = "gentoo" ]; then
if [ -f /sbin/functions.sh ]; then
. /sbin/functions.sh
fi
eend 1
}
eend $?
}
ebegin $1
}
shift
fi
fi
if [ "$system" = "lfs" ]; then
}
}
echo $1
}
fi
if [ "$system" = "other" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n $1
}
fi
group=1
fail()
{
eerror $1
exit 1
fi
echo "($1)"
exit 1
}
{
}
{
}
start()
{
running_vboxadd || {
}
fail "modprobe vboxadd failed"
}
sleep .5
}
if [ ! -c $dev ]; then
min=0
else
maj=10
fi
fi
fail "Cannot locate the VirtualBox device"
}
}
fi
}
running_vboxvfs || {
echo "You may be trying to run Guest Additions from binary release of VirtualBox"
echo "in the Open Source Edition."
exit 1
fi
fail "modprobe vboxvfs failed"
}
}
fi
# other startup script but this requires the vboxdrv kernel module loaded.
return 0
}
stop()
{
fail "Cannot unmount vboxsf folders"
fi
if running_vboxvfs; then
fi
fi
if running_vboxadd; then
fi
return 0
}
restart()
{
stop && start
return 0
}
setup()
{
# don't stop the old modules here -- they might be in use
begin "Removing old VirtualBox vboxvfs kernel module"
fi
begin "Removing old VirtualBox vboxadd kernel module"
fi
begin "Recompiling VirtualBox kernel modules"
if ! $BUILDVBOXADD \
fi
if ! $BUILDVBOXVFS \
--use-module-symvers /tmp/vboxadd-Module.symvers \
fi
fi
if ! $BUILDVBOXVIDEO \
--use-module-symvers /tmp/vboxadd-Module.symvers \
fi
fi
echo
echo "You should reboot your guest to make sure the new modules are actually used"
}
{
if running_vboxadd; then
echo "The VirtualBox Additions are currently running."
else
echo "The VirtualBox Additions are not currently running."
fi
}
case "$1" in
;;
stop)
stop
;;
;;
;;
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit