VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh

最後變更 在這個檔案是 108067,由 vboxsync 提交於 6 週 前

Additions: Installer: Linux: Fix installation script for systems which do not have X.org installed, bugref:10859.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 21.7 KB
 
1#! /bin/sh
2# $Id: vboxadd-x11.sh 108067 2025-02-05 11:35:39Z vboxsync $
3## @file
4# Linux Additions X11 setup init script ($Revision: 108067 $)
5#
6
7#
8# Copyright (C) 2006-2024 Oracle and/or its affiliates.
9#
10# This file is part of VirtualBox base platform packages, as
11# available from https://www.alldomusa.eu.org.
12#
13# This program is free software; you can redistribute it and/or
14# modify it under the terms of the GNU General Public License
15# as published by the Free Software Foundation, in version 3 of the
16# License.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, see <https://www.gnu.org/licenses>.
25#
26# SPDX-License-Identifier: GPL-3.0-only
27#
28
29
30# chkconfig: 35 30 70
31# description: VirtualBox Linux Additions kernel modules
32#
33### BEGIN INIT INFO
34# Provides: vboxadd-x11
35# Required-Start:
36# Required-Stop:
37# Default-Start:
38# Default-Stop:
39# Description: VirtualBox Linux Additions X11 setup
40### END INIT INFO
41
42PATH=$PATH:/bin:/sbin:/usr/sbin
43CONFIG_DIR="/var/lib/VBoxGuestAdditions"
44CONFIG="${CONFIG_DIR}/config"
45MODPROBE=/sbin/modprobe
46
47if $MODPROBE -c 2>/dev/null | grep -q '^allow_unsupported_modules *0'; then
48 MODPROBE="$MODPROBE --allow-unsupported-modules"
49fi
50
51# Find the version of X installed
52# The last of the three is for the X.org 6.7 included in Fedora Core 2
53xver=`X -version 2>&1`
54x_version=`echo "$xver" | sed -n 's/^X Window System Version \([0-9.]\+\)/\1/p'``echo "$xver" | sed -n 's/^XFree86 Version \([0-9.]\+\)/\1/p'``echo "$xver" | sed -n 's/^X Protocol Version 11, Revision 0, Release \([0-9.]\+\)/\1/p'``echo "$xver" | sed -n 's/^X.Org X Server \([0-9.]\+\)/\1/p'`
55x_version_short=`echo "${x_version}" | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/'`
56# Version of Redhat or Fedora installed. Needed for setting up selinux policy.
57redhat_release=`cat /etc/redhat-release 2> /dev/null`
58# Version of OL installed. Needed for blacklisting vboxvideo.
59oracle_release=`cat /etc/oracle-release 2> /dev/null`
60# All the different possible locations for XFree86/X.Org configuration files
61# - how many of these have ever been used?
62x11conf_files="/etc/X11/xorg.conf /etc/X11/xorg.conf-4 /etc/X11/.xorg.conf \
63 /etc/xorg.conf /usr/etc/X11/xorg.conf-4 /usr/etc/X11/xorg.conf \
64 /usr/lib/X11/xorg.conf-4 /usr/lib/X11/xorg.conf /etc/X11/XF86Config-4 \
65 /etc/X11/XF86Config /etc/XF86Config /usr/X11R6/etc/X11/XF86Config-4 \
66 /usr/X11R6/etc/X11/XF86Config /usr/X11R6/lib/X11/XF86Config-4 \
67 /usr/X11R6/lib/X11/XF86Config"
68
69# Preamble for Gentoo
70if [ "`which $0`" = "/sbin/rc" ]; then
71 shift
72fi
73
74dev=/dev/vboxguest
75userdev=/dev/vboxuser
76owner=vboxadd
77group=1
78
79fail()
80{
81 echo "${1}" >&2
82 exit 1
83}
84
85# Install an X11 desktop startup application. The application should be a shell script.
86# Its name should be purely alphanumeric and should start with a two digit number (preferably
87# 98 or thereabouts) to indicate its place in the Debian Xsession startup order.
88#
89# syntax: install_x11_startup_app app desktop service_name
90install_x11_startup_app() {
91 self="install_x11_startup_app"
92 app_src=$1
93 desktop_src=$2
94 service_name=$3
95 alt_command=$4
96 test -r "$app_src" || fail "$self: no script given"
97 test -r "$desktop_src" || fail "$self: no desktop file given"
98 test -n "$service_name" || fail "$self: no service given"
99 test -n "$alt_command" || fail "$self: no service given"
100 app_dest=`basename $app_src sh`
101 app_dest_sh=`basename $app_src sh`.sh
102 desktop_dest=`basename $desktop_src`
103 found=0
104 x11_autostart="/etc/xdg/autostart"
105 kde_autostart="/usr/share/autostart"
106 redhat_dir=/etc/X11/Xsession.d
107 mandriva_dir=/etc/X11/xinit.d
108 debian_dir=/etc/X11/xinit/xinitrc.d
109 if [ -d "$mandriva_dir" -a -w "$mandriva_dir" -a -x "$mandriva_dir" ]
110 then
111 install -m 0644 $app_src "$mandriva_dir/$app_dest"
112 found=1
113 fi
114 if [ -d "$x11_autostart" -a -w "$x11_autostart" -a -x "$x11_autostart" ]
115 then
116 install -m 0644 $desktop_src "$x11_autostart/$desktop_dest"
117 found=1
118 fi
119 if [ -d "$kde_autostart" -a -w "$kde_autostart" -a -x "$kde_autostart" ]
120 then
121 install -m 0644 $desktop_src "$kde_autostart/$desktop_dest"
122 found=1
123 fi
124 if [ -d "$redhat_dir" -a -w "$redhat_dir" -a -x "$redhat_dir" ]
125 then
126 install -m 0644 $app_src "$redhat_dir/$app_dest"
127 found=1
128 fi
129 if [ -d "$debian_dir" -a -w "$debian_dir" -a -x "$debian_dir" ]
130 then
131 install -m 0755 $app_src "$debian_dir/$app_dest_sh"
132 found=1
133 fi
134 if [ $found -eq 1 ]; then
135 return 0
136 fi
137 cat >&2 << EOF
138Could not set up the $service_name desktop service.
139To start it at log-in for a given user, add the command $alt_command
140to the file .xinitrc in their home directory.
141EOF
142 return 1
143}
144
145
146start()
147{
148 # Todo: check configuration and correct it if necessary
149 return 0
150}
151
152stop()
153{
154 return 0
155}
156
157restart()
158{
159 stop && start
160 return 0
161}
162
163setup_opengl()
164{
165 # Install the guest OpenGL drivers. For now we don't support
166 # multi-architecture installations
167 rm -f /etc/ld.so.conf.d/00vboxvideo.conf
168 rm -Rf /var/lib/VBoxGuestAdditions/lib
169 if /usr/bin/VBoxClient --check3d 2>/dev/null; then
170 mkdir -p /var/lib/VBoxGuestAdditions/lib
171 ln -sf "${INSTALL_DIR}/lib/VBoxOGL.so" /var/lib/VBoxGuestAdditions/lib/libGL.so.1
172 # SELinux for the OpenGL libraries, so that gdm can load them during the
173 # acceleration support check. This prevents an "Oh no, something has gone
174 # wrong!" error when starting EL7 guests.
175 if test -e /etc/selinux/config; then
176 if command -v semanage > /dev/null; then
177 semanage fcontext -a -t lib_t "/var/lib/VBoxGuestAdditions/lib/libGL.so.1"
178 fi
179 # This is needed on old Fedora/Redhat systems. No one remembers which.
180 chcon -h -t lib_t "/var/lib/VBoxGuestAdditions/lib/libGL.so.1" 2>/dev/null
181 fi
182 echo "/var/lib/VBoxGuestAdditions/lib" > /etc/ld.so.conf.d/00vboxvideo.conf
183 fi
184 ldconfig
185}
186
187setup()
188{
189 if test -r "${CONFIG}"; then
190 . "${CONFIG}"
191 else
192 fail "Configuration file ${CONFIG} not found"
193 fi
194 test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
195 fail "Configuration file ${CONFIG} not complete"
196 lib_dir="${INSTALL_DIR}/other"
197 test -x "${lib_dir}" ||
198 fail "Invalid Guest Additions configuration found."
199 # By default we want to configure X
200 dox11config="true"
201 # By default, we want to run our xorg.conf setup script
202 setupxorgconf="true"
203 # All but the oldest supported X servers can automatically set up the
204 # keyboard driver.
205 autokeyboard="--autoKeyboard"
206 # On more recent servers our kernel mouse driver will be used
207 # automatically
208 automouse="--autoMouse"
209 # We need to tell our xorg.conf hacking script whether /dev/psaux exists
210 nopsaux="--nopsaux"
211 case "`uname -r`" in 2.4.*)
212 test -c /dev/psaux && nopsaux="";;
213 esac
214 # Should we use the VMSVGA driver instead of VBoxVideo?
215 if grep 80eebeef /proc/bus/pci/devices > /dev/null; then
216 vmsvga=""
217 elif grep 15ad0405 /proc/bus/pci/devices > /dev/null; then
218 vmsvga="--vmsvga"
219 else
220 dox11config=""
221 fi
222 # The video driver to install for X.Org 6.9+
223 vboxvideo_src=
224 # The mouse driver to install for X.Org 6.9+
225 vboxmouse_src=
226 # The driver extension
227 driver_ext=".so"
228 # The configuration file we generate if no original was found but we need
229 # one.
230 main_cfg="/etc/X11/xorg.conf"
231
232 modules_dir=`X -showDefaultModulePath 2>&1` || modules_dir=
233 if [ -z "$modules_dir" ]; then
234 for dir in /usr/lib64/xorg/modules /usr/lib/xorg/modules /usr/X11R6/lib64/modules /usr/X11R6/lib/modules /usr/X11R6/lib/X11/modules; do
235 if [ -d $dir ]; then
236 modules_dir=$dir
237 break
238 fi
239 done
240 fi
241
242 case "${x_version}" in
243 4.* | 6.* | 7.* | 1.?.* | 1.1[0-6].* )
244 blacklist_vboxvideo="yes"
245 ;;
246 esac
247 case "$oracle_release" in
248 Oracle*release\ 6.* )
249 # relevant for OL6/UEK4 but cannot hurt for other kernels
250 blacklist_vboxvideo="yes"
251 esac
252 if test -n "${blacklist_vboxvideo}"; then
253 test -d /etc/modprobe.d &&
254 echo "blacklist vboxvideo" > /etc/modprobe.d/blacklist-vboxvideo.conf
255 else
256 test -f /etc/modprobe.d/blacklist-vboxvideo.conf &&
257 rm -f /etc/modprobe.d/blacklist-vboxvideo.conf
258 # We do not want to load the driver if X.Org Server is already
259 # running, as without a driver the server will touch the hardware
260 # directly, causing problems.
261 ps -Af | grep -q '[X]org' || ${MODPROBE} -q vboxvideo
262 fi
263
264 # Our logging code generates some glue code on 32-bit systems. At least F10
265 # needs a rule to allow this. Send all output to /dev/null in case this is
266 # completely irrelevant on the target system.
267 # chcon is needed on old Fedora/Redhat systems. No one remembers which.
268 chcon -t unconfined_execmem_exec_t '/usr/bin/VBoxClient' > /dev/null 2>&1
269 semanage fcontext -a -t unconfined_execmem_exec_t '/usr/bin/VBoxClient' > /dev/null 2>&1
270
271 # And set up VBoxClient to start when the X session does
272 install_x11_startup_app "${lib_dir}/98vboxadd-xclient" "${lib_dir}/vboxclient.desktop" VBoxClient VBoxClient-all ||
273 fail "Failed to set up VBoxClient to start automatically."
274 ln -s "${lib_dir}/98vboxadd-xclient" /usr/bin/VBoxClient-all 2>/dev/null
275
276 test -z "$x_version" -o -z "$modules_dir" &&
277 {
278 echo "Could not find the X.Org or XFree86 Window System, skipping." >&2
279 exit 0
280 }
281
282 # openSUSE 10.3 shipped X.Org 7.2 with X.Org Server 1.3, but didn't
283 # advertise the fact.
284 if grep -q '10\.3' /etc/SuSE-release 2>/dev/null; then
285 case $x_version in 7.2.*)
286 x_version=1.3.0;;
287 esac
288 fi
289 case $x_version in
290 1.*.99.* )
291 echo "Warning: unsupported pre-release version of X.Org Server installed. Not installing the X.Org drivers." >&2
292 dox11config=""
293 ;;
294 1.11.* )
295 xserver_version="X.Org Server 1.11"
296 vboxvideo_src=vboxvideo_drv_111.so
297 test "$system" = "redhat" && test -z "${vmsvga}" || setupxorgconf=""
298 ;;
299 1.10.* )
300 xserver_version="X.Org Server 1.10"
301 vboxvideo_src=vboxvideo_drv_110.so
302 test "$system" = "redhat" && test -z "${vmsvga}" || setupxorgconf=""
303 ;;
304 1.9.* )
305 xserver_version="X.Org Server 1.9"
306 vboxvideo_src=vboxvideo_drv_19.so
307 # Fedora 14 to 16 patched out vboxvideo detection
308 test "$system" = "redhat" && test -z "${vmsvga}" || setupxorgconf=""
309 ;;
310 1.8.* )
311 xserver_version="X.Org Server 1.8"
312 vboxvideo_src=vboxvideo_drv_18.so
313 # Fedora 13 shipped without vboxvideo detection
314 test "$system" = "redhat" && test -z "${vmsvga}" || setupxorgconf=""
315 ;;
316 1.7.* )
317 xserver_version="X.Org Server 1.7"
318 vboxvideo_src=vboxvideo_drv_17.so
319 setupxorgconf=""
320 ;;
321 1.6.* )
322 xserver_version="X.Org Server 1.6"
323 vboxvideo_src=vboxvideo_drv_16.so
324 vboxmouse_src=vboxmouse_drv_16.so
325 # SUSE SLE* with X.Org 1.6 does not do input autodetection;
326 # openSUSE does.
327 if grep -q -E '^SLE[^ ]' /etc/SuSE-brand 2>/dev/null; then
328 automouse=""
329 else
330 test "$system" = "suse" && setupxorgconf=""
331 fi
332 ;;
333 1.5.* )
334 xserver_version="X.Org Server 1.5"
335 vboxvideo_src=vboxvideo_drv_15.so
336 vboxmouse_src=vboxmouse_drv_15.so
337 # Historical note: SUSE with X.Org Server 1.5 disabled automatic
338 # mouse configuration and was handled specially. However since our
339 # kernel driver seems to have problems with X.Org Server 1.5 anyway
340 # we just create an X.Org configuration file and use the user space
341 # one generally, no longer just for SUSE.
342 automouse=""
343 ;;
344 1.4.* )
345 xserver_version="X.Org Server 1.4"
346 vboxvideo_src=vboxvideo_drv_14.so
347 vboxmouse_src=vboxmouse_drv_14.so
348 automouse=""
349 ;;
350 1.3.* )
351 # This was the first release which gave the server version number
352 # rather than the X11 release version when you did 'X -version'.
353 xserver_version="X.Org Server 1.3"
354 vboxvideo_src=vboxvideo_drv_13.so
355 vboxmouse_src=vboxmouse_drv_13.so
356 automouse=""
357 ;;
358 7.1.* | 7.2.* )
359 xserver_version="X.Org 7.1"
360 vboxvideo_src=vboxvideo_drv_71.so
361 vboxmouse_src=vboxmouse_drv_71.so
362 automouse=""
363 ;;
364 6.9.* | 7.0.* )
365 xserver_version="X.Org 6.9/7.0"
366 vboxvideo_src=vboxvideo_drv_70.so
367 vboxmouse_src=vboxmouse_drv_70.so
368 automouse=""
369 ;;
370 6.7* | 6.8.* | 4.2.* | 4.3.* )
371 # As the module binaries are the same we use one text for these
372 # four server versions.
373 xserver_version="XFree86 4.2/4.3 and X.Org 6.7/6.8"
374 driver_ext=.o
375 vboxvideo_src=vboxvideo_drv.o
376 vboxmouse_src=vboxmouse_drv.o
377 automouse=""
378 autokeyboard=""
379 case $x_version in
380 6.8.* )
381 autokeyboard="--autoKeyboard"
382 ;;
383 4.2.* | 4.3.* )
384 main_cfg="/etc/X11/XF86Config"
385 ;;
386 esac
387 ;;
388 1.12.* | 1.13.* | 1.14.* | 1.15.* | 1.16.* | 1.17.* | 1.18.* )
389 xserver_version="X.Org Server ${x_version_short}"
390 vboxvideo_src=vboxvideo_drv_`echo ${x_version_short} | sed 's/\.//'`.so
391 setupxorgconf=""
392 test -f "${lib_dir}/${vboxvideo_src}" ||
393 {
394 echo "Warning: unknown version of the X Window System installed. Not installing X Window System drivers." >&2
395 dox11config=""
396 vboxvideo_src=""
397 }
398 ;;
399 * )
400 # For anything else, assume kernel drivers.
401 dox11config=""
402 ;;
403 esac
404 test -n "${dox11config}" &&
405 echo "Installing $xserver_version modules" >&2
406 case "$vboxvideo_src" in
407 ?*)
408 ln -s "${lib_dir}/$vboxvideo_src" "$modules_dir/drivers/vboxvideo_drv$driver_ext.new" &&
409 mv "$modules_dir/drivers/vboxvideo_drv$driver_ext.new" "$modules_dir/drivers/vboxvideo_drv$driver_ext";;
410 *)
411 rm "$modules_dir/drivers/vboxvideo_drv$driver_ext" 2>/dev/null
412 esac
413 case "$vboxmouse_src" in
414 ?*)
415 ln -s "${lib_dir}/$vboxmouse_src" "$modules_dir/input/vboxmouse_drv$driver_ext.new" &&
416 mv "$modules_dir/input/vboxmouse_drv$driver_ext.new" "$modules_dir/input/vboxmouse_drv$driver_ext";;
417 *)
418 rm "$modules_dir/input/vboxmouse_drv$driver_ext" 2>/dev/null
419 esac
420
421 if test -n "$dox11config"; then
422 # Certain Ubuntu/Debian versions use a special PCI-id file to identify
423 # video drivers. Some versions have the directory and don't use it.
424 # Those versions can autoload vboxvideo though, so we don't need to
425 # hack the configuration file for them.
426 test "$system" = "debian" -a -d /usr/share/xserver-xorg/pci &&
427 {
428 rm -f "/usr/share/xserver-xorg/pci/vboxvideo.ids"
429 ln -s "${lib_dir}/vboxvideo.ids" /usr/share/xserver-xorg/pci 2>/dev/null
430 test -n "$automouse" && setupxorgconf=""
431 }
432
433 # Do the XF86Config/xorg.conf hack for those versions that require it
434 configured=""
435 generated=""
436 if test -n "$setupxorgconf"; then
437 for i in $x11conf_files; do
438 if test -r "$i"; then
439 if grep -q "VirtualBox generated" "$i"; then
440 generated="$generated `printf "$i\n"`"
441 else
442 "${lib_dir}/x11config.sh" $autokeyboard $automouse $nopsaux $vmsvga "$i"
443 fi
444 configured="true"
445 fi
446 # Timestamp, so that we can see if the config file is changed
447 # by someone else later
448 test -r "$i.vbox" && touch "$i.vbox"
449 done
450 # X.Org Server 1.5 and 1.6 can detect hardware they know, but they
451 # need a configuration file for VBoxVideo.
452 nobak_cfg="`expr "${main_cfg}" : '\([^.]*\)'`.vbox.nobak"
453 if test -z "$configured"; then
454 touch "$main_cfg"
455 "${lib_dir}/x11config.sh" $autokeyboard $automouse $nopsaux $vmsvga --noBak "$main_cfg"
456 touch "${nobak_cfg}"
457 fi
458 fi
459 test -n "$generated" &&
460 cat >&2 << EOF
461The following X.Org/XFree86 configuration files were originally generated by
462the VirtualBox Guest Additions and were not modified:
463
464$generated
465
466EOF
467 tty >/dev/null && cat << EOF
468You may need to restart the Window System (or just restart the guest system)
469to enable the Guest Additions.
470
471EOF
472 fi
473
474 case "$redhat_release" in
475 # Install selinux policy for Fedora 7 and 8 to allow the X server to
476 # open device files
477 Fedora\ release\ 7* | Fedora\ release\ 8* )
478 semodule -i "${lib_dir}/vbox_x11.pp" > /dev/null 2>&1
479 ;;
480 # Similar for the accelerated graphics check on Fedora 15
481 Fedora\ release\ 15* )
482 semodule -i "${lib_dir}/vbox_accel.pp" > /dev/null 2>&1
483 ;;
484 esac
485
486 # Install selinux policy for Fedora 8 to allow the X server to
487 # open our drivers
488 case "$redhat_release" in
489 Fedora\ release\ 8* )
490 chcon -u system_u -t lib_t "${lib_dir}"/*.so 2>/dev/null
491 ;;
492 esac
493
494 case "${x_version}" in 4.* | 6.* | 7.* | 1.?.* | 1.1* )
495 setup_opengl
496 esac
497}
498
499cleanup()
500{
501 # Restore xorg.conf files as far as possible
502 # List of generated files which have been changed since we generated them
503 newer=""
504 # Are we dealing with a legacy information which didn't support
505 # uninstallation?
506 legacy=""
507 # Do any of the restored configuration files still reference our drivers?
508 failed=""
509 # Have we encountered a "nobak" configuration file which means that there
510 # is no original file to restore?
511 nobak=""
512 test -r "$CONFIG_DIR/$CONFIG" || legacy="true"
513 for main_cfg in "/etc/X11/xorg.conf" "/etc/X11/XF86Config"; do
514 nobak_cfg="`expr "${main_cfg}" : '\([^.]*\)'`.vbox.nobak"
515 if test -r "${nobak_cfg}"; then
516 test -r "${main_cfg}" &&
517 if test -n "${legacy}" -o ! "${nobak_cfg}" -ot "${main_cfg}"; then
518 rm -f "${nobak_cfg}" "${main_cfg}"
519 else
520 newer="${newer}`printf " ${main_cfg} (no original)\n"`"
521 fi
522 nobak="true"
523 fi
524 done
525 if test -z "${nobak}"; then
526 for i in $x11conf_files; do
527 if test -r "$i.vbox"; then
528 if test ! "$i" -nt "$i.vbox" -o -n "$legacy"; then
529 mv -f "$i.vbox" "$i"
530 grep -q -E 'vboxvideo|vboxmouse' "$i" &&
531 failed="$failed`printf " $i\n"`"
532 else
533 newer="$newer`printf " $i ($i.vbox)\n"`"
534 fi
535 fi
536 done
537 fi
538 test -n "$newer" && cat >&2 << EOF
539
540The following X.Org/XFree86 configuration files were not restored, as they may
541have been changed since they were generated by the VirtualBox Guest Additions.
542You may wish to restore these manually. The file name in brackets is the
543original version.
544
545$newer
546
547EOF
548 test -n "$failed" && cat >&2 << EOF
549
550The following X.Org/XFree86 configuration files were restored, but still
551contain references to the Guest Additions drivers. You may wish to check and
552possibly correct the restored configuration files to be sure that the server
553will continue to work after it is restarted.
554
555$failed
556
557EOF
558
559 # Remove X.Org drivers
560 modules_dir=`X -showDefaultModulePath 2>&1` || modules_dir=
561 if [ -z "$modules_dir" ]; then
562 for dir in /usr/lib64/xorg/modules /usr/lib/xorg/modules /usr/X11R6/lib64/modules /usr/X11R6/lib/modules /usr/X11R6/lib/X11/modules; do
563 if [ -d $dir ]; then
564 modules_dir=$dir
565 break
566 fi
567 done
568 fi
569 rm -f "$modules_dir/drivers/vboxvideo_drv"* 2>/dev/null
570 rm -f "$modules_dir/input/vboxmouse_drv"* 2>/dev/null
571
572 # Remove the link to vboxvideo_dri.so
573 for dir in /usr/lib/dri /usr/lib32/dri /usr/lib64/dri \
574 /usr/lib/xorg/modules/dri /usr/lib32/xorg/modules/dri \
575 /usr/lib64/xorg/modules/dri /usr/lib/i386-linux-gnu/dri \
576 /usr/lib/x86_64-linux-gnu/dri; do
577 if [ -d $dir ]; then
578 rm -f "$dir/vboxvideo_dri.so" 2>/dev/null
579 fi
580 done
581
582 # Remove VBoxClient autostart files
583 rm /etc/X11/Xsession.d/98vboxadd-xclient 2>/dev/null
584 rm /etc/X11/xinit.d/98vboxadd-xclient 2>/dev/null
585 rm /etc/X11/xinit/xinitrc.d/98vboxadd-xclient.sh 2>/dev/null
586 rm /etc/xdg/autostart/vboxclient.desktop 2>/dev/null
587 rm /usr/share/autostart/vboxclient.desktop 2>/dev/null
588 rm /usr/bin/VBoxClient-all 2>/dev/null
589
590 # Remove other files
591 rm /usr/share/xserver-xorg/pci/vboxvideo.ids 2>/dev/null
592 return 0
593}
594
595dmnstatus()
596{
597 /bin/true
598}
599
600case "$1" in
601start)
602 start
603 ;;
604stop)
605 stop
606 ;;
607restart)
608 restart
609 ;;
610setup)
611 setup
612 ;;
613cleanup)
614 cleanup
615 ;;
616status)
617 dmnstatus
618 ;;
619*)
620 echo "Usage: $0 {start|stop|restart|status}"
621 exit 1
622esac
623
624exit
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette