1 | #!/bin/sh
|
---|
2 | # $Id: preremove.sh 69500 2017-10-28 15:14:05Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | # VirtualBox preremove script for Solaris Guest Additions.
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2008-2017 Oracle Corporation
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | # available from http://www.virtualbox.org. This file is free software;
|
---|
12 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | # General Public License (GPL) as published by the Free Software
|
---|
14 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | #
|
---|
18 | # The contents of this file may alternatively be used under the terms
|
---|
19 | # of the Common Development and Distribution License Version 1.0
|
---|
20 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
21 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
22 | # CDDL are applicable instead of those of the GPL.
|
---|
23 | #
|
---|
24 | # You may elect to license modified versions of this file under the
|
---|
25 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
26 | #
|
---|
27 |
|
---|
28 | LC_ALL=C
|
---|
29 | export LC_ALL
|
---|
30 |
|
---|
31 | LANG=C
|
---|
32 | export LANG
|
---|
33 |
|
---|
34 | echo "Removing VirtualBox service..."
|
---|
35 |
|
---|
36 | # stop and unregister VBoxService
|
---|
37 | /usr/sbin/svcadm disable -s virtualbox/vboxservice
|
---|
38 | # Don't need to delete, taken care of by the manifest action
|
---|
39 | # /usr/sbin/svccfg delete svc:/application/virtualbox/vboxservice:default
|
---|
40 | /usr/sbin/svcadm restart svc:/system/manifest-import:default
|
---|
41 |
|
---|
42 | # stop VBoxClient
|
---|
43 | pkill -INT VBoxClient
|
---|
44 |
|
---|
45 | echo "Removing VirtualBox kernel modules..."
|
---|
46 |
|
---|
47 | # vboxguest.sh would've been installed, we just need to call it.
|
---|
48 | /opt/VirtualBoxAdditions/vboxguest.sh stopall silentunload
|
---|
49 |
|
---|
50 | # remove devlink.tab entry for vboxguest
|
---|
51 | sed -e '
|
---|
52 | /name=vboxguest/d' /etc/devlink.tab > /etc/devlink.vbox
|
---|
53 | mv -f /etc/devlink.vbox /etc/devlink.tab
|
---|
54 |
|
---|
55 | # remove the link
|
---|
56 | if test -h "/dev/vboxguest" || test -f "/dev/vboxguest"; then
|
---|
57 | rm -f /dev/vboxdrv
|
---|
58 | fi
|
---|
59 | if test -h "/dev/vboxms" || test -f "/dev/vboxms"; then
|
---|
60 | rm -f /dev/vboxms
|
---|
61 | fi
|
---|
62 |
|
---|
63 | # Try and restore xorg.conf!
|
---|
64 | echo "Restoring X.Org..."
|
---|
65 | /opt/VirtualBoxAdditions/x11restore.pl
|
---|
66 |
|
---|
67 | # Revert set-up of our OpenGL library.
|
---|
68 | rm -f /lib/opengl/ogl_select/vbox_vendor_select
|
---|
69 | /lib/svc/method/ogl-select start
|
---|
70 |
|
---|
71 |
|
---|
72 | echo "Done."
|
---|
73 |
|
---|