]> git.pld-linux.org Git - packages/VirtualBox.git/commitdiff
- added vboxnetadp init script, rel 5
authortommat <tommat@pld-linux.org>
Thu, 4 Feb 2010 09:44:13 +0000 (09:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    VirtualBox-vboxnetadp.init -> 1.1
    VirtualBox.spec -> 1.262

VirtualBox-vboxnetadp.init [new file with mode: 0644]
VirtualBox.spec

diff --git a/VirtualBox-vboxnetadp.init b/VirtualBox-vboxnetadp.init
new file mode 100644 (file)
index 0000000..19486ff
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# virtualbox   VirtualBox virtualizer for x86 hardware
+#
+# chkconfig:   345 84 25
+#
+# description: InnoTek VirtualBox is a general-purpose full virtualizer for x86 
+#              hardware. Targeted at server, desktop and embedded use.
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+VBOX_DEVICE="/dev/vboxnetctl"
+VBOX_MODULE="vboxnetadp"
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
+
+start() {
+       if [ ! -f /var/lock/subsys/vboxnetadp ]; then
+               modprobe -s $VBOX_MODULE
+               # set proper /dev/vboxdrv for systems with static dev
+               touch /var/lock/subsys/vboxnetadp
+       fi
+}
+
+stop() {
+       # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
+       /sbin/rmmod $VBOX_MODULE
+       rm -f /var/lock/subsys/vboxnetadp
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/vboxnetadp ]; then
+               stop
+               start
+       else
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       if ! is_module $VBOX_MODULE; then
+               echo "$VBOX_MODULE module is loaded"
+       else
+               echo "$VBOX_MODULE module is not loaded"
+               RETVAL=3
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
index a66d4140181186b75c6b0a3a1a040091ca5e0f10..83b9c99d40a581c180e65a2b391cad2767e11903 100644 (file)
@@ -28,7 +28,7 @@
 %define                _enable_debug_packages  0
 %endif
 
-%define                rel             4
+%define                rel             5
 %define                pname   VirtualBox
 Summary:       VirtualBox OSE - x86 hardware virtualizer
 Summary(pl.UTF-8):     VirtualBox OSE - wirtualizator sprzętu x86
@@ -47,6 +47,7 @@ Source3:      %{pname}-vboxdrv.init
 Source4:       %{pname}-vboxguest.init
 Source5:       %{pname}-vboxnetflt.init
 Source6:       %{pname}-vboxvfs.init
+Source7:       %{pname}-vboxnetadp.init
 Source8:       %{pname}.sh
 Source9:       mount.vdi
 Patch0:                %{pname}-configure.patch
@@ -470,6 +471,7 @@ install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxdrv
 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxguest
 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxnetflt
 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxvfs
+install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxnetadp
 %install_kernel_modules -m PLD-MODULE-BUILD/vboxdrv/vboxdrv -d misc
 %install_kernel_modules -m PLD-MODULE-BUILD/vboxguest/vboxguest -d misc
 %install_kernel_modules -m PLD-MODULE-BUILD/vboxnetadp/vboxnetadp -d misc
@@ -550,10 +552,18 @@ fi
 
 %post  -n kernel%{_alt_kernel}-misc-vboxnetadp
 %depmod %{_kernel_ver}
+/sbin/chkconfig --add vboxnetadp
+%service vboxnetadp restart "VirtualBox OSE Network HostOnly driver"
 
 %postun        -n kernel%{_alt_kernel}-misc-vboxnetadp
 %depmod %{_kernel_ver}
 
+%preun -n kernel%{_alt_kernel}-misc-vboxnetadp
+if [ "$1" = "0" ]; then
+       %service vboxnetadp stop
+       /sbin/chkconfig --del vboxnetadp
+fi
+
 %post  -n kernel%{_alt_kernel}-misc-vboxnetflt
 %depmod %{_kernel_ver}
 /sbin/chkconfig --add vboxnetflt
@@ -721,6 +731,7 @@ fi
 
 %files -n kernel%{_alt_kernel}-misc-vboxnetadp
 %defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/vboxnetadp
 /lib/modules/%{_kernel_ver}/misc/vboxnetadp.ko*
 
 %files -n kernel%{_alt_kernel}-misc-vboxnetflt
This page took 0.032108 seconds and 4 git commands to generate.