1 |
polynomial-c 10/05/11 05:39:44 |
2 |
|
3 |
Added: virtualbox-guest-additions-4.initd |
4 |
Log: |
5 |
taking care of renamed module (vboxvfs --> vboxsf) |
6 |
(Portage version: 2.2_rc67/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-4.initd |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-4.initd?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-4.initd?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: virtualbox-guest-additions-4.initd |
15 |
=================================================================== |
16 |
#!/sbin/runscript |
17 |
# Copyright 1999-2009 Gentoo Foundation |
18 |
# Distributed under the terms of the GNU General Public License v2 |
19 |
# $Header: |
20 |
|
21 |
depend() { |
22 |
need localmount |
23 |
before xdm |
24 |
} |
25 |
|
26 |
createvboxdevice() { |
27 |
local maj min |
28 |
|
29 |
maj=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/devices` |
30 |
|
31 |
if ! [[ -z $maj ]] ; then |
32 |
min=0 |
33 |
else |
34 |
min=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/misc` |
35 |
if ! [[ -z $min ]] ; then |
36 |
maj=10 |
37 |
fi |
38 |
fi |
39 |
|
40 |
mknod /dev/vboxadd c $maj $min -m 0664 &> /dev/null |
41 |
} |
42 |
|
43 |
start() { |
44 |
ebegin "Starting VirtualBox guest additions" |
45 |
|
46 |
if [[ -e /dev/vboxadd ]] ; then |
47 |
rm -f /dev/vboxadd &> /dev/null |
48 |
fi |
49 |
|
50 |
einfo " Loading kernel modules and creating devices" |
51 |
/sbin/modprobe vboxadd &> /dev/null |
52 |
createvboxdevice |
53 |
/sbin/modprobe vboxsf &> /dev/null |
54 |
|
55 |
einfo " Starting the vboxadd system service" |
56 |
start-stop-daemon --start --make-pidfile \ |
57 |
--exec /usr/sbin/vboxadd-service --pidfile /var/run/vboxadd-service.pid \ |
58 |
--name vboxadd-service \ |
59 |
--background -- \ |
60 |
--foreground |
61 |
|
62 |
eend $? "Failed to start VirtualBox guest additions" |
63 |
} |
64 |
|
65 |
stop() { |
66 |
ebegin "Stopping VirtualBox guest additions" |
67 |
|
68 |
einfo " Stopping the vboxadd system service" |
69 |
start-stop-daemon --stop --quiet \ |
70 |
--pidfile /var/run/vboxadd-service.pid --name vboxadd-service |
71 |
|
72 |
einfo " Unloading kernel modules and removing devices" |
73 |
/sbin/rmmod vboxsf &> /dev/null |
74 |
/sbin/rmmod vboxadd &> /dev/null |
75 |
rm -f /dev/vboxadd &> /dev/null |
76 |
eend $? |
77 |
} |