blob: 732aacac7b67b74ca25610f8ecb6afcdee4c0737 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
depend() {
need localmount
before xdm
}
createvboxdevice() {
local maj min
maj=`sed -n 's;\([0-9]\+\) vboxguest;\1;p' /proc/devices`
if ! [[ -z $maj ]] ; then
min=0
else
min=`sed -n 's;\([0-9]\+\) vboxguest;\1;p' /proc/misc`
if ! [[ -z $min ]] ; then
maj=10
fi
fi
mknod /dev/vboxguest c $maj $min -m 0664 &> /dev/null
}
start() {
ebegin "Starting VirtualBox guest additions"
if [[ -e /dev/vboxguest ]] ; then
rm -f /dev/vboxguest &> /dev/null
fi
einfo " Loading kernel modules and creating devices"
/sbin/modprobe vboxguest &> /dev/null
createvboxdevice
/sbin/modprobe vboxvfs &> /dev/null
einfo " Starting the vboxguest system service"
start-stop-daemon --start --make-pidfile \
--exec /usr/sbin/vboxguest-service --pidfile /var/run/vboxguest-service.pid \
--name vboxguest-service \
--background -- \
--foreground
eend $? "Failed to start VirtualBox guest additions"
}
stop() {
ebegin "Stopping VirtualBox guest additions"
einfo " Stopping the vboxguest system service"
start-stop-daemon --stop --quiet \
--pidfile /var/run/vboxguest-service.pid --name vboxguest-service
einfo " Unloading kernel modules and removing devices"
/sbin/rmmod vboxvfs &> /dev/null
/sbin/rmmod vboxguest &> /dev/null
rm -f /dev/vboxguest &> /dev/null
eend $?
}
|