VirtualBox

source: vbox/trunk/src/VBox/Additions/solaris/Installer/preremove.sh

Last change on this file was 101937, checked in by vboxsync, 7 months ago

Additions/solaris/{Installer,vboxms,vboxservice}: Add support for the
Solaris Guest Additions to be installed into an alternate root path
('pkgad -R'). This also enables the Solaris GAs to be installed in an
automated fashion when building Solaris images using the distribution
constructor (aka the distro_const(8) utility).

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1#!/bin/sh
2# $Id: preremove.sh 101937 2023-11-07 12:15:59Z vboxsync $
3## @file
4# VirtualBox preremove script for Solaris Guest Additions.
5#
6
7#
8# Copyright (C) 2008-2023 Oracle and/or its affiliates.
9#
10# This file is part of VirtualBox base platform packages, as
11# available from https://www.virtualbox.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# The contents of this file may alternatively be used under the terms
27# of the Common Development and Distribution License Version 1.0
28# (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
29# in the VirtualBox distribution, in which case the provisions of the
30# CDDL are applicable instead of those of the GPL.
31#
32# You may elect to license modified versions of this file under the
33# terms and conditions of either the GPL or the CDDL or both.
34#
35# SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
36#
37
38LC_ALL=C
39export LC_ALL
40
41LANG=C
42export LANG
43
44echo "Removing VirtualBox service..."
45
46# stop and unregister VBoxService
47if [ "${PKG_INSTALL_ROOT:-/}" = "/" ] ; then
48 /usr/sbin/svcadm disable -s svc:/application/virtualbox/vboxservice:default
49 /usr/sbin/svcadm disable -s svc:/application/virtualbox/vboxmslnk:default
50 # Don't need to delete, taken care of by the manifest action
51 #/usr/sbin/svccfg delete svc:/application/virtualbox/vboxservice:default
52 #/usr/sbin/svccfg delete svc:/application/virtualbox/vboxmslnk:default
53 /usr/sbin/svcadm restart -s svc:/system/manifest-import:default
54
55 # stop VBoxClient
56 pkill -INT VBoxClient
57fi
58
59echo "Removing VirtualBox kernel modules..."
60
61# vboxguest.sh would've been installed, we just need to call it.
62
63${PKG_INSTALL_ROOT}/opt/VirtualBoxAdditions/vboxguest.sh stopall silentunload
64
65# Figure out group to use for /etc/devlink.tab (before Solaris 11 SRU6
66# it was always using group sys)
67group=sys
68if [ -f /etc/dev/reserved_devnames ]; then
69 # Solaris 11 SRU6 and later use group root (check a file which isn't
70 # tainted by VirtualBox install scripts and allow no other group)
71 refgroup=`LC_ALL=C /usr/bin/ls -lL /etc/dev/reserved_devnames | awk '{ print $4 }' 2>/dev/null`
72 if [ $? -eq 0 -a "x$refgroup" = "xroot" ]; then
73 group=root
74 fi
75 unset refgroup
76fi
77
78# remove devlink.tab entry for vboxguest
79sed -e '/name=vboxguest/d' ${PKG_INSTALL_ROOT}/etc/devlink.tab > ${PKG_INSTALL_ROOT}/etc/devlink.vbox
80chmod 0644 ${PKG_INSTALL_ROOT}/etc/devlink.vbox
81chown root:$group ${PKG_INSTALL_ROOT}/etc/devlink.vbox
82mv -f ${PKG_INSTALL_ROOT}/etc/devlink.vbox ${PKG_INSTALL_ROOT}/etc/devlink.tab
83
84# remove the link
85if test -h "${PKG_INSTALL_ROOT}/dev/vboxguest" || test -f "${PKG_INSTALL_ROOT}/dev/vboxguest"; then
86 rm -f ${PKG_INSTALL_ROOT}/dev/vboxdrv
87fi
88if test -h "${PKG_INSTALL_ROOT}/dev/vboxms" || test -f "${PKG_INSTALL_ROOT}/dev/vboxms"; then
89 rm -f ${PKG_INSTALL_ROOT}/dev/vboxms
90fi
91
92# Try and restore xorg.conf!
93echo "Restoring X.Org..."
94${PKG_INSTALL_ROOT}/opt/VirtualBoxAdditions/x11restore.pl
95
96
97echo "Done."
98
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use