Gentoo Archives: gentoo-commits

From: "Markus Ullmann (jokey)" <jokey@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-bin/files: virtualbox-bin-wrapper virtualbox-bin-config virtualbox-bin-interfaces digest-virtualbox-bin-1.4.0-r1 digest-virtualbox-bin-1.5.0-r1
Date: Mon, 22 Oct 2007 22:22:01
Message-Id: E1Ik5ek-0007rP-La@stork.gentoo.org
1 jokey 07/10/22 22:21:54
2
3 Modified: virtualbox-bin-wrapper
4 Added: virtualbox-bin-config virtualbox-bin-interfaces
5 Removed: digest-virtualbox-bin-1.4.0-r1
6 digest-virtualbox-bin-1.5.0-r1
7 Log:
8 Drop old and add new-style wrapper
9 (Portage version: 2.1.3.15)
10
11 Revision Changes Path
12 1.3 app-emulation/virtualbox-bin/files/virtualbox-bin-wrapper
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-wrapper?rev=1.3&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-wrapper?rev=1.3&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-wrapper?r1=1.2&r2=1.3
17
18 Index: virtualbox-bin-wrapper
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-wrapper,v
21 retrieving revision 1.2
22 retrieving revision 1.3
23 diff -u -r1.2 -r1.3
24 --- virtualbox-bin-wrapper 7 Oct 2007 22:01:12 -0000 1.2
25 +++ virtualbox-bin-wrapper 22 Oct 2007 22:21:54 -0000 1.3
26 @@ -1,66 +1,116 @@
27 #!/bin/sh
28 +#
29 +# innotek VirtualBox
30 +#
31 +# Copyright (C) 2006-2007 innotek GmbH
32 +#
33 +# This file is part of VirtualBox Open Source Edition (OSE), as
34 +# available from http://www.virtualbox.org. This file is free software;
35 +# you can redistribute it and/or modify it under the terms of the GNU
36 +# General Public License as published by the Free Software Foundation,
37 +# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
38 +# distribution. VirtualBox OSE is distributed in the hope that it will
39 +# be useful, but WITHOUT ANY WARRANTY of any kind.
40 +
41 +PATH="/usr/bin:/bin:/usr/sbin:/sbin"
42 +CONFIG="/etc/vbox/vbox.cfg"
43 +
44 +if [ ! -r "$CONFIG" ]; then
45 + echo "Could not find VirtualBox installation. Please reinstall."
46 + exit 1
47 +fi
48 +
49 +. "$CONFIG"
50
51 -INSTALL_DIR=/opt/VirtualBox
52 -USER=$( whoami )
53 -
54 -SERVER_PID=$( ps -U $USER | grep VBoxSVC | awk '{ print $1 }' )
55 +# Note: This script must not fail if the module was not successfully installed
56 +# because the user might not want to run a VM but only change VM params!
57
58 -if [ "$1" = shutdown ]; then
59 - if [ "$SERVER_PID" != "" ]; then
60 - kill -TERM $SERVER_PID
61 - sleep 2
62 - fi
63 - exit 0
64 -fi
65 +if [ "$1" = "shutdown" ]; then
66 + SHUTDOWN="true"
67 +elif [ ! -e /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
68 + cat << EOF
69 +WARNING: There is no module available for the currente kernel (`uname -r`).
70 + Please recompile the kernel module and install it by
71 +
72 + sudo emerge -1 virtualbox-modules
73 +
74 + You will not be able to start VMs until this problem is fixed.
75 +EOF
76 +elif ! lsmod|grep -q vboxdrv; then
77 + cat << EOF
78 +WARNING: The vboxdrv kernel module is not loaded.
79 + Please load the kernel by
80 +
81 + sudo modprobe vboxdrv
82 +
83 + You will not be able to start VMs until this problem is fixed.
84 +EOF
85 +elif [ ! -c /dev/vboxdrv ]; then
86 + cat << EOF
87 +WARNING: The character device /dev/vboxdrv does not exist. Try
88
89 -[ -z "$VBOX_USER_HOME" ] && VBOX_USER_HOME="$HOME/.VirtualBox"
90 + sudo /etc/init.d/virtualbox restart
91
92 -mkdir -p "$VBOX_USER_HOME"
93 -LOG="$VBOX_USER_HOME/VBoxSVC.log"
94 + and if that is not successful, try to re-install the package.
95
96 -if [ -e /proc/modules -a ! -e /dev/vboxdrv ] ; then
97 - echo "Error: vboxdrv kernel module is not loaded..."
98 - echo "Please load the module before starting VirtualBox."
99 - exit 1
100 + You will not be able to start VMs until this problem is fixed.
101 +EOF
102 elif [ ! -w /dev/vboxdrv ]; then
103 - if [ "`id | grep vboxusers`" = "" ]; then
104 - echo "Error: You are not a member of the \"vboxusers\" group..."
105 - echo "Please add yourself to this group before starting VirtualBox."
106 - else
107 - echo "Error: /dev/vboxdrv is not writable for some reason..."
108 - echo "If you recently added the current user to the vboxusers group,"
109 - echo "then you have to logout and re-login to take the change effect."
110 - fi
111 - exit 1
112 + if [ "`id | grep vboxusers`" = "" ]; then
113 + cat << EOF
114 +WARNING: You are not a member of the "vboxusers" group. Please add yourself
115 + to this group before starting VirtualBox.
116 +
117 + You will not be able to start VMs until this problem is fixed.
118 +EOF
119 + else
120 + cat << EOF
121 +WARNING: /dev/vboxdrv not writable for some reason. If you recently added the
122 + current user to the vboxusers group then you have to logout and
123 + re-login to take the change effect.
124 +
125 + You will not be able to start VMs until this problem is fixed.
126 +EOF
127 + fi
128 fi
129
130 -export LD_LIBRARY_PATH="$INSTALL_DIR"
131 +export LD_LIBRARY_PATH="$INSTALL_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
132
133 +SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
134 if [ -z "$SERVER_PID" ]; then
135 - rm -rf /tmp/.vbox-$USER-ipc
136 - [ -f "$LOG.1" ] && mv "$LOG.1" "$LOG.2"
137 - [ -f "$LOG.0" ] && mv "$LOG.0" "$LOG.1"
138 - [ -f "$LOG" ] && mv "$LOG" "$LOG.0"
139 - /opt/VirtualBox/VBoxSVC --daemonize >"$LOG" 2>&1
140 + # Server not running yet/anymore, cleanup socket path.
141 + # See IPC_GetDefaultSocketPath()!
142 + if [ -n "$LOGNAME" ]; then
143 + rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
144 + else
145 + rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
146 + fi
147 +fi
148 +
149 +if [ "$SHUTDOWN" = "true" ]; then
150 + if [ -n "$SERVER_PID" ]; then
151 + kill -TERM $SERVER_PID
152 + sleep 2
153 + fi
154 + exit 0
155 fi
156
157 -APP=$( command -v "$0" )
158 +APP=`which $0`
159 APP=${APP##/*/}
160 case "$APP" in
161 - virtualbox)
162 - exec "$INSTALL_DIR/VirtualBox" "$@"
163 - ;;
164 - vboxmanage)
165 - exec "$INSTALL_DIR/VBoxManage" "$@"
166 - ;;
167 - vboxsdl)
168 - exec "$INSTALL_DIR/VBoxSDL" "$@"
169 - ;;
170 - vboxvrdp)
171 - exec "$INSTALL_DIR/VBoxVRDP" "$@"
172 - ;;
173 - *)
174 - echo "Error: Unknown application - $APP"
175 - exit 1
176 - ;;
177 + VirtualBox)
178 + exec "$INSTALL_DIR/VirtualBox" "$@"
179 + ;;
180 + VBoxManage)
181 + exec "$INSTALL_DIR/VBoxManage" "$@"
182 + ;;
183 + VBoxSDL)
184 + exec "$INSTALL_DIR/VBoxSDL" "$@"
185 + ;;
186 + VBoxVRDP)
187 + exec "$INSTALL_DIR/VBoxVRDP" "$@"
188 + ;;
189 + *)
190 + echo "Unknown application - $APP"
191 + ;;
192 esac
193
194
195
196 1.1 app-emulation/virtualbox-bin/files/virtualbox-bin-config
197
198 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-config?rev=1.1&view=markup
199 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-config?rev=1.1&content-type=text/plain
200
201 Index: virtualbox-bin-config
202 ===================================================================
203 INSTALL_DIR=/opt/VirtualBox
204
205
206
207 1.1 app-emulation/virtualbox-bin/files/virtualbox-bin-interfaces
208
209 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-interfaces?rev=1.1&view=markup
210 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-bin/files/virtualbox-bin-interfaces?rev=1.1&content-type=text/plain
211
212 Index: virtualbox-bin-interfaces
213 ===================================================================
214 # This file is for registering VirtualBox permanent host networking interfaces
215 # and optionally adding them to network bridges on the host.
216 # Each line should be of the format <interface name> <user name> [<bridge>].
217
218
219
220
221 --
222 gentoo-commits@g.o mailing list