Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-ose/files: virtualbox-ose-3-wrapper
Date: Tue, 03 Nov 2009 08:13:52
Message-Id: E1N5EWT-00028Q-UN@stork.gentoo.org
1 patrick 09/11/03 08:13:49
2
3 Added: virtualbox-ose-3-wrapper
4 Log:
5 Bump to 3.0.10, fixes #291214 #290296 #285749 #286163
6 (Portage version: 2.2_rc48/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 app-emulation/virtualbox-ose/files/virtualbox-ose-3-wrapper
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-ose/files/virtualbox-ose-3-wrapper?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-ose/files/virtualbox-ose-3-wrapper?rev=1.1&content-type=text/plain
13
14 Index: virtualbox-ose-3-wrapper
15 ===================================================================
16 #!/bin/sh
17 #
18 # Sun VirtualBox
19 #
20 # Copyright (C) 2006-2009 Sun Microsystems, Inc.
21 #
22 # This file is part of VirtualBox Open Source Edition (OSE), as
23 # available from http://www.virtualbox.org. This file is free software;
24 # you can redistribute it and/or modify it under the terms of the GNU
25 # General Public License (GPL) as published by the Free Software
26 # Foundation, in version 2 as it comes in the "COPYING" file of the
27 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
28 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
29 #
30 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
31 # Clara, CA 95054 USA or visit http://www.sun.com if you need
32 # additional information or have any questions.
33 #
34
35 PATH="/usr/bin:/bin:/usr/sbin:/sbin"
36 CONFIG="/etc/vbox/vbox.cfg"
37
38 if [ ! -r "$CONFIG" ]; then
39 echo "Could not find VirtualBox installation. Please reinstall."
40 exit 1
41 fi
42
43 . "$CONFIG"
44
45 # Note: This script must not fail if the module was not successfully installed
46 # because the user might not want to run a VM but only change VM params!
47
48 if [ "$1" = "shutdown" ]; then
49 SHUTDOWN="true"
50 elif ! lsmod|grep -q vboxdrv; then
51 cat << EOF
52 WARNING: The VirtualBox kernel modules are not loaded.
53 Please load all the needed kernel modules by:
54
55 for m in vbox{drv,netadp,netflt}; do modprobe $m; done
56
57 You will not be able to start VMs until this problem is fixed.
58 EOF
59 elif [ ! -c /dev/vboxdrv ]; then
60 cat << EOF
61 WARNING: The character device /dev/vboxdrv does not exist.
62 Please try to reload all the needed kernel modules by:
63
64 for m in vbox{netflt,netadp,drv}; do rmmod $m; done
65 for m in vbox{drv,netadp,netflt}; do modprobe $m; done
66
67 and if that is not successful, try to re-install the package by:
68
69 emerge -1av app-emulation/virtualbox-modules
70
71 You will not be able to start VMs until this problem is fixed.
72 EOF
73 fi
74
75 SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
76 if [ -z "$SERVER_PID" ]; then
77 # Server not running yet/anymore, cleanup socket path.
78 # See IPC_GetDefaultSocketPath()!
79 if [ -n "$LOGNAME" ]; then
80 rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
81 else
82 rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
83 fi
84 fi
85
86 if [ "$SHUTDOWN" = "true" ]; then
87 if [ -n "$SERVER_PID" ]; then
88 kill -TERM $SERVER_PID
89 sleep 2
90 fi
91 exit 0
92 fi
93
94 APP=`which $0`
95 APP=`basename $APP`
96 APP=${APP##/*/}
97 case "$APP" in
98 VirtualBox)
99 exec "$INSTALL_DIR/VirtualBox" "$@"
100 ;;
101 VBoxManage)
102 exec "$INSTALL_DIR/VBoxManage" "$@"
103 ;;
104 VBoxSDL)
105 exec "$INSTALL_DIR/VBoxSDL" "$@"
106 ;;
107 VBoxVRDP)
108 exec "$INSTALL_DIR/VBoxHeadless" "$@"
109 ;;
110 VBoxHeadless)
111 exec "$INSTALL_DIR/VBoxHeadless" "$@"
112 ;;
113 vboxwebsrv)
114 exec "$INSTALL_DIR/vboxwebsrv" "$@"
115 ;;
116 *)
117 echo "Unknown application - $APP"
118 ;;
119 esac