[Pkg-virtualbox-commits] [virtualbox] 03/04: Revert "Do the same for virtualbox-guest-utils"

Gianfranco Costamagna locutusofborg-guest at moszumanska.debian.org
Wed Dec 30 16:31:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

locutusofborg-guest pushed a commit to branch master
in repository virtualbox.

commit d91f0f3a11cb7773922fd2ada2f334ec79e90b33
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Mon Dec 28 18:15:33 2015 +0100

    Revert "Do the same for virtualbox-guest-utils"
    
    This reverts commit c4a8473c17833969feebe8fb4b805fe6e275205b.
---
 debian/virtualbox-guest-utils.init        | 102 ++++++++++++++++++++++++++++++
 debian/virtualbox-guest-utils.maintscript |   1 -
 debian/virtualbox-guest-utils.postinst    |   9 ---
 3 files changed, 102 insertions(+), 10 deletions(-)

diff --git a/debian/virtualbox-guest-utils.init b/debian/virtualbox-guest-utils.init
new file mode 100644
index 0000000..2f7a518
--- /dev/null
+++ b/debian/virtualbox-guest-utils.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+# (C) 2007 Michael Meskes <meskes at debian.org>
+
+### BEGIN INIT INFO
+# Provides:          vboxguest virtualbox-guest-utils
+# Short-Description: VirtualBox Linux Additions
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+
+PATH=$PATH:/bin:/sbin:/usr/sbin
+
+. /lib/lsb/init-functions
+
+test -d /usr/share/doc/virtualbox-guest-utils -a -x /usr/sbin/VBoxService || exit 0
+
+in_virtual_machine()
+{
+	if [ -z "$(lspci -d 80ee:beef)" ]; then
+		log_warning_msg "VirtualBox Additions disabled, not in a Virtual Machine"
+		return 1
+	fi
+
+	return 0
+}
+
+running()
+{
+    lsmod | grep -q "$1[^_-]"
+}
+
+case "$1" in
+  start)
+	in_virtual_machine || exit 0
+	log_begin_msg "Starting VirtualBox Additions"
+
+	if ! running vboxguest; then
+		if ! modprobe vboxguest > /dev/null 2>&1; then
+			if ! find /lib/modules/`uname -r` -name "vboxguest\.*" 2>/dev/null|grep -q vboxguest; then
+				log_failure_msg "No suitable module for running kernel found"
+			else
+				log_failure_msg "modprobe vboxguest failed. Please use 'dmesg' to find out why"
+			fi
+			log_end_msg 1
+			return 1
+		fi
+	fi
+
+	if ! running vboxsf; then
+		if ! modprobe vboxsf > /dev/null 2>&1; then
+			if ! find /lib/modules/`uname -r` -name "vboxsf\.*" 2>/dev/null|grep -q vboxsf; then
+				log_failure_msg "No suitable module for running kernel found"
+			else
+				log_failure_msg "modprobe vboxsf failed. Please use 'dmesg' to find out why"
+			fi
+			log_end_msg 1
+			return 1
+		fi
+	fi
+
+	start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/VBoxService
+	if [ $? -ne 0 ]; then
+		log_end_msg 1
+		exit 1
+	fi
+
+	log_end_msg 0
+	;;
+
+  stop)
+	in_virtual_machine || exit 0
+	log_begin_msg "Stopping VirtualBox Additions"
+
+	start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/VBoxService
+	if [ $? -ne 0 ]; then
+		log_end_msg 1
+		exit 1
+	fi
+
+	log_end_msg 0
+	;;
+
+  restart|force-reload)
+	$0 stop && $0 start
+	;;
+
+  status)
+	if ! pgrep -x VBoxService > /dev/null; then
+		echo "VBoxService daemon isn't running"
+		exit 3
+	fi
+
+	exit 0
+	;;
+
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload|status}"
+	exit 1
+	;;
+esac
diff --git a/debian/virtualbox-guest-utils.maintscript b/debian/virtualbox-guest-utils.maintscript
deleted file mode 100644
index 39663d8..0000000
--- a/debian/virtualbox-guest-utils.maintscript
+++ /dev/null
@@ -1 +0,0 @@
-rm_conffile /etc/init.d/virtualbox-guest-utils 5.0.12-dfsg-2~
diff --git a/debian/virtualbox-guest-utils.postinst b/debian/virtualbox-guest-utils.postinst
index 1c47ec7..f9849ce 100644
--- a/debian/virtualbox-guest-utils.postinst
+++ b/debian/virtualbox-guest-utils.postinst
@@ -14,12 +14,3 @@ fi
 if [ "$1" = configure ] && [ -z `getent group vboxsf` ]; then
 	addgroup --system --quiet vboxsf
 fi
-
-# remove stale virtualbox-guest-utils links
-case "$1" in
-  configure)
-    if dpkg --compare-versions "$2" lt "5.0.12-dfsg-2~" ; then
-      update-rc.d -f virtualbox-guest-utils remove > /dev/null || true
-    fi
-  ;;
-esac

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git



More information about the Pkg-virtualbox-commits mailing list