public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-guest-additions/files: virtualbox-guest-additions-4.initd
@ 2010-05-11  5:39 Lars Wendler (polynomial-c)
  0 siblings, 0 replies; only message in thread
From: Lars Wendler (polynomial-c) @ 2010-05-11  5:39 UTC (permalink / raw
  To: gentoo-commits

polynomial-c    10/05/11 05:39:44

  Added:                virtualbox-guest-additions-4.initd
  Log:
  taking care of renamed module (vboxvfs --> vboxsf)
  (Portage version: 2.2_rc67/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-4.initd

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
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

Index: virtualbox-guest-additions-4.initd
===================================================================
#!/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]\+\) vboxadd;\1;p' /proc/devices`

		if ! [[ -z $maj ]] ; then
			min=0
		else
			min=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/misc`
			if ! [[ -z $min ]] ; then
				maj=10
			fi
		fi

		mknod /dev/vboxadd c $maj $min -m 0664 &> /dev/null
}

start() {
	ebegin "Starting VirtualBox guest additions"

	if [[ -e /dev/vboxadd ]] ; then
		rm -f /dev/vboxadd &> /dev/null
	fi

	einfo "	Loading kernel modules and creating devices"
	/sbin/modprobe vboxadd &> /dev/null
	createvboxdevice
	/sbin/modprobe vboxsf &> /dev/null

	einfo "	Starting the vboxadd system service"
        start-stop-daemon --start --make-pidfile \
		--exec /usr/sbin/vboxadd-service --pidfile /var/run/vboxadd-service.pid \
		--name vboxadd-service \
		--background -- \
		--foreground

        eend $? "Failed to start VirtualBox guest additions"
}

stop() {
        ebegin "Stopping VirtualBox guest additions"

	einfo "	Stopping the vboxadd system service"
	start-stop-daemon --stop --quiet \
		--pidfile /var/run/vboxadd-service.pid --name vboxadd-service

	einfo " Unloading kernel modules and removing devices"
	/sbin/rmmod vboxsf &> /dev/null
	/sbin/rmmod vboxadd &> /dev/null
	rm -f /dev/vboxadd &> /dev/null
        eend $?
}






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-11  5:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11  5:39 [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-guest-additions/files: virtualbox-guest-additions-4.initd Lars Wendler (polynomial-c)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox