VirtualBox

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

Last change on this file since 92503 was 92503, checked in by vboxsync, 3 years ago

Installer/solaris, Additions/solaris/Installer: Fix handing of /etc/devlink.tab group membership in the driver install. Automatically adjusts to the group which should be used on the respective OS update version. Done in a way which automatically repairs the incorrect group membership on the next install/uninstall.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1#!/bin/sh
2# $Id: preremove.sh 92503 2021-11-18 17:43:22Z vboxsync $
3## @file
4# VirtualBox preremove script for Solaris Guest Additions.
5#
6
7#
8# Copyright (C) 2008-2020 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
28LC_ALL=C
29export LC_ALL
30
31LANG=C
32export LANG
33
34echo "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
43pkill -INT VBoxClient
44
45echo "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# Figure out group to use for /etc/devlink.tab (before Solaris 11 SRU6
51# it was always using group sys)
52group=sys
53if [ -f /etc/dev/reserved_devnames ]; then
54 # Solaris 11 SRU6 and later use group root (check a file which isn't
55 # tainted by VirtualBox install scripts and allow no other group)
56 refgroup=$(LC_ALL=C /usr/bin/ls -lL /etc/dev/reserved_devnames | awk '{ print $4 }' 2>/dev/null)
57 if [ $? -eq 0 -a "x$refgroup" = "xroot" ]; then
58 group=root
59 fi
60 unset refgroup
61fi
62
63# remove devlink.tab entry for vboxguest
64sed -e '/name=vboxguest/d' /etc/devlink.tab > /etc/devlink.vbox
65chmod 0644 /etc/devlink.vbox
66chown root:$group /etc/devlink.vbox
67mv -f /etc/devlink.vbox /etc/devlink.tab
68
69# remove the link
70if test -h "/dev/vboxguest" || test -f "/dev/vboxguest"; then
71 rm -f /dev/vboxdrv
72fi
73if test -h "/dev/vboxms" || test -f "/dev/vboxms"; then
74 rm -f /dev/vboxms
75fi
76
77# Try and restore xorg.conf!
78echo "Restoring X.Org..."
79/opt/VirtualBoxAdditions/x11restore.pl
80
81
82echo "Done."
83
Note: See TracBrowser for help on using the repository browser.

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